var JX=Object.defineProperty;var xB=t=>{throw TypeError(t)};var eK=(t,e,n)=>e in t?JX(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Ke=(t,e,n)=>eK(t,typeof e!="symbol"?e+"":e,n),I_=(t,e,n)=>e.has(t)||xB("Cannot "+n);var $=(t,e,n)=>(I_(t,e,"read from private field"),n?n.call(t):e.get(t)),lt=(t,e,n)=>e.has(t)?xB("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Fe=(t,e,n,i)=>(I_(t,e,"write to private field"),i?i.call(t,n):e.set(t,n),n),We=(t,e,n)=>(I_(t,e,"access private method"),n);var qd=(t,e,n,i)=>({set _(r){Fe(t,e,r,n)},get _(){return $(t,e,i)}});function tK(t,e){for(var n=0;n<e.length;n++){const i=e[n];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in t)){const s=Object.getOwnPropertyDescriptor(i,r);s&&Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>i[r]})}}}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 r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();function Al(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function zE(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=function i(){return this instanceof i?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(i){var r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(n,i,r.get?r:{enumerable:!0,get:function(){return t[i]}})}),n}var B_={exports:{}},_0={};/**
 * @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 bB;function nK(){if(bB)return _0;bB=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(i,r,s){var a=null;if(s!==void 0&&(a=""+s),r.key!==void 0&&(a=""+r.key),"key"in r){s={};for(var l in r)l!=="key"&&(s[l]=r[l])}else s=r;return r=s.ref,{$$typeof:t,type:i,key:a,ref:r!==void 0?r:null,props:s}}return _0.Fragment=e,_0.jsx=n,_0.jsxs=n,_0}var AB;function iK(){return AB||(AB=1,B_.exports=nK()),B_.exports}var o=iK(),L_={exports:{}},Jt={};/**
 * @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 wB;function rK(){if(wB)return Jt;wB=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),m=Symbol.iterator;function v(z){return z===null||typeof z!="object"?null:(z=m&&z[m]||z["@@iterator"],typeof z=="function"?z:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,A={};function w(z,U,V){this.props=z,this.context=U,this.refs=A,this.updater=V||y}w.prototype.isReactComponent={},w.prototype.setState=function(z,U){if(typeof z!="object"&&typeof z!="function"&&z!=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,z,U,"setState")},w.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function S(){}S.prototype=w.prototype;function j(z,U,V){this.props=z,this.context=U,this.refs=A,this.updater=V||y}var C=j.prototype=new S;C.constructor=j,b(C,w.prototype),C.isPureReactComponent=!0;var k=Array.isArray;function E(){}var M={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function D(z,U,V){var J=V.ref;return{$$typeof:t,type:z,key:U,ref:J!==void 0?J:null,props:V}}function F(z,U){return D(z.type,U,z.props)}function I(z){return typeof z=="object"&&z!==null&&z.$$typeof===t}function Q(z){var U={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(V){return U[V]})}var G=/\/+/g;function L(z,U){return typeof z=="object"&&z!==null&&z.key!=null?Q(""+z.key):U.toString(36)}function q(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(E,E):(z.status="pending",z.then(function(U){z.status==="pending"&&(z.status="fulfilled",z.value=U)},function(U){z.status==="pending"&&(z.status="rejected",z.reason=U)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function N(z,U,V,J,ee){var ce=typeof z;(ce==="undefined"||ce==="boolean")&&(z=null);var he=!1;if(z===null)he=!0;else switch(ce){case"bigint":case"string":case"number":he=!0;break;case"object":switch(z.$$typeof){case t:case e:he=!0;break;case f:return he=z._init,N(he(z._payload),U,V,J,ee)}}if(he)return ee=ee(z),he=J===""?"."+L(z,0):J,k(ee)?(V="",he!=null&&(V=he.replace(G,"$&/")+"/"),N(ee,U,V,"",function(Re){return Re})):ee!=null&&(I(ee)&&(ee=F(ee,V+(ee.key==null||z&&z.key===ee.key?"":(""+ee.key).replace(G,"$&/")+"/")+he)),U.push(ee)),1;he=0;var Oe=J===""?".":J+":";if(k(z))for(var Te=0;Te<z.length;Te++)J=z[Te],ce=Oe+L(J,Te),he+=N(J,U,V,ce,ee);else if(Te=v(z),typeof Te=="function")for(z=Te.call(z),Te=0;!(J=z.next()).done;)J=J.value,ce=Oe+L(J,Te++),he+=N(J,U,V,ce,ee);else if(ce==="object"){if(typeof z.then=="function")return N(q(z),U,V,J,ee);throw U=String(z),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return he}function P(z,U,V){if(z==null)return z;var J=[],ee=0;return N(z,J,"","",function(ce){return U.call(V,ce,ee++)}),J}function Y(z){if(z._status===-1){var U=z._result;U=U(),U.then(function(V){(z._status===0||z._status===-1)&&(z._status=1,z._result=V)},function(V){(z._status===0||z._status===-1)&&(z._status=2,z._result=V)}),z._status===-1&&(z._status=0,z._result=U)}if(z._status===1)return z._result.default;throw z._result}var K=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)},W={map:P,forEach:function(z,U,V){P(z,function(){U.apply(this,arguments)},V)},count:function(z){var U=0;return P(z,function(){U++}),U},toArray:function(z){return P(z,function(U){return U})||[]},only:function(z){if(!I(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return Jt.Activity=p,Jt.Children=W,Jt.Component=w,Jt.Fragment=n,Jt.Profiler=r,Jt.PureComponent=j,Jt.StrictMode=i,Jt.Suspense=u,Jt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,Jt.__COMPILER_RUNTIME={__proto__:null,c:function(z){return M.H.useMemoCache(z)}},Jt.cache=function(z){return function(){return z.apply(null,arguments)}},Jt.cacheSignal=function(){return null},Jt.cloneElement=function(z,U,V){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var J=b({},z.props),ee=z.key;if(U!=null)for(ce in U.key!==void 0&&(ee=""+U.key),U)!R.call(U,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&U.ref===void 0||(J[ce]=U[ce]);var ce=arguments.length-2;if(ce===1)J.children=V;else if(1<ce){for(var he=Array(ce),Oe=0;Oe<ce;Oe++)he[Oe]=arguments[Oe+2];J.children=he}return D(z.type,ee,J)},Jt.createContext=function(z){return z={$$typeof:a,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:s,_context:z},z},Jt.createElement=function(z,U,V){var J,ee={},ce=null;if(U!=null)for(J in U.key!==void 0&&(ce=""+U.key),U)R.call(U,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(ee[J]=U[J]);var he=arguments.length-2;if(he===1)ee.children=V;else if(1<he){for(var Oe=Array(he),Te=0;Te<he;Te++)Oe[Te]=arguments[Te+2];ee.children=Oe}if(z&&z.defaultProps)for(J in he=z.defaultProps,he)ee[J]===void 0&&(ee[J]=he[J]);return D(z,ce,ee)},Jt.createRef=function(){return{current:null}},Jt.forwardRef=function(z){return{$$typeof:l,render:z}},Jt.isValidElement=I,Jt.lazy=function(z){return{$$typeof:f,_payload:{_status:-1,_result:z},_init:Y}},Jt.memo=function(z,U){return{$$typeof:d,type:z,compare:U===void 0?null:U}},Jt.startTransition=function(z){var U=M.T,V={};M.T=V;try{var J=z(),ee=M.S;ee!==null&&ee(V,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(E,K)}catch(ce){K(ce)}finally{U!==null&&V.types!==null&&(U.types=V.types),M.T=U}},Jt.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},Jt.use=function(z){return M.H.use(z)},Jt.useActionState=function(z,U,V){return M.H.useActionState(z,U,V)},Jt.useCallback=function(z,U){return M.H.useCallback(z,U)},Jt.useContext=function(z){return M.H.useContext(z)},Jt.useDebugValue=function(){},Jt.useDeferredValue=function(z,U){return M.H.useDeferredValue(z,U)},Jt.useEffect=function(z,U){return M.H.useEffect(z,U)},Jt.useEffectEvent=function(z){return M.H.useEffectEvent(z)},Jt.useId=function(){return M.H.useId()},Jt.useImperativeHandle=function(z,U,V){return M.H.useImperativeHandle(z,U,V)},Jt.useInsertionEffect=function(z,U){return M.H.useInsertionEffect(z,U)},Jt.useLayoutEffect=function(z,U){return M.H.useLayoutEffect(z,U)},Jt.useMemo=function(z,U){return M.H.useMemo(z,U)},Jt.useOptimistic=function(z,U){return M.H.useOptimistic(z,U)},Jt.useReducer=function(z,U,V){return M.H.useReducer(z,U,V)},Jt.useRef=function(z){return M.H.useRef(z)},Jt.useState=function(z){return M.H.useState(z)},Jt.useSyncExternalStore=function(z,U,V){return M.H.useSyncExternalStore(z,U,V)},Jt.useTransition=function(){return M.H.useTransition()},Jt.version="19.2.8",Jt}var SB;function gy(){return SB||(SB=1,L_.exports=rK()),L_.exports}var T=gy();const Vn=Al(T),m8=tK({__proto__:null,default:Vn},[T]);var P_={exports:{}},k0={},F_={exports:{}},$_={};/**
 * @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 jB;function sK(){return jB||(jB=1,(function(t){function e(N,P){var Y=N.length;N.push(P);e:for(;0<Y;){var K=Y-1>>>1,W=N[K];if(0<r(W,P))N[K]=P,N[Y]=W,Y=K;else break e}}function n(N){return N.length===0?null:N[0]}function i(N){if(N.length===0)return null;var P=N[0],Y=N.pop();if(Y!==P){N[0]=Y;e:for(var K=0,W=N.length,z=W>>>1;K<z;){var U=2*(K+1)-1,V=N[U],J=U+1,ee=N[J];if(0>r(V,Y))J<W&&0>r(ee,V)?(N[K]=ee,N[J]=Y,K=J):(N[K]=V,N[U]=Y,K=U);else if(J<W&&0>r(ee,Y))N[K]=ee,N[J]=Y,K=J;else break e}}return P}function r(N,P){var Y=N.sortIndex-P.sortIndex;return Y!==0?Y:N.id-P.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 a=Date,l=a.now();t.unstable_now=function(){return a.now()-l}}var u=[],d=[],f=1,p=null,m=3,v=!1,y=!1,b=!1,A=!1,w=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function C(N){for(var P=n(d);P!==null;){if(P.callback===null)i(d);else if(P.startTime<=N)i(d),P.sortIndex=P.expirationTime,e(u,P);else break;P=n(d)}}function k(N){if(b=!1,C(N),!y)if(n(u)!==null)y=!0,E||(E=!0,Q());else{var P=n(d);P!==null&&q(k,P.startTime-N)}}var E=!1,M=-1,R=5,D=-1;function F(){return A?!0:!(t.unstable_now()-D<R)}function I(){if(A=!1,E){var N=t.unstable_now();D=N;var P=!0;try{e:{y=!1,b&&(b=!1,S(M),M=-1),v=!0;var Y=m;try{t:{for(C(N),p=n(u);p!==null&&!(p.expirationTime>N&&F());){var K=p.callback;if(typeof K=="function"){p.callback=null,m=p.priorityLevel;var W=K(p.expirationTime<=N);if(N=t.unstable_now(),typeof W=="function"){p.callback=W,C(N),P=!0;break t}p===n(u)&&i(u),C(N)}else i(u);p=n(u)}if(p!==null)P=!0;else{var z=n(d);z!==null&&q(k,z.startTime-N),P=!1}}break e}finally{p=null,m=Y,v=!1}P=void 0}}finally{P?Q():E=!1}}}var Q;if(typeof j=="function")Q=function(){j(I)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,L=G.port2;G.port1.onmessage=I,Q=function(){L.postMessage(null)}}else Q=function(){w(I,0)};function q(N,P){M=w(function(){N(t.unstable_now())},P)}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(N){N.callback=null},t.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<N?Math.floor(1e3/N):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_next=function(N){switch(m){case 1:case 2:case 3:var P=3;break;default:P=m}var Y=m;m=P;try{return N()}finally{m=Y}},t.unstable_requestPaint=function(){A=!0},t.unstable_runWithPriority=function(N,P){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var Y=m;m=N;try{return P()}finally{m=Y}},t.unstable_scheduleCallback=function(N,P,Y){var K=t.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?K+Y:K):Y=K,N){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=Y+W,N={id:f++,callback:P,priorityLevel:N,startTime:Y,expirationTime:W,sortIndex:-1},Y>K?(N.sortIndex=Y,e(d,N),n(u)===null&&N===n(d)&&(b?(S(M),M=-1):b=!0,q(k,Y-K))):(N.sortIndex=W,e(u,N),y||v||(y=!0,E||(E=!0,Q()))),N},t.unstable_shouldYield=F,t.unstable_wrapCallback=function(N){var P=m;return function(){var Y=m;m=P;try{return N.apply(this,arguments)}finally{m=Y}}}})($_)),$_}var CB;function oK(){return CB||(CB=1,F_.exports=sK()),F_.exports}var z_={exports:{}},Ds={};/**
 * @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 _B;function aK(){if(_B)return Ds;_B=1;var t=gy();function e(u){var d="https://react.dev/errors/"+u;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)d+="&args[]="+encodeURIComponent(arguments[f])}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 n(){}var i={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},r=Symbol.for("react.portal");function s(u,d,f){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:p==null?null:""+p,children:u,containerInfo:d,implementation:f}}var a=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(u,d){if(u==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Ds.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Ds.createPortal=function(u,d){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(e(299));return s(u,d,null,f)},Ds.flushSync=function(u){var d=a.T,f=i.p;try{if(a.T=null,i.p=2,u)return u()}finally{a.T=d,i.p=f,i.d.f()}},Ds.preconnect=function(u,d){typeof u=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,i.d.C(u,d))},Ds.prefetchDNS=function(u){typeof u=="string"&&i.d.D(u)},Ds.preinit=function(u,d){if(typeof u=="string"&&d&&typeof d.as=="string"){var f=d.as,p=l(f,d.crossOrigin),m=typeof d.integrity=="string"?d.integrity:void 0,v=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;f==="style"?i.d.S(u,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:p,integrity:m,fetchPriority:v}):f==="script"&&i.d.X(u,{crossOrigin:p,integrity:m,fetchPriority:v,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Ds.preinitModule=function(u,d){if(typeof u=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var f=l(d.as,d.crossOrigin);i.d.M(u,{crossOrigin:f,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&i.d.M(u)},Ds.preload=function(u,d){if(typeof u=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var f=d.as,p=l(f,d.crossOrigin);i.d.L(u,f,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Ds.preloadModule=function(u,d){if(typeof u=="string")if(d){var f=l(d.as,d.crossOrigin);i.d.m(u,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:f,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else i.d.m(u)},Ds.requestFormReset=function(u){i.d.r(u)},Ds.unstable_batchedUpdates=function(u,d){return u(d)},Ds.useFormState=function(u,d,f){return a.H.useFormState(u,d,f)},Ds.useFormStatus=function(){return a.H.useHostTransitionStatus()},Ds.version="19.2.8",Ds}var kB;function g8(){if(kB)return z_.exports;kB=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(),z_.exports=aK(),z_.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 TB;function lK(){if(TB)return k0;TB=1;var t=oK(),e=gy(),n=g8();function i(c){var h="https://react.dev/errors/"+c;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}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 r(c){return!(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)}function s(c){var h=c,g=c;if(c.alternate)for(;h.return;)h=h.return;else{c=h;do h=c,(h.flags&4098)!==0&&(g=h.return),c=h.return;while(c)}return h.tag===3?g:null}function a(c){if(c.tag===13){var h=c.memoizedState;if(h===null&&(c=c.alternate,c!==null&&(h=c.memoizedState)),h!==null)return h.dehydrated}return null}function l(c){if(c.tag===31){var h=c.memoizedState;if(h===null&&(c=c.alternate,c!==null&&(h=c.memoizedState)),h!==null)return h.dehydrated}return null}function u(c){if(s(c)!==c)throw Error(i(188))}function d(c){var h=c.alternate;if(!h){if(h=s(c),h===null)throw Error(i(188));return h!==c?null:c}for(var g=c,x=h;;){var _=g.return;if(_===null)break;var O=_.alternate;if(O===null){if(x=_.return,x!==null){g=x;continue}break}if(_.child===O.child){for(O=_.child;O;){if(O===g)return u(_),c;if(O===x)return u(_),h;O=O.sibling}throw Error(i(188))}if(g.return!==x.return)g=_,x=O;else{for(var B=!1,Z=_.child;Z;){if(Z===g){B=!0,g=_,x=O;break}if(Z===x){B=!0,x=_,g=O;break}Z=Z.sibling}if(!B){for(Z=O.child;Z;){if(Z===g){B=!0,g=O,x=_;break}if(Z===x){B=!0,x=O,g=_;break}Z=Z.sibling}if(!B)throw Error(i(189))}}if(g.alternate!==x)throw Error(i(190))}if(g.tag!==3)throw Error(i(188));return g.stateNode.current===g?c:h}function f(c){var h=c.tag;if(h===5||h===26||h===27||h===6)return c;for(c=c.child;c!==null;){if(h=f(c),h!==null)return h;c=c.sibling}return null}var p=Object.assign,m=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),S=Symbol.for("react.consumer"),j=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),D=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),I=Symbol.iterator;function Q(c){return c===null||typeof c!="object"?null:(c=I&&c[I]||c["@@iterator"],typeof c=="function"?c:null)}var G=Symbol.for("react.client.reference");function L(c){if(c==null)return null;if(typeof c=="function")return c.$$typeof===G?null:c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case b:return"Fragment";case w:return"Profiler";case A:return"StrictMode";case k:return"Suspense";case E:return"SuspenseList";case D:return"Activity"}if(typeof c=="object")switch(c.$$typeof){case y:return"Portal";case j:return c.displayName||"Context";case S:return(c._context.displayName||"Context")+".Consumer";case C:var h=c.render;return c=c.displayName,c||(c=h.displayName||h.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case M:return h=c.displayName||null,h!==null?h:L(c.type)||"Memo";case R:h=c._payload,c=c._init;try{return L(c(h))}catch{}}return null}var q=Array.isArray,N=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},K=[],W=-1;function z(c){return{current:c}}function U(c){0>W||(c.current=K[W],K[W]=null,W--)}function V(c,h){W++,K[W]=c.current,c.current=h}var J=z(null),ee=z(null),ce=z(null),he=z(null);function Oe(c,h){switch(V(ce,h),V(ee,c),V(J,null),h.nodeType){case 9:case 11:c=(c=h.documentElement)&&(c=c.namespaceURI)?H3(c):0;break;default:if(c=h.tagName,h=h.namespaceURI)h=H3(h),c=q3(h,c);else switch(c){case"svg":c=1;break;case"math":c=2;break;default:c=0}}U(J),V(J,c)}function Te(){U(J),U(ee),U(ce)}function Re(c){c.memoizedState!==null&&V(he,c);var h=J.current,g=q3(h,c.type);h!==g&&(V(ee,c),V(J,g))}function qe(c){ee.current===c&&(U(J),U(ee)),he.current===c&&(U(he),w0._currentValue=Y)}var ie,je;function se(c){if(ie===void 0)try{throw Error()}catch(g){var h=g.stack.trim().match(/\n( *(at )?)/);ie=h&&h[1]||"",je=-1<g.stack.indexOf(`
    at`)?" (<anonymous>)":-1<g.stack.indexOf("@")?"@unknown:0:0":""}return`
`+ie+c+je}var be=!1;function Be(c,h){if(!c||be)return"";be=!0;var g=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var x={DetermineComponentFrameRoot:function(){try{if(h){var Ue=function(){throw Error()};if(Object.defineProperty(Ue.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ue,[])}catch(Me){var ke=Me}Reflect.construct(c,[],Ue)}else{try{Ue.call()}catch(Me){ke=Me}c.call(Ue.prototype)}}else{try{throw Error()}catch(Me){ke=Me}(Ue=c())&&typeof Ue.catch=="function"&&Ue.catch(function(){})}}catch(Me){if(Me&&ke&&typeof Me.stack=="string")return[Me.stack,ke.stack]}return[null,null]}};x.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var _=Object.getOwnPropertyDescriptor(x.DetermineComponentFrameRoot,"name");_&&_.configurable&&Object.defineProperty(x.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var O=x.DetermineComponentFrameRoot(),B=O[0],Z=O[1];if(B&&Z){var ae=B.split(`
`),_e=Z.split(`
`);for(_=x=0;x<ae.length&&!ae[x].includes("DetermineComponentFrameRoot");)x++;for(;_<_e.length&&!_e[_].includes("DetermineComponentFrameRoot");)_++;if(x===ae.length||_===_e.length)for(x=ae.length-1,_=_e.length-1;1<=x&&0<=_&&ae[x]!==_e[_];)_--;for(;1<=x&&0<=_;x--,_--)if(ae[x]!==_e[_]){if(x!==1||_!==1)do if(x--,_--,0>_||ae[x]!==_e[_]){var Ie=`
`+ae[x].replace(" at new "," at ");return c.displayName&&Ie.includes("<anonymous>")&&(Ie=Ie.replace("<anonymous>",c.displayName)),Ie}while(1<=x&&0<=_);break}}}finally{be=!1,Error.prepareStackTrace=g}return(g=c?c.displayName||c.name:"")?se(g):""}function Ce(c,h){switch(c.tag){case 26:case 27:case 5:return se(c.type);case 16:return se("Lazy");case 13:return c.child!==h&&h!==null?se("Suspense Fallback"):se("Suspense");case 19:return se("SuspenseList");case 0:case 15:return Be(c.type,!1);case 11:return Be(c.type.render,!1);case 1:return Be(c.type,!0);case 31:return se("Activity");default:return""}}function Ve(c){try{var h="",g=null;do h+=Ce(c,g),g=c,c=c.return;while(c);return h}catch(x){return`
Error generating stack: `+x.message+`
`+x.stack}}var st=Object.prototype.hasOwnProperty,Ye=t.unstable_scheduleCallback,Ge=t.unstable_cancelCallback,dt=t.unstable_shouldYield,nt=t.unstable_requestPaint,Ee=t.unstable_now,Qe=t.unstable_getCurrentPriorityLevel,Xe=t.unstable_ImmediatePriority,Ze=t.unstable_UserBlockingPriority,vt=t.unstable_NormalPriority,pn=t.unstable_LowPriority,mn=t.unstable_IdlePriority,un=t.log,Qt=t.unstable_setDisableYieldValue,ct=null,zt=null;function on(c){if(typeof un=="function"&&Qt(c),zt&&typeof zt.setStrictMode=="function")try{zt.setStrictMode(ct,c)}catch{}}var Lt=Math.clz32?Math.clz32:dn,It=Math.log,$t=Math.LN2;function dn(c){return c>>>=0,c===0?32:31-(It(c)/$t|0)|0}var ji=256,tn=262144,an=4194304;function gn(c){var h=c&42;if(h!==0)return h;switch(c&-c){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return c&261888;case 262144:case 524288:case 1048576:case 2097152:return c&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return c&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return c}}function re(c,h,g){var x=c.pendingLanes;if(x===0)return 0;var _=0,O=c.suspendedLanes,B=c.pingedLanes;c=c.warmLanes;var Z=x&134217727;return Z!==0?(x=Z&~O,x!==0?_=gn(x):(B&=Z,B!==0?_=gn(B):g||(g=Z&~c,g!==0&&(_=gn(g))))):(Z=x&~O,Z!==0?_=gn(Z):B!==0?_=gn(B):g||(g=x&~c,g!==0&&(_=gn(g)))),_===0?0:h!==0&&h!==_&&(h&O)===0&&(O=_&-_,g=h&-h,O>=g||O===32&&(g&4194048)!==0)?h:_}function ve(c,h){return(c.pendingLanes&~(c.suspendedLanes&~c.pingedLanes)&h)===0}function pe(c,h){switch(c){case 1:case 2:case 4:case 8:case 64:return h+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 h+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 Ne(){var c=an;return an<<=1,(an&62914560)===0&&(an=4194304),c}function Ut(c){for(var h=[],g=0;31>g;g++)h.push(c);return h}function Kt(c,h){c.pendingLanes|=h,h!==268435456&&(c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0)}function it(c,h,g,x,_,O){var B=c.pendingLanes;c.pendingLanes=g,c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0,c.expiredLanes&=g,c.entangledLanes&=g,c.errorRecoveryDisabledLanes&=g,c.shellSuspendCounter=0;var Z=c.entanglements,ae=c.expirationTimes,_e=c.hiddenUpdates;for(g=B&~g;0<g;){var Ie=31-Lt(g),Ue=1<<Ie;Z[Ie]=0,ae[Ie]=-1;var ke=_e[Ie];if(ke!==null)for(_e[Ie]=null,Ie=0;Ie<ke.length;Ie++){var Me=ke[Ie];Me!==null&&(Me.lane&=-536870913)}g&=~Ue}x!==0&&rt(c,x,0),O!==0&&_===0&&c.tag!==0&&(c.suspendedLanes|=O&~(B&~h))}function rt(c,h,g){c.pendingLanes|=h,c.suspendedLanes&=~h;var x=31-Lt(h);c.entangledLanes|=h,c.entanglements[x]=c.entanglements[x]|1073741824|g&261930}function ht(c,h){var g=c.entangledLanes|=h;for(c=c.entanglements;g;){var x=31-Lt(g),_=1<<x;_&h|c[x]&h&&(c[x]|=h),g&=~_}}function Et(c,h){var g=h&-h;return g=(g&42)!==0?1:Tt(g),(g&(c.suspendedLanes|h))!==0?0:g}function Tt(c){switch(c){case 2:c=1;break;case 8:c=4;break;case 32:c=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:c=128;break;case 268435456:c=134217728;break;default:c=0}return c}function Ct(c){return c&=-c,2<c?8<c?(c&134217727)!==0?32:268435456:8:2}function vn(){var c=P.p;return c!==0?c:(c=window.event,c===void 0?32:dB(c.type))}function gi(c,h){var g=P.p;try{return P.p=c,h()}finally{P.p=g}}var er=Math.random().toString(36).slice(2),li="__reactFiber$"+er,Qr="__reactProps$"+er,js="__reactContainer$"+er,wd="__reactEvents$"+er,Tl="__reactListeners$"+er,jc="__reactHandles$"+er,Eo="__reactResources$"+er,Ei="__reactMarker$"+er;function $i(c){delete c[li],delete c[Qr],delete c[wd],delete c[Tl],delete c[jc]}function Rn(c){var h=c[li];if(h)return h;for(var g=c.parentNode;g;){if(h=g[js]||g[li]){if(g=h.alternate,h.child!==null||g!==null&&g.child!==null)for(c=X3(c);c!==null;){if(g=c[li])return g;c=X3(c)}return h}c=g,g=c.parentNode}return null}function ro(c){if(c=c[li]||c[js]){var h=c.tag;if(h===5||h===6||h===13||h===31||h===26||h===27||h===3)return c}return null}function wr(c){var h=c.tag;if(h===5||h===26||h===27||h===6)return c.stateNode;throw Error(i(33))}function so(c){var h=c[Eo];return h||(h=c[Eo]={hoistableStyles:new Map,hoistableScripts:new Map}),h}function Wi(c){c[Ei]=!0}var Du=new Set,aa={};function Cs(c,h){tt(c,h),tt(c+"Capture",h)}function tt(c,h){for(aa[c]=h,c=0;c<h.length;c++)Du.add(h[c])}var Rt=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]*$"),ln={},Nn={};function Mi(c){return st.call(Nn,c)?!0:st.call(ln,c)?!1:Rt.test(c)?Nn[c]=!0:(ln[c]=!0,!1)}function Sr(c,h,g){if(Mi(h))if(g===null)c.removeAttribute(h);else{switch(typeof g){case"undefined":case"function":case"symbol":c.removeAttribute(h);return;case"boolean":var x=h.toLowerCase().slice(0,5);if(x!=="data-"&&x!=="aria-"){c.removeAttribute(h);return}}c.setAttribute(h,""+g)}}function os(c,h,g){if(g===null)c.removeAttribute(h);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":c.removeAttribute(h);return}c.setAttribute(h,""+g)}}function ei(c,h,g,x){if(x===null)c.removeAttribute(g);else{switch(typeof x){case"undefined":case"function":case"symbol":case"boolean":c.removeAttribute(g);return}c.setAttributeNS(h,g,""+x)}}function ti(c){switch(typeof c){case"bigint":case"boolean":case"number":case"string":case"undefined":return c;case"object":return c;default:return""}}function _s(c){var h=c.type;return(c=c.nodeName)&&c.toLowerCase()==="input"&&(h==="checkbox"||h==="radio")}function Nu(c,h,g){var x=Object.getOwnPropertyDescriptor(c.constructor.prototype,h);if(!c.hasOwnProperty(h)&&typeof x<"u"&&typeof x.get=="function"&&typeof x.set=="function"){var _=x.get,O=x.set;return Object.defineProperty(c,h,{configurable:!0,get:function(){return _.call(this)},set:function(B){g=""+B,O.call(this,B)}}),Object.defineProperty(c,h,{enumerable:x.enumerable}),{getValue:function(){return g},setValue:function(B){g=""+B},stopTracking:function(){c._valueTracker=null,delete c[h]}}}}function Cc(c){if(!c._valueTracker){var h=_s(c)?"checked":"value";c._valueTracker=Nu(c,h,""+c[h])}}function Sd(c){if(!c)return!1;var h=c._valueTracker;if(!h)return!0;var g=h.getValue(),x="";return c&&(x=_s(c)?c.checked?"true":"false":c.value),c=x,c!==g?(h.setValue(c),!0):!1}function Iu(c){if(c=c||(typeof document<"u"?document:void 0),typeof c>"u")return null;try{return c.activeElement||c.body}catch{return c.body}}var Lg=/[\n"\\]/g;function as(c){return c.replace(Lg,function(h){return"\\"+h.charCodeAt(0).toString(16)+" "})}function Bu(c,h,g,x,_,O,B,Z){c.name="",B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"?c.type=B:c.removeAttribute("type"),h!=null?B==="number"?(h===0&&c.value===""||c.value!=h)&&(c.value=""+ti(h)):c.value!==""+ti(h)&&(c.value=""+ti(h)):B!=="submit"&&B!=="reset"||c.removeAttribute("value"),h!=null?kc(c,B,ti(h)):g!=null?kc(c,B,ti(g)):x!=null&&c.removeAttribute("value"),_==null&&O!=null&&(c.defaultChecked=!!O),_!=null&&(c.checked=_&&typeof _!="function"&&typeof _!="symbol"),Z!=null&&typeof Z!="function"&&typeof Z!="symbol"&&typeof Z!="boolean"?c.name=""+ti(Z):c.removeAttribute("name")}function _c(c,h,g,x,_,O,B,Z){if(O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(c.type=O),h!=null||g!=null){if(!(O!=="submit"&&O!=="reset"||h!=null)){Cc(c);return}g=g!=null?""+ti(g):"",h=h!=null?""+ti(h):g,Z||h===c.value||(c.value=h),c.defaultValue=h}x=x??_,x=typeof x!="function"&&typeof x!="symbol"&&!!x,c.checked=Z?c.checked:!!x,c.defaultChecked=!!x,B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"&&(c.name=B),Cc(c)}function kc(c,h,g){h==="number"&&Iu(c.ownerDocument)===c||c.defaultValue===""+g||(c.defaultValue=""+g)}function dr(c,h,g,x){if(c=c.options,h){h={};for(var _=0;_<g.length;_++)h["$"+g[_]]=!0;for(g=0;g<c.length;g++)_=h.hasOwnProperty("$"+c[g].value),c[g].selected!==_&&(c[g].selected=_),_&&x&&(c[g].defaultSelected=!0)}else{for(g=""+ti(g),h=null,_=0;_<c.length;_++){if(c[_].value===g){c[_].selected=!0,x&&(c[_].defaultSelected=!0);return}h!==null||c[_].disabled||(h=c[_])}h!==null&&(h.selected=!0)}}function Tc(c,h,g){if(h!=null&&(h=""+ti(h),h!==c.value&&(c.value=h),g==null)){c.defaultValue!==h&&(c.defaultValue=h);return}c.defaultValue=g!=null?""+ti(g):""}function La(c,h,g,x){if(h==null){if(x!=null){if(g!=null)throw Error(i(92));if(q(x)){if(1<x.length)throw Error(i(93));x=x[0]}g=x}g==null&&(g=""),h=g}g=ti(h),c.defaultValue=g,x=c.textContent,x===g&&x!==""&&x!==null&&(c.value=x),Cc(c)}function Ht(c,h){if(h){var g=c.firstChild;if(g&&g===c.lastChild&&g.nodeType===3){g.nodeValue=h;return}}c.textContent=h}var Lu=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 tr(c,h,g){var x=h.indexOf("--")===0;g==null||typeof g=="boolean"||g===""?x?c.setProperty(h,""):h==="float"?c.cssFloat="":c[h]="":x?c.setProperty(h,g):typeof g!="number"||g===0||Lu.has(h)?h==="float"?c.cssFloat=g:c[h]=(""+g).trim():c[h]=g+"px"}function qn(c,h,g){if(h!=null&&typeof h!="object")throw Error(i(62));if(c=c.style,g!=null){for(var x in g)!g.hasOwnProperty(x)||h!=null&&h.hasOwnProperty(x)||(x.indexOf("--")===0?c.setProperty(x,""):x==="float"?c.cssFloat="":c[x]="");for(var _ in h)x=h[_],h.hasOwnProperty(_)&&g[_]!==x&&tr(c,_,x)}else for(var O in h)h.hasOwnProperty(O)&&tr(c,O,h[O])}function Ol(c){if(c.indexOf("-")===-1)return!1;switch(c){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ks=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"]]),El=/^[\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 la(c){return El.test(""+c)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":c}function at(){}var kt=null;function Wt(c){return c=c.target||c.srcElement||window,c.correspondingUseElement&&(c=c.correspondingUseElement),c.nodeType===3?c.parentNode:c}var yn=null,Ci=null;function Ts(c){var h=ro(c);if(h&&(c=h.stateNode)){var g=c[Qr]||null;e:switch(c=h.stateNode,h.type){case"input":if(Bu(c,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name),h=g.name,g.type==="radio"&&h!=null){for(g=c;g.parentNode;)g=g.parentNode;for(g=g.querySelectorAll('input[name="'+as(""+h)+'"][type="radio"]'),h=0;h<g.length;h++){var x=g[h];if(x!==c&&x.form===c.form){var _=x[Qr]||null;if(!_)throw Error(i(90));Bu(x,_.value,_.defaultValue,_.defaultValue,_.checked,_.defaultChecked,_.type,_.name)}}for(h=0;h<g.length;h++)x=g[h],x.form===c.form&&Sd(x)}break e;case"textarea":Tc(c,g.value,g.defaultValue);break e;case"select":h=g.value,h!=null&&dr(c,!!g.multiple,h,!1)}}}var Oc=!1;function Pu(c,h,g){if(Oc)return c(h,g);Oc=!0;try{var x=c(h);return x}finally{if(Oc=!1,(yn!==null||Ci!==null)&&(ab(),yn&&(h=yn,c=Ci,Ci=yn=null,Ts(h),c)))for(h=0;h<c.length;h++)Ts(c[h])}}function ca(c,h){var g=c.stateNode;if(g===null)return null;var x=g[Qr]||null;if(x===null)return null;g=x[h];e:switch(h){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(x=!x.disabled)||(c=c.type,x=!(c==="button"||c==="input"||c==="select"||c==="textarea")),c=!x;break e;default:c=!1}if(c)return null;if(g&&typeof g!="function")throw Error(i(231,h,typeof g));return g}var Os=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Kf=!1;if(Os)try{var Fu={};Object.defineProperty(Fu,"passive",{get:function(){Kf=!0}}),window.addEventListener("test",Fu,Fu),window.removeEventListener("test",Fu,Fu)}catch{Kf=!1}var zs=null,Ml=null,jd=null;function Pg(){if(jd)return jd;var c,h=Ml,g=h.length,x,_="value"in zs?zs.value:zs.textContent,O=_.length;for(c=0;c<g&&h[c]===_[c];c++);var B=g-c;for(x=1;x<=B&&h[g-x]===_[O-x];x++);return jd=_.slice(c,1<x?1-x:void 0)}function Xn(c){var h=c.keyCode;return"charCode"in c?(c=c.charCode,c===0&&h===13&&(c=13)):c=h,c===10&&(c=13),32<=c||c===13?c:0}function ni(){return!0}function Pa(){return!1}function Bn(c){function h(g,x,_,O,B){this._reactName=g,this._targetInst=_,this.type=x,this.nativeEvent=O,this.target=B,this.currentTarget=null;for(var Z in c)c.hasOwnProperty(Z)&&(g=c[Z],this[Z]=g?g(O):O[Z]);return this.isDefaultPrevented=(O.defaultPrevented!=null?O.defaultPrevented:O.returnValue===!1)?ni:Pa,this.isPropagationStopped=Pa,this}return p(h.prototype,{preventDefault:function(){this.defaultPrevented=!0;var g=this.nativeEvent;g&&(g.preventDefault?g.preventDefault():typeof g.returnValue!="unknown"&&(g.returnValue=!1),this.isDefaultPrevented=ni)},stopPropagation:function(){var g=this.nativeEvent;g&&(g.stopPropagation?g.stopPropagation():typeof g.cancelBubble!="unknown"&&(g.cancelBubble=!0),this.isPropagationStopped=ni)},persist:function(){},isPersistent:ni}),h}var _i={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(c){return c.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ui=Bn(_i),Qn=p({},_i,{view:0,detail:0}),$u=Bn(Qn),zu,Fg,oo,Hs=p({},Qn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$g,button:0,buttons:0,relatedTarget:function(c){return c.relatedTarget===void 0?c.fromElement===c.srcElement?c.toElement:c.fromElement:c.relatedTarget},movementX:function(c){return"movementX"in c?c.movementX:(c!==oo&&(oo&&c.type==="mousemove"?(zu=c.screenX-oo.screenX,Fg=c.screenY-oo.screenY):Fg=zu=0,oo=c),zu)},movementY:function(c){return"movementY"in c?c.movementY:Fg}}),mx=Bn(Hs),Hj=p({},Hs,{dataTransfer:0}),qj=Bn(Hj),Qj=p({},Qn,{relatedTarget:0}),Mo=Bn(Qj),Rl=p({},_i,{animationName:0,elapsedTime:0,pseudoElement:0}),Ec=Bn(Rl),Hu=p({},_i,{clipboardData:function(c){return"clipboardData"in c?c.clipboardData:window.clipboardData}}),Yj=Bn(Hu),ua=p({},_i,{data:0}),gx=Bn(ua),vx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},yx={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"},Cd={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _d(c){var h=this.nativeEvent;return h.getModifierState?h.getModifierState(c):(c=Cd[c])?!!h[c]:!1}function $g(){return _d}var zg=p({},Qn,{key:function(c){if(c.key){var h=vx[c.key]||c.key;if(h!=="Unidentified")return h}return c.type==="keypress"?(c=Xn(c),c===13?"Enter":String.fromCharCode(c)):c.type==="keydown"||c.type==="keyup"?yx[c.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$g,charCode:function(c){return c.type==="keypress"?Xn(c):0},keyCode:function(c){return c.type==="keydown"||c.type==="keyup"?c.keyCode:0},which:function(c){return c.type==="keypress"?Xn(c):c.type==="keydown"||c.type==="keyup"?c.keyCode:0}}),Wj=Bn(zg),Mc=p({},Hs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Fa=Bn(Mc),kd=p({},Qn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$g}),xx=Bn(kd),Hg=p({},_i,{propertyName:0,elapsedTime:0,pseudoElement:0}),qg=Bn(Hg),Qg=p({},Hs,{deltaX:function(c){return"deltaX"in c?c.deltaX:"wheelDeltaX"in c?-c.wheelDeltaX:0},deltaY:function(c){return"deltaY"in c?c.deltaY:"wheelDeltaY"in c?-c.wheelDeltaY:"wheelDelta"in c?-c.wheelDelta:0},deltaZ:0,deltaMode:0}),bx=Bn(Qg),Ax=p({},_i,{newState:0,oldState:0}),wx=Bn(Ax),Sx=[9,13,27,32],Zf=Os&&"CompositionEvent"in window,qu=null;Os&&"documentMode"in document&&(qu=document.documentMode);var Uj=Os&&"TextEvent"in window&&!qu,Yg=Os&&(!Zf||qu&&8<qu&&11>=qu),Wg=" ",Rc=!1;function Td(c,h){switch(c){case"keyup":return Sx.indexOf(h.keyCode)!==-1;case"keydown":return h.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function fr(c){return c=c.detail,typeof c=="object"&&"data"in c?c.data:null}var Dc=!1;function nr(c,h){switch(c){case"compositionend":return fr(h);case"keypress":return h.which!==32?null:(Rc=!0,Wg);case"textInput":return c=h.data,c===Wg&&Rc?null:c;default:return null}}function jx(c,h){if(Dc)return c==="compositionend"||!Zf&&Td(c,h)?(c=Pg(),jd=Ml=zs=null,Dc=!1,c):null;switch(c){case"paste":return null;case"keypress":if(!(h.ctrlKey||h.altKey||h.metaKey)||h.ctrlKey&&h.altKey){if(h.char&&1<h.char.length)return h.char;if(h.which)return String.fromCharCode(h.which)}return null;case"compositionend":return Yg&&h.locale!=="ko"?null:h.data;default:return null}}var Ug={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 Qu(c){var h=c&&c.nodeName&&c.nodeName.toLowerCase();return h==="input"?!!Ug[c.type]:h==="textarea"}function Cx(c,h,g,x){yn?Ci?Ci.push(x):Ci=[x]:yn=x,h=pb(h,"onChange"),0<h.length&&(g=new Ui("onChange","change",null,g,x),c.push({event:g,listeners:h}))}var Od=null,Nc=null;function H(c){B3(c,0)}function X(c){var h=wr(c);if(Sd(h))return c}function te(c,h){if(c==="change")return h}var ne=!1;if(Os){var de;if(Os){var Ae="oninput"in document;if(!Ae){var $e=document.createElement("div");$e.setAttribute("oninput","return;"),Ae=typeof $e.oninput=="function"}de=Ae}else de=!1;ne=de&&(!document.documentMode||9<document.documentMode)}function Je(){Od&&(Od.detachEvent("onpropertychange",ot),Nc=Od=null)}function ot(c){if(c.propertyName==="value"&&X(Nc)){var h=[];Cx(h,Nc,c,Wt(c)),Pu(H,h)}}function yt(c,h,g){c==="focusin"?(Je(),Od=h,Nc=g,Od.attachEvent("onpropertychange",ot)):c==="focusout"&&Je()}function At(c){if(c==="selectionchange"||c==="keyup"||c==="keydown")return X(Nc)}function jt(c,h){if(c==="click")return X(h)}function Vt(c,h){if(c==="input"||c==="change")return X(h)}function In(c,h){return c===h&&(c!==0||1/c===1/h)||c!==c&&h!==h}var Gt=typeof Object.is=="function"?Object.is:In;function nn(c,h){if(Gt(c,h))return!0;if(typeof c!="object"||c===null||typeof h!="object"||h===null)return!1;var g=Object.keys(c),x=Object.keys(h);if(g.length!==x.length)return!1;for(x=0;x<g.length;x++){var _=g[x];if(!st.call(h,_)||!Gt(c[_],h[_]))return!1}return!0}function qt(c){for(;c&&c.firstChild;)c=c.firstChild;return c}function Dt(c,h){var g=qt(c);c=0;for(var x;g;){if(g.nodeType===3){if(x=c+g.textContent.length,c<=h&&x>=h)return{node:g,offset:h-c};c=x}e:{for(;g;){if(g.nextSibling){g=g.nextSibling;break e}g=g.parentNode}g=void 0}g=qt(g)}}function ci(c,h){return c&&h?c===h?!0:c&&c.nodeType===3?!1:h&&h.nodeType===3?ci(c,h.parentNode):"contains"in c?c.contains(h):c.compareDocumentPosition?!!(c.compareDocumentPosition(h)&16):!1:!1}function Ri(c){c=c!=null&&c.ownerDocument!=null&&c.ownerDocument.defaultView!=null?c.ownerDocument.defaultView:window;for(var h=Iu(c.document);h instanceof c.HTMLIFrameElement;){try{var g=typeof h.contentWindow.location.href=="string"}catch{g=!1}if(g)c=h.contentWindow;else break;h=Iu(c.document)}return h}function ir(c){var h=c&&c.nodeName&&c.nodeName.toLowerCase();return h&&(h==="input"&&(c.type==="text"||c.type==="search"||c.type==="tel"||c.type==="url"||c.type==="password")||h==="textarea"||c.contentEditable==="true")}var Kn=Os&&"documentMode"in document&&11>=document.documentMode,ii=null,ls=null,pr=null,Es=!1;function ao(c,h,g){var x=g.window===g?g.document:g.nodeType===9?g:g.ownerDocument;Es||ii==null||ii!==Iu(x)||(x=ii,"selectionStart"in x&&ir(x)?x={start:x.selectionStart,end:x.selectionEnd}:(x=(x.ownerDocument&&x.ownerDocument.defaultView||window).getSelection(),x={anchorNode:x.anchorNode,anchorOffset:x.anchorOffset,focusNode:x.focusNode,focusOffset:x.focusOffset}),pr&&nn(pr,x)||(pr=x,x=pb(ls,"onSelect"),0<x.length&&(h=new Ui("onSelect","select",null,h,g),c.push({event:h,listeners:x}),h.target=ii)))}function Yr(c,h){var g={};return g[c.toLowerCase()]=h.toLowerCase(),g["Webkit"+c]="webkit"+h,g["Moz"+c]="moz"+h,g}var jr={animationend:Yr("Animation","AnimationEnd"),animationiteration:Yr("Animation","AnimationIteration"),animationstart:Yr("Animation","AnimationStart"),transitionrun:Yr("Transition","TransitionRun"),transitionstart:Yr("Transition","TransitionStart"),transitioncancel:Yr("Transition","TransitionCancel"),transitionend:Yr("Transition","TransitionEnd")},Ms={},lo={};Os&&(lo=document.createElement("div").style,"AnimationEvent"in window||(delete jr.animationend.animation,delete jr.animationiteration.animation,delete jr.animationstart.animation),"TransitionEvent"in window||delete jr.transitionend.transition);function Wr(c){if(Ms[c])return Ms[c];if(!jr[c])return c;var h=jr[c],g;for(g in h)if(h.hasOwnProperty(g)&&g in lo)return Ms[c]=h[g];return c}var Ur=Wr("animationend"),Rs=Wr("animationiteration"),Dl=Wr("animationstart"),cs=Wr("transitionrun"),_x=Wr("transitionstart"),IG=Wr("transitioncancel"),mN=Wr("transitionend"),gN=new Map,Vj="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(" ");Vj.push("scrollEnd");function $a(c,h){gN.set(c,h),Cs(h,[c])}var kx=typeof reportError=="function"?reportError:function(c){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var h=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof c=="object"&&c!==null&&typeof c.message=="string"?String(c.message):String(c),error:c});if(!window.dispatchEvent(h))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",c);return}console.error(c)},ha=[],Jf=0,Gj=0;function Tx(){for(var c=Jf,h=Gj=Jf=0;h<c;){var g=ha[h];ha[h++]=null;var x=ha[h];ha[h++]=null;var _=ha[h];ha[h++]=null;var O=ha[h];if(ha[h++]=null,x!==null&&_!==null){var B=x.pending;B===null?_.next=_:(_.next=B.next,B.next=_),x.pending=_}O!==0&&vN(g,_,O)}}function Ox(c,h,g,x){ha[Jf++]=c,ha[Jf++]=h,ha[Jf++]=g,ha[Jf++]=x,Gj|=x,c.lanes|=x,c=c.alternate,c!==null&&(c.lanes|=x)}function Xj(c,h,g,x){return Ox(c,h,g,x),Ex(c)}function Ed(c,h){return Ox(c,null,null,h),Ex(c)}function vN(c,h,g){c.lanes|=g;var x=c.alternate;x!==null&&(x.lanes|=g);for(var _=!1,O=c.return;O!==null;)O.childLanes|=g,x=O.alternate,x!==null&&(x.childLanes|=g),O.tag===22&&(c=O.stateNode,c===null||c._visibility&1||(_=!0)),c=O,O=O.return;return c.tag===3?(O=c.stateNode,_&&h!==null&&(_=31-Lt(g),c=O.hiddenUpdates,x=c[_],x===null?c[_]=[h]:x.push(h),h.lane=g|536870912),O):null}function Ex(c){if(50<m0)throw m0=0,s_=null,Error(i(185));for(var h=c.return;h!==null;)c=h,h=c.return;return c.tag===3?c.stateNode:null}var ep={};function BG(c,h,g,x){this.tag=c,this.key=g,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=h,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=x,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ro(c,h,g,x){return new BG(c,h,g,x)}function Kj(c){return c=c.prototype,!(!c||!c.isReactComponent)}function Ic(c,h){var g=c.alternate;return g===null?(g=Ro(c.tag,h,c.key,c.mode),g.elementType=c.elementType,g.type=c.type,g.stateNode=c.stateNode,g.alternate=c,c.alternate=g):(g.pendingProps=h,g.type=c.type,g.flags=0,g.subtreeFlags=0,g.deletions=null),g.flags=c.flags&65011712,g.childLanes=c.childLanes,g.lanes=c.lanes,g.child=c.child,g.memoizedProps=c.memoizedProps,g.memoizedState=c.memoizedState,g.updateQueue=c.updateQueue,h=c.dependencies,g.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext},g.sibling=c.sibling,g.index=c.index,g.ref=c.ref,g.refCleanup=c.refCleanup,g}function yN(c,h){c.flags&=65011714;var g=c.alternate;return g===null?(c.childLanes=0,c.lanes=h,c.child=null,c.subtreeFlags=0,c.memoizedProps=null,c.memoizedState=null,c.updateQueue=null,c.dependencies=null,c.stateNode=null):(c.childLanes=g.childLanes,c.lanes=g.lanes,c.child=g.child,c.subtreeFlags=0,c.deletions=null,c.memoizedProps=g.memoizedProps,c.memoizedState=g.memoizedState,c.updateQueue=g.updateQueue,c.type=g.type,h=g.dependencies,c.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext}),c}function Mx(c,h,g,x,_,O){var B=0;if(x=c,typeof c=="function")Kj(c)&&(B=1);else if(typeof c=="string")B=zX(c,g,J.current)?26:c==="html"||c==="head"||c==="body"?27:5;else e:switch(c){case D:return c=Ro(31,g,h,_),c.elementType=D,c.lanes=O,c;case b:return Md(g.children,_,O,h);case A:B=8,_|=24;break;case w:return c=Ro(12,g,h,_|2),c.elementType=w,c.lanes=O,c;case k:return c=Ro(13,g,h,_),c.elementType=k,c.lanes=O,c;case E:return c=Ro(19,g,h,_),c.elementType=E,c.lanes=O,c;default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case j:B=10;break e;case S:B=9;break e;case C:B=11;break e;case M:B=14;break e;case R:B=16,x=null;break e}B=29,g=Error(i(130,c===null?"null":typeof c,"")),x=null}return h=Ro(B,g,h,_),h.elementType=c,h.type=x,h.lanes=O,h}function Md(c,h,g,x){return c=Ro(7,c,x,h),c.lanes=g,c}function Zj(c,h,g){return c=Ro(6,c,null,h),c.lanes=g,c}function xN(c){var h=Ro(18,null,null,0);return h.stateNode=c,h}function Jj(c,h,g){return h=Ro(4,c.children!==null?c.children:[],c.key,h),h.lanes=g,h.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},h}var bN=new WeakMap;function da(c,h){if(typeof c=="object"&&c!==null){var g=bN.get(c);return g!==void 0?g:(h={value:c,source:h,stack:Ve(h)},bN.set(c,h),h)}return{value:c,source:h,stack:Ve(h)}}var tp=[],np=0,Rx=null,Vg=0,fa=[],pa=0,Yu=null,Nl=1,Il="";function Bc(c,h){tp[np++]=Vg,tp[np++]=Rx,Rx=c,Vg=h}function AN(c,h,g){fa[pa++]=Nl,fa[pa++]=Il,fa[pa++]=Yu,Yu=c;var x=Nl;c=Il;var _=32-Lt(x)-1;x&=~(1<<_),g+=1;var O=32-Lt(h)+_;if(30<O){var B=_-_%5;O=(x&(1<<B)-1).toString(32),x>>=B,_-=B,Nl=1<<32-Lt(h)+_|g<<_|x,Il=O+c}else Nl=1<<O|g<<_|x,Il=c}function eC(c){c.return!==null&&(Bc(c,1),AN(c,1,0))}function tC(c){for(;c===Rx;)Rx=tp[--np],tp[np]=null,Vg=tp[--np],tp[np]=null;for(;c===Yu;)Yu=fa[--pa],fa[pa]=null,Il=fa[--pa],fa[pa]=null,Nl=fa[--pa],fa[pa]=null}function wN(c,h){fa[pa++]=Nl,fa[pa++]=Il,fa[pa++]=Yu,Nl=h.id,Il=h.overflow,Yu=c}var us=null,Di=null,Tn=!1,Wu=null,ma=!1,nC=Error(i(519));function Uu(c){var h=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Gg(da(h,c)),nC}function SN(c){var h=c.stateNode,g=c.type,x=c.memoizedProps;switch(h[li]=c,h[Qr]=x,g){case"dialog":An("cancel",h),An("close",h);break;case"iframe":case"object":case"embed":An("load",h);break;case"video":case"audio":for(g=0;g<v0.length;g++)An(v0[g],h);break;case"source":An("error",h);break;case"img":case"image":case"link":An("error",h),An("load",h);break;case"details":An("toggle",h);break;case"input":An("invalid",h),_c(h,x.value,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name,!0);break;case"select":An("invalid",h);break;case"textarea":An("invalid",h),La(h,x.value,x.defaultValue,x.children)}g=x.children,typeof g!="string"&&typeof g!="number"&&typeof g!="bigint"||h.textContent===""+g||x.suppressHydrationWarning===!0||$3(h.textContent,g)?(x.popover!=null&&(An("beforetoggle",h),An("toggle",h)),x.onScroll!=null&&An("scroll",h),x.onScrollEnd!=null&&An("scrollend",h),x.onClick!=null&&(h.onclick=at),h=!0):h=!1,h||Uu(c,!0)}function jN(c){for(us=c.return;us;)switch(us.tag){case 5:case 31:case 13:ma=!1;return;case 27:case 3:ma=!0;return;default:us=us.return}}function ip(c){if(c!==us)return!1;if(!Tn)return jN(c),Tn=!0,!1;var h=c.tag,g;if((g=h!==3&&h!==27)&&((g=h===5)&&(g=c.type,g=!(g!=="form"&&g!=="button")||b_(c.type,c.memoizedProps)),g=!g),g&&Di&&Uu(c),jN(c),h===13){if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));Di=G3(c)}else if(h===31){if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));Di=G3(c)}else h===27?(h=Di,ah(c.type)?(c=C_,C_=null,Di=c):Di=h):Di=us?va(c.stateNode.nextSibling):null;return!0}function Rd(){Di=us=null,Tn=!1}function iC(){var c=Wu;return c!==null&&(fo===null?fo=c:fo.push.apply(fo,c),Wu=null),c}function Gg(c){Wu===null?Wu=[c]:Wu.push(c)}var rC=z(null),Dd=null,Lc=null;function Vu(c,h,g){V(rC,h._currentValue),h._currentValue=g}function Pc(c){c._currentValue=rC.current,U(rC)}function sC(c,h,g){for(;c!==null;){var x=c.alternate;if((c.childLanes&h)!==h?(c.childLanes|=h,x!==null&&(x.childLanes|=h)):x!==null&&(x.childLanes&h)!==h&&(x.childLanes|=h),c===g)break;c=c.return}}function oC(c,h,g,x){var _=c.child;for(_!==null&&(_.return=c);_!==null;){var O=_.dependencies;if(O!==null){var B=_.child;O=O.firstContext;e:for(;O!==null;){var Z=O;O=_;for(var ae=0;ae<h.length;ae++)if(Z.context===h[ae]){O.lanes|=g,Z=O.alternate,Z!==null&&(Z.lanes|=g),sC(O.return,g,c),x||(B=null);break e}O=Z.next}}else if(_.tag===18){if(B=_.return,B===null)throw Error(i(341));B.lanes|=g,O=B.alternate,O!==null&&(O.lanes|=g),sC(B,g,c),B=null}else B=_.child;if(B!==null)B.return=_;else for(B=_;B!==null;){if(B===c){B=null;break}if(_=B.sibling,_!==null){_.return=B.return,B=_;break}B=B.return}_=B}}function rp(c,h,g,x){c=null;for(var _=h,O=!1;_!==null;){if(!O){if((_.flags&524288)!==0)O=!0;else if((_.flags&262144)!==0)break}if(_.tag===10){var B=_.alternate;if(B===null)throw Error(i(387));if(B=B.memoizedProps,B!==null){var Z=_.type;Gt(_.pendingProps.value,B.value)||(c!==null?c.push(Z):c=[Z])}}else if(_===he.current){if(B=_.alternate,B===null)throw Error(i(387));B.memoizedState.memoizedState!==_.memoizedState.memoizedState&&(c!==null?c.push(w0):c=[w0])}_=_.return}c!==null&&oC(h,c,g,x),h.flags|=262144}function Dx(c){for(c=c.firstContext;c!==null;){if(!Gt(c.context._currentValue,c.memoizedValue))return!0;c=c.next}return!1}function Nd(c){Dd=c,Lc=null,c=c.dependencies,c!==null&&(c.firstContext=null)}function hs(c){return CN(Dd,c)}function Nx(c,h){return Dd===null&&Nd(c),CN(c,h)}function CN(c,h){var g=h._currentValue;if(h={context:h,memoizedValue:g,next:null},Lc===null){if(c===null)throw Error(i(308));Lc=h,c.dependencies={lanes:0,firstContext:h},c.flags|=524288}else Lc=Lc.next=h;return g}var LG=typeof AbortController<"u"?AbortController:function(){var c=[],h=this.signal={aborted:!1,addEventListener:function(g,x){c.push(x)}};this.abort=function(){h.aborted=!0,c.forEach(function(g){return g()})}},PG=t.unstable_scheduleCallback,FG=t.unstable_NormalPriority,Cr={$$typeof:j,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function aC(){return{controller:new LG,data:new Map,refCount:0}}function Xg(c){c.refCount--,c.refCount===0&&PG(FG,function(){c.controller.abort()})}var Kg=null,lC=0,sp=0,op=null;function $G(c,h){if(Kg===null){var g=Kg=[];lC=0,sp=h_(),op={status:"pending",value:void 0,then:function(x){g.push(x)}}}return lC++,h.then(_N,_N),h}function _N(){if(--lC===0&&Kg!==null){op!==null&&(op.status="fulfilled");var c=Kg;Kg=null,sp=0,op=null;for(var h=0;h<c.length;h++)(0,c[h])()}}function zG(c,h){var g=[],x={status:"pending",value:null,reason:null,then:function(_){g.push(_)}};return c.then(function(){x.status="fulfilled",x.value=h;for(var _=0;_<g.length;_++)(0,g[_])(h)},function(_){for(x.status="rejected",x.reason=_,_=0;_<g.length;_++)(0,g[_])(void 0)}),x}var kN=N.S;N.S=function(c,h){u3=Ee(),typeof h=="object"&&h!==null&&typeof h.then=="function"&&$G(c,h),kN!==null&&kN(c,h)};var Id=z(null);function cC(){var c=Id.current;return c!==null?c:vi.pooledCache}function Ix(c,h){h===null?V(Id,Id.current):V(Id,h.pool)}function TN(){var c=cC();return c===null?null:{parent:Cr._currentValue,pool:c}}var ap=Error(i(460)),uC=Error(i(474)),Bx=Error(i(542)),Lx={then:function(){}};function ON(c){return c=c.status,c==="fulfilled"||c==="rejected"}function EN(c,h,g){switch(g=c[g],g===void 0?c.push(h):g!==h&&(h.then(at,at),h=g),h.status){case"fulfilled":return h.value;case"rejected":throw c=h.reason,RN(c),c;default:if(typeof h.status=="string")h.then(at,at);else{if(c=vi,c!==null&&100<c.shellSuspendCounter)throw Error(i(482));c=h,c.status="pending",c.then(function(x){if(h.status==="pending"){var _=h;_.status="fulfilled",_.value=x}},function(x){if(h.status==="pending"){var _=h;_.status="rejected",_.reason=x}})}switch(h.status){case"fulfilled":return h.value;case"rejected":throw c=h.reason,RN(c),c}throw Ld=h,ap}}function Bd(c){try{var h=c._init;return h(c._payload)}catch(g){throw g!==null&&typeof g=="object"&&typeof g.then=="function"?(Ld=g,ap):g}}var Ld=null;function MN(){if(Ld===null)throw Error(i(459));var c=Ld;return Ld=null,c}function RN(c){if(c===ap||c===Bx)throw Error(i(483))}var lp=null,Zg=0;function Px(c){var h=Zg;return Zg+=1,lp===null&&(lp=[]),EN(lp,c,h)}function Jg(c,h){h=h.props.ref,c.ref=h!==void 0?h:null}function Fx(c,h){throw h.$$typeof===m?Error(i(525)):(c=Object.prototype.toString.call(h),Error(i(31,c==="[object Object]"?"object with keys {"+Object.keys(h).join(", ")+"}":c)))}function DN(c){function h(me,fe){if(c){var Se=me.deletions;Se===null?(me.deletions=[fe],me.flags|=16):Se.push(fe)}}function g(me,fe){if(!c)return null;for(;fe!==null;)h(me,fe),fe=fe.sibling;return null}function x(me){for(var fe=new Map;me!==null;)me.key!==null?fe.set(me.key,me):fe.set(me.index,me),me=me.sibling;return fe}function _(me,fe){return me=Ic(me,fe),me.index=0,me.sibling=null,me}function O(me,fe,Se){return me.index=Se,c?(Se=me.alternate,Se!==null?(Se=Se.index,Se<fe?(me.flags|=67108866,fe):Se):(me.flags|=67108866,fe)):(me.flags|=1048576,fe)}function B(me){return c&&me.alternate===null&&(me.flags|=67108866),me}function Z(me,fe,Se,He){return fe===null||fe.tag!==6?(fe=Zj(Se,me.mode,He),fe.return=me,fe):(fe=_(fe,Se),fe.return=me,fe)}function ae(me,fe,Se,He){var Ft=Se.type;return Ft===b?Ie(me,fe,Se.props.children,He,Se.key):fe!==null&&(fe.elementType===Ft||typeof Ft=="object"&&Ft!==null&&Ft.$$typeof===R&&Bd(Ft)===fe.type)?(fe=_(fe,Se.props),Jg(fe,Se),fe.return=me,fe):(fe=Mx(Se.type,Se.key,Se.props,null,me.mode,He),Jg(fe,Se),fe.return=me,fe)}function _e(me,fe,Se,He){return fe===null||fe.tag!==4||fe.stateNode.containerInfo!==Se.containerInfo||fe.stateNode.implementation!==Se.implementation?(fe=Jj(Se,me.mode,He),fe.return=me,fe):(fe=_(fe,Se.children||[]),fe.return=me,fe)}function Ie(me,fe,Se,He,Ft){return fe===null||fe.tag!==7?(fe=Md(Se,me.mode,He,Ft),fe.return=me,fe):(fe=_(fe,Se),fe.return=me,fe)}function Ue(me,fe,Se){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return fe=Zj(""+fe,me.mode,Se),fe.return=me,fe;if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case v:return Se=Mx(fe.type,fe.key,fe.props,null,me.mode,Se),Jg(Se,fe),Se.return=me,Se;case y:return fe=Jj(fe,me.mode,Se),fe.return=me,fe;case R:return fe=Bd(fe),Ue(me,fe,Se)}if(q(fe)||Q(fe))return fe=Md(fe,me.mode,Se,null),fe.return=me,fe;if(typeof fe.then=="function")return Ue(me,Px(fe),Se);if(fe.$$typeof===j)return Ue(me,Nx(me,fe),Se);Fx(me,fe)}return null}function ke(me,fe,Se,He){var Ft=fe!==null?fe.key:null;if(typeof Se=="string"&&Se!==""||typeof Se=="number"||typeof Se=="bigint")return Ft!==null?null:Z(me,fe,""+Se,He);if(typeof Se=="object"&&Se!==null){switch(Se.$$typeof){case v:return Se.key===Ft?ae(me,fe,Se,He):null;case y:return Se.key===Ft?_e(me,fe,Se,He):null;case R:return Se=Bd(Se),ke(me,fe,Se,He)}if(q(Se)||Q(Se))return Ft!==null?null:Ie(me,fe,Se,He,null);if(typeof Se.then=="function")return ke(me,fe,Px(Se),He);if(Se.$$typeof===j)return ke(me,fe,Nx(me,Se),He);Fx(me,Se)}return null}function Me(me,fe,Se,He,Ft){if(typeof He=="string"&&He!==""||typeof He=="number"||typeof He=="bigint")return me=me.get(Se)||null,Z(fe,me,""+He,Ft);if(typeof He=="object"&&He!==null){switch(He.$$typeof){case v:return me=me.get(He.key===null?Se:He.key)||null,ae(fe,me,He,Ft);case y:return me=me.get(He.key===null?Se:He.key)||null,_e(fe,me,He,Ft);case R:return He=Bd(He),Me(me,fe,Se,He,Ft)}if(q(He)||Q(He))return me=me.get(Se)||null,Ie(fe,me,He,Ft,null);if(typeof He.then=="function")return Me(me,fe,Se,Px(He),Ft);if(He.$$typeof===j)return Me(me,fe,Se,Nx(fe,He),Ft);Fx(fe,He)}return null}function _t(me,fe,Se,He){for(var Ft=null,Ln=null,Mt=fe,hn=fe=0,Cn=null;Mt!==null&&hn<Se.length;hn++){Mt.index>hn?(Cn=Mt,Mt=null):Cn=Mt.sibling;var Pn=ke(me,Mt,Se[hn],He);if(Pn===null){Mt===null&&(Mt=Cn);break}c&&Mt&&Pn.alternate===null&&h(me,Mt),fe=O(Pn,fe,hn),Ln===null?Ft=Pn:Ln.sibling=Pn,Ln=Pn,Mt=Cn}if(hn===Se.length)return g(me,Mt),Tn&&Bc(me,hn),Ft;if(Mt===null){for(;hn<Se.length;hn++)Mt=Ue(me,Se[hn],He),Mt!==null&&(fe=O(Mt,fe,hn),Ln===null?Ft=Mt:Ln.sibling=Mt,Ln=Mt);return Tn&&Bc(me,hn),Ft}for(Mt=x(Mt);hn<Se.length;hn++)Cn=Me(Mt,me,hn,Se[hn],He),Cn!==null&&(c&&Cn.alternate!==null&&Mt.delete(Cn.key===null?hn:Cn.key),fe=O(Cn,fe,hn),Ln===null?Ft=Cn:Ln.sibling=Cn,Ln=Cn);return c&&Mt.forEach(function(dh){return h(me,dh)}),Tn&&Bc(me,hn),Ft}function Yt(me,fe,Se,He){if(Se==null)throw Error(i(151));for(var Ft=null,Ln=null,Mt=fe,hn=fe=0,Cn=null,Pn=Se.next();Mt!==null&&!Pn.done;hn++,Pn=Se.next()){Mt.index>hn?(Cn=Mt,Mt=null):Cn=Mt.sibling;var dh=ke(me,Mt,Pn.value,He);if(dh===null){Mt===null&&(Mt=Cn);break}c&&Mt&&dh.alternate===null&&h(me,Mt),fe=O(dh,fe,hn),Ln===null?Ft=dh:Ln.sibling=dh,Ln=dh,Mt=Cn}if(Pn.done)return g(me,Mt),Tn&&Bc(me,hn),Ft;if(Mt===null){for(;!Pn.done;hn++,Pn=Se.next())Pn=Ue(me,Pn.value,He),Pn!==null&&(fe=O(Pn,fe,hn),Ln===null?Ft=Pn:Ln.sibling=Pn,Ln=Pn);return Tn&&Bc(me,hn),Ft}for(Mt=x(Mt);!Pn.done;hn++,Pn=Se.next())Pn=Me(Mt,me,hn,Pn.value,He),Pn!==null&&(c&&Pn.alternate!==null&&Mt.delete(Pn.key===null?hn:Pn.key),fe=O(Pn,fe,hn),Ln===null?Ft=Pn:Ln.sibling=Pn,Ln=Pn);return c&&Mt.forEach(function(ZX){return h(me,ZX)}),Tn&&Bc(me,hn),Ft}function di(me,fe,Se,He){if(typeof Se=="object"&&Se!==null&&Se.type===b&&Se.key===null&&(Se=Se.props.children),typeof Se=="object"&&Se!==null){switch(Se.$$typeof){case v:e:{for(var Ft=Se.key;fe!==null;){if(fe.key===Ft){if(Ft=Se.type,Ft===b){if(fe.tag===7){g(me,fe.sibling),He=_(fe,Se.props.children),He.return=me,me=He;break e}}else if(fe.elementType===Ft||typeof Ft=="object"&&Ft!==null&&Ft.$$typeof===R&&Bd(Ft)===fe.type){g(me,fe.sibling),He=_(fe,Se.props),Jg(He,Se),He.return=me,me=He;break e}g(me,fe);break}else h(me,fe);fe=fe.sibling}Se.type===b?(He=Md(Se.props.children,me.mode,He,Se.key),He.return=me,me=He):(He=Mx(Se.type,Se.key,Se.props,null,me.mode,He),Jg(He,Se),He.return=me,me=He)}return B(me);case y:e:{for(Ft=Se.key;fe!==null;){if(fe.key===Ft)if(fe.tag===4&&fe.stateNode.containerInfo===Se.containerInfo&&fe.stateNode.implementation===Se.implementation){g(me,fe.sibling),He=_(fe,Se.children||[]),He.return=me,me=He;break e}else{g(me,fe);break}else h(me,fe);fe=fe.sibling}He=Jj(Se,me.mode,He),He.return=me,me=He}return B(me);case R:return Se=Bd(Se),di(me,fe,Se,He)}if(q(Se))return _t(me,fe,Se,He);if(Q(Se)){if(Ft=Q(Se),typeof Ft!="function")throw Error(i(150));return Se=Ft.call(Se),Yt(me,fe,Se,He)}if(typeof Se.then=="function")return di(me,fe,Px(Se),He);if(Se.$$typeof===j)return di(me,fe,Nx(me,Se),He);Fx(me,Se)}return typeof Se=="string"&&Se!==""||typeof Se=="number"||typeof Se=="bigint"?(Se=""+Se,fe!==null&&fe.tag===6?(g(me,fe.sibling),He=_(fe,Se),He.return=me,me=He):(g(me,fe),He=Zj(Se,me.mode,He),He.return=me,me=He),B(me)):g(me,fe)}return function(me,fe,Se,He){try{Zg=0;var Ft=di(me,fe,Se,He);return lp=null,Ft}catch(Mt){if(Mt===ap||Mt===Bx)throw Mt;var Ln=Ro(29,Mt,null,me.mode);return Ln.lanes=He,Ln.return=me,Ln}finally{}}}var Pd=DN(!0),NN=DN(!1),Gu=!1;function hC(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function dC(c,h){c=c.updateQueue,h.updateQueue===c&&(h.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,callbacks:null})}function Xu(c){return{lane:c,tag:0,payload:null,callback:null,next:null}}function Ku(c,h,g){var x=c.updateQueue;if(x===null)return null;if(x=x.shared,(Yn&2)!==0){var _=x.pending;return _===null?h.next=h:(h.next=_.next,_.next=h),x.pending=h,h=Ex(c),vN(c,null,g),h}return Ox(c,x,h,g),Ex(c)}function e0(c,h,g){if(h=h.updateQueue,h!==null&&(h=h.shared,(g&4194048)!==0)){var x=h.lanes;x&=c.pendingLanes,g|=x,h.lanes=g,ht(c,g)}}function fC(c,h){var g=c.updateQueue,x=c.alternate;if(x!==null&&(x=x.updateQueue,g===x)){var _=null,O=null;if(g=g.firstBaseUpdate,g!==null){do{var B={lane:g.lane,tag:g.tag,payload:g.payload,callback:null,next:null};O===null?_=O=B:O=O.next=B,g=g.next}while(g!==null);O===null?_=O=h:O=O.next=h}else _=O=h;g={baseState:x.baseState,firstBaseUpdate:_,lastBaseUpdate:O,shared:x.shared,callbacks:x.callbacks},c.updateQueue=g;return}c=g.lastBaseUpdate,c===null?g.firstBaseUpdate=h:c.next=h,g.lastBaseUpdate=h}var pC=!1;function t0(){if(pC){var c=op;if(c!==null)throw c}}function n0(c,h,g,x){pC=!1;var _=c.updateQueue;Gu=!1;var O=_.firstBaseUpdate,B=_.lastBaseUpdate,Z=_.shared.pending;if(Z!==null){_.shared.pending=null;var ae=Z,_e=ae.next;ae.next=null,B===null?O=_e:B.next=_e,B=ae;var Ie=c.alternate;Ie!==null&&(Ie=Ie.updateQueue,Z=Ie.lastBaseUpdate,Z!==B&&(Z===null?Ie.firstBaseUpdate=_e:Z.next=_e,Ie.lastBaseUpdate=ae))}if(O!==null){var Ue=_.baseState;B=0,Ie=_e=ae=null,Z=O;do{var ke=Z.lane&-536870913,Me=ke!==Z.lane;if(Me?(jn&ke)===ke:(x&ke)===ke){ke!==0&&ke===sp&&(pC=!0),Ie!==null&&(Ie=Ie.next={lane:0,tag:Z.tag,payload:Z.payload,callback:null,next:null});e:{var _t=c,Yt=Z;ke=h;var di=g;switch(Yt.tag){case 1:if(_t=Yt.payload,typeof _t=="function"){Ue=_t.call(di,Ue,ke);break e}Ue=_t;break e;case 3:_t.flags=_t.flags&-65537|128;case 0:if(_t=Yt.payload,ke=typeof _t=="function"?_t.call(di,Ue,ke):_t,ke==null)break e;Ue=p({},Ue,ke);break e;case 2:Gu=!0}}ke=Z.callback,ke!==null&&(c.flags|=64,Me&&(c.flags|=8192),Me=_.callbacks,Me===null?_.callbacks=[ke]:Me.push(ke))}else Me={lane:ke,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null},Ie===null?(_e=Ie=Me,ae=Ue):Ie=Ie.next=Me,B|=ke;if(Z=Z.next,Z===null){if(Z=_.shared.pending,Z===null)break;Me=Z,Z=Me.next,Me.next=null,_.lastBaseUpdate=Me,_.shared.pending=null}}while(!0);Ie===null&&(ae=Ue),_.baseState=ae,_.firstBaseUpdate=_e,_.lastBaseUpdate=Ie,O===null&&(_.shared.lanes=0),nh|=B,c.lanes=B,c.memoizedState=Ue}}function IN(c,h){if(typeof c!="function")throw Error(i(191,c));c.call(h)}function BN(c,h){var g=c.callbacks;if(g!==null)for(c.callbacks=null,c=0;c<g.length;c++)IN(g[c],h)}var cp=z(null),$x=z(0);function LN(c,h){c=Uc,V($x,c),V(cp,h),Uc=c|h.baseLanes}function mC(){V($x,Uc),V(cp,cp.current)}function gC(){Uc=$x.current,U(cp),U($x)}var Do=z(null),ga=null;function Zu(c){var h=c.alternate;V(mr,mr.current&1),V(Do,c),ga===null&&(h===null||cp.current!==null||h.memoizedState!==null)&&(ga=c)}function vC(c){V(mr,mr.current),V(Do,c),ga===null&&(ga=c)}function PN(c){c.tag===22?(V(mr,mr.current),V(Do,c),ga===null&&(ga=c)):Ju()}function Ju(){V(mr,mr.current),V(Do,Do.current)}function No(c){U(Do),ga===c&&(ga=null),U(mr)}var mr=z(0);function zx(c){for(var h=c;h!==null;){if(h.tag===13){var g=h.memoizedState;if(g!==null&&(g=g.dehydrated,g===null||S_(g)||j_(g)))return h}else if(h.tag===19&&(h.memoizedProps.revealOrder==="forwards"||h.memoizedProps.revealOrder==="backwards"||h.memoizedProps.revealOrder==="unstable_legacy-backwards"||h.memoizedProps.revealOrder==="together")){if((h.flags&128)!==0)return h}else if(h.child!==null){h.child.return=h,h=h.child;continue}if(h===c)break;for(;h.sibling===null;){if(h.return===null||h.return===c)return null;h=h.return}h.sibling.return=h.return,h=h.sibling}return null}var Fc=0,cn=null,ui=null,_r=null,Hx=!1,up=!1,Fd=!1,qx=0,i0=0,hp=null,HG=0;function rr(){throw Error(i(321))}function yC(c,h){if(h===null)return!1;for(var g=0;g<h.length&&g<c.length;g++)if(!Gt(c[g],h[g]))return!1;return!0}function xC(c,h,g,x,_,O){return Fc=O,cn=h,h.memoizedState=null,h.updateQueue=null,h.lanes=0,N.H=c===null||c.memoizedState===null?AI:NC,Fd=!1,O=g(x,_),Fd=!1,up&&(O=$N(h,g,x,_)),FN(c),O}function FN(c){N.H=o0;var h=ui!==null&&ui.next!==null;if(Fc=0,_r=ui=cn=null,Hx=!1,i0=0,hp=null,h)throw Error(i(300));c===null||kr||(c=c.dependencies,c!==null&&Dx(c)&&(kr=!0))}function $N(c,h,g,x){cn=c;var _=0;do{if(up&&(hp=null),i0=0,up=!1,25<=_)throw Error(i(301));if(_+=1,_r=ui=null,c.updateQueue!=null){var O=c.updateQueue;O.lastEffect=null,O.events=null,O.stores=null,O.memoCache!=null&&(O.memoCache.index=0)}N.H=wI,O=h(g,x)}while(up);return O}function qG(){var c=N.H,h=c.useState()[0];return h=typeof h.then=="function"?r0(h):h,c=c.useState()[0],(ui!==null?ui.memoizedState:null)!==c&&(cn.flags|=1024),h}function bC(){var c=qx!==0;return qx=0,c}function AC(c,h,g){h.updateQueue=c.updateQueue,h.flags&=-2053,c.lanes&=~g}function wC(c){if(Hx){for(c=c.memoizedState;c!==null;){var h=c.queue;h!==null&&(h.pending=null),c=c.next}Hx=!1}Fc=0,_r=ui=cn=null,up=!1,i0=qx=0,hp=null}function qs(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _r===null?cn.memoizedState=_r=c:_r=_r.next=c,_r}function gr(){if(ui===null){var c=cn.alternate;c=c!==null?c.memoizedState:null}else c=ui.next;var h=_r===null?cn.memoizedState:_r.next;if(h!==null)_r=h,ui=c;else{if(c===null)throw cn.alternate===null?Error(i(467)):Error(i(310));ui=c,c={memoizedState:ui.memoizedState,baseState:ui.baseState,baseQueue:ui.baseQueue,queue:ui.queue,next:null},_r===null?cn.memoizedState=_r=c:_r=_r.next=c}return _r}function Qx(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function r0(c){var h=i0;return i0+=1,hp===null&&(hp=[]),c=EN(hp,c,h),h=cn,(_r===null?h.memoizedState:_r.next)===null&&(h=h.alternate,N.H=h===null||h.memoizedState===null?AI:NC),c}function Yx(c){if(c!==null&&typeof c=="object"){if(typeof c.then=="function")return r0(c);if(c.$$typeof===j)return hs(c)}throw Error(i(438,String(c)))}function SC(c){var h=null,g=cn.updateQueue;if(g!==null&&(h=g.memoCache),h==null){var x=cn.alternate;x!==null&&(x=x.updateQueue,x!==null&&(x=x.memoCache,x!=null&&(h={data:x.data.map(function(_){return _.slice()}),index:0})))}if(h==null&&(h={data:[],index:0}),g===null&&(g=Qx(),cn.updateQueue=g),g.memoCache=h,g=h.data[h.index],g===void 0)for(g=h.data[h.index]=Array(c),x=0;x<c;x++)g[x]=F;return h.index++,g}function $c(c,h){return typeof h=="function"?h(c):h}function Wx(c){var h=gr();return jC(h,ui,c)}function jC(c,h,g){var x=c.queue;if(x===null)throw Error(i(311));x.lastRenderedReducer=g;var _=c.baseQueue,O=x.pending;if(O!==null){if(_!==null){var B=_.next;_.next=O.next,O.next=B}h.baseQueue=_=O,x.pending=null}if(O=c.baseState,_===null)c.memoizedState=O;else{h=_.next;var Z=B=null,ae=null,_e=h,Ie=!1;do{var Ue=_e.lane&-536870913;if(Ue!==_e.lane?(jn&Ue)===Ue:(Fc&Ue)===Ue){var ke=_e.revertLane;if(ke===0)ae!==null&&(ae=ae.next={lane:0,revertLane:0,gesture:null,action:_e.action,hasEagerState:_e.hasEagerState,eagerState:_e.eagerState,next:null}),Ue===sp&&(Ie=!0);else if((Fc&ke)===ke){_e=_e.next,ke===sp&&(Ie=!0);continue}else Ue={lane:0,revertLane:_e.revertLane,gesture:null,action:_e.action,hasEagerState:_e.hasEagerState,eagerState:_e.eagerState,next:null},ae===null?(Z=ae=Ue,B=O):ae=ae.next=Ue,cn.lanes|=ke,nh|=ke;Ue=_e.action,Fd&&g(O,Ue),O=_e.hasEagerState?_e.eagerState:g(O,Ue)}else ke={lane:Ue,revertLane:_e.revertLane,gesture:_e.gesture,action:_e.action,hasEagerState:_e.hasEagerState,eagerState:_e.eagerState,next:null},ae===null?(Z=ae=ke,B=O):ae=ae.next=ke,cn.lanes|=Ue,nh|=Ue;_e=_e.next}while(_e!==null&&_e!==h);if(ae===null?B=O:ae.next=Z,!Gt(O,c.memoizedState)&&(kr=!0,Ie&&(g=op,g!==null)))throw g;c.memoizedState=O,c.baseState=B,c.baseQueue=ae,x.lastRenderedState=O}return _===null&&(x.lanes=0),[c.memoizedState,x.dispatch]}function CC(c){var h=gr(),g=h.queue;if(g===null)throw Error(i(311));g.lastRenderedReducer=c;var x=g.dispatch,_=g.pending,O=h.memoizedState;if(_!==null){g.pending=null;var B=_=_.next;do O=c(O,B.action),B=B.next;while(B!==_);Gt(O,h.memoizedState)||(kr=!0),h.memoizedState=O,h.baseQueue===null&&(h.baseState=O),g.lastRenderedState=O}return[O,x]}function zN(c,h,g){var x=cn,_=gr(),O=Tn;if(O){if(g===void 0)throw Error(i(407));g=g()}else g=h();var B=!Gt((ui||_).memoizedState,g);if(B&&(_.memoizedState=g,kr=!0),_=_.queue,TC(QN.bind(null,x,_,c),[c]),_.getSnapshot!==h||B||_r!==null&&_r.memoizedState.tag&1){if(x.flags|=2048,dp(9,{destroy:void 0},qN.bind(null,x,_,g,h),null),vi===null)throw Error(i(349));O||(Fc&127)!==0||HN(x,h,g)}return g}function HN(c,h,g){c.flags|=16384,c={getSnapshot:h,value:g},h=cn.updateQueue,h===null?(h=Qx(),cn.updateQueue=h,h.stores=[c]):(g=h.stores,g===null?h.stores=[c]:g.push(c))}function qN(c,h,g,x){h.value=g,h.getSnapshot=x,YN(h)&&WN(c)}function QN(c,h,g){return g(function(){YN(h)&&WN(c)})}function YN(c){var h=c.getSnapshot;c=c.value;try{var g=h();return!Gt(c,g)}catch{return!0}}function WN(c){var h=Ed(c,2);h!==null&&po(h,c,2)}function _C(c){var h=qs();if(typeof c=="function"){var g=c;if(c=g(),Fd){on(!0);try{g()}finally{on(!1)}}}return h.memoizedState=h.baseState=c,h.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$c,lastRenderedState:c},h}function UN(c,h,g,x){return c.baseState=g,jC(c,ui,typeof x=="function"?x:$c)}function QG(c,h,g,x,_){if(Gx(c))throw Error(i(485));if(c=h.action,c!==null){var O={payload:_,action:c,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(B){O.listeners.push(B)}};N.T!==null?g(!0):O.isTransition=!1,x(O),g=h.pending,g===null?(O.next=h.pending=O,VN(h,O)):(O.next=g.next,h.pending=g.next=O)}}function VN(c,h){var g=h.action,x=h.payload,_=c.state;if(h.isTransition){var O=N.T,B={};N.T=B;try{var Z=g(_,x),ae=N.S;ae!==null&&ae(B,Z),GN(c,h,Z)}catch(_e){kC(c,h,_e)}finally{O!==null&&B.types!==null&&(O.types=B.types),N.T=O}}else try{O=g(_,x),GN(c,h,O)}catch(_e){kC(c,h,_e)}}function GN(c,h,g){g!==null&&typeof g=="object"&&typeof g.then=="function"?g.then(function(x){XN(c,h,x)},function(x){return kC(c,h,x)}):XN(c,h,g)}function XN(c,h,g){h.status="fulfilled",h.value=g,KN(h),c.state=g,h=c.pending,h!==null&&(g=h.next,g===h?c.pending=null:(g=g.next,h.next=g,VN(c,g)))}function kC(c,h,g){var x=c.pending;if(c.pending=null,x!==null){x=x.next;do h.status="rejected",h.reason=g,KN(h),h=h.next;while(h!==x)}c.action=null}function KN(c){c=c.listeners;for(var h=0;h<c.length;h++)(0,c[h])()}function ZN(c,h){return h}function JN(c,h){if(Tn){var g=vi.formState;if(g!==null){e:{var x=cn;if(Tn){if(Di){t:{for(var _=Di,O=ma;_.nodeType!==8;){if(!O){_=null;break t}if(_=va(_.nextSibling),_===null){_=null;break t}}O=_.data,_=O==="F!"||O==="F"?_:null}if(_){Di=va(_.nextSibling),x=_.data==="F!";break e}}Uu(x)}x=!1}x&&(h=g[0])}}return g=qs(),g.memoizedState=g.baseState=h,x={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ZN,lastRenderedState:h},g.queue=x,g=yI.bind(null,cn,x),x.dispatch=g,x=_C(!1),O=DC.bind(null,cn,!1,x.queue),x=qs(),_={state:h,dispatch:null,action:c,pending:null},x.queue=_,g=QG.bind(null,cn,_,O,g),_.dispatch=g,x.memoizedState=c,[h,g,!1]}function eI(c){var h=gr();return tI(h,ui,c)}function tI(c,h,g){if(h=jC(c,h,ZN)[0],c=Wx($c)[0],typeof h=="object"&&h!==null&&typeof h.then=="function")try{var x=r0(h)}catch(B){throw B===ap?Bx:B}else x=h;h=gr();var _=h.queue,O=_.dispatch;return g!==h.memoizedState&&(cn.flags|=2048,dp(9,{destroy:void 0},YG.bind(null,_,g),null)),[x,O,c]}function YG(c,h){c.action=h}function nI(c){var h=gr(),g=ui;if(g!==null)return tI(h,g,c);gr(),h=h.memoizedState,g=gr();var x=g.queue.dispatch;return g.memoizedState=c,[h,x,!1]}function dp(c,h,g,x){return c={tag:c,create:g,deps:x,inst:h,next:null},h=cn.updateQueue,h===null&&(h=Qx(),cn.updateQueue=h),g=h.lastEffect,g===null?h.lastEffect=c.next=c:(x=g.next,g.next=c,c.next=x,h.lastEffect=c),c}function iI(){return gr().memoizedState}function Ux(c,h,g,x){var _=qs();cn.flags|=c,_.memoizedState=dp(1|h,{destroy:void 0},g,x===void 0?null:x)}function Vx(c,h,g,x){var _=gr();x=x===void 0?null:x;var O=_.memoizedState.inst;ui!==null&&x!==null&&yC(x,ui.memoizedState.deps)?_.memoizedState=dp(h,O,g,x):(cn.flags|=c,_.memoizedState=dp(1|h,O,g,x))}function rI(c,h){Ux(8390656,8,c,h)}function TC(c,h){Vx(2048,8,c,h)}function WG(c){cn.flags|=4;var h=cn.updateQueue;if(h===null)h=Qx(),cn.updateQueue=h,h.events=[c];else{var g=h.events;g===null?h.events=[c]:g.push(c)}}function sI(c){var h=gr().memoizedState;return WG({ref:h,nextImpl:c}),function(){if((Yn&2)!==0)throw Error(i(440));return h.impl.apply(void 0,arguments)}}function oI(c,h){return Vx(4,2,c,h)}function aI(c,h){return Vx(4,4,c,h)}function lI(c,h){if(typeof h=="function"){c=c();var g=h(c);return function(){typeof g=="function"?g():h(null)}}if(h!=null)return c=c(),h.current=c,function(){h.current=null}}function cI(c,h,g){g=g!=null?g.concat([c]):null,Vx(4,4,lI.bind(null,h,c),g)}function OC(){}function uI(c,h){var g=gr();h=h===void 0?null:h;var x=g.memoizedState;return h!==null&&yC(h,x[1])?x[0]:(g.memoizedState=[c,h],c)}function hI(c,h){var g=gr();h=h===void 0?null:h;var x=g.memoizedState;if(h!==null&&yC(h,x[1]))return x[0];if(x=c(),Fd){on(!0);try{c()}finally{on(!1)}}return g.memoizedState=[x,h],x}function EC(c,h,g){return g===void 0||(Fc&1073741824)!==0&&(jn&261930)===0?c.memoizedState=h:(c.memoizedState=g,c=d3(),cn.lanes|=c,nh|=c,g)}function dI(c,h,g,x){return Gt(g,h)?g:cp.current!==null?(c=EC(c,g,x),Gt(c,h)||(kr=!0),c):(Fc&42)===0||(Fc&1073741824)!==0&&(jn&261930)===0?(kr=!0,c.memoizedState=g):(c=d3(),cn.lanes|=c,nh|=c,h)}function fI(c,h,g,x,_){var O=P.p;P.p=O!==0&&8>O?O:8;var B=N.T,Z={};N.T=Z,DC(c,!1,h,g);try{var ae=_(),_e=N.S;if(_e!==null&&_e(Z,ae),ae!==null&&typeof ae=="object"&&typeof ae.then=="function"){var Ie=zG(ae,x);s0(c,h,Ie,Lo(c))}else s0(c,h,x,Lo(c))}catch(Ue){s0(c,h,{then:function(){},status:"rejected",reason:Ue},Lo())}finally{P.p=O,B!==null&&Z.types!==null&&(B.types=Z.types),N.T=B}}function UG(){}function MC(c,h,g,x){if(c.tag!==5)throw Error(i(476));var _=pI(c).queue;fI(c,_,h,Y,g===null?UG:function(){return mI(c),g(x)})}function pI(c){var h=c.memoizedState;if(h!==null)return h;h={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$c,lastRenderedState:Y},next:null};var g={};return h.next={memoizedState:g,baseState:g,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$c,lastRenderedState:g},next:null},c.memoizedState=h,c=c.alternate,c!==null&&(c.memoizedState=h),h}function mI(c){var h=pI(c);h.next===null&&(h=c.alternate.memoizedState),s0(c,h.next.queue,{},Lo())}function RC(){return hs(w0)}function gI(){return gr().memoizedState}function vI(){return gr().memoizedState}function VG(c){for(var h=c.return;h!==null;){switch(h.tag){case 24:case 3:var g=Lo();c=Xu(g);var x=Ku(h,c,g);x!==null&&(po(x,h,g),e0(x,h,g)),h={cache:aC()},c.payload=h;return}h=h.return}}function GG(c,h,g){var x=Lo();g={lane:x,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Gx(c)?xI(h,g):(g=Xj(c,h,g,x),g!==null&&(po(g,c,x),bI(g,h,x)))}function yI(c,h,g){var x=Lo();s0(c,h,g,x)}function s0(c,h,g,x){var _={lane:x,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null};if(Gx(c))xI(h,_);else{var O=c.alternate;if(c.lanes===0&&(O===null||O.lanes===0)&&(O=h.lastRenderedReducer,O!==null))try{var B=h.lastRenderedState,Z=O(B,g);if(_.hasEagerState=!0,_.eagerState=Z,Gt(Z,B))return Ox(c,h,_,0),vi===null&&Tx(),!1}catch{}finally{}if(g=Xj(c,h,_,x),g!==null)return po(g,c,x),bI(g,h,x),!0}return!1}function DC(c,h,g,x){if(x={lane:2,revertLane:h_(),gesture:null,action:x,hasEagerState:!1,eagerState:null,next:null},Gx(c)){if(h)throw Error(i(479))}else h=Xj(c,g,x,2),h!==null&&po(h,c,2)}function Gx(c){var h=c.alternate;return c===cn||h!==null&&h===cn}function xI(c,h){up=Hx=!0;var g=c.pending;g===null?h.next=h:(h.next=g.next,g.next=h),c.pending=h}function bI(c,h,g){if((g&4194048)!==0){var x=h.lanes;x&=c.pendingLanes,g|=x,h.lanes=g,ht(c,g)}}var o0={readContext:hs,use:Yx,useCallback:rr,useContext:rr,useEffect:rr,useImperativeHandle:rr,useLayoutEffect:rr,useInsertionEffect:rr,useMemo:rr,useReducer:rr,useRef:rr,useState:rr,useDebugValue:rr,useDeferredValue:rr,useTransition:rr,useSyncExternalStore:rr,useId:rr,useHostTransitionStatus:rr,useFormState:rr,useActionState:rr,useOptimistic:rr,useMemoCache:rr,useCacheRefresh:rr};o0.useEffectEvent=rr;var AI={readContext:hs,use:Yx,useCallback:function(c,h){return qs().memoizedState=[c,h===void 0?null:h],c},useContext:hs,useEffect:rI,useImperativeHandle:function(c,h,g){g=g!=null?g.concat([c]):null,Ux(4194308,4,lI.bind(null,h,c),g)},useLayoutEffect:function(c,h){return Ux(4194308,4,c,h)},useInsertionEffect:function(c,h){Ux(4,2,c,h)},useMemo:function(c,h){var g=qs();h=h===void 0?null:h;var x=c();if(Fd){on(!0);try{c()}finally{on(!1)}}return g.memoizedState=[x,h],x},useReducer:function(c,h,g){var x=qs();if(g!==void 0){var _=g(h);if(Fd){on(!0);try{g(h)}finally{on(!1)}}}else _=h;return x.memoizedState=x.baseState=_,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:_},x.queue=c,c=c.dispatch=GG.bind(null,cn,c),[x.memoizedState,c]},useRef:function(c){var h=qs();return c={current:c},h.memoizedState=c},useState:function(c){c=_C(c);var h=c.queue,g=yI.bind(null,cn,h);return h.dispatch=g,[c.memoizedState,g]},useDebugValue:OC,useDeferredValue:function(c,h){var g=qs();return EC(g,c,h)},useTransition:function(){var c=_C(!1);return c=fI.bind(null,cn,c.queue,!0,!1),qs().memoizedState=c,[!1,c]},useSyncExternalStore:function(c,h,g){var x=cn,_=qs();if(Tn){if(g===void 0)throw Error(i(407));g=g()}else{if(g=h(),vi===null)throw Error(i(349));(jn&127)!==0||HN(x,h,g)}_.memoizedState=g;var O={value:g,getSnapshot:h};return _.queue=O,rI(QN.bind(null,x,O,c),[c]),x.flags|=2048,dp(9,{destroy:void 0},qN.bind(null,x,O,g,h),null),g},useId:function(){var c=qs(),h=vi.identifierPrefix;if(Tn){var g=Il,x=Nl;g=(x&~(1<<32-Lt(x)-1)).toString(32)+g,h="_"+h+"R_"+g,g=qx++,0<g&&(h+="H"+g.toString(32)),h+="_"}else g=HG++,h="_"+h+"r_"+g.toString(32)+"_";return c.memoizedState=h},useHostTransitionStatus:RC,useFormState:JN,useActionState:JN,useOptimistic:function(c){var h=qs();h.memoizedState=h.baseState=c;var g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return h.queue=g,h=DC.bind(null,cn,!0,g),g.dispatch=h,[c,h]},useMemoCache:SC,useCacheRefresh:function(){return qs().memoizedState=VG.bind(null,cn)},useEffectEvent:function(c){var h=qs(),g={impl:c};return h.memoizedState=g,function(){if((Yn&2)!==0)throw Error(i(440));return g.impl.apply(void 0,arguments)}}},NC={readContext:hs,use:Yx,useCallback:uI,useContext:hs,useEffect:TC,useImperativeHandle:cI,useInsertionEffect:oI,useLayoutEffect:aI,useMemo:hI,useReducer:Wx,useRef:iI,useState:function(){return Wx($c)},useDebugValue:OC,useDeferredValue:function(c,h){var g=gr();return dI(g,ui.memoizedState,c,h)},useTransition:function(){var c=Wx($c)[0],h=gr().memoizedState;return[typeof c=="boolean"?c:r0(c),h]},useSyncExternalStore:zN,useId:gI,useHostTransitionStatus:RC,useFormState:eI,useActionState:eI,useOptimistic:function(c,h){var g=gr();return UN(g,ui,c,h)},useMemoCache:SC,useCacheRefresh:vI};NC.useEffectEvent=sI;var wI={readContext:hs,use:Yx,useCallback:uI,useContext:hs,useEffect:TC,useImperativeHandle:cI,useInsertionEffect:oI,useLayoutEffect:aI,useMemo:hI,useReducer:CC,useRef:iI,useState:function(){return CC($c)},useDebugValue:OC,useDeferredValue:function(c,h){var g=gr();return ui===null?EC(g,c,h):dI(g,ui.memoizedState,c,h)},useTransition:function(){var c=CC($c)[0],h=gr().memoizedState;return[typeof c=="boolean"?c:r0(c),h]},useSyncExternalStore:zN,useId:gI,useHostTransitionStatus:RC,useFormState:nI,useActionState:nI,useOptimistic:function(c,h){var g=gr();return ui!==null?UN(g,ui,c,h):(g.baseState=c,[c,g.queue.dispatch])},useMemoCache:SC,useCacheRefresh:vI};wI.useEffectEvent=sI;function IC(c,h,g,x){h=c.memoizedState,g=g(x,h),g=g==null?h:p({},h,g),c.memoizedState=g,c.lanes===0&&(c.updateQueue.baseState=g)}var BC={enqueueSetState:function(c,h,g){c=c._reactInternals;var x=Lo(),_=Xu(x);_.payload=h,g!=null&&(_.callback=g),h=Ku(c,_,x),h!==null&&(po(h,c,x),e0(h,c,x))},enqueueReplaceState:function(c,h,g){c=c._reactInternals;var x=Lo(),_=Xu(x);_.tag=1,_.payload=h,g!=null&&(_.callback=g),h=Ku(c,_,x),h!==null&&(po(h,c,x),e0(h,c,x))},enqueueForceUpdate:function(c,h){c=c._reactInternals;var g=Lo(),x=Xu(g);x.tag=2,h!=null&&(x.callback=h),h=Ku(c,x,g),h!==null&&(po(h,c,g),e0(h,c,g))}};function SI(c,h,g,x,_,O,B){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(x,O,B):h.prototype&&h.prototype.isPureReactComponent?!nn(g,x)||!nn(_,O):!0}function jI(c,h,g,x){c=h.state,typeof h.componentWillReceiveProps=="function"&&h.componentWillReceiveProps(g,x),typeof h.UNSAFE_componentWillReceiveProps=="function"&&h.UNSAFE_componentWillReceiveProps(g,x),h.state!==c&&BC.enqueueReplaceState(h,h.state,null)}function $d(c,h){var g=h;if("ref"in h){g={};for(var x in h)x!=="ref"&&(g[x]=h[x])}if(c=c.defaultProps){g===h&&(g=p({},g));for(var _ in c)g[_]===void 0&&(g[_]=c[_])}return g}function CI(c){kx(c)}function _I(c){console.error(c)}function kI(c){kx(c)}function Xx(c,h){try{var g=c.onUncaughtError;g(h.value,{componentStack:h.stack})}catch(x){setTimeout(function(){throw x})}}function TI(c,h,g){try{var x=c.onCaughtError;x(g.value,{componentStack:g.stack,errorBoundary:h.tag===1?h.stateNode:null})}catch(_){setTimeout(function(){throw _})}}function LC(c,h,g){return g=Xu(g),g.tag=3,g.payload={element:null},g.callback=function(){Xx(c,h)},g}function OI(c){return c=Xu(c),c.tag=3,c}function EI(c,h,g,x){var _=g.type.getDerivedStateFromError;if(typeof _=="function"){var O=x.value;c.payload=function(){return _(O)},c.callback=function(){TI(h,g,x)}}var B=g.stateNode;B!==null&&typeof B.componentDidCatch=="function"&&(c.callback=function(){TI(h,g,x),typeof _!="function"&&(ih===null?ih=new Set([this]):ih.add(this));var Z=x.stack;this.componentDidCatch(x.value,{componentStack:Z!==null?Z:""})})}function XG(c,h,g,x,_){if(g.flags|=32768,x!==null&&typeof x=="object"&&typeof x.then=="function"){if(h=g.alternate,h!==null&&rp(h,g,_,!0),g=Do.current,g!==null){switch(g.tag){case 31:case 13:return ga===null?lb():g.alternate===null&&sr===0&&(sr=3),g.flags&=-257,g.flags|=65536,g.lanes=_,x===Lx?g.flags|=16384:(h=g.updateQueue,h===null?g.updateQueue=new Set([x]):h.add(x),l_(c,x,_)),!1;case 22:return g.flags|=65536,x===Lx?g.flags|=16384:(h=g.updateQueue,h===null?(h={transitions:null,markerInstances:null,retryQueue:new Set([x])},g.updateQueue=h):(g=h.retryQueue,g===null?h.retryQueue=new Set([x]):g.add(x)),l_(c,x,_)),!1}throw Error(i(435,g.tag))}return l_(c,x,_),lb(),!1}if(Tn)return h=Do.current,h!==null?((h.flags&65536)===0&&(h.flags|=256),h.flags|=65536,h.lanes=_,x!==nC&&(c=Error(i(422),{cause:x}),Gg(da(c,g)))):(x!==nC&&(h=Error(i(423),{cause:x}),Gg(da(h,g))),c=c.current.alternate,c.flags|=65536,_&=-_,c.lanes|=_,x=da(x,g),_=LC(c.stateNode,x,_),fC(c,_),sr!==4&&(sr=2)),!1;var O=Error(i(520),{cause:x});if(O=da(O,g),p0===null?p0=[O]:p0.push(O),sr!==4&&(sr=2),h===null)return!0;x=da(x,g),g=h;do{switch(g.tag){case 3:return g.flags|=65536,c=_&-_,g.lanes|=c,c=LC(g.stateNode,x,c),fC(g,c),!1;case 1:if(h=g.type,O=g.stateNode,(g.flags&128)===0&&(typeof h.getDerivedStateFromError=="function"||O!==null&&typeof O.componentDidCatch=="function"&&(ih===null||!ih.has(O))))return g.flags|=65536,_&=-_,g.lanes|=_,_=OI(_),EI(_,c,g,x),fC(g,_),!1}g=g.return}while(g!==null);return!1}var PC=Error(i(461)),kr=!1;function ds(c,h,g,x){h.child=c===null?NN(h,null,g,x):Pd(h,c.child,g,x)}function MI(c,h,g,x,_){g=g.render;var O=h.ref;if("ref"in x){var B={};for(var Z in x)Z!=="ref"&&(B[Z]=x[Z])}else B=x;return Nd(h),x=xC(c,h,g,B,O,_),Z=bC(),c!==null&&!kr?(AC(c,h,_),zc(c,h,_)):(Tn&&Z&&eC(h),h.flags|=1,ds(c,h,x,_),h.child)}function RI(c,h,g,x,_){if(c===null){var O=g.type;return typeof O=="function"&&!Kj(O)&&O.defaultProps===void 0&&g.compare===null?(h.tag=15,h.type=O,DI(c,h,O,x,_)):(c=Mx(g.type,null,x,h,h.mode,_),c.ref=h.ref,c.return=h,h.child=c)}if(O=c.child,!WC(c,_)){var B=O.memoizedProps;if(g=g.compare,g=g!==null?g:nn,g(B,x)&&c.ref===h.ref)return zc(c,h,_)}return h.flags|=1,c=Ic(O,x),c.ref=h.ref,c.return=h,h.child=c}function DI(c,h,g,x,_){if(c!==null){var O=c.memoizedProps;if(nn(O,x)&&c.ref===h.ref)if(kr=!1,h.pendingProps=x=O,WC(c,_))(c.flags&131072)!==0&&(kr=!0);else return h.lanes=c.lanes,zc(c,h,_)}return FC(c,h,g,x,_)}function NI(c,h,g,x){var _=x.children,O=c!==null?c.memoizedState:null;if(c===null&&h.stateNode===null&&(h.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),x.mode==="hidden"){if((h.flags&128)!==0){if(O=O!==null?O.baseLanes|g:g,c!==null){for(x=h.child=c.child,_=0;x!==null;)_=_|x.lanes|x.childLanes,x=x.sibling;x=_&~O}else x=0,h.child=null;return II(c,h,O,g,x)}if((g&536870912)!==0)h.memoizedState={baseLanes:0,cachePool:null},c!==null&&Ix(h,O!==null?O.cachePool:null),O!==null?LN(h,O):mC(),PN(h);else return x=h.lanes=536870912,II(c,h,O!==null?O.baseLanes|g:g,g,x)}else O!==null?(Ix(h,O.cachePool),LN(h,O),Ju(),h.memoizedState=null):(c!==null&&Ix(h,null),mC(),Ju());return ds(c,h,_,g),h.child}function a0(c,h){return c!==null&&c.tag===22||h.stateNode!==null||(h.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.sibling}function II(c,h,g,x,_){var O=cC();return O=O===null?null:{parent:Cr._currentValue,pool:O},h.memoizedState={baseLanes:g,cachePool:O},c!==null&&Ix(h,null),mC(),PN(h),c!==null&&rp(c,h,x,!0),h.childLanes=_,null}function Kx(c,h){return h=Jx({mode:h.mode,children:h.children},c.mode),h.ref=c.ref,c.child=h,h.return=c,h}function BI(c,h,g){return Pd(h,c.child,null,g),c=Kx(h,h.pendingProps),c.flags|=2,No(h),h.memoizedState=null,c}function KG(c,h,g){var x=h.pendingProps,_=(h.flags&128)!==0;if(h.flags&=-129,c===null){if(Tn){if(x.mode==="hidden")return c=Kx(h,x),h.lanes=536870912,a0(null,c);if(vC(h),(c=Di)?(c=V3(c,ma),c=c!==null&&c.data==="&"?c:null,c!==null&&(h.memoizedState={dehydrated:c,treeContext:Yu!==null?{id:Nl,overflow:Il}:null,retryLane:536870912,hydrationErrors:null},g=xN(c),g.return=h,h.child=g,us=h,Di=null)):c=null,c===null)throw Uu(h);return h.lanes=536870912,null}return Kx(h,x)}var O=c.memoizedState;if(O!==null){var B=O.dehydrated;if(vC(h),_)if(h.flags&256)h.flags&=-257,h=BI(c,h,g);else if(h.memoizedState!==null)h.child=c.child,h.flags|=128,h=null;else throw Error(i(558));else if(kr||rp(c,h,g,!1),_=(g&c.childLanes)!==0,kr||_){if(x=vi,x!==null&&(B=Et(x,g),B!==0&&B!==O.retryLane))throw O.retryLane=B,Ed(c,B),po(x,c,B),PC;lb(),h=BI(c,h,g)}else c=O.treeContext,Di=va(B.nextSibling),us=h,Tn=!0,Wu=null,ma=!1,c!==null&&wN(h,c),h=Kx(h,x),h.flags|=4096;return h}return c=Ic(c.child,{mode:x.mode,children:x.children}),c.ref=h.ref,h.child=c,c.return=h,c}function Zx(c,h){var g=h.ref;if(g===null)c!==null&&c.ref!==null&&(h.flags|=4194816);else{if(typeof g!="function"&&typeof g!="object")throw Error(i(284));(c===null||c.ref!==g)&&(h.flags|=4194816)}}function FC(c,h,g,x,_){return Nd(h),g=xC(c,h,g,x,void 0,_),x=bC(),c!==null&&!kr?(AC(c,h,_),zc(c,h,_)):(Tn&&x&&eC(h),h.flags|=1,ds(c,h,g,_),h.child)}function LI(c,h,g,x,_,O){return Nd(h),h.updateQueue=null,g=$N(h,x,g,_),FN(c),x=bC(),c!==null&&!kr?(AC(c,h,O),zc(c,h,O)):(Tn&&x&&eC(h),h.flags|=1,ds(c,h,g,O),h.child)}function PI(c,h,g,x,_){if(Nd(h),h.stateNode===null){var O=ep,B=g.contextType;typeof B=="object"&&B!==null&&(O=hs(B)),O=new g(x,O),h.memoizedState=O.state!==null&&O.state!==void 0?O.state:null,O.updater=BC,h.stateNode=O,O._reactInternals=h,O=h.stateNode,O.props=x,O.state=h.memoizedState,O.refs={},hC(h),B=g.contextType,O.context=typeof B=="object"&&B!==null?hs(B):ep,O.state=h.memoizedState,B=g.getDerivedStateFromProps,typeof B=="function"&&(IC(h,g,B,x),O.state=h.memoizedState),typeof g.getDerivedStateFromProps=="function"||typeof O.getSnapshotBeforeUpdate=="function"||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(B=O.state,typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount(),B!==O.state&&BC.enqueueReplaceState(O,O.state,null),n0(h,x,O,_),t0(),O.state=h.memoizedState),typeof O.componentDidMount=="function"&&(h.flags|=4194308),x=!0}else if(c===null){O=h.stateNode;var Z=h.memoizedProps,ae=$d(g,Z);O.props=ae;var _e=O.context,Ie=g.contextType;B=ep,typeof Ie=="object"&&Ie!==null&&(B=hs(Ie));var Ue=g.getDerivedStateFromProps;Ie=typeof Ue=="function"||typeof O.getSnapshotBeforeUpdate=="function",Z=h.pendingProps!==Z,Ie||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(Z||_e!==B)&&jI(h,O,x,B),Gu=!1;var ke=h.memoizedState;O.state=ke,n0(h,x,O,_),t0(),_e=h.memoizedState,Z||ke!==_e||Gu?(typeof Ue=="function"&&(IC(h,g,Ue,x),_e=h.memoizedState),(ae=Gu||SI(h,g,ae,x,ke,_e,B))?(Ie||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount()),typeof O.componentDidMount=="function"&&(h.flags|=4194308)):(typeof O.componentDidMount=="function"&&(h.flags|=4194308),h.memoizedProps=x,h.memoizedState=_e),O.props=x,O.state=_e,O.context=B,x=ae):(typeof O.componentDidMount=="function"&&(h.flags|=4194308),x=!1)}else{O=h.stateNode,dC(c,h),B=h.memoizedProps,Ie=$d(g,B),O.props=Ie,Ue=h.pendingProps,ke=O.context,_e=g.contextType,ae=ep,typeof _e=="object"&&_e!==null&&(ae=hs(_e)),Z=g.getDerivedStateFromProps,(_e=typeof Z=="function"||typeof O.getSnapshotBeforeUpdate=="function")||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(B!==Ue||ke!==ae)&&jI(h,O,x,ae),Gu=!1,ke=h.memoizedState,O.state=ke,n0(h,x,O,_),t0();var Me=h.memoizedState;B!==Ue||ke!==Me||Gu||c!==null&&c.dependencies!==null&&Dx(c.dependencies)?(typeof Z=="function"&&(IC(h,g,Z,x),Me=h.memoizedState),(Ie=Gu||SI(h,g,Ie,x,ke,Me,ae)||c!==null&&c.dependencies!==null&&Dx(c.dependencies))?(_e||typeof O.UNSAFE_componentWillUpdate!="function"&&typeof O.componentWillUpdate!="function"||(typeof O.componentWillUpdate=="function"&&O.componentWillUpdate(x,Me,ae),typeof O.UNSAFE_componentWillUpdate=="function"&&O.UNSAFE_componentWillUpdate(x,Me,ae)),typeof O.componentDidUpdate=="function"&&(h.flags|=4),typeof O.getSnapshotBeforeUpdate=="function"&&(h.flags|=1024)):(typeof O.componentDidUpdate!="function"||B===c.memoizedProps&&ke===c.memoizedState||(h.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||B===c.memoizedProps&&ke===c.memoizedState||(h.flags|=1024),h.memoizedProps=x,h.memoizedState=Me),O.props=x,O.state=Me,O.context=ae,x=Ie):(typeof O.componentDidUpdate!="function"||B===c.memoizedProps&&ke===c.memoizedState||(h.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||B===c.memoizedProps&&ke===c.memoizedState||(h.flags|=1024),x=!1)}return O=x,Zx(c,h),x=(h.flags&128)!==0,O||x?(O=h.stateNode,g=x&&typeof g.getDerivedStateFromError!="function"?null:O.render(),h.flags|=1,c!==null&&x?(h.child=Pd(h,c.child,null,_),h.child=Pd(h,null,g,_)):ds(c,h,g,_),h.memoizedState=O.state,c=h.child):c=zc(c,h,_),c}function FI(c,h,g,x){return Rd(),h.flags|=256,ds(c,h,g,x),h.child}var $C={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function zC(c){return{baseLanes:c,cachePool:TN()}}function HC(c,h,g){return c=c!==null?c.childLanes&~g:0,h&&(c|=Bo),c}function $I(c,h,g){var x=h.pendingProps,_=!1,O=(h.flags&128)!==0,B;if((B=O)||(B=c!==null&&c.memoizedState===null?!1:(mr.current&2)!==0),B&&(_=!0,h.flags&=-129),B=(h.flags&32)!==0,h.flags&=-33,c===null){if(Tn){if(_?Zu(h):Ju(),(c=Di)?(c=V3(c,ma),c=c!==null&&c.data!=="&"?c:null,c!==null&&(h.memoizedState={dehydrated:c,treeContext:Yu!==null?{id:Nl,overflow:Il}:null,retryLane:536870912,hydrationErrors:null},g=xN(c),g.return=h,h.child=g,us=h,Di=null)):c=null,c===null)throw Uu(h);return j_(c)?h.lanes=32:h.lanes=536870912,null}var Z=x.children;return x=x.fallback,_?(Ju(),_=h.mode,Z=Jx({mode:"hidden",children:Z},_),x=Md(x,_,g,null),Z.return=h,x.return=h,Z.sibling=x,h.child=Z,x=h.child,x.memoizedState=zC(g),x.childLanes=HC(c,B,g),h.memoizedState=$C,a0(null,x)):(Zu(h),qC(h,Z))}var ae=c.memoizedState;if(ae!==null&&(Z=ae.dehydrated,Z!==null)){if(O)h.flags&256?(Zu(h),h.flags&=-257,h=QC(c,h,g)):h.memoizedState!==null?(Ju(),h.child=c.child,h.flags|=128,h=null):(Ju(),Z=x.fallback,_=h.mode,x=Jx({mode:"visible",children:x.children},_),Z=Md(Z,_,g,null),Z.flags|=2,x.return=h,Z.return=h,x.sibling=Z,h.child=x,Pd(h,c.child,null,g),x=h.child,x.memoizedState=zC(g),x.childLanes=HC(c,B,g),h.memoizedState=$C,h=a0(null,x));else if(Zu(h),j_(Z)){if(B=Z.nextSibling&&Z.nextSibling.dataset,B)var _e=B.dgst;B=_e,x=Error(i(419)),x.stack="",x.digest=B,Gg({value:x,source:null,stack:null}),h=QC(c,h,g)}else if(kr||rp(c,h,g,!1),B=(g&c.childLanes)!==0,kr||B){if(B=vi,B!==null&&(x=Et(B,g),x!==0&&x!==ae.retryLane))throw ae.retryLane=x,Ed(c,x),po(B,c,x),PC;S_(Z)||lb(),h=QC(c,h,g)}else S_(Z)?(h.flags|=192,h.child=c.child,h=null):(c=ae.treeContext,Di=va(Z.nextSibling),us=h,Tn=!0,Wu=null,ma=!1,c!==null&&wN(h,c),h=qC(h,x.children),h.flags|=4096);return h}return _?(Ju(),Z=x.fallback,_=h.mode,ae=c.child,_e=ae.sibling,x=Ic(ae,{mode:"hidden",children:x.children}),x.subtreeFlags=ae.subtreeFlags&65011712,_e!==null?Z=Ic(_e,Z):(Z=Md(Z,_,g,null),Z.flags|=2),Z.return=h,x.return=h,x.sibling=Z,h.child=x,a0(null,x),x=h.child,Z=c.child.memoizedState,Z===null?Z=zC(g):(_=Z.cachePool,_!==null?(ae=Cr._currentValue,_=_.parent!==ae?{parent:ae,pool:ae}:_):_=TN(),Z={baseLanes:Z.baseLanes|g,cachePool:_}),x.memoizedState=Z,x.childLanes=HC(c,B,g),h.memoizedState=$C,a0(c.child,x)):(Zu(h),g=c.child,c=g.sibling,g=Ic(g,{mode:"visible",children:x.children}),g.return=h,g.sibling=null,c!==null&&(B=h.deletions,B===null?(h.deletions=[c],h.flags|=16):B.push(c)),h.child=g,h.memoizedState=null,g)}function qC(c,h){return h=Jx({mode:"visible",children:h},c.mode),h.return=c,c.child=h}function Jx(c,h){return c=Ro(22,c,null,h),c.lanes=0,c}function QC(c,h,g){return Pd(h,c.child,null,g),c=qC(h,h.pendingProps.children),c.flags|=2,h.memoizedState=null,c}function zI(c,h,g){c.lanes|=h;var x=c.alternate;x!==null&&(x.lanes|=h),sC(c.return,h,g)}function YC(c,h,g,x,_,O){var B=c.memoizedState;B===null?c.memoizedState={isBackwards:h,rendering:null,renderingStartTime:0,last:x,tail:g,tailMode:_,treeForkCount:O}:(B.isBackwards=h,B.rendering=null,B.renderingStartTime=0,B.last=x,B.tail=g,B.tailMode=_,B.treeForkCount=O)}function HI(c,h,g){var x=h.pendingProps,_=x.revealOrder,O=x.tail;x=x.children;var B=mr.current,Z=(B&2)!==0;if(Z?(B=B&1|2,h.flags|=128):B&=1,V(mr,B),ds(c,h,x,g),x=Tn?Vg:0,!Z&&c!==null&&(c.flags&128)!==0)e:for(c=h.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&zI(c,g,h);else if(c.tag===19)zI(c,g,h);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===h)break e;for(;c.sibling===null;){if(c.return===null||c.return===h)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}switch(_){case"forwards":for(g=h.child,_=null;g!==null;)c=g.alternate,c!==null&&zx(c)===null&&(_=g),g=g.sibling;g=_,g===null?(_=h.child,h.child=null):(_=g.sibling,g.sibling=null),YC(h,!1,_,g,O,x);break;case"backwards":case"unstable_legacy-backwards":for(g=null,_=h.child,h.child=null;_!==null;){if(c=_.alternate,c!==null&&zx(c)===null){h.child=_;break}c=_.sibling,_.sibling=g,g=_,_=c}YC(h,!0,g,null,O,x);break;case"together":YC(h,!1,null,null,void 0,x);break;default:h.memoizedState=null}return h.child}function zc(c,h,g){if(c!==null&&(h.dependencies=c.dependencies),nh|=h.lanes,(g&h.childLanes)===0)if(c!==null){if(rp(c,h,g,!1),(g&h.childLanes)===0)return null}else return null;if(c!==null&&h.child!==c.child)throw Error(i(153));if(h.child!==null){for(c=h.child,g=Ic(c,c.pendingProps),h.child=g,g.return=h;c.sibling!==null;)c=c.sibling,g=g.sibling=Ic(c,c.pendingProps),g.return=h;g.sibling=null}return h.child}function WC(c,h){return(c.lanes&h)!==0?!0:(c=c.dependencies,!!(c!==null&&Dx(c)))}function ZG(c,h,g){switch(h.tag){case 3:Oe(h,h.stateNode.containerInfo),Vu(h,Cr,c.memoizedState.cache),Rd();break;case 27:case 5:Re(h);break;case 4:Oe(h,h.stateNode.containerInfo);break;case 10:Vu(h,h.type,h.memoizedProps.value);break;case 31:if(h.memoizedState!==null)return h.flags|=128,vC(h),null;break;case 13:var x=h.memoizedState;if(x!==null)return x.dehydrated!==null?(Zu(h),h.flags|=128,null):(g&h.child.childLanes)!==0?$I(c,h,g):(Zu(h),c=zc(c,h,g),c!==null?c.sibling:null);Zu(h);break;case 19:var _=(c.flags&128)!==0;if(x=(g&h.childLanes)!==0,x||(rp(c,h,g,!1),x=(g&h.childLanes)!==0),_){if(x)return HI(c,h,g);h.flags|=128}if(_=h.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),V(mr,mr.current),x)break;return null;case 22:return h.lanes=0,NI(c,h,g,h.pendingProps);case 24:Vu(h,Cr,c.memoizedState.cache)}return zc(c,h,g)}function qI(c,h,g){if(c!==null)if(c.memoizedProps!==h.pendingProps)kr=!0;else{if(!WC(c,g)&&(h.flags&128)===0)return kr=!1,ZG(c,h,g);kr=(c.flags&131072)!==0}else kr=!1,Tn&&(h.flags&1048576)!==0&&AN(h,Vg,h.index);switch(h.lanes=0,h.tag){case 16:e:{var x=h.pendingProps;if(c=Bd(h.elementType),h.type=c,typeof c=="function")Kj(c)?(x=$d(c,x),h.tag=1,h=PI(null,h,c,x,g)):(h.tag=0,h=FC(null,h,c,x,g));else{if(c!=null){var _=c.$$typeof;if(_===C){h.tag=11,h=MI(null,h,c,x,g);break e}else if(_===M){h.tag=14,h=RI(null,h,c,x,g);break e}}throw h=L(c)||c,Error(i(306,h,""))}}return h;case 0:return FC(c,h,h.type,h.pendingProps,g);case 1:return x=h.type,_=$d(x,h.pendingProps),PI(c,h,x,_,g);case 3:e:{if(Oe(h,h.stateNode.containerInfo),c===null)throw Error(i(387));x=h.pendingProps;var O=h.memoizedState;_=O.element,dC(c,h),n0(h,x,null,g);var B=h.memoizedState;if(x=B.cache,Vu(h,Cr,x),x!==O.cache&&oC(h,[Cr],g,!0),t0(),x=B.element,O.isDehydrated)if(O={element:x,isDehydrated:!1,cache:B.cache},h.updateQueue.baseState=O,h.memoizedState=O,h.flags&256){h=FI(c,h,x,g);break e}else if(x!==_){_=da(Error(i(424)),h),Gg(_),h=FI(c,h,x,g);break e}else{switch(c=h.stateNode.containerInfo,c.nodeType){case 9:c=c.body;break;default:c=c.nodeName==="HTML"?c.ownerDocument.body:c}for(Di=va(c.firstChild),us=h,Tn=!0,Wu=null,ma=!0,g=NN(h,null,x,g),h.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling}else{if(Rd(),x===_){h=zc(c,h,g);break e}ds(c,h,x,g)}h=h.child}return h;case 26:return Zx(c,h),c===null?(g=eB(h.type,null,h.pendingProps,null))?h.memoizedState=g:Tn||(g=h.type,c=h.pendingProps,x=mb(ce.current).createElement(g),x[li]=h,x[Qr]=c,fs(x,g,c),Wi(x),h.stateNode=x):h.memoizedState=eB(h.type,c.memoizedProps,h.pendingProps,c.memoizedState),null;case 27:return Re(h),c===null&&Tn&&(x=h.stateNode=K3(h.type,h.pendingProps,ce.current),us=h,ma=!0,_=Di,ah(h.type)?(C_=_,Di=va(x.firstChild)):Di=_),ds(c,h,h.pendingProps.children,g),Zx(c,h),c===null&&(h.flags|=4194304),h.child;case 5:return c===null&&Tn&&((_=x=Di)&&(x=TX(x,h.type,h.pendingProps,ma),x!==null?(h.stateNode=x,us=h,Di=va(x.firstChild),ma=!1,_=!0):_=!1),_||Uu(h)),Re(h),_=h.type,O=h.pendingProps,B=c!==null?c.memoizedProps:null,x=O.children,b_(_,O)?x=null:B!==null&&b_(_,B)&&(h.flags|=32),h.memoizedState!==null&&(_=xC(c,h,qG,null,null,g),w0._currentValue=_),Zx(c,h),ds(c,h,x,g),h.child;case 6:return c===null&&Tn&&((c=g=Di)&&(g=OX(g,h.pendingProps,ma),g!==null?(h.stateNode=g,us=h,Di=null,c=!0):c=!1),c||Uu(h)),null;case 13:return $I(c,h,g);case 4:return Oe(h,h.stateNode.containerInfo),x=h.pendingProps,c===null?h.child=Pd(h,null,x,g):ds(c,h,x,g),h.child;case 11:return MI(c,h,h.type,h.pendingProps,g);case 7:return ds(c,h,h.pendingProps,g),h.child;case 8:return ds(c,h,h.pendingProps.children,g),h.child;case 12:return ds(c,h,h.pendingProps.children,g),h.child;case 10:return x=h.pendingProps,Vu(h,h.type,x.value),ds(c,h,x.children,g),h.child;case 9:return _=h.type._context,x=h.pendingProps.children,Nd(h),_=hs(_),x=x(_),h.flags|=1,ds(c,h,x,g),h.child;case 14:return RI(c,h,h.type,h.pendingProps,g);case 15:return DI(c,h,h.type,h.pendingProps,g);case 19:return HI(c,h,g);case 31:return KG(c,h,g);case 22:return NI(c,h,g,h.pendingProps);case 24:return Nd(h),x=hs(Cr),c===null?(_=cC(),_===null&&(_=vi,O=aC(),_.pooledCache=O,O.refCount++,O!==null&&(_.pooledCacheLanes|=g),_=O),h.memoizedState={parent:x,cache:_},hC(h),Vu(h,Cr,_)):((c.lanes&g)!==0&&(dC(c,h),n0(h,null,null,g),t0()),_=c.memoizedState,O=h.memoizedState,_.parent!==x?(_={parent:x,cache:x},h.memoizedState=_,h.lanes===0&&(h.memoizedState=h.updateQueue.baseState=_),Vu(h,Cr,x)):(x=O.cache,Vu(h,Cr,x),x!==_.cache&&oC(h,[Cr],g,!0))),ds(c,h,h.pendingProps.children,g),h.child;case 29:throw h.pendingProps}throw Error(i(156,h.tag))}function Hc(c){c.flags|=4}function UC(c,h,g,x,_){if((h=(c.mode&32)!==0)&&(h=!1),h){if(c.flags|=16777216,(_&335544128)===_)if(c.stateNode.complete)c.flags|=8192;else if(g3())c.flags|=8192;else throw Ld=Lx,uC}else c.flags&=-16777217}function QI(c,h){if(h.type!=="stylesheet"||(h.state.loading&4)!==0)c.flags&=-16777217;else if(c.flags|=16777216,!sB(h))if(g3())c.flags|=8192;else throw Ld=Lx,uC}function eb(c,h){h!==null&&(c.flags|=4),c.flags&16384&&(h=c.tag!==22?Ne():536870912,c.lanes|=h,gp|=h)}function l0(c,h){if(!Tn)switch(c.tailMode){case"hidden":h=c.tail;for(var g=null;h!==null;)h.alternate!==null&&(g=h),h=h.sibling;g===null?c.tail=null:g.sibling=null;break;case"collapsed":g=c.tail;for(var x=null;g!==null;)g.alternate!==null&&(x=g),g=g.sibling;x===null?h||c.tail===null?c.tail=null:c.tail.sibling=null:x.sibling=null}}function Ni(c){var h=c.alternate!==null&&c.alternate.child===c.child,g=0,x=0;if(h)for(var _=c.child;_!==null;)g|=_.lanes|_.childLanes,x|=_.subtreeFlags&65011712,x|=_.flags&65011712,_.return=c,_=_.sibling;else for(_=c.child;_!==null;)g|=_.lanes|_.childLanes,x|=_.subtreeFlags,x|=_.flags,_.return=c,_=_.sibling;return c.subtreeFlags|=x,c.childLanes=g,h}function JG(c,h,g){var x=h.pendingProps;switch(tC(h),h.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ni(h),null;case 1:return Ni(h),null;case 3:return g=h.stateNode,x=null,c!==null&&(x=c.memoizedState.cache),h.memoizedState.cache!==x&&(h.flags|=2048),Pc(Cr),Te(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(c===null||c.child===null)&&(ip(h)?Hc(h):c===null||c.memoizedState.isDehydrated&&(h.flags&256)===0||(h.flags|=1024,iC())),Ni(h),null;case 26:var _=h.type,O=h.memoizedState;return c===null?(Hc(h),O!==null?(Ni(h),QI(h,O)):(Ni(h),UC(h,_,null,x,g))):O?O!==c.memoizedState?(Hc(h),Ni(h),QI(h,O)):(Ni(h),h.flags&=-16777217):(c=c.memoizedProps,c!==x&&Hc(h),Ni(h),UC(h,_,c,x,g)),null;case 27:if(qe(h),g=ce.current,_=h.type,c!==null&&h.stateNode!=null)c.memoizedProps!==x&&Hc(h);else{if(!x){if(h.stateNode===null)throw Error(i(166));return Ni(h),null}c=J.current,ip(h)?SN(h):(c=K3(_,x,g),h.stateNode=c,Hc(h))}return Ni(h),null;case 5:if(qe(h),_=h.type,c!==null&&h.stateNode!=null)c.memoizedProps!==x&&Hc(h);else{if(!x){if(h.stateNode===null)throw Error(i(166));return Ni(h),null}if(O=J.current,ip(h))SN(h);else{var B=mb(ce.current);switch(O){case 1:O=B.createElementNS("http://www.w3.org/2000/svg",_);break;case 2:O=B.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;default:switch(_){case"svg":O=B.createElementNS("http://www.w3.org/2000/svg",_);break;case"math":O=B.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;case"script":O=B.createElement("div"),O.innerHTML="<script><\/script>",O=O.removeChild(O.firstChild);break;case"select":O=typeof x.is=="string"?B.createElement("select",{is:x.is}):B.createElement("select"),x.multiple?O.multiple=!0:x.size&&(O.size=x.size);break;default:O=typeof x.is=="string"?B.createElement(_,{is:x.is}):B.createElement(_)}}O[li]=h,O[Qr]=x;e:for(B=h.child;B!==null;){if(B.tag===5||B.tag===6)O.appendChild(B.stateNode);else if(B.tag!==4&&B.tag!==27&&B.child!==null){B.child.return=B,B=B.child;continue}if(B===h)break e;for(;B.sibling===null;){if(B.return===null||B.return===h)break e;B=B.return}B.sibling.return=B.return,B=B.sibling}h.stateNode=O;e:switch(fs(O,_,x),_){case"button":case"input":case"select":case"textarea":x=!!x.autoFocus;break e;case"img":x=!0;break e;default:x=!1}x&&Hc(h)}}return Ni(h),UC(h,h.type,c===null?null:c.memoizedProps,h.pendingProps,g),null;case 6:if(c&&h.stateNode!=null)c.memoizedProps!==x&&Hc(h);else{if(typeof x!="string"&&h.stateNode===null)throw Error(i(166));if(c=ce.current,ip(h)){if(c=h.stateNode,g=h.memoizedProps,x=null,_=us,_!==null)switch(_.tag){case 27:case 5:x=_.memoizedProps}c[li]=h,c=!!(c.nodeValue===g||x!==null&&x.suppressHydrationWarning===!0||$3(c.nodeValue,g)),c||Uu(h,!0)}else c=mb(c).createTextNode(x),c[li]=h,h.stateNode=c}return Ni(h),null;case 31:if(g=h.memoizedState,c===null||c.memoizedState!==null){if(x=ip(h),g!==null){if(c===null){if(!x)throw Error(i(318));if(c=h.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(557));c[li]=h}else Rd(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;Ni(h),c=!1}else g=iC(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=g),c=!0;if(!c)return h.flags&256?(No(h),h):(No(h),null);if((h.flags&128)!==0)throw Error(i(558))}return Ni(h),null;case 13:if(x=h.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(_=ip(h),x!==null&&x.dehydrated!==null){if(c===null){if(!_)throw Error(i(318));if(_=h.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(i(317));_[li]=h}else Rd(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;Ni(h),_=!1}else _=iC(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=_),_=!0;if(!_)return h.flags&256?(No(h),h):(No(h),null)}return No(h),(h.flags&128)!==0?(h.lanes=g,h):(g=x!==null,c=c!==null&&c.memoizedState!==null,g&&(x=h.child,_=null,x.alternate!==null&&x.alternate.memoizedState!==null&&x.alternate.memoizedState.cachePool!==null&&(_=x.alternate.memoizedState.cachePool.pool),O=null,x.memoizedState!==null&&x.memoizedState.cachePool!==null&&(O=x.memoizedState.cachePool.pool),O!==_&&(x.flags|=2048)),g!==c&&g&&(h.child.flags|=8192),eb(h,h.updateQueue),Ni(h),null);case 4:return Te(),c===null&&m_(h.stateNode.containerInfo),Ni(h),null;case 10:return Pc(h.type),Ni(h),null;case 19:if(U(mr),x=h.memoizedState,x===null)return Ni(h),null;if(_=(h.flags&128)!==0,O=x.rendering,O===null)if(_)l0(x,!1);else{if(sr!==0||c!==null&&(c.flags&128)!==0)for(c=h.child;c!==null;){if(O=zx(c),O!==null){for(h.flags|=128,l0(x,!1),c=O.updateQueue,h.updateQueue=c,eb(h,c),h.subtreeFlags=0,c=g,g=h.child;g!==null;)yN(g,c),g=g.sibling;return V(mr,mr.current&1|2),Tn&&Bc(h,x.treeForkCount),h.child}c=c.sibling}x.tail!==null&&Ee()>sb&&(h.flags|=128,_=!0,l0(x,!1),h.lanes=4194304)}else{if(!_)if(c=zx(O),c!==null){if(h.flags|=128,_=!0,c=c.updateQueue,h.updateQueue=c,eb(h,c),l0(x,!0),x.tail===null&&x.tailMode==="hidden"&&!O.alternate&&!Tn)return Ni(h),null}else 2*Ee()-x.renderingStartTime>sb&&g!==536870912&&(h.flags|=128,_=!0,l0(x,!1),h.lanes=4194304);x.isBackwards?(O.sibling=h.child,h.child=O):(c=x.last,c!==null?c.sibling=O:h.child=O,x.last=O)}return x.tail!==null?(c=x.tail,x.rendering=c,x.tail=c.sibling,x.renderingStartTime=Ee(),c.sibling=null,g=mr.current,V(mr,_?g&1|2:g&1),Tn&&Bc(h,x.treeForkCount),c):(Ni(h),null);case 22:case 23:return No(h),gC(),x=h.memoizedState!==null,c!==null?c.memoizedState!==null!==x&&(h.flags|=8192):x&&(h.flags|=8192),x?(g&536870912)!==0&&(h.flags&128)===0&&(Ni(h),h.subtreeFlags&6&&(h.flags|=8192)):Ni(h),g=h.updateQueue,g!==null&&eb(h,g.retryQueue),g=null,c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),x=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(x=h.memoizedState.cachePool.pool),x!==g&&(h.flags|=2048),c!==null&&U(Id),null;case 24:return g=null,c!==null&&(g=c.memoizedState.cache),h.memoizedState.cache!==g&&(h.flags|=2048),Pc(Cr),Ni(h),null;case 25:return null;case 30:return null}throw Error(i(156,h.tag))}function eX(c,h){switch(tC(h),h.tag){case 1:return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 3:return Pc(Cr),Te(),c=h.flags,(c&65536)!==0&&(c&128)===0?(h.flags=c&-65537|128,h):null;case 26:case 27:case 5:return qe(h),null;case 31:if(h.memoizedState!==null){if(No(h),h.alternate===null)throw Error(i(340));Rd()}return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 13:if(No(h),c=h.memoizedState,c!==null&&c.dehydrated!==null){if(h.alternate===null)throw Error(i(340));Rd()}return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 19:return U(mr),null;case 4:return Te(),null;case 10:return Pc(h.type),null;case 22:case 23:return No(h),gC(),c!==null&&U(Id),c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 24:return Pc(Cr),null;case 25:return null;default:return null}}function YI(c,h){switch(tC(h),h.tag){case 3:Pc(Cr),Te();break;case 26:case 27:case 5:qe(h);break;case 4:Te();break;case 31:h.memoizedState!==null&&No(h);break;case 13:No(h);break;case 19:U(mr);break;case 10:Pc(h.type);break;case 22:case 23:No(h),gC(),c!==null&&U(Id);break;case 24:Pc(Cr)}}function c0(c,h){try{var g=h.updateQueue,x=g!==null?g.lastEffect:null;if(x!==null){var _=x.next;g=_;do{if((g.tag&c)===c){x=void 0;var O=g.create,B=g.inst;x=O(),B.destroy=x}g=g.next}while(g!==_)}}catch(Z){si(h,h.return,Z)}}function eh(c,h,g){try{var x=h.updateQueue,_=x!==null?x.lastEffect:null;if(_!==null){var O=_.next;x=O;do{if((x.tag&c)===c){var B=x.inst,Z=B.destroy;if(Z!==void 0){B.destroy=void 0,_=h;var ae=g,_e=Z;try{_e()}catch(Ie){si(_,ae,Ie)}}}x=x.next}while(x!==O)}}catch(Ie){si(h,h.return,Ie)}}function WI(c){var h=c.updateQueue;if(h!==null){var g=c.stateNode;try{BN(h,g)}catch(x){si(c,c.return,x)}}}function UI(c,h,g){g.props=$d(c.type,c.memoizedProps),g.state=c.memoizedState;try{g.componentWillUnmount()}catch(x){si(c,h,x)}}function u0(c,h){try{var g=c.ref;if(g!==null){switch(c.tag){case 26:case 27:case 5:var x=c.stateNode;break;case 30:x=c.stateNode;break;default:x=c.stateNode}typeof g=="function"?c.refCleanup=g(x):g.current=x}}catch(_){si(c,h,_)}}function Bl(c,h){var g=c.ref,x=c.refCleanup;if(g!==null)if(typeof x=="function")try{x()}catch(_){si(c,h,_)}finally{c.refCleanup=null,c=c.alternate,c!=null&&(c.refCleanup=null)}else if(typeof g=="function")try{g(null)}catch(_){si(c,h,_)}else g.current=null}function VI(c){var h=c.type,g=c.memoizedProps,x=c.stateNode;try{e:switch(h){case"button":case"input":case"select":case"textarea":g.autoFocus&&x.focus();break e;case"img":g.src?x.src=g.src:g.srcSet&&(x.srcset=g.srcSet)}}catch(_){si(c,c.return,_)}}function VC(c,h,g){try{var x=c.stateNode;wX(x,c.type,g,h),x[Qr]=h}catch(_){si(c,c.return,_)}}function GI(c){return c.tag===5||c.tag===3||c.tag===26||c.tag===27&&ah(c.type)||c.tag===4}function GC(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||GI(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.tag===27&&ah(c.type)||c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function XC(c,h,g){var x=c.tag;if(x===5||x===6)c=c.stateNode,h?(g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g).insertBefore(c,h):(h=g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g,h.appendChild(c),g=g._reactRootContainer,g!=null||h.onclick!==null||(h.onclick=at));else if(x!==4&&(x===27&&ah(c.type)&&(g=c.stateNode,h=null),c=c.child,c!==null))for(XC(c,h,g),c=c.sibling;c!==null;)XC(c,h,g),c=c.sibling}function tb(c,h,g){var x=c.tag;if(x===5||x===6)c=c.stateNode,h?g.insertBefore(c,h):g.appendChild(c);else if(x!==4&&(x===27&&ah(c.type)&&(g=c.stateNode),c=c.child,c!==null))for(tb(c,h,g),c=c.sibling;c!==null;)tb(c,h,g),c=c.sibling}function XI(c){var h=c.stateNode,g=c.memoizedProps;try{for(var x=c.type,_=h.attributes;_.length;)h.removeAttributeNode(_[0]);fs(h,x,g),h[li]=c,h[Qr]=g}catch(O){si(c,c.return,O)}}var qc=!1,Tr=!1,KC=!1,KI=typeof WeakSet=="function"?WeakSet:Set,Vr=null;function tX(c,h){if(c=c.containerInfo,y_=wb,c=Ri(c),ir(c)){if("selectionStart"in c)var g={start:c.selectionStart,end:c.selectionEnd};else e:{g=(g=c.ownerDocument)&&g.defaultView||window;var x=g.getSelection&&g.getSelection();if(x&&x.rangeCount!==0){g=x.anchorNode;var _=x.anchorOffset,O=x.focusNode;x=x.focusOffset;try{g.nodeType,O.nodeType}catch{g=null;break e}var B=0,Z=-1,ae=-1,_e=0,Ie=0,Ue=c,ke=null;t:for(;;){for(var Me;Ue!==g||_!==0&&Ue.nodeType!==3||(Z=B+_),Ue!==O||x!==0&&Ue.nodeType!==3||(ae=B+x),Ue.nodeType===3&&(B+=Ue.nodeValue.length),(Me=Ue.firstChild)!==null;)ke=Ue,Ue=Me;for(;;){if(Ue===c)break t;if(ke===g&&++_e===_&&(Z=B),ke===O&&++Ie===x&&(ae=B),(Me=Ue.nextSibling)!==null)break;Ue=ke,ke=Ue.parentNode}Ue=Me}g=Z===-1||ae===-1?null:{start:Z,end:ae}}else g=null}g=g||{start:0,end:0}}else g=null;for(x_={focusedElem:c,selectionRange:g},wb=!1,Vr=h;Vr!==null;)if(h=Vr,c=h.child,(h.subtreeFlags&1028)!==0&&c!==null)c.return=h,Vr=c;else for(;Vr!==null;){switch(h=Vr,O=h.alternate,c=h.flags,h.tag){case 0:if((c&4)!==0&&(c=h.updateQueue,c=c!==null?c.events:null,c!==null))for(g=0;g<c.length;g++)_=c[g],_.ref.impl=_.nextImpl;break;case 11:case 15:break;case 1:if((c&1024)!==0&&O!==null){c=void 0,g=h,_=O.memoizedProps,O=O.memoizedState,x=g.stateNode;try{var _t=$d(g.type,_);c=x.getSnapshotBeforeUpdate(_t,O),x.__reactInternalSnapshotBeforeUpdate=c}catch(Yt){si(g,g.return,Yt)}}break;case 3:if((c&1024)!==0){if(c=h.stateNode.containerInfo,g=c.nodeType,g===9)w_(c);else if(g===1)switch(c.nodeName){case"HEAD":case"HTML":case"BODY":w_(c);break;default:c.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((c&1024)!==0)throw Error(i(163))}if(c=h.sibling,c!==null){c.return=h.return,Vr=c;break}Vr=h.return}}function ZI(c,h,g){var x=g.flags;switch(g.tag){case 0:case 11:case 15:Yc(c,g),x&4&&c0(5,g);break;case 1:if(Yc(c,g),x&4)if(c=g.stateNode,h===null)try{c.componentDidMount()}catch(B){si(g,g.return,B)}else{var _=$d(g.type,h.memoizedProps);h=h.memoizedState;try{c.componentDidUpdate(_,h,c.__reactInternalSnapshotBeforeUpdate)}catch(B){si(g,g.return,B)}}x&64&&WI(g),x&512&&u0(g,g.return);break;case 3:if(Yc(c,g),x&64&&(c=g.updateQueue,c!==null)){if(h=null,g.child!==null)switch(g.child.tag){case 27:case 5:h=g.child.stateNode;break;case 1:h=g.child.stateNode}try{BN(c,h)}catch(B){si(g,g.return,B)}}break;case 27:h===null&&x&4&&XI(g);case 26:case 5:Yc(c,g),h===null&&x&4&&VI(g),x&512&&u0(g,g.return);break;case 12:Yc(c,g);break;case 31:Yc(c,g),x&4&&t3(c,g);break;case 13:Yc(c,g),x&4&&n3(c,g),x&64&&(c=g.memoizedState,c!==null&&(c=c.dehydrated,c!==null&&(g=uX.bind(null,g),EX(c,g))));break;case 22:if(x=g.memoizedState!==null||qc,!x){h=h!==null&&h.memoizedState!==null||Tr,_=qc;var O=Tr;qc=x,(Tr=h)&&!O?Wc(c,g,(g.subtreeFlags&8772)!==0):Yc(c,g),qc=_,Tr=O}break;case 30:break;default:Yc(c,g)}}function JI(c){var h=c.alternate;h!==null&&(c.alternate=null,JI(h)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(h=c.stateNode,h!==null&&$i(h)),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}var zi=null,co=!1;function Qc(c,h,g){for(g=g.child;g!==null;)e3(c,h,g),g=g.sibling}function e3(c,h,g){if(zt&&typeof zt.onCommitFiberUnmount=="function")try{zt.onCommitFiberUnmount(ct,g)}catch{}switch(g.tag){case 26:Tr||Bl(g,h),Qc(c,h,g),g.memoizedState?g.memoizedState.count--:g.stateNode&&(g=g.stateNode,g.parentNode.removeChild(g));break;case 27:Tr||Bl(g,h);var x=zi,_=co;ah(g.type)&&(zi=g.stateNode,co=!1),Qc(c,h,g),x0(g.stateNode),zi=x,co=_;break;case 5:Tr||Bl(g,h);case 6:if(x=zi,_=co,zi=null,Qc(c,h,g),zi=x,co=_,zi!==null)if(co)try{(zi.nodeType===9?zi.body:zi.nodeName==="HTML"?zi.ownerDocument.body:zi).removeChild(g.stateNode)}catch(O){si(g,h,O)}else try{zi.removeChild(g.stateNode)}catch(O){si(g,h,O)}break;case 18:zi!==null&&(co?(c=zi,W3(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,g.stateNode),jp(c)):W3(zi,g.stateNode));break;case 4:x=zi,_=co,zi=g.stateNode.containerInfo,co=!0,Qc(c,h,g),zi=x,co=_;break;case 0:case 11:case 14:case 15:eh(2,g,h),Tr||eh(4,g,h),Qc(c,h,g);break;case 1:Tr||(Bl(g,h),x=g.stateNode,typeof x.componentWillUnmount=="function"&&UI(g,h,x)),Qc(c,h,g);break;case 21:Qc(c,h,g);break;case 22:Tr=(x=Tr)||g.memoizedState!==null,Qc(c,h,g),Tr=x;break;default:Qc(c,h,g)}}function t3(c,h){if(h.memoizedState===null&&(c=h.alternate,c!==null&&(c=c.memoizedState,c!==null))){c=c.dehydrated;try{jp(c)}catch(g){si(h,h.return,g)}}}function n3(c,h){if(h.memoizedState===null&&(c=h.alternate,c!==null&&(c=c.memoizedState,c!==null&&(c=c.dehydrated,c!==null))))try{jp(c)}catch(g){si(h,h.return,g)}}function nX(c){switch(c.tag){case 31:case 13:case 19:var h=c.stateNode;return h===null&&(h=c.stateNode=new KI),h;case 22:return c=c.stateNode,h=c._retryCache,h===null&&(h=c._retryCache=new KI),h;default:throw Error(i(435,c.tag))}}function nb(c,h){var g=nX(c);h.forEach(function(x){if(!g.has(x)){g.add(x);var _=hX.bind(null,c,x);x.then(_,_)}})}function uo(c,h){var g=h.deletions;if(g!==null)for(var x=0;x<g.length;x++){var _=g[x],O=c,B=h,Z=B;e:for(;Z!==null;){switch(Z.tag){case 27:if(ah(Z.type)){zi=Z.stateNode,co=!1;break e}break;case 5:zi=Z.stateNode,co=!1;break e;case 3:case 4:zi=Z.stateNode.containerInfo,co=!0;break e}Z=Z.return}if(zi===null)throw Error(i(160));e3(O,B,_),zi=null,co=!1,O=_.alternate,O!==null&&(O.return=null),_.return=null}if(h.subtreeFlags&13886)for(h=h.child;h!==null;)i3(h,c),h=h.sibling}var za=null;function i3(c,h){var g=c.alternate,x=c.flags;switch(c.tag){case 0:case 11:case 14:case 15:uo(h,c),ho(c),x&4&&(eh(3,c,c.return),c0(3,c),eh(5,c,c.return));break;case 1:uo(h,c),ho(c),x&512&&(Tr||g===null||Bl(g,g.return)),x&64&&qc&&(c=c.updateQueue,c!==null&&(x=c.callbacks,x!==null&&(g=c.shared.hiddenCallbacks,c.shared.hiddenCallbacks=g===null?x:g.concat(x))));break;case 26:var _=za;if(uo(h,c),ho(c),x&512&&(Tr||g===null||Bl(g,g.return)),x&4){var O=g!==null?g.memoizedState:null;if(x=c.memoizedState,g===null)if(x===null)if(c.stateNode===null){e:{x=c.type,g=c.memoizedProps,_=_.ownerDocument||_;t:switch(x){case"title":O=_.getElementsByTagName("title")[0],(!O||O[Ei]||O[li]||O.namespaceURI==="http://www.w3.org/2000/svg"||O.hasAttribute("itemprop"))&&(O=_.createElement(x),_.head.insertBefore(O,_.querySelector("head > title"))),fs(O,x,g),O[li]=c,Wi(O),x=O;break e;case"link":var B=iB("link","href",_).get(x+(g.href||""));if(B){for(var Z=0;Z<B.length;Z++)if(O=B[Z],O.getAttribute("href")===(g.href==null||g.href===""?null:g.href)&&O.getAttribute("rel")===(g.rel==null?null:g.rel)&&O.getAttribute("title")===(g.title==null?null:g.title)&&O.getAttribute("crossorigin")===(g.crossOrigin==null?null:g.crossOrigin)){B.splice(Z,1);break t}}O=_.createElement(x),fs(O,x,g),_.head.appendChild(O);break;case"meta":if(B=iB("meta","content",_).get(x+(g.content||""))){for(Z=0;Z<B.length;Z++)if(O=B[Z],O.getAttribute("content")===(g.content==null?null:""+g.content)&&O.getAttribute("name")===(g.name==null?null:g.name)&&O.getAttribute("property")===(g.property==null?null:g.property)&&O.getAttribute("http-equiv")===(g.httpEquiv==null?null:g.httpEquiv)&&O.getAttribute("charset")===(g.charSet==null?null:g.charSet)){B.splice(Z,1);break t}}O=_.createElement(x),fs(O,x,g),_.head.appendChild(O);break;default:throw Error(i(468,x))}O[li]=c,Wi(O),x=O}c.stateNode=x}else rB(_,c.type,c.stateNode);else c.stateNode=nB(_,x,c.memoizedProps);else O!==x?(O===null?g.stateNode!==null&&(g=g.stateNode,g.parentNode.removeChild(g)):O.count--,x===null?rB(_,c.type,c.stateNode):nB(_,x,c.memoizedProps)):x===null&&c.stateNode!==null&&VC(c,c.memoizedProps,g.memoizedProps)}break;case 27:uo(h,c),ho(c),x&512&&(Tr||g===null||Bl(g,g.return)),g!==null&&x&4&&VC(c,c.memoizedProps,g.memoizedProps);break;case 5:if(uo(h,c),ho(c),x&512&&(Tr||g===null||Bl(g,g.return)),c.flags&32){_=c.stateNode;try{Ht(_,"")}catch(_t){si(c,c.return,_t)}}x&4&&c.stateNode!=null&&(_=c.memoizedProps,VC(c,_,g!==null?g.memoizedProps:_)),x&1024&&(KC=!0);break;case 6:if(uo(h,c),ho(c),x&4){if(c.stateNode===null)throw Error(i(162));x=c.memoizedProps,g=c.stateNode;try{g.nodeValue=x}catch(_t){si(c,c.return,_t)}}break;case 3:if(yb=null,_=za,za=gb(h.containerInfo),uo(h,c),za=_,ho(c),x&4&&g!==null&&g.memoizedState.isDehydrated)try{jp(h.containerInfo)}catch(_t){si(c,c.return,_t)}KC&&(KC=!1,r3(c));break;case 4:x=za,za=gb(c.stateNode.containerInfo),uo(h,c),ho(c),za=x;break;case 12:uo(h,c),ho(c);break;case 31:uo(h,c),ho(c),x&4&&(x=c.updateQueue,x!==null&&(c.updateQueue=null,nb(c,x)));break;case 13:uo(h,c),ho(c),c.child.flags&8192&&c.memoizedState!==null!=(g!==null&&g.memoizedState!==null)&&(rb=Ee()),x&4&&(x=c.updateQueue,x!==null&&(c.updateQueue=null,nb(c,x)));break;case 22:_=c.memoizedState!==null;var ae=g!==null&&g.memoizedState!==null,_e=qc,Ie=Tr;if(qc=_e||_,Tr=Ie||ae,uo(h,c),Tr=Ie,qc=_e,ho(c),x&8192)e:for(h=c.stateNode,h._visibility=_?h._visibility&-2:h._visibility|1,_&&(g===null||ae||qc||Tr||zd(c)),g=null,h=c;;){if(h.tag===5||h.tag===26){if(g===null){ae=g=h;try{if(O=ae.stateNode,_)B=O.style,typeof B.setProperty=="function"?B.setProperty("display","none","important"):B.display="none";else{Z=ae.stateNode;var Ue=ae.memoizedProps.style,ke=Ue!=null&&Ue.hasOwnProperty("display")?Ue.display:null;Z.style.display=ke==null||typeof ke=="boolean"?"":(""+ke).trim()}}catch(_t){si(ae,ae.return,_t)}}}else if(h.tag===6){if(g===null){ae=h;try{ae.stateNode.nodeValue=_?"":ae.memoizedProps}catch(_t){si(ae,ae.return,_t)}}}else if(h.tag===18){if(g===null){ae=h;try{var Me=ae.stateNode;_?U3(Me,!0):U3(ae.stateNode,!1)}catch(_t){si(ae,ae.return,_t)}}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===c)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===c)break e;for(;h.sibling===null;){if(h.return===null||h.return===c)break e;g===h&&(g=null),h=h.return}g===h&&(g=null),h.sibling.return=h.return,h=h.sibling}x&4&&(x=c.updateQueue,x!==null&&(g=x.retryQueue,g!==null&&(x.retryQueue=null,nb(c,g))));break;case 19:uo(h,c),ho(c),x&4&&(x=c.updateQueue,x!==null&&(c.updateQueue=null,nb(c,x)));break;case 30:break;case 21:break;default:uo(h,c),ho(c)}}function ho(c){var h=c.flags;if(h&2){try{for(var g,x=c.return;x!==null;){if(GI(x)){g=x;break}x=x.return}if(g==null)throw Error(i(160));switch(g.tag){case 27:var _=g.stateNode,O=GC(c);tb(c,O,_);break;case 5:var B=g.stateNode;g.flags&32&&(Ht(B,""),g.flags&=-33);var Z=GC(c);tb(c,Z,B);break;case 3:case 4:var ae=g.stateNode.containerInfo,_e=GC(c);XC(c,_e,ae);break;default:throw Error(i(161))}}catch(Ie){si(c,c.return,Ie)}c.flags&=-3}h&4096&&(c.flags&=-4097)}function r3(c){if(c.subtreeFlags&1024)for(c=c.child;c!==null;){var h=c;r3(h),h.tag===5&&h.flags&1024&&h.stateNode.reset(),c=c.sibling}}function Yc(c,h){if(h.subtreeFlags&8772)for(h=h.child;h!==null;)ZI(c,h.alternate,h),h=h.sibling}function zd(c){for(c=c.child;c!==null;){var h=c;switch(h.tag){case 0:case 11:case 14:case 15:eh(4,h,h.return),zd(h);break;case 1:Bl(h,h.return);var g=h.stateNode;typeof g.componentWillUnmount=="function"&&UI(h,h.return,g),zd(h);break;case 27:x0(h.stateNode);case 26:case 5:Bl(h,h.return),zd(h);break;case 22:h.memoizedState===null&&zd(h);break;case 30:zd(h);break;default:zd(h)}c=c.sibling}}function Wc(c,h,g){for(g=g&&(h.subtreeFlags&8772)!==0,h=h.child;h!==null;){var x=h.alternate,_=c,O=h,B=O.flags;switch(O.tag){case 0:case 11:case 15:Wc(_,O,g),c0(4,O);break;case 1:if(Wc(_,O,g),x=O,_=x.stateNode,typeof _.componentDidMount=="function")try{_.componentDidMount()}catch(_e){si(x,x.return,_e)}if(x=O,_=x.updateQueue,_!==null){var Z=x.stateNode;try{var ae=_.shared.hiddenCallbacks;if(ae!==null)for(_.shared.hiddenCallbacks=null,_=0;_<ae.length;_++)IN(ae[_],Z)}catch(_e){si(x,x.return,_e)}}g&&B&64&&WI(O),u0(O,O.return);break;case 27:XI(O);case 26:case 5:Wc(_,O,g),g&&x===null&&B&4&&VI(O),u0(O,O.return);break;case 12:Wc(_,O,g);break;case 31:Wc(_,O,g),g&&B&4&&t3(_,O);break;case 13:Wc(_,O,g),g&&B&4&&n3(_,O);break;case 22:O.memoizedState===null&&Wc(_,O,g),u0(O,O.return);break;case 30:break;default:Wc(_,O,g)}h=h.sibling}}function ZC(c,h){var g=null;c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),c=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(c=h.memoizedState.cachePool.pool),c!==g&&(c!=null&&c.refCount++,g!=null&&Xg(g))}function JC(c,h){c=null,h.alternate!==null&&(c=h.alternate.memoizedState.cache),h=h.memoizedState.cache,h!==c&&(h.refCount++,c!=null&&Xg(c))}function Ha(c,h,g,x){if(h.subtreeFlags&10256)for(h=h.child;h!==null;)s3(c,h,g,x),h=h.sibling}function s3(c,h,g,x){var _=h.flags;switch(h.tag){case 0:case 11:case 15:Ha(c,h,g,x),_&2048&&c0(9,h);break;case 1:Ha(c,h,g,x);break;case 3:Ha(c,h,g,x),_&2048&&(c=null,h.alternate!==null&&(c=h.alternate.memoizedState.cache),h=h.memoizedState.cache,h!==c&&(h.refCount++,c!=null&&Xg(c)));break;case 12:if(_&2048){Ha(c,h,g,x),c=h.stateNode;try{var O=h.memoizedProps,B=O.id,Z=O.onPostCommit;typeof Z=="function"&&Z(B,h.alternate===null?"mount":"update",c.passiveEffectDuration,-0)}catch(ae){si(h,h.return,ae)}}else Ha(c,h,g,x);break;case 31:Ha(c,h,g,x);break;case 13:Ha(c,h,g,x);break;case 23:break;case 22:O=h.stateNode,B=h.alternate,h.memoizedState!==null?O._visibility&2?Ha(c,h,g,x):h0(c,h):O._visibility&2?Ha(c,h,g,x):(O._visibility|=2,fp(c,h,g,x,(h.subtreeFlags&10256)!==0||!1)),_&2048&&ZC(B,h);break;case 24:Ha(c,h,g,x),_&2048&&JC(h.alternate,h);break;default:Ha(c,h,g,x)}}function fp(c,h,g,x,_){for(_=_&&((h.subtreeFlags&10256)!==0||!1),h=h.child;h!==null;){var O=c,B=h,Z=g,ae=x,_e=B.flags;switch(B.tag){case 0:case 11:case 15:fp(O,B,Z,ae,_),c0(8,B);break;case 23:break;case 22:var Ie=B.stateNode;B.memoizedState!==null?Ie._visibility&2?fp(O,B,Z,ae,_):h0(O,B):(Ie._visibility|=2,fp(O,B,Z,ae,_)),_&&_e&2048&&ZC(B.alternate,B);break;case 24:fp(O,B,Z,ae,_),_&&_e&2048&&JC(B.alternate,B);break;default:fp(O,B,Z,ae,_)}h=h.sibling}}function h0(c,h){if(h.subtreeFlags&10256)for(h=h.child;h!==null;){var g=c,x=h,_=x.flags;switch(x.tag){case 22:h0(g,x),_&2048&&ZC(x.alternate,x);break;case 24:h0(g,x),_&2048&&JC(x.alternate,x);break;default:h0(g,x)}h=h.sibling}}var d0=8192;function pp(c,h,g){if(c.subtreeFlags&d0)for(c=c.child;c!==null;)o3(c,h,g),c=c.sibling}function o3(c,h,g){switch(c.tag){case 26:pp(c,h,g),c.flags&d0&&c.memoizedState!==null&&HX(g,za,c.memoizedState,c.memoizedProps);break;case 5:pp(c,h,g);break;case 3:case 4:var x=za;za=gb(c.stateNode.containerInfo),pp(c,h,g),za=x;break;case 22:c.memoizedState===null&&(x=c.alternate,x!==null&&x.memoizedState!==null?(x=d0,d0=16777216,pp(c,h,g),d0=x):pp(c,h,g));break;default:pp(c,h,g)}}function a3(c){var h=c.alternate;if(h!==null&&(c=h.child,c!==null)){h.child=null;do h=c.sibling,c.sibling=null,c=h;while(c!==null)}}function f0(c){var h=c.deletions;if((c.flags&16)!==0){if(h!==null)for(var g=0;g<h.length;g++){var x=h[g];Vr=x,c3(x,c)}a3(c)}if(c.subtreeFlags&10256)for(c=c.child;c!==null;)l3(c),c=c.sibling}function l3(c){switch(c.tag){case 0:case 11:case 15:f0(c),c.flags&2048&&eh(9,c,c.return);break;case 3:f0(c);break;case 12:f0(c);break;case 22:var h=c.stateNode;c.memoizedState!==null&&h._visibility&2&&(c.return===null||c.return.tag!==13)?(h._visibility&=-3,ib(c)):f0(c);break;default:f0(c)}}function ib(c){var h=c.deletions;if((c.flags&16)!==0){if(h!==null)for(var g=0;g<h.length;g++){var x=h[g];Vr=x,c3(x,c)}a3(c)}for(c=c.child;c!==null;){switch(h=c,h.tag){case 0:case 11:case 15:eh(8,h,h.return),ib(h);break;case 22:g=h.stateNode,g._visibility&2&&(g._visibility&=-3,ib(h));break;default:ib(h)}c=c.sibling}}function c3(c,h){for(;Vr!==null;){var g=Vr;switch(g.tag){case 0:case 11:case 15:eh(8,g,h);break;case 23:case 22:if(g.memoizedState!==null&&g.memoizedState.cachePool!==null){var x=g.memoizedState.cachePool.pool;x!=null&&x.refCount++}break;case 24:Xg(g.memoizedState.cache)}if(x=g.child,x!==null)x.return=g,Vr=x;else e:for(g=c;Vr!==null;){x=Vr;var _=x.sibling,O=x.return;if(JI(x),x===g){Vr=null;break e}if(_!==null){_.return=O,Vr=_;break e}Vr=O}}}var iX={getCacheForType:function(c){var h=hs(Cr),g=h.data.get(c);return g===void 0&&(g=c(),h.data.set(c,g)),g},cacheSignal:function(){return hs(Cr).controller.signal}},rX=typeof WeakMap=="function"?WeakMap:Map,Yn=0,vi=null,bn=null,jn=0,ri=0,Io=null,th=!1,mp=!1,e_=!1,Uc=0,sr=0,nh=0,Hd=0,t_=0,Bo=0,gp=0,p0=null,fo=null,n_=!1,rb=0,u3=0,sb=1/0,ob=null,ih=null,Rr=0,rh=null,vp=null,Vc=0,i_=0,r_=null,h3=null,m0=0,s_=null;function Lo(){return(Yn&2)!==0&&jn!==0?jn&-jn:N.T!==null?h_():vn()}function d3(){if(Bo===0)if((jn&536870912)===0||Tn){var c=tn;tn<<=1,(tn&3932160)===0&&(tn=262144),Bo=c}else Bo=536870912;return c=Do.current,c!==null&&(c.flags|=32),Bo}function po(c,h,g){(c===vi&&(ri===2||ri===9)||c.cancelPendingCommit!==null)&&(yp(c,0),sh(c,jn,Bo,!1)),Kt(c,g),((Yn&2)===0||c!==vi)&&(c===vi&&((Yn&2)===0&&(Hd|=g),sr===4&&sh(c,jn,Bo,!1)),Ll(c))}function f3(c,h,g){if((Yn&6)!==0)throw Error(i(327));var x=!g&&(h&127)===0&&(h&c.expiredLanes)===0||ve(c,h),_=x?aX(c,h):a_(c,h,!0),O=x;do{if(_===0){mp&&!x&&sh(c,h,0,!1);break}else{if(g=c.current.alternate,O&&!sX(g)){_=a_(c,h,!1),O=!1;continue}if(_===2){if(O=h,c.errorRecoveryDisabledLanes&O)var B=0;else B=c.pendingLanes&-536870913,B=B!==0?B:B&536870912?536870912:0;if(B!==0){h=B;e:{var Z=c;_=p0;var ae=Z.current.memoizedState.isDehydrated;if(ae&&(yp(Z,B).flags|=256),B=a_(Z,B,!1),B!==2){if(e_&&!ae){Z.errorRecoveryDisabledLanes|=O,Hd|=O,_=4;break e}O=fo,fo=_,O!==null&&(fo===null?fo=O:fo.push.apply(fo,O))}_=B}if(O=!1,_!==2)continue}}if(_===1){yp(c,0),sh(c,h,0,!0);break}e:{switch(x=c,O=_,O){case 0:case 1:throw Error(i(345));case 4:if((h&4194048)!==h)break;case 6:sh(x,h,Bo,!th);break e;case 2:fo=null;break;case 3:case 5:break;default:throw Error(i(329))}if((h&62914560)===h&&(_=rb+300-Ee(),10<_)){if(sh(x,h,Bo,!th),re(x,0,!0)!==0)break e;Vc=h,x.timeoutHandle=Q3(p3.bind(null,x,g,fo,ob,n_,h,Bo,Hd,gp,th,O,"Throttled",-0,0),_);break e}p3(x,g,fo,ob,n_,h,Bo,Hd,gp,th,O,null,-0,0)}}break}while(!0);Ll(c)}function p3(c,h,g,x,_,O,B,Z,ae,_e,Ie,Ue,ke,Me){if(c.timeoutHandle=-1,Ue=h.subtreeFlags,Ue&8192||(Ue&16785408)===16785408){Ue={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:at},o3(h,O,Ue);var _t=(O&62914560)===O?rb-Ee():(O&4194048)===O?u3-Ee():0;if(_t=qX(Ue,_t),_t!==null){Vc=O,c.cancelPendingCommit=_t(w3.bind(null,c,h,O,g,x,_,B,Z,ae,Ie,Ue,null,ke,Me)),sh(c,O,B,!_e);return}}w3(c,h,O,g,x,_,B,Z,ae)}function sX(c){for(var h=c;;){var g=h.tag;if((g===0||g===11||g===15)&&h.flags&16384&&(g=h.updateQueue,g!==null&&(g=g.stores,g!==null)))for(var x=0;x<g.length;x++){var _=g[x],O=_.getSnapshot;_=_.value;try{if(!Gt(O(),_))return!1}catch{return!1}}if(g=h.child,h.subtreeFlags&16384&&g!==null)g.return=h,h=g;else{if(h===c)break;for(;h.sibling===null;){if(h.return===null||h.return===c)return!0;h=h.return}h.sibling.return=h.return,h=h.sibling}}return!0}function sh(c,h,g,x){h&=~t_,h&=~Hd,c.suspendedLanes|=h,c.pingedLanes&=~h,x&&(c.warmLanes|=h),x=c.expirationTimes;for(var _=h;0<_;){var O=31-Lt(_),B=1<<O;x[O]=-1,_&=~B}g!==0&&rt(c,g,h)}function ab(){return(Yn&6)===0?(g0(0),!1):!0}function o_(){if(bn!==null){if(ri===0)var c=bn.return;else c=bn,Lc=Dd=null,wC(c),lp=null,Zg=0,c=bn;for(;c!==null;)YI(c.alternate,c),c=c.return;bn=null}}function yp(c,h){var g=c.timeoutHandle;g!==-1&&(c.timeoutHandle=-1,CX(g)),g=c.cancelPendingCommit,g!==null&&(c.cancelPendingCommit=null,g()),Vc=0,o_(),vi=c,bn=g=Ic(c.current,null),jn=h,ri=0,Io=null,th=!1,mp=ve(c,h),e_=!1,gp=Bo=t_=Hd=nh=sr=0,fo=p0=null,n_=!1,(h&8)!==0&&(h|=h&32);var x=c.entangledLanes;if(x!==0)for(c=c.entanglements,x&=h;0<x;){var _=31-Lt(x),O=1<<_;h|=c[_],x&=~O}return Uc=h,Tx(),g}function m3(c,h){cn=null,N.H=o0,h===ap||h===Bx?(h=MN(),ri=3):h===uC?(h=MN(),ri=4):ri=h===PC?8:h!==null&&typeof h=="object"&&typeof h.then=="function"?6:1,Io=h,bn===null&&(sr=1,Xx(c,da(h,c.current)))}function g3(){var c=Do.current;return c===null?!0:(jn&4194048)===jn?ga===null:(jn&62914560)===jn||(jn&536870912)!==0?c===ga:!1}function v3(){var c=N.H;return N.H=o0,c===null?o0:c}function y3(){var c=N.A;return N.A=iX,c}function lb(){sr=4,th||(jn&4194048)!==jn&&Do.current!==null||(mp=!0),(nh&134217727)===0&&(Hd&134217727)===0||vi===null||sh(vi,jn,Bo,!1)}function a_(c,h,g){var x=Yn;Yn|=2;var _=v3(),O=y3();(vi!==c||jn!==h)&&(ob=null,yp(c,h)),h=!1;var B=sr;e:do try{if(ri!==0&&bn!==null){var Z=bn,ae=Io;switch(ri){case 8:o_(),B=6;break e;case 3:case 2:case 9:case 6:Do.current===null&&(h=!0);var _e=ri;if(ri=0,Io=null,xp(c,Z,ae,_e),g&&mp){B=0;break e}break;default:_e=ri,ri=0,Io=null,xp(c,Z,ae,_e)}}oX(),B=sr;break}catch(Ie){m3(c,Ie)}while(!0);return h&&c.shellSuspendCounter++,Lc=Dd=null,Yn=x,N.H=_,N.A=O,bn===null&&(vi=null,jn=0,Tx()),B}function oX(){for(;bn!==null;)x3(bn)}function aX(c,h){var g=Yn;Yn|=2;var x=v3(),_=y3();vi!==c||jn!==h?(ob=null,sb=Ee()+500,yp(c,h)):mp=ve(c,h);e:do try{if(ri!==0&&bn!==null){h=bn;var O=Io;t:switch(ri){case 1:ri=0,Io=null,xp(c,h,O,1);break;case 2:case 9:if(ON(O)){ri=0,Io=null,b3(h);break}h=function(){ri!==2&&ri!==9||vi!==c||(ri=7),Ll(c)},O.then(h,h);break e;case 3:ri=7;break e;case 4:ri=5;break e;case 7:ON(O)?(ri=0,Io=null,b3(h)):(ri=0,Io=null,xp(c,h,O,7));break;case 5:var B=null;switch(bn.tag){case 26:B=bn.memoizedState;case 5:case 27:var Z=bn;if(B?sB(B):Z.stateNode.complete){ri=0,Io=null;var ae=Z.sibling;if(ae!==null)bn=ae;else{var _e=Z.return;_e!==null?(bn=_e,cb(_e)):bn=null}break t}}ri=0,Io=null,xp(c,h,O,5);break;case 6:ri=0,Io=null,xp(c,h,O,6);break;case 8:o_(),sr=6;break e;default:throw Error(i(462))}}lX();break}catch(Ie){m3(c,Ie)}while(!0);return Lc=Dd=null,N.H=x,N.A=_,Yn=g,bn!==null?0:(vi=null,jn=0,Tx(),sr)}function lX(){for(;bn!==null&&!dt();)x3(bn)}function x3(c){var h=qI(c.alternate,c,Uc);c.memoizedProps=c.pendingProps,h===null?cb(c):bn=h}function b3(c){var h=c,g=h.alternate;switch(h.tag){case 15:case 0:h=LI(g,h,h.pendingProps,h.type,void 0,jn);break;case 11:h=LI(g,h,h.pendingProps,h.type.render,h.ref,jn);break;case 5:wC(h);default:YI(g,h),h=bn=yN(h,Uc),h=qI(g,h,Uc)}c.memoizedProps=c.pendingProps,h===null?cb(c):bn=h}function xp(c,h,g,x){Lc=Dd=null,wC(h),lp=null,Zg=0;var _=h.return;try{if(XG(c,_,h,g,jn)){sr=1,Xx(c,da(g,c.current)),bn=null;return}}catch(O){if(_!==null)throw bn=_,O;sr=1,Xx(c,da(g,c.current)),bn=null;return}h.flags&32768?(Tn||x===1?c=!0:mp||(jn&536870912)!==0?c=!1:(th=c=!0,(x===2||x===9||x===3||x===6)&&(x=Do.current,x!==null&&x.tag===13&&(x.flags|=16384))),A3(h,c)):cb(h)}function cb(c){var h=c;do{if((h.flags&32768)!==0){A3(h,th);return}c=h.return;var g=JG(h.alternate,h,Uc);if(g!==null){bn=g;return}if(h=h.sibling,h!==null){bn=h;return}bn=h=c}while(h!==null);sr===0&&(sr=5)}function A3(c,h){do{var g=eX(c.alternate,c);if(g!==null){g.flags&=32767,bn=g;return}if(g=c.return,g!==null&&(g.flags|=32768,g.subtreeFlags=0,g.deletions=null),!h&&(c=c.sibling,c!==null)){bn=c;return}bn=c=g}while(c!==null);sr=6,bn=null}function w3(c,h,g,x,_,O,B,Z,ae){c.cancelPendingCommit=null;do ub();while(Rr!==0);if((Yn&6)!==0)throw Error(i(327));if(h!==null){if(h===c.current)throw Error(i(177));if(O=h.lanes|h.childLanes,O|=Gj,it(c,g,O,B,Z,ae),c===vi&&(bn=vi=null,jn=0),vp=h,rh=c,Vc=g,i_=O,r_=_,h3=x,(h.subtreeFlags&10256)!==0||(h.flags&10256)!==0?(c.callbackNode=null,c.callbackPriority=0,dX(vt,function(){return k3(),null})):(c.callbackNode=null,c.callbackPriority=0),x=(h.flags&13878)!==0,(h.subtreeFlags&13878)!==0||x){x=N.T,N.T=null,_=P.p,P.p=2,B=Yn,Yn|=4;try{tX(c,h,g)}finally{Yn=B,P.p=_,N.T=x}}Rr=1,S3(),j3(),C3()}}function S3(){if(Rr===1){Rr=0;var c=rh,h=vp,g=(h.flags&13878)!==0;if((h.subtreeFlags&13878)!==0||g){g=N.T,N.T=null;var x=P.p;P.p=2;var _=Yn;Yn|=4;try{i3(h,c);var O=x_,B=Ri(c.containerInfo),Z=O.focusedElem,ae=O.selectionRange;if(B!==Z&&Z&&Z.ownerDocument&&ci(Z.ownerDocument.documentElement,Z)){if(ae!==null&&ir(Z)){var _e=ae.start,Ie=ae.end;if(Ie===void 0&&(Ie=_e),"selectionStart"in Z)Z.selectionStart=_e,Z.selectionEnd=Math.min(Ie,Z.value.length);else{var Ue=Z.ownerDocument||document,ke=Ue&&Ue.defaultView||window;if(ke.getSelection){var Me=ke.getSelection(),_t=Z.textContent.length,Yt=Math.min(ae.start,_t),di=ae.end===void 0?Yt:Math.min(ae.end,_t);!Me.extend&&Yt>di&&(B=di,di=Yt,Yt=B);var me=Dt(Z,Yt),fe=Dt(Z,di);if(me&&fe&&(Me.rangeCount!==1||Me.anchorNode!==me.node||Me.anchorOffset!==me.offset||Me.focusNode!==fe.node||Me.focusOffset!==fe.offset)){var Se=Ue.createRange();Se.setStart(me.node,me.offset),Me.removeAllRanges(),Yt>di?(Me.addRange(Se),Me.extend(fe.node,fe.offset)):(Se.setEnd(fe.node,fe.offset),Me.addRange(Se))}}}}for(Ue=[],Me=Z;Me=Me.parentNode;)Me.nodeType===1&&Ue.push({element:Me,left:Me.scrollLeft,top:Me.scrollTop});for(typeof Z.focus=="function"&&Z.focus(),Z=0;Z<Ue.length;Z++){var He=Ue[Z];He.element.scrollLeft=He.left,He.element.scrollTop=He.top}}wb=!!y_,x_=y_=null}finally{Yn=_,P.p=x,N.T=g}}c.current=h,Rr=2}}function j3(){if(Rr===2){Rr=0;var c=rh,h=vp,g=(h.flags&8772)!==0;if((h.subtreeFlags&8772)!==0||g){g=N.T,N.T=null;var x=P.p;P.p=2;var _=Yn;Yn|=4;try{ZI(c,h.alternate,h)}finally{Yn=_,P.p=x,N.T=g}}Rr=3}}function C3(){if(Rr===4||Rr===3){Rr=0,nt();var c=rh,h=vp,g=Vc,x=h3;(h.subtreeFlags&10256)!==0||(h.flags&10256)!==0?Rr=5:(Rr=0,vp=rh=null,_3(c,c.pendingLanes));var _=c.pendingLanes;if(_===0&&(ih=null),Ct(g),h=h.stateNode,zt&&typeof zt.onCommitFiberRoot=="function")try{zt.onCommitFiberRoot(ct,h,void 0,(h.current.flags&128)===128)}catch{}if(x!==null){h=N.T,_=P.p,P.p=2,N.T=null;try{for(var O=c.onRecoverableError,B=0;B<x.length;B++){var Z=x[B];O(Z.value,{componentStack:Z.stack})}}finally{N.T=h,P.p=_}}(Vc&3)!==0&&ub(),Ll(c),_=c.pendingLanes,(g&261930)!==0&&(_&42)!==0?c===s_?m0++:(m0=0,s_=c):m0=0,g0(0)}}function _3(c,h){(c.pooledCacheLanes&=h)===0&&(h=c.pooledCache,h!=null&&(c.pooledCache=null,Xg(h)))}function ub(){return S3(),j3(),C3(),k3()}function k3(){if(Rr!==5)return!1;var c=rh,h=i_;i_=0;var g=Ct(Vc),x=N.T,_=P.p;try{P.p=32>g?32:g,N.T=null,g=r_,r_=null;var O=rh,B=Vc;if(Rr=0,vp=rh=null,Vc=0,(Yn&6)!==0)throw Error(i(331));var Z=Yn;if(Yn|=4,l3(O.current),s3(O,O.current,B,g),Yn=Z,g0(0,!1),zt&&typeof zt.onPostCommitFiberRoot=="function")try{zt.onPostCommitFiberRoot(ct,O)}catch{}return!0}finally{P.p=_,N.T=x,_3(c,h)}}function T3(c,h,g){h=da(g,h),h=LC(c.stateNode,h,2),c=Ku(c,h,2),c!==null&&(Kt(c,2),Ll(c))}function si(c,h,g){if(c.tag===3)T3(c,c,g);else for(;h!==null;){if(h.tag===3){T3(h,c,g);break}else if(h.tag===1){var x=h.stateNode;if(typeof h.type.getDerivedStateFromError=="function"||typeof x.componentDidCatch=="function"&&(ih===null||!ih.has(x))){c=da(g,c),g=OI(2),x=Ku(h,g,2),x!==null&&(EI(g,x,h,c),Kt(x,2),Ll(x));break}}h=h.return}}function l_(c,h,g){var x=c.pingCache;if(x===null){x=c.pingCache=new rX;var _=new Set;x.set(h,_)}else _=x.get(h),_===void 0&&(_=new Set,x.set(h,_));_.has(g)||(e_=!0,_.add(g),c=cX.bind(null,c,h,g),h.then(c,c))}function cX(c,h,g){var x=c.pingCache;x!==null&&x.delete(h),c.pingedLanes|=c.suspendedLanes&g,c.warmLanes&=~g,vi===c&&(jn&g)===g&&(sr===4||sr===3&&(jn&62914560)===jn&&300>Ee()-rb?(Yn&2)===0&&yp(c,0):t_|=g,gp===jn&&(gp=0)),Ll(c)}function O3(c,h){h===0&&(h=Ne()),c=Ed(c,h),c!==null&&(Kt(c,h),Ll(c))}function uX(c){var h=c.memoizedState,g=0;h!==null&&(g=h.retryLane),O3(c,g)}function hX(c,h){var g=0;switch(c.tag){case 31:case 13:var x=c.stateNode,_=c.memoizedState;_!==null&&(g=_.retryLane);break;case 19:x=c.stateNode;break;case 22:x=c.stateNode._retryCache;break;default:throw Error(i(314))}x!==null&&x.delete(h),O3(c,g)}function dX(c,h){return Ye(c,h)}var hb=null,bp=null,c_=!1,db=!1,u_=!1,oh=0;function Ll(c){c!==bp&&c.next===null&&(bp===null?hb=bp=c:bp=bp.next=c),db=!0,c_||(c_=!0,pX())}function g0(c,h){if(!u_&&db){u_=!0;do for(var g=!1,x=hb;x!==null;){if(c!==0){var _=x.pendingLanes;if(_===0)var O=0;else{var B=x.suspendedLanes,Z=x.pingedLanes;O=(1<<31-Lt(42|c)+1)-1,O&=_&~(B&~Z),O=O&201326741?O&201326741|1:O?O|2:0}O!==0&&(g=!0,D3(x,O))}else O=jn,O=re(x,x===vi?O:0,x.cancelPendingCommit!==null||x.timeoutHandle!==-1),(O&3)===0||ve(x,O)||(g=!0,D3(x,O));x=x.next}while(g);u_=!1}}function fX(){E3()}function E3(){db=c_=!1;var c=0;oh!==0&&jX()&&(c=oh);for(var h=Ee(),g=null,x=hb;x!==null;){var _=x.next,O=M3(x,h);O===0?(x.next=null,g===null?hb=_:g.next=_,_===null&&(bp=g)):(g=x,(c!==0||(O&3)!==0)&&(db=!0)),x=_}Rr!==0&&Rr!==5||g0(c),oh!==0&&(oh=0)}function M3(c,h){for(var g=c.suspendedLanes,x=c.pingedLanes,_=c.expirationTimes,O=c.pendingLanes&-62914561;0<O;){var B=31-Lt(O),Z=1<<B,ae=_[B];ae===-1?((Z&g)===0||(Z&x)!==0)&&(_[B]=pe(Z,h)):ae<=h&&(c.expiredLanes|=Z),O&=~Z}if(h=vi,g=jn,g=re(c,c===h?g:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),x=c.callbackNode,g===0||c===h&&(ri===2||ri===9)||c.cancelPendingCommit!==null)return x!==null&&x!==null&&Ge(x),c.callbackNode=null,c.callbackPriority=0;if((g&3)===0||ve(c,g)){if(h=g&-g,h===c.callbackPriority)return h;switch(x!==null&&Ge(x),Ct(g)){case 2:case 8:g=Ze;break;case 32:g=vt;break;case 268435456:g=mn;break;default:g=vt}return x=R3.bind(null,c),g=Ye(g,x),c.callbackPriority=h,c.callbackNode=g,h}return x!==null&&x!==null&&Ge(x),c.callbackPriority=2,c.callbackNode=null,2}function R3(c,h){if(Rr!==0&&Rr!==5)return c.callbackNode=null,c.callbackPriority=0,null;var g=c.callbackNode;if(ub()&&c.callbackNode!==g)return null;var x=jn;return x=re(c,c===vi?x:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),x===0?null:(f3(c,x,h),M3(c,Ee()),c.callbackNode!=null&&c.callbackNode===g?R3.bind(null,c):null)}function D3(c,h){if(ub())return null;f3(c,h,!0)}function pX(){_X(function(){(Yn&6)!==0?Ye(Xe,fX):E3()})}function h_(){if(oh===0){var c=sp;c===0&&(c=ji,ji<<=1,(ji&261888)===0&&(ji=256)),oh=c}return oh}function N3(c){return c==null||typeof c=="symbol"||typeof c=="boolean"?null:typeof c=="function"?c:la(""+c)}function I3(c,h){var g=h.ownerDocument.createElement("input");return g.name=h.name,g.value=h.value,c.id&&g.setAttribute("form",c.id),h.parentNode.insertBefore(g,h),c=new FormData(c),g.parentNode.removeChild(g),c}function mX(c,h,g,x,_){if(h==="submit"&&g&&g.stateNode===_){var O=N3((_[Qr]||null).action),B=x.submitter;B&&(h=(h=B[Qr]||null)?N3(h.formAction):B.getAttribute("formAction"),h!==null&&(O=h,B=null));var Z=new Ui("action","action",null,x,_);c.push({event:Z,listeners:[{instance:null,listener:function(){if(x.defaultPrevented){if(oh!==0){var ae=B?I3(_,B):new FormData(_);MC(g,{pending:!0,data:ae,method:_.method,action:O},null,ae)}}else typeof O=="function"&&(Z.preventDefault(),ae=B?I3(_,B):new FormData(_),MC(g,{pending:!0,data:ae,method:_.method,action:O},O,ae))},currentTarget:_}]})}}for(var d_=0;d_<Vj.length;d_++){var f_=Vj[d_],gX=f_.toLowerCase(),vX=f_[0].toUpperCase()+f_.slice(1);$a(gX,"on"+vX)}$a(Ur,"onAnimationEnd"),$a(Rs,"onAnimationIteration"),$a(Dl,"onAnimationStart"),$a("dblclick","onDoubleClick"),$a("focusin","onFocus"),$a("focusout","onBlur"),$a(cs,"onTransitionRun"),$a(_x,"onTransitionStart"),$a(IG,"onTransitionCancel"),$a(mN,"onTransitionEnd"),tt("onMouseEnter",["mouseout","mouseover"]),tt("onMouseLeave",["mouseout","mouseover"]),tt("onPointerEnter",["pointerout","pointerover"]),tt("onPointerLeave",["pointerout","pointerover"]),Cs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Cs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Cs("onBeforeInput",["compositionend","keypress","textInput","paste"]),Cs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Cs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Cs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var v0="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(" "),yX=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(v0));function B3(c,h){h=(h&4)!==0;for(var g=0;g<c.length;g++){var x=c[g],_=x.event;x=x.listeners;e:{var O=void 0;if(h)for(var B=x.length-1;0<=B;B--){var Z=x[B],ae=Z.instance,_e=Z.currentTarget;if(Z=Z.listener,ae!==O&&_.isPropagationStopped())break e;O=Z,_.currentTarget=_e;try{O(_)}catch(Ie){kx(Ie)}_.currentTarget=null,O=ae}else for(B=0;B<x.length;B++){if(Z=x[B],ae=Z.instance,_e=Z.currentTarget,Z=Z.listener,ae!==O&&_.isPropagationStopped())break e;O=Z,_.currentTarget=_e;try{O(_)}catch(Ie){kx(Ie)}_.currentTarget=null,O=ae}}}}function An(c,h){var g=h[wd];g===void 0&&(g=h[wd]=new Set);var x=c+"__bubble";g.has(x)||(L3(h,c,2,!1),g.add(x))}function p_(c,h,g){var x=0;h&&(x|=4),L3(g,c,x,h)}var fb="_reactListening"+Math.random().toString(36).slice(2);function m_(c){if(!c[fb]){c[fb]=!0,Du.forEach(function(g){g!=="selectionchange"&&(yX.has(g)||p_(g,!1,c),p_(g,!0,c))});var h=c.nodeType===9?c:c.ownerDocument;h===null||h[fb]||(h[fb]=!0,p_("selectionchange",!1,h))}}function L3(c,h,g,x){switch(dB(h)){case 2:var _=WX;break;case 8:_=UX;break;default:_=E_}g=_.bind(null,h,g,c),_=void 0,!Kf||h!=="touchstart"&&h!=="touchmove"&&h!=="wheel"||(_=!0),x?_!==void 0?c.addEventListener(h,g,{capture:!0,passive:_}):c.addEventListener(h,g,!0):_!==void 0?c.addEventListener(h,g,{passive:_}):c.addEventListener(h,g,!1)}function g_(c,h,g,x,_){var O=x;if((h&1)===0&&(h&2)===0&&x!==null)e:for(;;){if(x===null)return;var B=x.tag;if(B===3||B===4){var Z=x.stateNode.containerInfo;if(Z===_)break;if(B===4)for(B=x.return;B!==null;){var ae=B.tag;if((ae===3||ae===4)&&B.stateNode.containerInfo===_)return;B=B.return}for(;Z!==null;){if(B=Rn(Z),B===null)return;if(ae=B.tag,ae===5||ae===6||ae===26||ae===27){x=O=B;continue e}Z=Z.parentNode}}x=x.return}Pu(function(){var _e=O,Ie=Wt(g),Ue=[];e:{var ke=gN.get(c);if(ke!==void 0){var Me=Ui,_t=c;switch(c){case"keypress":if(Xn(g)===0)break e;case"keydown":case"keyup":Me=Wj;break;case"focusin":_t="focus",Me=Mo;break;case"focusout":_t="blur",Me=Mo;break;case"beforeblur":case"afterblur":Me=Mo;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":Me=mx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Me=qj;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Me=xx;break;case Ur:case Rs:case Dl:Me=Ec;break;case mN:Me=qg;break;case"scroll":case"scrollend":Me=$u;break;case"wheel":Me=bx;break;case"copy":case"cut":case"paste":Me=Yj;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Me=Fa;break;case"toggle":case"beforetoggle":Me=wx}var Yt=(h&4)!==0,di=!Yt&&(c==="scroll"||c==="scrollend"),me=Yt?ke!==null?ke+"Capture":null:ke;Yt=[];for(var fe=_e,Se;fe!==null;){var He=fe;if(Se=He.stateNode,He=He.tag,He!==5&&He!==26&&He!==27||Se===null||me===null||(He=ca(fe,me),He!=null&&Yt.push(y0(fe,He,Se))),di)break;fe=fe.return}0<Yt.length&&(ke=new Me(ke,_t,null,g,Ie),Ue.push({event:ke,listeners:Yt}))}}if((h&7)===0){e:{if(ke=c==="mouseover"||c==="pointerover",Me=c==="mouseout"||c==="pointerout",ke&&g!==kt&&(_t=g.relatedTarget||g.fromElement)&&(Rn(_t)||_t[js]))break e;if((Me||ke)&&(ke=Ie.window===Ie?Ie:(ke=Ie.ownerDocument)?ke.defaultView||ke.parentWindow:window,Me?(_t=g.relatedTarget||g.toElement,Me=_e,_t=_t?Rn(_t):null,_t!==null&&(di=s(_t),Yt=_t.tag,_t!==di||Yt!==5&&Yt!==27&&Yt!==6)&&(_t=null)):(Me=null,_t=_e),Me!==_t)){if(Yt=mx,He="onMouseLeave",me="onMouseEnter",fe="mouse",(c==="pointerout"||c==="pointerover")&&(Yt=Fa,He="onPointerLeave",me="onPointerEnter",fe="pointer"),di=Me==null?ke:wr(Me),Se=_t==null?ke:wr(_t),ke=new Yt(He,fe+"leave",Me,g,Ie),ke.target=di,ke.relatedTarget=Se,He=null,Rn(Ie)===_e&&(Yt=new Yt(me,fe+"enter",_t,g,Ie),Yt.target=Se,Yt.relatedTarget=di,He=Yt),di=He,Me&&_t)t:{for(Yt=xX,me=Me,fe=_t,Se=0,He=me;He;He=Yt(He))Se++;He=0;for(var Ft=fe;Ft;Ft=Yt(Ft))He++;for(;0<Se-He;)me=Yt(me),Se--;for(;0<He-Se;)fe=Yt(fe),He--;for(;Se--;){if(me===fe||fe!==null&&me===fe.alternate){Yt=me;break t}me=Yt(me),fe=Yt(fe)}Yt=null}else Yt=null;Me!==null&&P3(Ue,ke,Me,Yt,!1),_t!==null&&di!==null&&P3(Ue,di,_t,Yt,!0)}}e:{if(ke=_e?wr(_e):window,Me=ke.nodeName&&ke.nodeName.toLowerCase(),Me==="select"||Me==="input"&&ke.type==="file")var Ln=te;else if(Qu(ke))if(ne)Ln=Vt;else{Ln=At;var Mt=yt}else Me=ke.nodeName,!Me||Me.toLowerCase()!=="input"||ke.type!=="checkbox"&&ke.type!=="radio"?_e&&Ol(_e.elementType)&&(Ln=te):Ln=jt;if(Ln&&(Ln=Ln(c,_e))){Cx(Ue,Ln,g,Ie);break e}Mt&&Mt(c,ke,_e),c==="focusout"&&_e&&ke.type==="number"&&_e.memoizedProps.value!=null&&kc(ke,"number",ke.value)}switch(Mt=_e?wr(_e):window,c){case"focusin":(Qu(Mt)||Mt.contentEditable==="true")&&(ii=Mt,ls=_e,pr=null);break;case"focusout":pr=ls=ii=null;break;case"mousedown":Es=!0;break;case"contextmenu":case"mouseup":case"dragend":Es=!1,ao(Ue,g,Ie);break;case"selectionchange":if(Kn)break;case"keydown":case"keyup":ao(Ue,g,Ie)}var hn;if(Zf)e:{switch(c){case"compositionstart":var Cn="onCompositionStart";break e;case"compositionend":Cn="onCompositionEnd";break e;case"compositionupdate":Cn="onCompositionUpdate";break e}Cn=void 0}else Dc?Td(c,g)&&(Cn="onCompositionEnd"):c==="keydown"&&g.keyCode===229&&(Cn="onCompositionStart");Cn&&(Yg&&g.locale!=="ko"&&(Dc||Cn!=="onCompositionStart"?Cn==="onCompositionEnd"&&Dc&&(hn=Pg()):(zs=Ie,Ml="value"in zs?zs.value:zs.textContent,Dc=!0)),Mt=pb(_e,Cn),0<Mt.length&&(Cn=new gx(Cn,c,null,g,Ie),Ue.push({event:Cn,listeners:Mt}),hn?Cn.data=hn:(hn=fr(g),hn!==null&&(Cn.data=hn)))),(hn=Uj?nr(c,g):jx(c,g))&&(Cn=pb(_e,"onBeforeInput"),0<Cn.length&&(Mt=new gx("onBeforeInput","beforeinput",null,g,Ie),Ue.push({event:Mt,listeners:Cn}),Mt.data=hn)),mX(Ue,c,_e,g,Ie)}B3(Ue,h)})}function y0(c,h,g){return{instance:c,listener:h,currentTarget:g}}function pb(c,h){for(var g=h+"Capture",x=[];c!==null;){var _=c,O=_.stateNode;if(_=_.tag,_!==5&&_!==26&&_!==27||O===null||(_=ca(c,g),_!=null&&x.unshift(y0(c,_,O)),_=ca(c,h),_!=null&&x.push(y0(c,_,O))),c.tag===3)return x;c=c.return}return[]}function xX(c){if(c===null)return null;do c=c.return;while(c&&c.tag!==5&&c.tag!==27);return c||null}function P3(c,h,g,x,_){for(var O=h._reactName,B=[];g!==null&&g!==x;){var Z=g,ae=Z.alternate,_e=Z.stateNode;if(Z=Z.tag,ae!==null&&ae===x)break;Z!==5&&Z!==26&&Z!==27||_e===null||(ae=_e,_?(_e=ca(g,O),_e!=null&&B.unshift(y0(g,_e,ae))):_||(_e=ca(g,O),_e!=null&&B.push(y0(g,_e,ae)))),g=g.return}B.length!==0&&c.push({event:h,listeners:B})}var bX=/\r\n?/g,AX=/\u0000|\uFFFD/g;function F3(c){return(typeof c=="string"?c:""+c).replace(bX,`
`).replace(AX,"")}function $3(c,h){return h=F3(h),F3(c)===h}function hi(c,h,g,x,_,O){switch(g){case"children":typeof x=="string"?h==="body"||h==="textarea"&&x===""||Ht(c,x):(typeof x=="number"||typeof x=="bigint")&&h!=="body"&&Ht(c,""+x);break;case"className":os(c,"class",x);break;case"tabIndex":os(c,"tabindex",x);break;case"dir":case"role":case"viewBox":case"width":case"height":os(c,g,x);break;case"style":qn(c,x,O);break;case"data":if(h!=="object"){os(c,"data",x);break}case"src":case"href":if(x===""&&(h!=="a"||g!=="href")){c.removeAttribute(g);break}if(x==null||typeof x=="function"||typeof x=="symbol"||typeof x=="boolean"){c.removeAttribute(g);break}x=la(""+x),c.setAttribute(g,x);break;case"action":case"formAction":if(typeof x=="function"){c.setAttribute(g,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof O=="function"&&(g==="formAction"?(h!=="input"&&hi(c,h,"name",_.name,_,null),hi(c,h,"formEncType",_.formEncType,_,null),hi(c,h,"formMethod",_.formMethod,_,null),hi(c,h,"formTarget",_.formTarget,_,null)):(hi(c,h,"encType",_.encType,_,null),hi(c,h,"method",_.method,_,null),hi(c,h,"target",_.target,_,null)));if(x==null||typeof x=="symbol"||typeof x=="boolean"){c.removeAttribute(g);break}x=la(""+x),c.setAttribute(g,x);break;case"onClick":x!=null&&(c.onclick=at);break;case"onScroll":x!=null&&An("scroll",c);break;case"onScrollEnd":x!=null&&An("scrollend",c);break;case"dangerouslySetInnerHTML":if(x!=null){if(typeof x!="object"||!("__html"in x))throw Error(i(61));if(g=x.__html,g!=null){if(_.children!=null)throw Error(i(60));c.innerHTML=g}}break;case"multiple":c.multiple=x&&typeof x!="function"&&typeof x!="symbol";break;case"muted":c.muted=x&&typeof x!="function"&&typeof x!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(x==null||typeof x=="function"||typeof x=="boolean"||typeof x=="symbol"){c.removeAttribute("xlink:href");break}g=la(""+x),c.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",g);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":x!=null&&typeof x!="function"&&typeof x!="symbol"?c.setAttribute(g,""+x):c.removeAttribute(g);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":x&&typeof x!="function"&&typeof x!="symbol"?c.setAttribute(g,""):c.removeAttribute(g);break;case"capture":case"download":x===!0?c.setAttribute(g,""):x!==!1&&x!=null&&typeof x!="function"&&typeof x!="symbol"?c.setAttribute(g,x):c.removeAttribute(g);break;case"cols":case"rows":case"size":case"span":x!=null&&typeof x!="function"&&typeof x!="symbol"&&!isNaN(x)&&1<=x?c.setAttribute(g,x):c.removeAttribute(g);break;case"rowSpan":case"start":x==null||typeof x=="function"||typeof x=="symbol"||isNaN(x)?c.removeAttribute(g):c.setAttribute(g,x);break;case"popover":An("beforetoggle",c),An("toggle",c),Sr(c,"popover",x);break;case"xlinkActuate":ei(c,"http://www.w3.org/1999/xlink","xlink:actuate",x);break;case"xlinkArcrole":ei(c,"http://www.w3.org/1999/xlink","xlink:arcrole",x);break;case"xlinkRole":ei(c,"http://www.w3.org/1999/xlink","xlink:role",x);break;case"xlinkShow":ei(c,"http://www.w3.org/1999/xlink","xlink:show",x);break;case"xlinkTitle":ei(c,"http://www.w3.org/1999/xlink","xlink:title",x);break;case"xlinkType":ei(c,"http://www.w3.org/1999/xlink","xlink:type",x);break;case"xmlBase":ei(c,"http://www.w3.org/XML/1998/namespace","xml:base",x);break;case"xmlLang":ei(c,"http://www.w3.org/XML/1998/namespace","xml:lang",x);break;case"xmlSpace":ei(c,"http://www.w3.org/XML/1998/namespace","xml:space",x);break;case"is":Sr(c,"is",x);break;case"innerText":case"textContent":break;default:(!(2<g.length)||g[0]!=="o"&&g[0]!=="O"||g[1]!=="n"&&g[1]!=="N")&&(g=ks.get(g)||g,Sr(c,g,x))}}function v_(c,h,g,x,_,O){switch(g){case"style":qn(c,x,O);break;case"dangerouslySetInnerHTML":if(x!=null){if(typeof x!="object"||!("__html"in x))throw Error(i(61));if(g=x.__html,g!=null){if(_.children!=null)throw Error(i(60));c.innerHTML=g}}break;case"children":typeof x=="string"?Ht(c,x):(typeof x=="number"||typeof x=="bigint")&&Ht(c,""+x);break;case"onScroll":x!=null&&An("scroll",c);break;case"onScrollEnd":x!=null&&An("scrollend",c);break;case"onClick":x!=null&&(c.onclick=at);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!aa.hasOwnProperty(g))e:{if(g[0]==="o"&&g[1]==="n"&&(_=g.endsWith("Capture"),h=g.slice(2,_?g.length-7:void 0),O=c[Qr]||null,O=O!=null?O[g]:null,typeof O=="function"&&c.removeEventListener(h,O,_),typeof x=="function")){typeof O!="function"&&O!==null&&(g in c?c[g]=null:c.hasAttribute(g)&&c.removeAttribute(g)),c.addEventListener(h,x,_);break e}g in c?c[g]=x:x===!0?c.setAttribute(g,""):Sr(c,g,x)}}}function fs(c,h,g){switch(h){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":An("error",c),An("load",c);var x=!1,_=!1,O;for(O in g)if(g.hasOwnProperty(O)){var B=g[O];if(B!=null)switch(O){case"src":x=!0;break;case"srcSet":_=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,h));default:hi(c,h,O,B,g,null)}}_&&hi(c,h,"srcSet",g.srcSet,g,null),x&&hi(c,h,"src",g.src,g,null);return;case"input":An("invalid",c);var Z=O=B=_=null,ae=null,_e=null;for(x in g)if(g.hasOwnProperty(x)){var Ie=g[x];if(Ie!=null)switch(x){case"name":_=Ie;break;case"type":B=Ie;break;case"checked":ae=Ie;break;case"defaultChecked":_e=Ie;break;case"value":O=Ie;break;case"defaultValue":Z=Ie;break;case"children":case"dangerouslySetInnerHTML":if(Ie!=null)throw Error(i(137,h));break;default:hi(c,h,x,Ie,g,null)}}_c(c,O,Z,ae,_e,B,_,!1);return;case"select":An("invalid",c),x=B=O=null;for(_ in g)if(g.hasOwnProperty(_)&&(Z=g[_],Z!=null))switch(_){case"value":O=Z;break;case"defaultValue":B=Z;break;case"multiple":x=Z;default:hi(c,h,_,Z,g,null)}h=O,g=B,c.multiple=!!x,h!=null?dr(c,!!x,h,!1):g!=null&&dr(c,!!x,g,!0);return;case"textarea":An("invalid",c),O=_=x=null;for(B in g)if(g.hasOwnProperty(B)&&(Z=g[B],Z!=null))switch(B){case"value":x=Z;break;case"defaultValue":_=Z;break;case"children":O=Z;break;case"dangerouslySetInnerHTML":if(Z!=null)throw Error(i(91));break;default:hi(c,h,B,Z,g,null)}La(c,x,_,O);return;case"option":for(ae in g)if(g.hasOwnProperty(ae)&&(x=g[ae],x!=null))switch(ae){case"selected":c.selected=x&&typeof x!="function"&&typeof x!="symbol";break;default:hi(c,h,ae,x,g,null)}return;case"dialog":An("beforetoggle",c),An("toggle",c),An("cancel",c),An("close",c);break;case"iframe":case"object":An("load",c);break;case"video":case"audio":for(x=0;x<v0.length;x++)An(v0[x],c);break;case"image":An("error",c),An("load",c);break;case"details":An("toggle",c);break;case"embed":case"source":case"link":An("error",c),An("load",c);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(_e in g)if(g.hasOwnProperty(_e)&&(x=g[_e],x!=null))switch(_e){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,h));default:hi(c,h,_e,x,g,null)}return;default:if(Ol(h)){for(Ie in g)g.hasOwnProperty(Ie)&&(x=g[Ie],x!==void 0&&v_(c,h,Ie,x,g,void 0));return}}for(Z in g)g.hasOwnProperty(Z)&&(x=g[Z],x!=null&&hi(c,h,Z,x,g,null))}function wX(c,h,g,x){switch(h){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var _=null,O=null,B=null,Z=null,ae=null,_e=null,Ie=null;for(Me in g){var Ue=g[Me];if(g.hasOwnProperty(Me)&&Ue!=null)switch(Me){case"checked":break;case"value":break;case"defaultValue":ae=Ue;default:x.hasOwnProperty(Me)||hi(c,h,Me,null,x,Ue)}}for(var ke in x){var Me=x[ke];if(Ue=g[ke],x.hasOwnProperty(ke)&&(Me!=null||Ue!=null))switch(ke){case"type":O=Me;break;case"name":_=Me;break;case"checked":_e=Me;break;case"defaultChecked":Ie=Me;break;case"value":B=Me;break;case"defaultValue":Z=Me;break;case"children":case"dangerouslySetInnerHTML":if(Me!=null)throw Error(i(137,h));break;default:Me!==Ue&&hi(c,h,ke,Me,x,Ue)}}Bu(c,B,Z,ae,_e,Ie,O,_);return;case"select":Me=B=Z=ke=null;for(O in g)if(ae=g[O],g.hasOwnProperty(O)&&ae!=null)switch(O){case"value":break;case"multiple":Me=ae;default:x.hasOwnProperty(O)||hi(c,h,O,null,x,ae)}for(_ in x)if(O=x[_],ae=g[_],x.hasOwnProperty(_)&&(O!=null||ae!=null))switch(_){case"value":ke=O;break;case"defaultValue":Z=O;break;case"multiple":B=O;default:O!==ae&&hi(c,h,_,O,x,ae)}h=Z,g=B,x=Me,ke!=null?dr(c,!!g,ke,!1):!!x!=!!g&&(h!=null?dr(c,!!g,h,!0):dr(c,!!g,g?[]:"",!1));return;case"textarea":Me=ke=null;for(Z in g)if(_=g[Z],g.hasOwnProperty(Z)&&_!=null&&!x.hasOwnProperty(Z))switch(Z){case"value":break;case"children":break;default:hi(c,h,Z,null,x,_)}for(B in x)if(_=x[B],O=g[B],x.hasOwnProperty(B)&&(_!=null||O!=null))switch(B){case"value":ke=_;break;case"defaultValue":Me=_;break;case"children":break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(i(91));break;default:_!==O&&hi(c,h,B,_,x,O)}Tc(c,ke,Me);return;case"option":for(var _t in g)if(ke=g[_t],g.hasOwnProperty(_t)&&ke!=null&&!x.hasOwnProperty(_t))switch(_t){case"selected":c.selected=!1;break;default:hi(c,h,_t,null,x,ke)}for(ae in x)if(ke=x[ae],Me=g[ae],x.hasOwnProperty(ae)&&ke!==Me&&(ke!=null||Me!=null))switch(ae){case"selected":c.selected=ke&&typeof ke!="function"&&typeof ke!="symbol";break;default:hi(c,h,ae,ke,x,Me)}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 Yt in g)ke=g[Yt],g.hasOwnProperty(Yt)&&ke!=null&&!x.hasOwnProperty(Yt)&&hi(c,h,Yt,null,x,ke);for(_e in x)if(ke=x[_e],Me=g[_e],x.hasOwnProperty(_e)&&ke!==Me&&(ke!=null||Me!=null))switch(_e){case"children":case"dangerouslySetInnerHTML":if(ke!=null)throw Error(i(137,h));break;default:hi(c,h,_e,ke,x,Me)}return;default:if(Ol(h)){for(var di in g)ke=g[di],g.hasOwnProperty(di)&&ke!==void 0&&!x.hasOwnProperty(di)&&v_(c,h,di,void 0,x,ke);for(Ie in x)ke=x[Ie],Me=g[Ie],!x.hasOwnProperty(Ie)||ke===Me||ke===void 0&&Me===void 0||v_(c,h,Ie,ke,x,Me);return}}for(var me in g)ke=g[me],g.hasOwnProperty(me)&&ke!=null&&!x.hasOwnProperty(me)&&hi(c,h,me,null,x,ke);for(Ue in x)ke=x[Ue],Me=g[Ue],!x.hasOwnProperty(Ue)||ke===Me||ke==null&&Me==null||hi(c,h,Ue,ke,x,Me)}function z3(c){switch(c){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function SX(){if(typeof performance.getEntriesByType=="function"){for(var c=0,h=0,g=performance.getEntriesByType("resource"),x=0;x<g.length;x++){var _=g[x],O=_.transferSize,B=_.initiatorType,Z=_.duration;if(O&&Z&&z3(B)){for(B=0,Z=_.responseEnd,x+=1;x<g.length;x++){var ae=g[x],_e=ae.startTime;if(_e>Z)break;var Ie=ae.transferSize,Ue=ae.initiatorType;Ie&&z3(Ue)&&(ae=ae.responseEnd,B+=Ie*(ae<Z?1:(Z-_e)/(ae-_e)))}if(--x,h+=8*(O+B)/(_.duration/1e3),c++,10<c)break}}if(0<c)return h/c/1e6}return navigator.connection&&(c=navigator.connection.downlink,typeof c=="number")?c:5}var y_=null,x_=null;function mb(c){return c.nodeType===9?c:c.ownerDocument}function H3(c){switch(c){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function q3(c,h){if(c===0)switch(h){case"svg":return 1;case"math":return 2;default:return 0}return c===1&&h==="foreignObject"?0:c}function b_(c,h){return c==="textarea"||c==="noscript"||typeof h.children=="string"||typeof h.children=="number"||typeof h.children=="bigint"||typeof h.dangerouslySetInnerHTML=="object"&&h.dangerouslySetInnerHTML!==null&&h.dangerouslySetInnerHTML.__html!=null}var A_=null;function jX(){var c=window.event;return c&&c.type==="popstate"?c===A_?!1:(A_=c,!0):(A_=null,!1)}var Q3=typeof setTimeout=="function"?setTimeout:void 0,CX=typeof clearTimeout=="function"?clearTimeout:void 0,Y3=typeof Promise=="function"?Promise:void 0,_X=typeof queueMicrotask=="function"?queueMicrotask:typeof Y3<"u"?function(c){return Y3.resolve(null).then(c).catch(kX)}:Q3;function kX(c){setTimeout(function(){throw c})}function ah(c){return c==="head"}function W3(c,h){var g=h,x=0;do{var _=g.nextSibling;if(c.removeChild(g),_&&_.nodeType===8)if(g=_.data,g==="/$"||g==="/&"){if(x===0){c.removeChild(_),jp(h);return}x--}else if(g==="$"||g==="$?"||g==="$~"||g==="$!"||g==="&")x++;else if(g==="html")x0(c.ownerDocument.documentElement);else if(g==="head"){g=c.ownerDocument.head,x0(g);for(var O=g.firstChild;O;){var B=O.nextSibling,Z=O.nodeName;O[Ei]||Z==="SCRIPT"||Z==="STYLE"||Z==="LINK"&&O.rel.toLowerCase()==="stylesheet"||g.removeChild(O),O=B}}else g==="body"&&x0(c.ownerDocument.body);g=_}while(g);jp(h)}function U3(c,h){var g=c;c=0;do{var x=g.nextSibling;if(g.nodeType===1?h?(g._stashedDisplay=g.style.display,g.style.display="none"):(g.style.display=g._stashedDisplay||"",g.getAttribute("style")===""&&g.removeAttribute("style")):g.nodeType===3&&(h?(g._stashedText=g.nodeValue,g.nodeValue=""):g.nodeValue=g._stashedText||""),x&&x.nodeType===8)if(g=x.data,g==="/$"){if(c===0)break;c--}else g!=="$"&&g!=="$?"&&g!=="$~"&&g!=="$!"||c++;g=x}while(g)}function w_(c){var h=c.firstChild;for(h&&h.nodeType===10&&(h=h.nextSibling);h;){var g=h;switch(h=h.nextSibling,g.nodeName){case"HTML":case"HEAD":case"BODY":w_(g),$i(g);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(g.rel.toLowerCase()==="stylesheet")continue}c.removeChild(g)}}function TX(c,h,g,x){for(;c.nodeType===1;){var _=g;if(c.nodeName.toLowerCase()!==h.toLowerCase()){if(!x&&(c.nodeName!=="INPUT"||c.type!=="hidden"))break}else if(x){if(!c[Ei])switch(h){case"meta":if(!c.hasAttribute("itemprop"))break;return c;case"link":if(O=c.getAttribute("rel"),O==="stylesheet"&&c.hasAttribute("data-precedence"))break;if(O!==_.rel||c.getAttribute("href")!==(_.href==null||_.href===""?null:_.href)||c.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin)||c.getAttribute("title")!==(_.title==null?null:_.title))break;return c;case"style":if(c.hasAttribute("data-precedence"))break;return c;case"script":if(O=c.getAttribute("src"),(O!==(_.src==null?null:_.src)||c.getAttribute("type")!==(_.type==null?null:_.type)||c.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin))&&O&&c.hasAttribute("async")&&!c.hasAttribute("itemprop"))break;return c;default:return c}}else if(h==="input"&&c.type==="hidden"){var O=_.name==null?null:""+_.name;if(_.type==="hidden"&&c.getAttribute("name")===O)return c}else return c;if(c=va(c.nextSibling),c===null)break}return null}function OX(c,h,g){if(h==="")return null;for(;c.nodeType!==3;)if((c.nodeType!==1||c.nodeName!=="INPUT"||c.type!=="hidden")&&!g||(c=va(c.nextSibling),c===null))return null;return c}function V3(c,h){for(;c.nodeType!==8;)if((c.nodeType!==1||c.nodeName!=="INPUT"||c.type!=="hidden")&&!h||(c=va(c.nextSibling),c===null))return null;return c}function S_(c){return c.data==="$?"||c.data==="$~"}function j_(c){return c.data==="$!"||c.data==="$?"&&c.ownerDocument.readyState!=="loading"}function EX(c,h){var g=c.ownerDocument;if(c.data==="$~")c._reactRetry=h;else if(c.data!=="$?"||g.readyState!=="loading")h();else{var x=function(){h(),g.removeEventListener("DOMContentLoaded",x)};g.addEventListener("DOMContentLoaded",x),c._reactRetry=x}}function va(c){for(;c!=null;c=c.nextSibling){var h=c.nodeType;if(h===1||h===3)break;if(h===8){if(h=c.data,h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"||h==="F!"||h==="F")break;if(h==="/$"||h==="/&")return null}}return c}var C_=null;function G3(c){c=c.nextSibling;for(var h=0;c;){if(c.nodeType===8){var g=c.data;if(g==="/$"||g==="/&"){if(h===0)return va(c.nextSibling);h--}else g!=="$"&&g!=="$!"&&g!=="$?"&&g!=="$~"&&g!=="&"||h++}c=c.nextSibling}return null}function X3(c){c=c.previousSibling;for(var h=0;c;){if(c.nodeType===8){var g=c.data;if(g==="$"||g==="$!"||g==="$?"||g==="$~"||g==="&"){if(h===0)return c;h--}else g!=="/$"&&g!=="/&"||h++}c=c.previousSibling}return null}function K3(c,h,g){switch(h=mb(g),c){case"html":if(c=h.documentElement,!c)throw Error(i(452));return c;case"head":if(c=h.head,!c)throw Error(i(453));return c;case"body":if(c=h.body,!c)throw Error(i(454));return c;default:throw Error(i(451))}}function x0(c){for(var h=c.attributes;h.length;)c.removeAttributeNode(h[0]);$i(c)}var ya=new Map,Z3=new Set;function gb(c){return typeof c.getRootNode=="function"?c.getRootNode():c.nodeType===9?c:c.ownerDocument}var Gc=P.d;P.d={f:MX,r:RX,D:DX,C:NX,L:IX,m:BX,X:PX,S:LX,M:FX};function MX(){var c=Gc.f(),h=ab();return c||h}function RX(c){var h=ro(c);h!==null&&h.tag===5&&h.type==="form"?mI(h):Gc.r(c)}var Ap=typeof document>"u"?null:document;function J3(c,h,g){var x=Ap;if(x&&typeof h=="string"&&h){var _=as(h);_='link[rel="'+c+'"][href="'+_+'"]',typeof g=="string"&&(_+='[crossorigin="'+g+'"]'),Z3.has(_)||(Z3.add(_),c={rel:c,crossOrigin:g,href:h},x.querySelector(_)===null&&(h=x.createElement("link"),fs(h,"link",c),Wi(h),x.head.appendChild(h)))}}function DX(c){Gc.D(c),J3("dns-prefetch",c,null)}function NX(c,h){Gc.C(c,h),J3("preconnect",c,h)}function IX(c,h,g){Gc.L(c,h,g);var x=Ap;if(x&&c&&h){var _='link[rel="preload"][as="'+as(h)+'"]';h==="image"&&g&&g.imageSrcSet?(_+='[imagesrcset="'+as(g.imageSrcSet)+'"]',typeof g.imageSizes=="string"&&(_+='[imagesizes="'+as(g.imageSizes)+'"]')):_+='[href="'+as(c)+'"]';var O=_;switch(h){case"style":O=wp(c);break;case"script":O=Sp(c)}ya.has(O)||(c=p({rel:"preload",href:h==="image"&&g&&g.imageSrcSet?void 0:c,as:h},g),ya.set(O,c),x.querySelector(_)!==null||h==="style"&&x.querySelector(b0(O))||h==="script"&&x.querySelector(A0(O))||(h=x.createElement("link"),fs(h,"link",c),Wi(h),x.head.appendChild(h)))}}function BX(c,h){Gc.m(c,h);var g=Ap;if(g&&c){var x=h&&typeof h.as=="string"?h.as:"script",_='link[rel="modulepreload"][as="'+as(x)+'"][href="'+as(c)+'"]',O=_;switch(x){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":O=Sp(c)}if(!ya.has(O)&&(c=p({rel:"modulepreload",href:c},h),ya.set(O,c),g.querySelector(_)===null)){switch(x){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(g.querySelector(A0(O)))return}x=g.createElement("link"),fs(x,"link",c),Wi(x),g.head.appendChild(x)}}}function LX(c,h,g){Gc.S(c,h,g);var x=Ap;if(x&&c){var _=so(x).hoistableStyles,O=wp(c);h=h||"default";var B=_.get(O);if(!B){var Z={loading:0,preload:null};if(B=x.querySelector(b0(O)))Z.loading=5;else{c=p({rel:"stylesheet",href:c,"data-precedence":h},g),(g=ya.get(O))&&__(c,g);var ae=B=x.createElement("link");Wi(ae),fs(ae,"link",c),ae._p=new Promise(function(_e,Ie){ae.onload=_e,ae.onerror=Ie}),ae.addEventListener("load",function(){Z.loading|=1}),ae.addEventListener("error",function(){Z.loading|=2}),Z.loading|=4,vb(B,h,x)}B={type:"stylesheet",instance:B,count:1,state:Z},_.set(O,B)}}}function PX(c,h){Gc.X(c,h);var g=Ap;if(g&&c){var x=so(g).hoistableScripts,_=Sp(c),O=x.get(_);O||(O=g.querySelector(A0(_)),O||(c=p({src:c,async:!0},h),(h=ya.get(_))&&k_(c,h),O=g.createElement("script"),Wi(O),fs(O,"link",c),g.head.appendChild(O)),O={type:"script",instance:O,count:1,state:null},x.set(_,O))}}function FX(c,h){Gc.M(c,h);var g=Ap;if(g&&c){var x=so(g).hoistableScripts,_=Sp(c),O=x.get(_);O||(O=g.querySelector(A0(_)),O||(c=p({src:c,async:!0,type:"module"},h),(h=ya.get(_))&&k_(c,h),O=g.createElement("script"),Wi(O),fs(O,"link",c),g.head.appendChild(O)),O={type:"script",instance:O,count:1,state:null},x.set(_,O))}}function eB(c,h,g,x){var _=(_=ce.current)?gb(_):null;if(!_)throw Error(i(446));switch(c){case"meta":case"title":return null;case"style":return typeof g.precedence=="string"&&typeof g.href=="string"?(h=wp(g.href),g=so(_).hoistableStyles,x=g.get(h),x||(x={type:"style",instance:null,count:0,state:null},g.set(h,x)),x):{type:"void",instance:null,count:0,state:null};case"link":if(g.rel==="stylesheet"&&typeof g.href=="string"&&typeof g.precedence=="string"){c=wp(g.href);var O=so(_).hoistableStyles,B=O.get(c);if(B||(_=_.ownerDocument||_,B={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},O.set(c,B),(O=_.querySelector(b0(c)))&&!O._p&&(B.instance=O,B.state.loading=5),ya.has(c)||(g={rel:"preload",as:"style",href:g.href,crossOrigin:g.crossOrigin,integrity:g.integrity,media:g.media,hrefLang:g.hrefLang,referrerPolicy:g.referrerPolicy},ya.set(c,g),O||$X(_,c,g,B.state))),h&&x===null)throw Error(i(528,""));return B}if(h&&x!==null)throw Error(i(529,""));return null;case"script":return h=g.async,g=g.src,typeof g=="string"&&h&&typeof h!="function"&&typeof h!="symbol"?(h=Sp(g),g=so(_).hoistableScripts,x=g.get(h),x||(x={type:"script",instance:null,count:0,state:null},g.set(h,x)),x):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,c))}}function wp(c){return'href="'+as(c)+'"'}function b0(c){return'link[rel="stylesheet"]['+c+"]"}function tB(c){return p({},c,{"data-precedence":c.precedence,precedence:null})}function $X(c,h,g,x){c.querySelector('link[rel="preload"][as="style"]['+h+"]")?x.loading=1:(h=c.createElement("link"),x.preload=h,h.addEventListener("load",function(){return x.loading|=1}),h.addEventListener("error",function(){return x.loading|=2}),fs(h,"link",g),Wi(h),c.head.appendChild(h))}function Sp(c){return'[src="'+as(c)+'"]'}function A0(c){return"script[async]"+c}function nB(c,h,g){if(h.count++,h.instance===null)switch(h.type){case"style":var x=c.querySelector('style[data-href~="'+as(g.href)+'"]');if(x)return h.instance=x,Wi(x),x;var _=p({},g,{"data-href":g.href,"data-precedence":g.precedence,href:null,precedence:null});return x=(c.ownerDocument||c).createElement("style"),Wi(x),fs(x,"style",_),vb(x,g.precedence,c),h.instance=x;case"stylesheet":_=wp(g.href);var O=c.querySelector(b0(_));if(O)return h.state.loading|=4,h.instance=O,Wi(O),O;x=tB(g),(_=ya.get(_))&&__(x,_),O=(c.ownerDocument||c).createElement("link"),Wi(O);var B=O;return B._p=new Promise(function(Z,ae){B.onload=Z,B.onerror=ae}),fs(O,"link",x),h.state.loading|=4,vb(O,g.precedence,c),h.instance=O;case"script":return O=Sp(g.src),(_=c.querySelector(A0(O)))?(h.instance=_,Wi(_),_):(x=g,(_=ya.get(O))&&(x=p({},g),k_(x,_)),c=c.ownerDocument||c,_=c.createElement("script"),Wi(_),fs(_,"link",x),c.head.appendChild(_),h.instance=_);case"void":return null;default:throw Error(i(443,h.type))}else h.type==="stylesheet"&&(h.state.loading&4)===0&&(x=h.instance,h.state.loading|=4,vb(x,g.precedence,c));return h.instance}function vb(c,h,g){for(var x=g.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),_=x.length?x[x.length-1]:null,O=_,B=0;B<x.length;B++){var Z=x[B];if(Z.dataset.precedence===h)O=Z;else if(O!==_)break}O?O.parentNode.insertBefore(c,O.nextSibling):(h=g.nodeType===9?g.head:g,h.insertBefore(c,h.firstChild))}function __(c,h){c.crossOrigin==null&&(c.crossOrigin=h.crossOrigin),c.referrerPolicy==null&&(c.referrerPolicy=h.referrerPolicy),c.title==null&&(c.title=h.title)}function k_(c,h){c.crossOrigin==null&&(c.crossOrigin=h.crossOrigin),c.referrerPolicy==null&&(c.referrerPolicy=h.referrerPolicy),c.integrity==null&&(c.integrity=h.integrity)}var yb=null;function iB(c,h,g){if(yb===null){var x=new Map,_=yb=new Map;_.set(g,x)}else _=yb,x=_.get(g),x||(x=new Map,_.set(g,x));if(x.has(c))return x;for(x.set(c,null),g=g.getElementsByTagName(c),_=0;_<g.length;_++){var O=g[_];if(!(O[Ei]||O[li]||c==="link"&&O.getAttribute("rel")==="stylesheet")&&O.namespaceURI!=="http://www.w3.org/2000/svg"){var B=O.getAttribute(h)||"";B=c+B;var Z=x.get(B);Z?Z.push(O):x.set(B,[O])}}return x}function rB(c,h,g){c=c.ownerDocument||c,c.head.insertBefore(g,h==="title"?c.querySelector("head > title"):null)}function zX(c,h,g){if(g===1||h.itemProp!=null)return!1;switch(c){case"meta":case"title":return!0;case"style":if(typeof h.precedence!="string"||typeof h.href!="string"||h.href==="")break;return!0;case"link":if(typeof h.rel!="string"||typeof h.href!="string"||h.href===""||h.onLoad||h.onError)break;switch(h.rel){case"stylesheet":return c=h.disabled,typeof h.precedence=="string"&&c==null;default:return!0}case"script":if(h.async&&typeof h.async!="function"&&typeof h.async!="symbol"&&!h.onLoad&&!h.onError&&h.src&&typeof h.src=="string")return!0}return!1}function sB(c){return!(c.type==="stylesheet"&&(c.state.loading&3)===0)}function HX(c,h,g,x){if(g.type==="stylesheet"&&(typeof x.media!="string"||matchMedia(x.media).matches!==!1)&&(g.state.loading&4)===0){if(g.instance===null){var _=wp(x.href),O=h.querySelector(b0(_));if(O){h=O._p,h!==null&&typeof h=="object"&&typeof h.then=="function"&&(c.count++,c=xb.bind(c),h.then(c,c)),g.state.loading|=4,g.instance=O,Wi(O);return}O=h.ownerDocument||h,x=tB(x),(_=ya.get(_))&&__(x,_),O=O.createElement("link"),Wi(O);var B=O;B._p=new Promise(function(Z,ae){B.onload=Z,B.onerror=ae}),fs(O,"link",x),g.instance=O}c.stylesheets===null&&(c.stylesheets=new Map),c.stylesheets.set(g,h),(h=g.state.preload)&&(g.state.loading&3)===0&&(c.count++,g=xb.bind(c),h.addEventListener("load",g),h.addEventListener("error",g))}}var T_=0;function qX(c,h){return c.stylesheets&&c.count===0&&Ab(c,c.stylesheets),0<c.count||0<c.imgCount?function(g){var x=setTimeout(function(){if(c.stylesheets&&Ab(c,c.stylesheets),c.unsuspend){var O=c.unsuspend;c.unsuspend=null,O()}},6e4+h);0<c.imgBytes&&T_===0&&(T_=62500*SX());var _=setTimeout(function(){if(c.waitingForImages=!1,c.count===0&&(c.stylesheets&&Ab(c,c.stylesheets),c.unsuspend)){var O=c.unsuspend;c.unsuspend=null,O()}},(c.imgBytes>T_?50:800)+h);return c.unsuspend=g,function(){c.unsuspend=null,clearTimeout(x),clearTimeout(_)}}:null}function xb(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ab(this,this.stylesheets);else if(this.unsuspend){var c=this.unsuspend;this.unsuspend=null,c()}}}var bb=null;function Ab(c,h){c.stylesheets=null,c.unsuspend!==null&&(c.count++,bb=new Map,h.forEach(QX,c),bb=null,xb.call(c))}function QX(c,h){if(!(h.state.loading&4)){var g=bb.get(c);if(g)var x=g.get(null);else{g=new Map,bb.set(c,g);for(var _=c.querySelectorAll("link[data-precedence],style[data-precedence]"),O=0;O<_.length;O++){var B=_[O];(B.nodeName==="LINK"||B.getAttribute("media")!=="not all")&&(g.set(B.dataset.precedence,B),x=B)}x&&g.set(null,x)}_=h.instance,B=_.getAttribute("data-precedence"),O=g.get(B)||x,O===x&&g.set(null,_),g.set(B,_),this.count++,x=xb.bind(this),_.addEventListener("load",x),_.addEventListener("error",x),O?O.parentNode.insertBefore(_,O.nextSibling):(c=c.nodeType===9?c.head:c,c.insertBefore(_,c.firstChild)),h.state.loading|=4}}var w0={$$typeof:j,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function YX(c,h,g,x,_,O,B,Z,ae){this.tag=1,this.containerInfo=c,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ut(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ut(0),this.hiddenUpdates=Ut(null),this.identifierPrefix=x,this.onUncaughtError=_,this.onCaughtError=O,this.onRecoverableError=B,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ae,this.incompleteTransitions=new Map}function oB(c,h,g,x,_,O,B,Z,ae,_e,Ie,Ue){return c=new YX(c,h,g,B,ae,_e,Ie,Ue,Z),h=1,O===!0&&(h|=24),O=Ro(3,null,null,h),c.current=O,O.stateNode=c,h=aC(),h.refCount++,c.pooledCache=h,h.refCount++,O.memoizedState={element:x,isDehydrated:g,cache:h},hC(O),c}function aB(c){return c?(c=ep,c):ep}function lB(c,h,g,x,_,O){_=aB(_),x.context===null?x.context=_:x.pendingContext=_,x=Xu(h),x.payload={element:g},O=O===void 0?null:O,O!==null&&(x.callback=O),g=Ku(c,x,h),g!==null&&(po(g,c,h),e0(g,c,h))}function cB(c,h){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var g=c.retryLane;c.retryLane=g!==0&&g<h?g:h}}function O_(c,h){cB(c,h),(c=c.alternate)&&cB(c,h)}function uB(c){if(c.tag===13||c.tag===31){var h=Ed(c,67108864);h!==null&&po(h,c,67108864),O_(c,67108864)}}function hB(c){if(c.tag===13||c.tag===31){var h=Lo();h=Tt(h);var g=Ed(c,h);g!==null&&po(g,c,h),O_(c,h)}}var wb=!0;function WX(c,h,g,x){var _=N.T;N.T=null;var O=P.p;try{P.p=2,E_(c,h,g,x)}finally{P.p=O,N.T=_}}function UX(c,h,g,x){var _=N.T;N.T=null;var O=P.p;try{P.p=8,E_(c,h,g,x)}finally{P.p=O,N.T=_}}function E_(c,h,g,x){if(wb){var _=M_(x);if(_===null)g_(c,h,x,Sb,g),fB(c,x);else if(GX(_,c,h,g,x))x.stopPropagation();else if(fB(c,x),h&4&&-1<VX.indexOf(c)){for(;_!==null;){var O=ro(_);if(O!==null)switch(O.tag){case 3:if(O=O.stateNode,O.current.memoizedState.isDehydrated){var B=gn(O.pendingLanes);if(B!==0){var Z=O;for(Z.pendingLanes|=2,Z.entangledLanes|=2;B;){var ae=1<<31-Lt(B);Z.entanglements[1]|=ae,B&=~ae}Ll(O),(Yn&6)===0&&(sb=Ee()+500,g0(0))}}break;case 31:case 13:Z=Ed(O,2),Z!==null&&po(Z,O,2),ab(),O_(O,2)}if(O=M_(x),O===null&&g_(c,h,x,Sb,g),O===_)break;_=O}_!==null&&x.stopPropagation()}else g_(c,h,x,null,g)}}function M_(c){return c=Wt(c),R_(c)}var Sb=null;function R_(c){if(Sb=null,c=Rn(c),c!==null){var h=s(c);if(h===null)c=null;else{var g=h.tag;if(g===13){if(c=a(h),c!==null)return c;c=null}else if(g===31){if(c=l(h),c!==null)return c;c=null}else if(g===3){if(h.stateNode.current.memoizedState.isDehydrated)return h.tag===3?h.stateNode.containerInfo:null;c=null}else h!==c&&(c=null)}}return Sb=c,null}function dB(c){switch(c){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Qe()){case Xe:return 2;case Ze:return 8;case vt:case pn:return 32;case mn:return 268435456;default:return 32}default:return 32}}var D_=!1,lh=null,ch=null,uh=null,S0=new Map,j0=new Map,hh=[],VX="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 fB(c,h){switch(c){case"focusin":case"focusout":lh=null;break;case"dragenter":case"dragleave":ch=null;break;case"mouseover":case"mouseout":uh=null;break;case"pointerover":case"pointerout":S0.delete(h.pointerId);break;case"gotpointercapture":case"lostpointercapture":j0.delete(h.pointerId)}}function C0(c,h,g,x,_,O){return c===null||c.nativeEvent!==O?(c={blockedOn:h,domEventName:g,eventSystemFlags:x,nativeEvent:O,targetContainers:[_]},h!==null&&(h=ro(h),h!==null&&uB(h)),c):(c.eventSystemFlags|=x,h=c.targetContainers,_!==null&&h.indexOf(_)===-1&&h.push(_),c)}function GX(c,h,g,x,_){switch(h){case"focusin":return lh=C0(lh,c,h,g,x,_),!0;case"dragenter":return ch=C0(ch,c,h,g,x,_),!0;case"mouseover":return uh=C0(uh,c,h,g,x,_),!0;case"pointerover":var O=_.pointerId;return S0.set(O,C0(S0.get(O)||null,c,h,g,x,_)),!0;case"gotpointercapture":return O=_.pointerId,j0.set(O,C0(j0.get(O)||null,c,h,g,x,_)),!0}return!1}function pB(c){var h=Rn(c.target);if(h!==null){var g=s(h);if(g!==null){if(h=g.tag,h===13){if(h=a(g),h!==null){c.blockedOn=h,gi(c.priority,function(){hB(g)});return}}else if(h===31){if(h=l(g),h!==null){c.blockedOn=h,gi(c.priority,function(){hB(g)});return}}else if(h===3&&g.stateNode.current.memoizedState.isDehydrated){c.blockedOn=g.tag===3?g.stateNode.containerInfo:null;return}}}c.blockedOn=null}function jb(c){if(c.blockedOn!==null)return!1;for(var h=c.targetContainers;0<h.length;){var g=M_(c.nativeEvent);if(g===null){g=c.nativeEvent;var x=new g.constructor(g.type,g);kt=x,g.target.dispatchEvent(x),kt=null}else return h=ro(g),h!==null&&uB(h),c.blockedOn=g,!1;h.shift()}return!0}function mB(c,h,g){jb(c)&&g.delete(h)}function XX(){D_=!1,lh!==null&&jb(lh)&&(lh=null),ch!==null&&jb(ch)&&(ch=null),uh!==null&&jb(uh)&&(uh=null),S0.forEach(mB),j0.forEach(mB)}function Cb(c,h){c.blockedOn===h&&(c.blockedOn=null,D_||(D_=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,XX)))}var _b=null;function gB(c){_b!==c&&(_b=c,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){_b===c&&(_b=null);for(var h=0;h<c.length;h+=3){var g=c[h],x=c[h+1],_=c[h+2];if(typeof x!="function"){if(R_(x||g)===null)continue;break}var O=ro(g);O!==null&&(c.splice(h,3),h-=3,MC(O,{pending:!0,data:_,method:g.method,action:x},x,_))}}))}function jp(c){function h(ae){return Cb(ae,c)}lh!==null&&Cb(lh,c),ch!==null&&Cb(ch,c),uh!==null&&Cb(uh,c),S0.forEach(h),j0.forEach(h);for(var g=0;g<hh.length;g++){var x=hh[g];x.blockedOn===c&&(x.blockedOn=null)}for(;0<hh.length&&(g=hh[0],g.blockedOn===null);)pB(g),g.blockedOn===null&&hh.shift();if(g=(c.ownerDocument||c).$$reactFormReplay,g!=null)for(x=0;x<g.length;x+=3){var _=g[x],O=g[x+1],B=_[Qr]||null;if(typeof O=="function")B||gB(g);else if(B){var Z=null;if(O&&O.hasAttribute("formAction")){if(_=O,B=O[Qr]||null)Z=B.formAction;else if(R_(_)!==null)continue}else Z=B.action;typeof Z=="function"?g[x+1]=Z:(g.splice(x,3),x-=3),gB(g)}}}function vB(){function c(O){O.canIntercept&&O.info==="react-transition"&&O.intercept({handler:function(){return new Promise(function(B){return _=B})},focusReset:"manual",scroll:"manual"})}function h(){_!==null&&(_(),_=null),x||setTimeout(g,20)}function g(){if(!x&&!navigation.transition){var O=navigation.currentEntry;O&&O.url!=null&&navigation.navigate(O.url,{state:O.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var x=!1,_=null;return navigation.addEventListener("navigate",c),navigation.addEventListener("navigatesuccess",h),navigation.addEventListener("navigateerror",h),setTimeout(g,100),function(){x=!0,navigation.removeEventListener("navigate",c),navigation.removeEventListener("navigatesuccess",h),navigation.removeEventListener("navigateerror",h),_!==null&&(_(),_=null)}}}function N_(c){this._internalRoot=c}kb.prototype.render=N_.prototype.render=function(c){var h=this._internalRoot;if(h===null)throw Error(i(409));var g=h.current,x=Lo();lB(g,x,c,h,null,null)},kb.prototype.unmount=N_.prototype.unmount=function(){var c=this._internalRoot;if(c!==null){this._internalRoot=null;var h=c.containerInfo;lB(c.current,2,null,c,null,null),ab(),h[js]=null}};function kb(c){this._internalRoot=c}kb.prototype.unstable_scheduleHydration=function(c){if(c){var h=vn();c={blockedOn:null,target:c,priority:h};for(var g=0;g<hh.length&&h!==0&&h<hh[g].priority;g++);hh.splice(g,0,c),g===0&&pB(c)}};var yB=e.version;if(yB!=="19.2.8")throw Error(i(527,yB,"19.2.8"));P.findDOMNode=function(c){var h=c._reactInternals;if(h===void 0)throw typeof c.render=="function"?Error(i(188)):(c=Object.keys(c).join(","),Error(i(268,c)));return c=d(h),c=c!==null?f(c):null,c=c===null?null:c.stateNode,c};var KX={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:N,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Tb=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Tb.isDisabled&&Tb.supportsFiber)try{ct=Tb.inject(KX),zt=Tb}catch{}}return k0.createRoot=function(c,h){if(!r(c))throw Error(i(299));var g=!1,x="",_=CI,O=_I,B=kI;return h!=null&&(h.unstable_strictMode===!0&&(g=!0),h.identifierPrefix!==void 0&&(x=h.identifierPrefix),h.onUncaughtError!==void 0&&(_=h.onUncaughtError),h.onCaughtError!==void 0&&(O=h.onCaughtError),h.onRecoverableError!==void 0&&(B=h.onRecoverableError)),h=oB(c,1,!1,null,null,g,x,null,_,O,B,vB),c[js]=h.current,m_(c),new N_(h)},k0.hydrateRoot=function(c,h,g){if(!r(c))throw Error(i(299));var x=!1,_="",O=CI,B=_I,Z=kI,ae=null;return g!=null&&(g.unstable_strictMode===!0&&(x=!0),g.identifierPrefix!==void 0&&(_=g.identifierPrefix),g.onUncaughtError!==void 0&&(O=g.onUncaughtError),g.onCaughtError!==void 0&&(B=g.onCaughtError),g.onRecoverableError!==void 0&&(Z=g.onRecoverableError),g.formState!==void 0&&(ae=g.formState)),h=oB(c,1,!0,h,g??null,x,_,ae,O,B,Z,vB),h.context=aB(null),g=h.current,x=Lo(),x=Tt(x),_=Xu(x),_.callback=null,Ku(g,_,x),g=x,h.current.lanes=g,Kt(h,g),Ll(h),c[js]=h.current,m_(c),new kb(h)},k0.version="19.2.8",k0}var OB;function cK(){if(OB)return P_.exports;OB=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(),P_.exports=lK(),P_.exports}var uK=cK();const hK=Al(uK),dK="_link_88ik9_12",Ob={link:dK},fK="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 cr(t){return Object.keys(t)}function H_(t){return t&&typeof t=="object"&&!Array.isArray(t)}function HE(t,e){const n={...t},i=e;return H_(t)&&H_(e)&&Object.keys(e).forEach(r=>{H_(i[r])&&r in t?n[r]=HE(n[r],i[r]):n[r]=i[r]}),n}function pK(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function mK(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 jv(t){const e=mK(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 EB(t){return t==="0rem"?"0rem":`calc(${t} * var(--mantine-scale))`}function v8(t,{shouldScale:e=!1}={}){function n(i){if(i===0||i==="0")return`0${t}`;if(typeof i=="number"){const r=`${i/16}${t}`;return e?EB(r):r}if(typeof i=="string"){if(i===""||i.startsWith("calc(")||i.startsWith("clamp(")||i.includes("rgba("))return i;if(i.includes(","))return i.split(",").map(s=>n(s)).join(",");if(i.includes(" "))return i.split(" ").map(s=>n(s)).join(" ");const r=i.replace("px","");if(!Number.isNaN(Number(r))){const s=`${Number(r)/16}${t}`;return e?EB(s):s}}return i}return n}const ge=v8("rem",{shouldScale:!0}),Ps=v8("em");function vy(t){return Object.keys(t).reduce((e,n)=>(t[n]!==void 0&&(e[n]=t[n]),e),{})}function y8(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 qE(t){return Array.isArray(t)||t===null?!1:typeof t=="object"?t.type!==T.Fragment:!1}function rs(t){const e=T.createContext(null);return[e,()=>{const i=T.use(e);if(i===null)throw new Error(t);return i}]}function f1(t,e){return n=>{if(typeof n!="string"||n.trim().length===0)throw new Error(e);return`${t}-${n}`}}function p1(t,e){let n=t;for(;(n=n.parentElement)&&!n.matches(e););return n}function MB(t,e,n){for(let i=t-1;i>=0;i-=1)if(!e[i].disabled)return i;if(n){for(let i=e.length-1;i>-1;i-=1)if(!e[i].disabled)return i}return t}function RB(t,e,n){for(let i=t+1;i<e.length;i+=1)if(!e[i].disabled)return i;if(n){for(let i=0;i<e.length;i+=1)if(!e[i].disabled)return i}return t}function gK(t,e,n){return p1(t,n)===p1(e,n)}function yy({parentSelector:t,siblingSelector:e,onKeyDown:n,loop:i=!0,activateOnFocus:r=!1,dir:s="rtl",orientation:a}){return l=>{var y,b,A;n==null||n(l);const u=Array.from(((y=p1(l.currentTarget,t))==null?void 0:y.querySelectorAll(e))||[]).filter(w=>gK(l.currentTarget,w,t)),d=u.findIndex(w=>l.currentTarget===w),f=RB(d,u,i),p=MB(d,u,i),m=s==="rtl"?p:f,v=s==="rtl"?f:p;switch(l.key){case"ArrowRight":a==="horizontal"&&(l.stopPropagation(),l.preventDefault(),u[m].focus(),r&&u[m].click());break;case"ArrowLeft":a==="horizontal"&&(l.stopPropagation(),l.preventDefault(),u[v].focus(),r&&u[v].click());break;case"ArrowUp":a==="vertical"&&(l.stopPropagation(),l.preventDefault(),u[p].focus(),r&&u[p].click());break;case"ArrowDown":a==="vertical"&&(l.stopPropagation(),l.preventDefault(),u[f].focus(),r&&u[f].click());break;case"Home":l.stopPropagation(),l.preventDefault(),(b=u[RB(-1,u,!1)])==null||b.focus();break;case"End":l.stopPropagation(),l.preventDefault(),(A=u[MB(u.length,u,!1)])==null||A.focus();break}}}const vK={app:100,modal:200,popover:300,overlay:400,max:9999};function Da(t){return vK[t]}const m1=()=>{};function yK(t,e={active:!0}){return typeof t!="function"||!e.active?e.onKeyDown||m1:n=>{var i;n.key==="Escape"&&(t(n),(i=e.onTrigger)==null||i.call(e))}}function Zt(t,e="size",n=!0){if(t!==void 0)return y8(t)?n?ge(t):t:`var(--${e}-${t})`}function ns(t){return Zt(t,"mantine-spacing")}function ai(t){return t===void 0?"var(--mantine-radius-default)":Zt(t,"mantine-radius")}function Ai(t){return Zt(t,"mantine-font-size")}function x8(t){return Zt(t,"mantine-line-height",!1)}function QE(t){if(t)return Zt(t,"mantine-shadow",!1)}function pi(t,e){return n=>{t==null||t(n),e==null||e(n)}}function YE(t,e){return t in e?jv(e[t]):jv(t)}function cO(t,e){const n=t.map(i=>({value:i,px:YE(i,e)}));return n.sort((i,r)=>i.px-r.px),n}function Zp(t){return typeof t=="object"&&t!==null?"base"in t?t.base:void 0:t}function xK(t,e,n){var i;return n?Array.from(((i=p1(n,e))==null?void 0:i.querySelectorAll(t))||[]).findIndex(r=>r===n):null}function Yh(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 Pm(t="mantine-"){return`${t}${Math.random().toString(36).slice(2,11)}`}function bK(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:i}=n;if(i!==Object.keys(e).length)return!1;for(let r=0;r<i;r+=1){const s=n[r];if(!(s in e)||t[s]!==e[s]&&!(Number.isNaN(t[s])&&Number.isNaN(e[s])))return!1}return!0}function Yp(t){const e=T.useRef(t);return T.useEffect(()=>{e.current=t}),T.useMemo(()=>((...n)=>{var i;return(i=e.current)==null?void 0:i.call(e,...n)}),[])}function Rw(t,e){const{delay:n,flushOnUnmount:i,leading:r,maxWait:s}=typeof e=="number"?{delay:e,flushOnUnmount:!1,leading:!1,maxWait:void 0}:e,a=Yp(t),l=T.useRef(0),u=T.useRef(0),d=T.useRef(null),f=T.useMemo(()=>{const p=Object.assign((...m)=>{window.clearTimeout(l.current),d.current=m;const v=p._isFirstCall;p._isFirstCall=!1;function y(){window.clearTimeout(l.current),window.clearTimeout(u.current),l.current=0,u.current=0,p._isFirstCall=!0,p._hasPendingCallback=!1}function b(){s!==void 0&&u.current===0&&(u.current=window.setTimeout(()=>{if(l.current!==0){const S=d.current;y(),a(...S)}},s))}if(r&&v){a(...m);const S=()=>{y()},j=()=>{l.current!==0&&(y(),a(...m))},C=()=>{y()};p.flush=j,p.cancel=C,l.current=window.setTimeout(S,n),b();return}if(r&&!v){p._hasPendingCallback=!0;const S=()=>{l.current!==0&&(y(),a(...m))},j=()=>{y()};p.flush=S,p.cancel=j;const C=()=>{y()};l.current=window.setTimeout(C,n),b();return}p._hasPendingCallback=!0;const A=()=>{l.current!==0&&(y(),a(...m))},w=()=>{y()};p.flush=A,p.cancel=w,l.current=window.setTimeout(A,n),b()},{flush:()=>{},cancel:()=>{},isPending:()=>p._hasPendingCallback,_isFirstCall:!0,_hasPendingCallback:!1});return p},[a,n,r,s]);return T.useEffect(()=>()=>{i?f.flush():f.cancel()},[f,i]),f}const AK=["mousedown","touchstart"];function wK(t,e,n,i=!0){const r=T.useRef(null),s=e||AK,a=T.useEffectEvent(u=>{const{target:d}=u??{};if(!document.body.contains(d)&&(d==null?void 0:d.tagName)!=="HTML")return;const f=u.composedPath();Array.isArray(n)?n.every(p=>!!p&&!f.includes(p))&&t(u):r.current&&!f.includes(r.current)&&t(u)}),l=s.join(",");return T.useEffect(()=>{if(!i)return;const u=l.split(",");return u.forEach(d=>document.addEventListener(d,a)),()=>{u.forEach(d=>document.removeEventListener(d,a))}},[l,i]),r}function b8(t={}){const e=t.timeout??2e3,[n,i]=T.useState(null),[r,s]=T.useState(!1),a=T.useRef(null);T.useEffect(()=>()=>{window.clearTimeout(a.current)},[]);const l=f=>{window.clearTimeout(a.current),a.current=window.setTimeout(()=>s(!1),e),s(f)};return{copy:f=>{"clipboard"in navigator?navigator.clipboard.writeText(f).then(()=>{i(null),l(!0)}).catch(p=>i(p)):i(new Error("useClipboard: navigator.clipboard is not supported"))},reset:()=>{s(!1),i(null),window.clearTimeout(a.current)},error:n,copied:r}}function SK(t,e){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(t).matches:!1}function A8(t,e,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[i,r]=T.useState(n?e:SK(t));return T.useEffect(()=>{try{if("matchMedia"in window){const s=window.matchMedia(t);r(s.matches);const a=l=>r(l.matches);return s.addEventListener("change",a),()=>{s.removeEventListener("change",a)}}}catch{return}},[t]),i||!1}function w8(t,e){return A8("(prefers-color-scheme: dark)",t==="dark",e)?"dark":"light"}function xy(t,e,n={leading:!1}){const[i,r]=T.useState(t),s=T.useRef(!1),a=T.useRef(null),l=T.useRef(!1),u=T.useRef(t);u.current=t;const d=T.useCallback(()=>{window.clearTimeout(a.current),a.current=null,l.current=!1},[]),f=T.useCallback(()=>{a.current&&(d(),l.current=!1,r(u.current))},[]);return T.useEffect(()=>{s.current&&(!l.current&&n.leading?(l.current=!0,r(t),a.current=window.setTimeout(()=>{l.current=!1},e)):(d(),a.current=window.setTimeout(()=>{l.current=!1,r(t)},e)))},[t,n.leading,e]),T.useEffect(()=>(s.current=!0,d),[]),[i,d,{cancel:d,flush:f}]}const uc=typeof document<"u"?T.useLayoutEffect:T.useEffect;function wu(t,e){const n=T.useRef(!1);T.useEffect(()=>()=>{n.current=!1},[]),T.useEffect(()=>{if(n.current)return t();n.current=!0},e)}function S8({opened:t,shouldReturnFocus:e=!0}){const n=T.useRef(null),i=()=>{var r;n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&((r=n.current)==null||r.focus({preventScroll:!0}))};return wu(()=>{let r=-1;const s=a=>{a.key==="Tab"&&window.clearTimeout(r)};if(document.addEventListener("keydown",s),t)n.current=document.activeElement;else if(e){const a=document.activeElement;r=window.setTimeout(()=>{const l=document.activeElement;(l===null||l===document.body||l===a)&&i()},10)}return()=>{window.clearTimeout(r),document.removeEventListener("keydown",s)}},[t,e]),i}const jK=/input|select|textarea|button|object/,j8="a, input, select, textarea, button, object, [tabindex]";function CK(t){return t.style.display==="none"}function _K(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(CK(e))return!1;e=e.parentNode}return!0}function C8(t){let e=t.getAttribute("tabindex");return e===null&&(e=void 0),parseInt(e,10)}function uO(t){const e=t.nodeName.toLowerCase(),n=!Number.isNaN(C8(t));return(jK.test(e)&&!t.disabled||t instanceof HTMLAnchorElement&&t.href||n)&&_K(t)}function _8(t){const e=C8(t);return(Number.isNaN(e)||e>=0)&&uO(t)}function kK(t){return Array.from(t.querySelectorAll(j8)).filter(_8)}function TK(t,e){const n=kK(t);if(!n.length){e.preventDefault();return}const i=n[e.shiftKey?0:n.length-1],r=t.getRootNode();let s=i===r.activeElement||t===r.activeElement;const a=r.activeElement;if(a.tagName==="INPUT"&&a.getAttribute("type")==="radio"&&(s=n.filter(u=>u.getAttribute("type")==="radio"&&u.getAttribute("name")===a.getAttribute("name")).includes(i)),!s)return;e.preventDefault();const l=n[e.shiftKey?n.length-1:0];l&&l.focus()}function OK(t=!0){const e=T.useRef(null),n=r=>{let s=r.querySelector("[data-autofocus]");if(!s){const a=Array.from(r.querySelectorAll(j8));s=a.find(_8)||a.find(uO)||null,!s&&uO(r)&&(s=r)}s?s.focus({preventScroll:!0}):console.warn("[@mantine/hooks/use-focus-trap] Failed to find focusable element within provided node",r)},i=T.useCallback(r=>{if(t){if(r===null){e.current=null;return}e.current!==r&&(setTimeout(()=>{r.getRootNode()?n(r):console.warn("[@mantine/hooks/use-focus-trap] Ref node is not part of the dom",r)}),e.current=r)}},[t]);return T.useEffect(()=>{if(!t)return;e.current&&setTimeout(()=>{e.current&&n(e.current)});const r=s=>{s.key==="Tab"&&e.current&&TK(e.current,s)};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[t]),i}const EK=t=>(t+1)%1e6;function k8(){const[,t]=T.useReducer(EK,0);return t}function zr(t){const[e,n]=T.useState(`mantine-${T.useId().replace(/:/g,"")}`),i=T.useRef(!1);return uc(()=>{i.current||(i.current=!0,n(Pm()))},[]),typeof t=="string"?t:e}function g1(t,e,n){const i=T.useEffectEvent(e);T.useEffect(()=>(window.addEventListener(t,i,n),()=>window.removeEventListener(t,i,n)),[t])}function MK(t,e="use-local-storage"){try{return JSON.stringify(t)}catch{throw new Error(`@mantine/hooks ${e}: Failed to serialize the value`)}}function RK(t){try{return t&&JSON.parse(t)}catch{return t}}function DK(t){return{getItem:r=>{try{return window[t].getItem(r)}catch{return console.warn("use-local-storage: Failed to get value from storage, localStorage is blocked"),null}},setItem:(r,s)=>{try{window[t].setItem(r,s)}catch{console.warn("use-local-storage: Failed to set value to storage, localStorage is blocked")}},removeItem:r=>{try{window[t].removeItem(r)}catch{console.warn("use-local-storage: Failed to remove value from storage, localStorage is blocked")}}}}function NK(t,e){const n="mantine-local-storage",{getItem:i,setItem:r,removeItem:s}=DK(t);return function({key:l,defaultValue:u,getInitialValueInEffect:d=!0,sync:f=!0,deserialize:p=RK,serialize:m=v=>MK(v,e)}){const v=T.useCallback(S=>{let j;try{j=typeof window>"u"||!(t in window)||window[t]===null||!!S}catch{j=!0}if(j)return u;const C=i(l);return C!==null?p(C):u},[l,u]),[y,b]=T.useState(v(d)),A=T.useCallback(S=>{S instanceof Function?b(j=>{const C=S(j);return r(l,m(C)),queueMicrotask(()=>{window.dispatchEvent(new CustomEvent(n,{detail:{key:l,value:C}}))}),C}):(r(l,m(S)),window.dispatchEvent(new CustomEvent(n,{detail:{key:l,value:S}})),b(S))},[l]),w=T.useCallback(()=>{s(l),b(u),window.dispatchEvent(new CustomEvent(n,{detail:{key:l,value:u}}))},[l,u]);return g1("storage",S=>{f&&S.storageArea===window[t]&&S.key===l&&b(p(S.newValue??void 0))}),g1(n,S=>{f&&S.detail.key===l&&b(S.detail.value)}),T.useEffect(()=>{u!==void 0&&y===void 0&&A(u)},[u,y,A]),T.useEffect(()=>{const S=v();S!==void 0&&A(S)},[l]),[y===void 0?u:y,A,w]}}function by(t){return NK("localStorage","use-local-storage")(t)}function v1(t,e){if(typeof t=="function")return t(e);typeof t=="object"&&t!==null&&"current"in t&&(t.current=e)}function WE(...t){const e=new Map;return n=>{if(t.forEach(i=>{const r=v1(i,n);r&&e.set(i,r)}),e.size>0)return()=>{t.forEach(i=>{const r=e.get(i);r&&typeof r=="function"?r():v1(i,null)}),e.clear()}}}function Dn(...t){return T.useCallback(WE(...t),t)}function hr({value:t,defaultValue:e,finalValue:n,onChange:i=()=>{}}){const[r,s]=T.useState(e!==void 0?e:n),a=(l,...u)=>{s(l),i==null||i(l,...u)};return t!==void 0?[t,i,!0]:[r,a,!1]}function fh(t,e){const n=e-t+1;return Array.from({length:n},(i,r)=>r+t)}const Eb="dots";function IK({total:t,siblings:e=1,boundaries:n=1,page:i,initialPage:r,onChange:s,startValue:a=1}){const l=Math.max(Math.trunc(a),1),u=Math.max(Math.trunc(t),l),d=u-l+1,f=r??l,[p,m]=hr({value:i,onChange:s,defaultValue:f,finalValue:f}),v=T.useCallback(S=>{S<l?m(l):S>u?m(u):m(S)},[l,u,m]),y=T.useCallback(()=>v(p+1),[p,v]),b=T.useCallback(()=>v(p-1),[p,v]),A=T.useCallback(()=>v(l),[v,l]),w=T.useCallback(()=>v(u),[u,v]);return{range:T.useMemo(()=>{if(e*2+3+n*2>=d)return fh(l,u);const S=Math.max(p-e,l+n-1),j=Math.min(p+e,u-n),C=S>l+n+1,k=j<u-n;if(!C&&k){const E=e*2+n+2;return[...fh(l,l+E-1),Eb,...fh(u-(n-1),u)]}if(C&&!k){const E=n+1+2*e;return[...fh(l,l+n-1),Eb,...fh(u-E,u)]}return[...fh(l,l+n-1),Eb,...fh(S,j),Eb,...fh(u-n+1,u)]},[d,e,p,l,u,n]),active:p,setPage:v,next:y,previous:b,first:A,last:w}}function Ay(t,e){return A8("(prefers-reduced-motion: reduce)",t,e)}const BK={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};function LK(t){const e=T.useRef(0),[n,i]=T.useState(BK),r=T.useRef(null);return[T.useCallback(s=>{r.current&&(r.current.disconnect(),r.current=null),e.current&&cancelAnimationFrame(e.current),s&&(r.current=new ResizeObserver(a=>{const l=a[0];l&&(cancelAnimationFrame(e.current),e.current=requestAnimationFrame(()=>{var d,f;const u=((d=l.borderBoxSize)==null?void 0:d[0])||((f=l.contentBoxSize)==null?void 0:f[0]);if(u){const p=u.inlineSize,m=u.blockSize;i({width:p,height:m,x:l.contentRect.x,y:l.contentRect.y,top:l.contentRect.top,left:l.contentRect.left,bottom:l.contentRect.bottom,right:l.contentRect.right})}else i(l.contentRect)}))}),r.current.observe(s,t))},[t]),n]}function PK(t){const[e,{width:n,height:i}]=LK(t);return{ref:e,width:n,height:i}}function FK(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(!bK(t[n],e[n]))return!1;return!0}function $K(t){const e=T.useRef([]),n=T.useRef(0);return FK(e.current,t)||(e.current=t,n.current+=1),[n.current]}function zK(t,e){T.useEffect(t,$K(e))}function Dw(t=!1,e={}){const[n,i]=T.useState(t),r=T.useCallback(()=>{i(a=>{var l;return a||((l=e.onOpen)==null||l.call(e),!0)})},[e.onOpen]),s=T.useCallback(()=>{i(a=>{var l;return a&&((l=e.onClose)==null||l.call(e),!1)})},[e.onClose]);return[n,{open:r,close:s,toggle:T.useCallback(()=>{n?s():r()},[s,r,n]),set:i}]}function HK(t,e,n={autoInvoke:!1}){const i=T.useRef(null),r=Yp(t),s=T.useCallback((...l)=>{i.current||(i.current=window.setTimeout(()=>{r(...l),i.current=null},e))},[e]),a=T.useCallback(()=>{i.current&&(window.clearTimeout(i.current),i.current=null)},[]);return T.useEffect(()=>(n.autoInvoke&&s(),a),[a,s]),{start:s,clear:a}}function qK(t){const e=T.useRef(void 0);return T.useEffect(()=>{e.current=t},[t]),e.current}function QK(t,e,n){const i=T.useRef(null);T.useEffect(()=>{i.current&&(i.current.disconnect(),i.current=null);const r=typeof n=="function"?n():n;return r&&(i.current=new MutationObserver(t),i.current.observe(r,e)),()=>{i.current&&(i.current.disconnect(),i.current=null)}},[t,e,n])}function YK(){const[t,e]=T.useState(!1);return T.useEffect(()=>e(!0),[]),t}const WK=["mouse","touch"],UK=10;function VK(t,e={}){const{threshold:n=400,events:i=WK,cancelOnMove:r=!1,onStart:s,onFinish:a,onCancel:l}=e,u=T.useRef(!1),d=T.useRef(!1),f=T.useRef(-1),p=T.useRef(null);return T.useEffect(()=>()=>window.clearTimeout(f.current),[]),T.useMemo(()=>{if(typeof t!="function")return{};const m=r!==!1,v=r===!0?UK:r===!1?0:r,y=S=>{!NB(S)&&!hO(S)||(s&&s(S),p.current=DB(S),d.current=!0,f.current=window.setTimeout(()=>{t(S),u.current=!0},n))},b=S=>{!NB(S)&&!hO(S)||(u.current?a&&a(S):d.current&&l&&l(S),u.current=!1,d.current=!1,p.current=null,f.current!==-1&&(window.clearTimeout(f.current),f.current=-1))},A=S=>{if(!m||!d.current||u.current)return;const j=DB(S);if(!j||!p.current)return;const C=j.x-p.current.x,k=j.y-p.current.y;Math.sqrt(C*C+k*k)>v&&b(S)},w={};return i.includes("mouse")&&(w.onMouseDown=y,w.onMouseUp=b,w.onMouseLeave=b,m&&(w.onMouseMove=A)),i.includes("touch")&&(w.onTouchStart=y,w.onTouchEnd=b,w.onTouchCancel=b,m&&(w.onTouchMove=A)),w},[t,n,l,a,s,r,i.join(",")])}function DB(t){if(hO(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 hO(t){return window.TouchEvent?t.nativeEvent instanceof TouchEvent:"touches"in t.nativeEvent}function NB(t){return t.nativeEvent instanceof MouseEvent}var lu=g8();const Q0=Al(lu);function GK(t){if(!t||typeof t=="string")return 0;const e=t/36;return Math.round((4+15*e**.25+e/5)*10)}function q_(t){return t.current?t.current.scrollHeight:"auto"}function XK({transitionDuration:t,transitionTimingFunction:e="ease",onTransitionEnd:n,onTransitionStart:i,expanded:r,keepMounted:s}){const a={height:0,overflow:"hidden",...s?{}:{display:"none"}},l=T.useEffectEvent(()=>i==null?void 0:i()),u=T.useRef(null),[d,f]=T.useState(r?{}:a),[p,m]=T.useState(r?"entered":"exited"),v=w=>{lu.flushSync(()=>f(w))},y=w=>{v(S=>({...S,...w}))},b=w=>{const S=t??GK(w);return{transition:`height ${S}ms ${e}, opacity ${S}ms ${e}`}};wu(()=>{t!==0&&l(),r?window.requestAnimationFrame(()=>{lu.flushSync(()=>m("entering")),y({willChange:"height",display:"block",overflow:"hidden"}),window.requestAnimationFrame(()=>{const w=q_(u);y({...b(w),height:w})})}):window.requestAnimationFrame(()=>{lu.flushSync(()=>m("exiting"));const w=q_(u);y({...b(w),willChange:"height",height:w}),window.requestAnimationFrame(()=>y({height:0,overflow:"hidden"}))})},[r]);const A=w=>{if(!(w.target!==u.current||w.propertyName!=="height"))if(r){const S=q_(u);S===d.height?v({}):y({height:S}),m("entered"),n==null||n()}else d.height===0&&(v(a),m("exited"),n==null||n())};return{state:p,getCollapseProps:w=>({"aria-hidden":!r,inert:!r,ref:WE(u,w==null?void 0:w.ref),onTransitionEnd:A,style:{boxSizing:"border-box",...w==null?void 0:w.style,...d}})}}function KK(t){if(!t||typeof t=="string")return 0;const e=t/36;return Math.round((4+15*e**.25+e/5)*10)}function Q_(t){return t.current?t.current.scrollWidth:"auto"}function ZK({transitionDuration:t,transitionTimingFunction:e="ease",onTransitionEnd:n,onTransitionStart:i,expanded:r,keepMounted:s}){const a={width:0,overflow:"hidden",...s?{}:{display:"none"}},l=T.useEffectEvent(()=>i==null?void 0:i()),u=T.useRef(null),[d,f]=T.useState(r?{}:a),[p,m]=T.useState(r?"entered":"exited"),v=w=>{lu.flushSync(()=>f(w))},y=w=>{v(S=>({...S,...w}))},b=w=>{const S=t??KK(w);return{transition:`width ${S}ms ${e}, opacity ${S}ms ${e}`}};wu(()=>{t!==0&&l(),r?window.requestAnimationFrame(()=>{lu.flushSync(()=>m("entering")),y({willChange:"width",display:"block",overflow:"hidden"}),window.requestAnimationFrame(()=>{const w=Q_(u);y({...b(w),width:w})})}):window.requestAnimationFrame(()=>{lu.flushSync(()=>m("exiting"));const w=Q_(u);y({...b(w),willChange:"width",width:w}),window.requestAnimationFrame(()=>y({width:0,overflow:"hidden"}))})},[r]);const A=w=>{if(!(w.target!==u.current||w.propertyName!=="width"))if(r){const S=Q_(u);S===d.width?v({}):y({width:S}),m("entered"),n==null||n()}else d.width===0&&(v(a),m("exited"),n==null||n())};return{state:p,getCollapseProps:w=>({"aria-hidden":!r,inert:!r,ref:WE(u,w==null?void 0:w.ref),onTransitionEnd:A,style:{boxSizing:"border-box",...w==null?void 0:w.style,...d}})}}const JK=100;function Cp(t){return t>0?1:t<0?-1:0}function IB(t){const e=t??0;return typeof e=="number"?[e,e]:e}function eZ(){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 tZ(t,e={}){const[n,i]=T.useState(!1),r=T.useRef(t);r.current=t;const s=T.useRef(e);s.current=e;const a=T.useRef(eZ()),l=T.useRef(null);return{ref:T.useCallback(u=>{if(!u)return;const d=new AbortController,f=S=>{const j=s.current,C=a.current;if(j.axis==="x")return[S[0],0];if(j.axis==="y")return[0,S[1]];if(j.axis==="lock"){if(C.lockedAxis===null){const k=j.axisThreshold??1;(Math.abs(S[0])>k||Math.abs(S[1])>k)&&(C.lockedAxis=Math.abs(S[0])>=Math.abs(S[1])?"x":"y")}if(C.lockedAxis==="x")return[S[0],0];if(C.lockedAxis==="y")return[0,S[1]]}return S},p=()=>{var j;const S=a.current;S.isActive=!1,S.pointerId=-1,S.thresholdMet=!1,S.firstFired=!1,S.lockedAxis=null,S.canceled=!1,i(!1),document.body.style.userSelect="",document.body.style.webkitUserSelect="",(j=l.current)==null||j.abort(),l.current=null},m=()=>{a.current.isActive&&(a.current.canceled=!0,p())},v=()=>{i(!0),document.body.style.userSelect="none",document.body.style.webkitUserSelect="none"},y=S=>{var M;if(s.current.enabled===!1||S.button!==0||a.current.isActive)return;const j=a.current;j.isActive=!0,j.pointerId=S.pointerId,j.startXY=[S.clientX,S.clientY],j.prevXY=[S.clientX,S.clientY],j.startTimestamp=S.timeStamp,j.prevTimestamp=S.timeStamp,j.thresholdMet=!1,j.firstFired=!1,j.lockedAxis=null,j.canceled=!1,j.lastVelocity=[0,0];const[C,k]=IB(s.current.threshold);C===0&&k===0&&(j.thresholdMet=!0,j.firstFired=!0,v(),r.current({xy:[S.clientX,S.clientY],initial:[S.clientX,S.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:S})),(M=l.current)==null||M.abort(),l.current=new AbortController;const E=l.current.signal;document.addEventListener("pointermove",b,{signal:E}),document.addEventListener("pointerup",A,{signal:E}),document.addEventListener("pointercancel",w,{signal:E})},b=S=>{const j=a.current;if(!j.isActive||S.pointerId!==j.pointerId)return;const C=[S.clientX-j.startXY[0],S.clientY-j.startXY[1]];if(!j.thresholdMet){const[I,Q]=IB(s.current.threshold);if(Math.abs(C[0])<I&&Math.abs(C[1])<Q){j.prevXY=[S.clientX,S.clientY],j.prevTimestamp=S.timeStamp;return}j.thresholdMet=!0,v()}const k=f(C),E=[S.clientX-j.prevXY[0],S.clientY-j.prevXY[1]],M=f(E),R=S.timeStamp-j.prevTimestamp,D=R>0?[Math.abs(M[0])/R,Math.abs(M[1])/R]:j.lastVelocity;j.lastVelocity=D;const F=!j.firstFired;j.firstFired=!0,j.prevXY=[S.clientX,S.clientY],j.prevTimestamp=S.timeStamp,r.current({xy:[S.clientX,S.clientY],initial:[...j.startXY],movement:k,delta:M,distance:[Math.abs(k[0]),Math.abs(k[1])],direction:[Cp(M[0]),Cp(M[1])],velocity:D,elapsedTime:S.timeStamp-j.startTimestamp,first:F,last:!1,active:!0,tap:!1,canceled:!1,cancel:m,event:S})},A=S=>{const j=a.current;if(!j.isActive||S.pointerId!==j.pointerId)return;const C=s.current;if(!j.thresholdMet){if(C.filterTaps){const G=[S.clientX-j.startXY[0],S.clientY-j.startXY[1]],L=f(G),q=[Math.abs(L[0]),Math.abs(L[1])],N=Math.max(q[0],q[1])<(C.tapThreshold??3);r.current({xy:[S.clientX,S.clientY],initial:[...j.startXY],movement:L,delta:L,distance:q,direction:[Cp(L[0]),Cp(L[1])],velocity:[0,0],elapsedTime:S.timeStamp-j.startTimestamp,first:!0,last:!0,active:!1,tap:N,canceled:!1,cancel:m,event:S})}p();return}const k=[S.clientX-j.startXY[0],S.clientY-j.startXY[1]],E=f(k),M=[Math.abs(E[0]),Math.abs(E[1])],R=[S.clientX-j.prevXY[0],S.clientY-j.prevXY[1]],D=f(R),F=S.timeStamp-j.prevTimestamp>JK?[0,0]:j.lastVelocity,I=Math.max(M[0],M[1]),Q=C.filterTaps===!0&&I<(C.tapThreshold??3);r.current({xy:[S.clientX,S.clientY],initial:[...j.startXY],movement:E,delta:D,distance:M,direction:[Cp(D[0]),Cp(D[1])],velocity:F,elapsedTime:S.timeStamp-j.startTimestamp,first:!j.firstFired,last:!0,active:!1,tap:Q,canceled:!1,cancel:m,event:S}),p()},w=S=>{const j=a.current;if(!j.isActive||S.pointerId!==j.pointerId)return;const C=[S.clientX-j.startXY[0],S.clientY-j.startXY[1]],k=f(C);r.current({xy:[S.clientX,S.clientY],initial:[...j.startXY],movement:k,delta:[0,0],distance:[Math.abs(k[0]),Math.abs(k[1])],direction:[0,0],velocity:[0,0],elapsedTime:S.timeStamp-j.startTimestamp,first:!j.firstFired,last:!0,active:!1,tap:!1,canceled:!0,cancel:m,event:S}),p()};return u.addEventListener("pointerdown",y,{signal:d.signal}),()=>{var S;d.abort(),(S=l.current)==null||S.abort(),l.current=null,a.current.isActive&&(a.current.isActive=!1,i(!1),document.body.style.userSelect="",document.body.style.webkitUserSelect="")}},[]),active:n}}var nZ={};function T8(){return"development"}function Nw(t){var n;const e=Vn.version;return typeof Vn.version!="string"||e.startsWith("18.")?t==null?void 0:t.ref:(n=t==null?void 0:t.props)==null?void 0:n.ref}function iZ(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="bigint"}function kA(t,e=document){const n=e.querySelector(t);if(n)return n;const i=e.querySelectorAll("*");for(let r=0;r<i.length;r+=1){const s=i[r];if(s.shadowRoot){const a=kA(t,s.shadowRoot);if(a)return a}}return null}function Kc(t,e=document){const n=[],i=e.querySelectorAll(t);n.push(...Array.from(i));const r=e.querySelectorAll("*");for(let s=0;s<r.length;s+=1){const a=r[s];if(a.shadowRoot){const l=Kc(t,a.shadowRoot);n.push(...l)}}return n}function Xc(t){if(!t)return document;const e=t.getRootNode();return e instanceof ShadowRoot||e instanceof Document?e:document}function Su(t){const e=T.Children.toArray(t);return e.length!==1||!qE(e[0])?null:e[0]}function O8(t){var e,n,i="";if(typeof t=="string"||typeof t=="number")i+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(e=0;e<r;e++)t[e]&&(n=O8(t[e]))&&(i&&(i+=" "),i+=n)}else for(n in t)t[n]&&(i&&(i+=" "),i+=n);return i}function Yi(){for(var t,e,n=0,i="",r=arguments.length;n<r;n++)(t=arguments[n])&&(e=O8(t))&&(i&&(i+=" "),i+=e);return i}const rZ={};function sZ(t){const e={};return t.forEach(n=>{Object.entries(n).forEach(([i,r])=>{e[i]?e[i]=Yi(e[i],r):e[i]=r})}),e}function Cv({theme:t,classNames:e,props:n,stylesCtx:i}){return sZ((Array.isArray(e)?e:[e]).map(r=>typeof r=="function"?r(t,n,i):r||rZ))}function y1({theme:t,styles:e,props:n,stylesCtx:i}){const r=Array.isArray(e)?e:[e],s={};for(const a of r)typeof a=="function"?Object.assign(s,a(t,n,i)):a&&Object.assign(s,a);return s}function BB(t){return t==="auto"||t==="dark"||t==="light"}function oZ({key:t="mantine-color-scheme-value"}={}){let e;return{get:n=>{if(typeof window>"u")return n;try{const i=window.localStorage.getItem(t);return BB(i)?i:n}catch{return n}},set:n=>{try{window.localStorage.setItem(t,n)}catch(i){console.warn("[@mantine/core] Local storage color scheme manager was unable to save color scheme.",i)}},subscribe:n=>{e=i=>{i.storageArea===window.localStorage&&i.key===t&&BB(i.newValue)&&n(i.newValue)},window.addEventListener("storage",e)},unsubscribe:()=>{window.removeEventListener("storage",e)},clear:()=>{window.localStorage.removeItem(t)}}}function _v(t,e){return typeof t.primaryShade=="number"?t.primaryShade:e==="dark"?t.primaryShade.dark:t.primaryShade.light}function aZ(t){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(t)}function lZ(t){let e=t.replace("#","");if(e.length===3){const i=e.split("");e=[i[0],i[0],i[1],i[1],i[2],i[2]].join("")}if(e.length===8){const i=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:i}}const n=parseInt(e,16);return{r:n>>16&255,g:n>>8&255,b:n&255,a:1}}function cZ(t){const[e,n,i,r]=t.replace(/[^0-9,./]/g,"").split(/[/,]/).map(Number);return{r:e,g:n,b:i,a:r===void 0?1:r}}function uZ(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),i=parseInt(e[2],10)/100,r=parseInt(e[3],10)/100,s=e[5]?parseFloat(e[5]):void 0,a=(1-Math.abs(2*r-1))*i,l=n/60,u=a*(1-Math.abs(l%2-1)),d=r-a/2;let f,p,m;return l>=0&&l<1?(f=a,p=u,m=0):l>=1&&l<2?(f=u,p=a,m=0):l>=2&&l<3?(f=0,p=a,m=u):l>=3&&l<4?(f=0,p=u,m=a):l>=4&&l<5?(f=u,p=0,m=a):(f=a,p=0,m=u),{r:Math.round((f+d)*255),g:Math.round((p+d)*255),b:Math.round((m+d)*255),a:s||1}}function Iw(t){return aZ(t)?lZ(t):t.startsWith("rgb")?cZ(t):t.startsWith("hsl")?uZ(t):{r:0,g:0,b:0,a:1}}function Y_(t){return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}function hZ(t){const e=t.match(/oklch\((.*?)%\s/);return e?parseFloat(e[1]):null}function dZ(t){if(t.startsWith("oklch("))return(hZ(t)||0)/100;const{r:e,g:n,b:i}=Iw(t),r=e/255,s=n/255,a=i/255,l=Y_(r),u=Y_(s),d=Y_(a);return .2126*l+.7152*u+.0722*d}function T0(t,e=.179){return t.startsWith("var(")?!1:dZ(t)>e}function mc({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:T0(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:T0(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:T0(t==="white"?e.white:e.black,e.luminanceThreshold),variable:`--mantine-color-${t}`};const[i,r]=t.split("."),s=r?Number(r):void 0,a=i in e.colors;if(a){const l=s!==void 0?e.colors[i][s]:e.colors[i][_v(e,n||"light")];return{color:i,value:l,shade:s,isThemeColor:a,isLight:T0(l,e.luminanceThreshold),variable:r?`--mantine-color-${i}-${s}`:`--mantine-color-${i}-filled`}}return{color:t,value:t,isThemeColor:a,isLight:T0(t,e.luminanceThreshold),shade:s,variable:void 0}}function Oi(t,e){const n=mc({color:t||e.primaryColor,theme:e});return n.variable?`var(${n.variable})`:t}function UE(t){return!!t&&typeof t=="object"&&"mantine-virtual-color"in t}function Jd(t,e){if(t.startsWith("var("))return`color-mix(in srgb, ${t}, black ${e*100}%)`;const{r:n,g:i,b:r,a:s}=Iw(t),a=1-e,l=u=>Math.round(u*a);return`rgba(${l(n)}, ${l(i)}, ${l(r)}, ${s})`}function dO(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},i=Oi(n.from,e),r=Oi(n.to,e);return`linear-gradient(${n.deg}deg, ${i} 0%, ${r} 100%)`}function Ah(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:i,b:r}=Iw(t);return`rgba(${n}, ${i}, ${r}, ${e})`}const LB=Ah,fZ=({color:t,theme:e,variant:n,gradient:i,autoContrast:r})=>{const s=mc({color:t,theme:e}),a=typeof r=="boolean"?r:e.autoContrast;if(n==="none")return{background:"transparent",hover:"transparent",color:"inherit",border:"none"};if(n==="filled"){const l=s.isThemeColor&&s.shade===void 0&&UE(e.colors[s.color]),u=a?l?`var(--mantine-color-${s.color}-contrast)`:s.isLight?"var(--mantine-color-black)":"var(--mantine-color-white)":"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:u,border:`${ge(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:u,border:`${ge(1)} solid transparent`}:{background:t,hover:Jd(t,.1),color:u,border:`${ge(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:`${ge(1)} solid transparent`};const l=e.colors[s.color][s.shade];return{background:l,hover:Jd(l,.1),color:`var(--mantine-color-${s.color}-light-color)`,border:`${ge(1)} solid transparent`}}return{background:Ah(t,.1),hover:Ah(t,.12),color:t,border:`${ge(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:`${ge(1)} solid var(--mantine-color-${t}-outline)`}:{background:"transparent",hover:Ah(e.colors[s.color][s.shade],.05),color:`var(--mantine-color-${s.color}-${s.shade})`,border:`${ge(1)} solid var(--mantine-color-${s.color}-${s.shade})`}:{background:"transparent",hover:Ah(t,.05),color:t,border:`${ge(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:`${ge(1)} solid transparent`};const l=e.colors[s.color][s.shade];return{background:"transparent",hover:Ah(l,.12),color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${ge(1)} solid transparent`}}return{background:"transparent",hover:Ah(t,.12),color:t,border:`${ge(1)} solid transparent`}}return n==="transparent"?s.isThemeColor?s.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${t}-light-color)`,border:`${ge(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${ge(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:t,border:`${ge(1)} solid transparent`}:n==="white"?s.isThemeColor?s.shade===void 0?{background:"var(--mantine-color-white)",hover:Jd(e.white,.01),color:`var(--mantine-color-${t}-filled)`,border:`${ge(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:Jd(e.white,.01),color:`var(--mantine-color-${s.color}-${s.shade})`,border:`${ge(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:Jd(e.white,.01),color:t,border:`${ge(1)} solid transparent`}:n==="gradient"?{background:dO(i,e),hover:dO(i,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:`${ge(1)} solid var(--mantine-color-default-border)`}:{}};function E8(t,e){if(t.startsWith("var("))return`color-mix(in srgb, ${t}, white ${e*100}%)`;const{r:n,g:i,b:r,a:s}=Iw(t),a=l=>Math.round(l+(255-l)*e);return`rgba(${a(n)}, ${a(i)}, ${a(r)}, ${s})`}function ju({color:t,theme:e,autoContrast:n,colorScheme:i}){return(typeof n=="boolean"?n:e.autoContrast)&&mc({color:t||e.primaryColor,theme:e,colorScheme:i}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function fO(t,e,n){return ju({color:n==="dark"?t.dark:t.light,theme:e,colorScheme:n,autoContrast:!0})}function PB(t,e){const n=t.colors[t.primaryColor];return UE(n)?t.autoContrast?fO(n,t,e):"var(--mantine-color-white)":ju({color:n[_v(t,e)],theme:t,autoContrast:null})}function hg(t,e){return typeof t=="boolean"?t:e.autoContrast}const VE=T.createContext(null);function gc(){const t=T.use(VE);if(!t)throw new Error("[@mantine/core] MantineProvider was not found in tree");return t}function pZ(){return gc().cssVariablesResolver}function mZ(){return gc().classNamesPrefix}function Bw(){return gc().getStyleNonce}function gZ(){return gc().withStaticClasses}function vZ(){return gc().headless}function yZ(){var t;return(t=gc().stylesTransform)==null?void 0:t.sx}function xZ(){var t;return(t=gc().stylesTransform)==null?void 0:t.styles}function wy(){return gc().env||"default"}function bZ(){return gc().deduplicateInlineStyles}function FB(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(i=>i.remove())}function M8({keepTransitions:t}={}){var f;const e=T.useRef(m1),n=T.useRef(-1),i=T.use(VE),r=T.useRef((f=Bw())==null?void 0:f());if(!i)throw new Error("[@mantine/core] MantineProvider was not found in tree");const s=p=>{i.setColorScheme(p),e.current=t?()=>{}:FB(r.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var m;(m=e.current)==null||m.call(e)},10)},a=()=>{i.clearColorScheme(),e.current=t?()=>{}:FB(r.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var p;(p=e.current)==null||p.call(e)},10)},l=w8("light",{getInitialValueInEffect:!1}),u=i.colorScheme==="auto"?l:i.colorScheme,d=T.useCallback(()=>s(u==="light"?"dark":"light"),[s,u]);return T.useEffect(()=>()=>{var p;(p=e.current)==null||p.call(e),window.clearTimeout(n.current)},[]),{colorScheme:i.colorScheme,setColorScheme:s,clearColorScheme:a,toggleColorScheme:d}}function _p(t,e){var r,s;const n=typeof window<"u"&&"matchMedia"in window&&((r=window.matchMedia("(prefers-color-scheme: dark)"))==null?void 0:r.matches),i=t!=="auto"?t:n?"dark":"light";(s=e())==null||s.setAttribute("data-mantine-color-scheme",i)}function AZ({manager:t,defaultColorScheme:e,getRootElement:n,forceColorScheme:i}){const r=T.useRef(null),[s,a]=T.useState(()=>t.get(e)),l=i||s,u=T.useCallback(f=>{i||(_p(f,n),a(f),t.set(f))},[t.set,l,i]),d=T.useCallback(()=>{a(e),_p(e,n),t.clear()},[t.clear,e]);return T.useEffect(()=>(t.subscribe(u),t.unsubscribe),[t.subscribe,t.unsubscribe]),uc(()=>{_p(t.get(e),n)},[]),T.useEffect(()=>{var p;if(i)return _p(i,n),()=>{};i===void 0&&_p(s,n),typeof window<"u"&&"matchMedia"in window&&(r.current=window.matchMedia("(prefers-color-scheme: dark)"));const f=m=>{s==="auto"&&_p(m.matches?"dark":"light",n)};return(p=r.current)==null||p.addEventListener("change",f),()=>{var m;return(m=r.current)==null?void 0:m.removeEventListener("change",f)}},[s,i]),{colorScheme:l,setColorScheme:u,clearColorScheme:d}}function Lw(t,e={getInitialValueInEffect:!0}){const n=w8(t,e),{colorScheme:i}=M8();return i==="auto"?n:i}const wZ={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"]},$B="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",GE={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:wZ,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:fZ,autoContrast:!1,luminanceThreshold:.3,fontFamily:$B,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:$B,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:ge(34),lineHeight:"1.3"},h2:{fontSize:ge(26),lineHeight:"1.35"},h3:{fontSize:ge(22),lineHeight:"1.4"},h4:{fontSize:ge(18),lineHeight:"1.45"},h5:{fontSize:ge(16),lineHeight:"1.5"},h6:{fontSize:ge(14),lineHeight:"1.5"}}},fontSizes:{xs:ge(12),sm:ge(14),md:ge(16),lg:ge(18),xl:ge(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:ge(2),sm:ge(4),md:ge(8),lg:ge(16),xl:ge(32)},spacing:{xs:ge(10),sm:ge(12),md:ge(16),lg:ge(20),xl:ge(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${ge(1)} ${ge(3)} rgba(0, 0, 0, 0.05), 0 ${ge(1)} ${ge(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${ge(1)} ${ge(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${ge(10)} ${ge(15)} ${ge(-5)}, rgba(0, 0, 0, 0.04) 0 ${ge(7)} ${ge(7)} ${ge(-5)}`,md:`0 ${ge(1)} ${ge(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${ge(20)} ${ge(25)} ${ge(-5)}, rgba(0, 0, 0, 0.04) 0 ${ge(10)} ${ge(10)} ${ge(-5)}`,lg:`0 ${ge(1)} ${ge(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${ge(28)} ${ge(23)} ${ge(-7)}, rgba(0, 0, 0, 0.04) 0 ${ge(12)} ${ge(12)} ${ge(-7)}`,xl:`0 ${ge(1)} ${ge(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${ge(36)} ${ge(28)} ${ge(-7)}, rgba(0, 0, 0, 0.04) 0 ${ge(17)} ${ge(17)} ${ge(-7)}`},other:{},components:{}},SZ="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",zB="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function W_(t){return t<0||t>9?!1:parseInt(t.toString(),10)===t}function HB(t){if(!(t.primaryColor in t.colors))throw new Error(SZ);if(typeof t.primaryShade=="object"&&(!W_(t.primaryShade.dark)||!W_(t.primaryShade.light)))throw new Error(zB);if(typeof t.primaryShade=="number"&&!W_(t.primaryShade))throw new Error(zB)}function jZ(t,e){var i;if(!e)return HB(t),t;const n=HE(t,e);return e.fontFamily&&!((i=e.headings)!=null&&i.fontFamily)&&(n.headings={...n.headings,fontFamily:e.fontFamily}),HB(n),n}const XE=T.createContext(null),CZ=()=>T.use(XE)||GE;function Ar(){const t=T.use(XE);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 R8({theme:t,children:e,inherit:n=!0}){const i=CZ(),r=T.useMemo(()=>jZ(n?i:GE,t),[t,i,n]);return o.jsx(XE,{value:r,children:e})}R8.displayName="@mantine/core/MantineThemeProvider";function U_(t){return Object.entries(t).map(([e,n])=>`${e}: ${n};`).join("")}function D8(t,e){const n=e?[e]:[":root",":host"],i=U_(t.variables),r=i?`${n.join(", ")}{${i}}`:"",s=U_(t.dark),a=U_(t.light),l=u=>n.map(d=>d===":host"?`${d}([data-mantine-color-scheme="${u}"])`:`${d}[data-mantine-color-scheme="${u}"]`).join(", ");return`${r}

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

${a?`${l("light")}{${a}}`:""}`}function Mb({theme:t,color:e,colorScheme:n,name:i=e,withColorValues:r=!0}){if(!t.colors[e])return{};if(n==="light"){const l=_v(t,"light"),u={[`--mantine-color-${i}-text`]:`var(--mantine-color-${i}-filled)`,[`--mantine-color-${i}-filled`]:`var(--mantine-color-${i}-${l})`,[`--mantine-color-${i}-filled-hover`]:`var(--mantine-color-${i}-${l===9?8:l+1})`,[`--mantine-color-${i}-light`]:`var(--mantine-color-${i}-1)`,[`--mantine-color-${i}-light-hover`]:`var(--mantine-color-${i}-2)`,[`--mantine-color-${i}-light-color`]:`var(--mantine-color-${i}-9)`,[`--mantine-color-${i}-outline`]:`var(--mantine-color-${i}-${l})`,[`--mantine-color-${i}-outline-hover`]:LB(t.colors[e][l],.05)};return r?{[`--mantine-color-${i}-0`]:t.colors[e][0],[`--mantine-color-${i}-1`]:t.colors[e][1],[`--mantine-color-${i}-2`]:t.colors[e][2],[`--mantine-color-${i}-3`]:t.colors[e][3],[`--mantine-color-${i}-4`]:t.colors[e][4],[`--mantine-color-${i}-5`]:t.colors[e][5],[`--mantine-color-${i}-6`]:t.colors[e][6],[`--mantine-color-${i}-7`]:t.colors[e][7],[`--mantine-color-${i}-8`]:t.colors[e][8],[`--mantine-color-${i}-9`]:t.colors[e][9],...u}:u}const s=_v(t,"dark"),a={[`--mantine-color-${i}-text`]:`var(--mantine-color-${i}-4)`,[`--mantine-color-${i}-filled`]:`var(--mantine-color-${i}-${s})`,[`--mantine-color-${i}-filled-hover`]:`var(--mantine-color-${i}-${s===9?8:s+1})`,[`--mantine-color-${i}-light`]:Jd(t.colors[e][9],.5),[`--mantine-color-${i}-light-hover`]:Jd(t.colors[e][9],.3),[`--mantine-color-${i}-light-color`]:`var(--mantine-color-${i}-0)`,[`--mantine-color-${i}-outline`]:`var(--mantine-color-${i}-${Math.max(s-4,0)})`,[`--mantine-color-${i}-outline-hover`]:LB(t.colors[e][Math.max(s-4,0)],.05)};return r?{[`--mantine-color-${i}-0`]:t.colors[e][0],[`--mantine-color-${i}-1`]:t.colors[e][1],[`--mantine-color-${i}-2`]:t.colors[e][2],[`--mantine-color-${i}-3`]:t.colors[e][3],[`--mantine-color-${i}-4`]:t.colors[e][4],[`--mantine-color-${i}-5`]:t.colors[e][5],[`--mantine-color-${i}-6`]:t.colors[e][6],[`--mantine-color-${i}-7`]:t.colors[e][7],[`--mantine-color-${i}-8`]:t.colors[e][8],[`--mantine-color-${i}-9`]:t.colors[e][9],...a}:a}function Qd(t,e,n){cr(e).forEach(i=>Object.assign(t,{[`--mantine-${n}-${i}`]:e[i]}))}const N8=t=>{const e=_v(t,"light"),n=t.defaultRadius in t.radius?t.radius[t.defaultRadius]:ge(t.defaultRadius),i={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":PB(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-success":"var(--mantine-color-teal-8)","--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":PB(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-success":"var(--mantine-color-teal-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)"}};Qd(i.variables,t.breakpoints,"breakpoint"),Qd(i.variables,t.spacing,"spacing"),Qd(i.variables,t.fontSizes,"font-size"),Qd(i.variables,t.lineHeights,"line-height"),Qd(i.variables,t.shadows,"shadow"),Qd(i.variables,t.radius,"radius"),Qd(i.variables,t.fontWeights,"font-weight"),t.colors[t.primaryColor].forEach((s,a)=>{i.variables[`--mantine-primary-color-${a}`]=`var(--mantine-color-${t.primaryColor}-${a})`}),cr(t.colors).forEach(s=>{const a=t.colors[s];if(UE(a)){Object.assign(i.light,Mb({theme:t,name:a.name,color:a.light,colorScheme:"light",withColorValues:!0})),Object.assign(i.dark,Mb({theme:t,name:a.name,color:a.dark,colorScheme:"dark",withColorValues:!0})),i.light[`--mantine-color-${a.name}-contrast`]=fO(a,t,"light"),i.dark[`--mantine-color-${a.name}-contrast`]=fO(a,t,"dark");return}a.forEach((l,u)=>{i.variables[`--mantine-color-${s}-${u}`]=l}),Object.assign(i.light,Mb({theme:t,color:s,colorScheme:"light",withColorValues:!1})),Object.assign(i.dark,Mb({theme:t,color:s,colorScheme:"dark",withColorValues:!1}))});const r=t.headings.sizes;return cr(r).forEach(s=>{i.variables[`--mantine-${s}-font-size`]=r[s].fontSize,i.variables[`--mantine-${s}-line-height`]=r[s].lineHeight,i.variables[`--mantine-${s}-font-weight`]=r[s].fontWeight||t.headings.fontWeight}),i};function _Z(){const t=Ar(),e=Bw(),n=cr(t.breakpoints).reduce((i,r)=>{const s=t.breakpoints[r].includes("px"),a=jv(t.breakpoints[r]);return`${i}@media (max-width: ${s?`${a-.1}px`:Ps(a-.1)}) {.mantine-visible-from-${r} {display: none !important;}}@media (min-width: ${s?`${a}px`:Ps(a)}) {.mantine-hidden-from-${r} {display: none !important;}}`},"");return o.jsx("style",{"data-mantine-styles":"classes",nonce:e==null?void 0:e(),dangerouslySetInnerHTML:{__html:n}})}function kZ({theme:t,generator:e}){const n=N8(t),i=e==null?void 0:e(t);return i?HE(n,i):n}const V_=N8(GE);function TZ(t){const e={variables:{},light:{},dark:{}};return cr(t.variables).forEach(n=>{V_.variables[n]!==t.variables[n]&&(e.variables[n]=t.variables[n])}),cr(t.light).forEach(n=>{V_.light[n]!==t.light[n]&&(e.light[n]=t.light[n])}),cr(t.dark).forEach(n=>{V_.dark[n]!==t.dark[n]&&(e.dark[n]=t.dark[n])}),e}function OZ(t){return D8({variables:{},dark:{"--mantine-color-scheme":"dark"},light:{"--mantine-color-scheme":"light"}},t)}function I8({cssVariablesSelector:t,deduplicateCssVariables:e}){const n=Ar(),i=Bw(),r=kZ({theme:n,generator:pZ()}),s=(t===void 0||t===":root"||t===":host")&&e,a=D8(s?TZ(r):r,t);return a?o.jsx("style",{"data-mantine-styles":!0,nonce:i==null?void 0:i(),dangerouslySetInnerHTML:{__html:`${a}${s?"":OZ(t)}`}}):null}I8.displayName="@mantine/CssVariables";function EZ({respectReducedMotion:t,getRootElement:e}){uc(()=>{var n;t&&((n=e())==null||n.setAttribute("data-respect-reduced-motion","true"))},[t])}function B8({theme:t,children:e,getStyleNonce:n,withStaticClasses:i=!0,withGlobalClasses:r=!0,deduplicateCssVariables:s=!0,withCssVariables:a=!0,cssVariablesSelector:l,classNamesPrefix:u="mantine",colorSchemeManager:d=oZ(),defaultColorScheme:f="light",getRootElement:p=()=>document.documentElement,cssVariablesResolver:m,forceColorScheme:v,stylesTransform:y,env:b,deduplicateInlineStyles:A=!1}){const{colorScheme:w,setColorScheme:S,clearColorScheme:j}=AZ({defaultColorScheme:f,forceColorScheme:v,manager:d,getRootElement:p});return EZ({respectReducedMotion:(t==null?void 0:t.respectReducedMotion)||!1,getRootElement:p}),o.jsx(VE,{value:{colorScheme:w,setColorScheme:S,clearColorScheme:j,getRootElement:p,classNamesPrefix:u,getStyleNonce:n,cssVariablesResolver:m,cssVariablesSelector:l??":root",withStaticClasses:i,stylesTransform:y,env:b,deduplicateInlineStyles:A},children:o.jsxs(R8,{theme:t,children:[a&&o.jsx(I8,{cssVariablesSelector:l,deduplicateCssVariables:s}),r&&o.jsx(_Z,{}),e]})})}B8.displayName="@mantine/core/MantineProvider";function we(t,e,n){var a;const i=Ar(),r=(Array.isArray(t)?t:[t]).filter(Boolean);let s={};for(const l of r){const u=(a=i.components[l])==null?void 0:a.defaultProps,d=typeof u=="function"?u(i):u;d&&(s={...s,...d})}return{...e,...s,...vy(n)}}function na({classNames:t,styles:e,props:n,stylesCtx:i}){const r=Ar();return{resolvedClassNames:t===void 0?void 0:Cv({theme:r,classNames:t,props:n,stylesCtx:i||void 0}),resolvedStyles:e===void 0?void 0:y1({theme:r,styles:e,props:n,stylesCtx:i||void 0})}}const MZ={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function RZ({theme:t,options:e,unstyled:n}){return Yi((e==null?void 0:e.focusable)&&!n&&(t.focusClassName||MZ[t.focusRing]),(e==null?void 0:e.active)&&!n&&t.activeClassName)}function DZ({selector:t,stylesCtx:e,options:n,props:i,theme:r}){return Cv({theme:r,classNames:n==null?void 0:n.classNames,props:(n==null?void 0:n.props)||i,stylesCtx:e})[t]}function NZ({selector:t,stylesCtx:e,theme:n,classNames:i,props:r}){return Cv({theme:n,classNames:i,props:r,stylesCtx:e})[t]}function IZ({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 LZ({themeName:t,classNamesPrefix:e,selector:n,withStaticClass:i}){return i===!1?[]:t.map(r=>`${e}-${r}-${n}`)}function PZ({options:t,classes:e,selector:n,unstyled:i}){return t!=null&&t.variant&&!i?e[`${n}--${t.variant}`]:void 0}function FZ({theme:t,options:e,themeName:n,selector:i,classNamesPrefix:r,resolvedClassNames:s,resolvedThemeClassNames:a,classes:l,unstyled:u,className:d,rootSelector:f,props:p,stylesCtx:m,withStaticClasses:v,headless:y,transformedStyles:b}){return Yi(RZ({theme:t,options:e,unstyled:u||y}),a.map(A=>A[i]),PZ({options:e,classes:l,selector:i,unstyled:u||y}),s[i],NZ({selector:i,stylesCtx:m,theme:t,classNames:b,props:p}),DZ({selector:i,stylesCtx:m,options:e,props:p,theme:t}),IZ({rootSelector:f,selector:i,className:d}),BZ({selector:i,classes:l,unstyled:u||y}),v&&!y&&LZ({themeName:n,classNamesPrefix:r,selector:i,withStaticClass:e==null?void 0:e.withStaticClass}),e==null?void 0:e.className)}function KE({style:t,theme:e}){return Array.isArray(t)?t.reduce((n,i)=>({...n,...KE({style:i,theme:e})}),{}):typeof t=="function"?t(e):t??{}}function $Z({theme:t,selector:e,options:n,props:i,stylesCtx:r,rootSelector:s,withStylesTransform:a,resolvedStyles:l,resolvedThemeStyles:u,resolvedVars:d,resolvedRootStyle:f}){return{...u[e],...l[e],...!a&&y1({theme:t,styles:n==null?void 0:n.styles,props:(n==null?void 0:n.props)||i,stylesCtx:r})[e],...d[e],...s===e?f:null,...KE({style:n==null?void 0:n.style,theme:t})}}function zZ(t){return t.reduce((e,n)=>(n&&Object.keys(n).forEach(i=>{e[i]={...e[i],...vy(n[i])}}),e),{})}function HZ({props:t,stylesCtx:e,themeName:n,theme:i}){var a;const r=(a=xZ())==null?void 0:a();return{getTransformedStyles:l=>r?[...l.map(u=>r(u,{props:t,theme:i,ctx:e})),...n.map(u=>{var d;return r((d=i.components[u])==null?void 0:d.styles,{props:t,theme:i,ctx:e})})].filter(Boolean):[],withStylesTransform:!!r}}function gt({name:t,classes:e,props:n,stylesCtx:i,className:r,style:s,rootSelector:a="root",unstyled:l,classNames:u,styles:d,vars:f,varsResolver:p,attributes:m}){var F;const v=Ar(),y=mZ(),b=gZ(),A=vZ(),w=(Array.isArray(t)?t:[t]).filter(I=>I),{withStylesTransform:S,getTransformedStyles:j}=HZ({props:n,stylesCtx:i,themeName:w,theme:v}),C=Cv({theme:v,classNames:u,props:n,stylesCtx:i}),k=w.map(I=>{var Q;return Cv({theme:v,classNames:(Q=v.components[I])==null?void 0:Q.classNames,props:n,stylesCtx:i})}),E=S?{}:y1({theme:v,styles:d,props:n,stylesCtx:i}),M={};if(!S)for(const I of w){const Q=y1({theme:v,styles:(F=v.components[I])==null?void 0:F.styles,props:n,stylesCtx:i});for(const G of Object.keys(Q))M[G]={...M[G],...Q[G]}}const R=zZ([A?{}:p==null?void 0:p(v,n,i),...w.map(I=>{var Q,G,L;return(L=(G=(Q=v.components)==null?void 0:Q[I])==null?void 0:G.vars)==null?void 0:L.call(G,v,n,i)}),f==null?void 0:f(v,n,i)]),D=KE({style:s,theme:v});return(I,Q)=>({...m==null?void 0:m[I],className:FZ({theme:v,options:Q,themeName:w,selector:I,classNamesPrefix:y,resolvedClassNames:C,resolvedThemeClassNames:k,classes:e,unstyled:l,className:r,rootSelector:a,props:n,stylesCtx:i,withStaticClasses:b,headless:A,transformedStyles:j([Q==null?void 0:Q.styles,d])}),style:$Z({theme:v,selector:I,options:Q,props:n,stylesCtx:i,rootSelector:a,withStylesTransform:S,resolvedStyles:E,resolvedThemeStyles:M,resolvedVars:R,resolvedRootStyle:D})})}function lv(t){return cr(t).reduce((e,n)=>t[n]!==void 0?`${e}${pK(n)}:${t[n]};`:e,"").trim()}function qZ({selector:t,styles:e,media:n,container:i}){const r=e?lv(e):"",s=Array.isArray(n)?n.map(l=>`@media${l.query}{${t}{${lv(l.styles)}}}`):[],a=Array.isArray(i)?i.map(l=>`@container ${l.query}{${t}{${lv(l.styles)}}}`):[];return`${r?`${t}{${r}}`:""}${s.join("")}${a.join("")}`.trim()}function QZ(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 Pw({deduplicate:t,...e}){const n=Bw(),i=qZ(e);return t?o.jsx("style",{href:`mantine-${QZ(i)}`,precedence:"mantine",nonce:n==null?void 0:n(),children:i}):o.jsx("style",{"data-mantine-styles":"inline",nonce:n==null?void 0:n(),dangerouslySetInnerHTML:{__html:i}})}function YZ(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 WZ(t,e){return`__mdi__-${YZ(`${t?lv(t):""}|${Array.isArray(e)?e.map(n=>`${n.query}:${lv(n.styles)}`).join("|"):""}`)}`}function Sy(t){const{m:e,mx:n,my:i,mt:r,mb:s,ml:a,mr:l,me:u,ms:d,mis:f,mie:p,p:m,px:v,py:y,pt:b,pb:A,pl:w,pr:S,pe:j,ps:C,pis:k,pie:E,bd:M,bdrs:R,bg:D,c:F,opacity:I,ff:Q,fz:G,fw:L,lts:q,ta:N,lh:P,fs:Y,tt:K,td:W,w:z,miw:U,maw:V,h:J,mih:ee,mah:ce,bgsz:he,bgp:Oe,bgr:Te,bga:Re,pos:qe,top:ie,left:je,bottom:se,right:be,inset:Be,display:Ce,flex:Ve,hiddenFrom:st,visibleFrom:Ye,lightHidden:Ge,darkHidden:dt,sx:nt,...Ee}=t;return{styleProps:vy({m:e,mx:n,my:i,mt:r,mb:s,ml:a,mr:l,me:u,ms:d,mis:f,mie:p,p:m,px:v,py:y,pt:b,pb:A,pl:w,pr:S,pis:k,pie:E,pe:j,ps:C,bd:M,bg:D,c:F,opacity:I,ff:Q,fz:G,fw:L,lts:q,ta:N,lh:P,fs:Y,tt:K,td:W,w:z,miw:U,maw:V,h:J,mih:ee,mah:ce,bgsz:he,bgp:Oe,bgr:Te,bga:Re,pos:qe,top:ie,left:je,bottom:se,right:be,inset:Be,display:Ce,flex:Ve,bdrs:R,hiddenFrom:st,visibleFrom:Ye,lightHidden:Ge,darkHidden:dt,sx:nt}),rest:Ee}}const UZ={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 ZE(t,e){const n=mc({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 VZ(t,e){const n=mc({color:t,theme:e});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:ZE(t,e)}function GZ(t,e){if(typeof t=="number")return ge(t);if(typeof t=="string"){const[n,i,...r]=t.split(" ").filter(a=>a.trim()!=="");let s=`${ge(n)}`;return i&&(s+=` ${i}`),r.length>0&&(s+=` ${ZE(r.join(" "),e)}`),s.trim()}return t}const qB={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 XZ(t){return typeof t=="string"&&t in qB?qB[t]:t}const KZ=["h1","h2","h3","h4","h5","h6"];function ZZ(t,e){return typeof t=="string"&&t in e.fontSizes?`var(--mantine-font-size-${t})`:typeof t=="string"&&KZ.includes(t)?`var(--mantine-${t}-font-size)`:typeof t=="number"||typeof t=="string"?ge(t):t}function JZ(t){return t}const eJ=["h1","h2","h3","h4","h5","h6"];function tJ(t,e){return typeof t=="string"&&t in e.lineHeights?`var(--mantine-line-height-${t})`:typeof t=="string"&&eJ.includes(t)?`var(--mantine-${t}-line-height)`:t}function nJ(t,e){return typeof t=="string"&&t in e.radius?`var(--mantine-radius-${t})`:typeof t=="number"||typeof t=="string"?ge(t):t}function iJ(t){return typeof t=="number"?ge(t):t}function rJ(t,e){if(typeof t=="number")return ge(t);if(typeof t=="string"){const n=t.replace("-","");if(!(n in e.spacing))return ge(t);const i=`--mantine-spacing-${n}`;return t.startsWith("-")?`calc(var(${i}) * -1)`:`var(${i})`}return t}const G_={color:ZE,textColor:VZ,fontSize:ZZ,spacing:rJ,radius:nJ,identity:JZ,size:iJ,lineHeight:tJ,fontFamily:XZ,border:GZ};function QB(t){return t.replace("(min-width: ","").replace("em)","")}function sJ({media:t,...e}){const n=Object.keys(t).sort((i,r)=>Number(QB(i))-Number(QB(r))).map(i=>({query:i,styles:t[i]}));return{...e,media:n}}function oJ(t){if(typeof t!="object"||t===null)return!1;const e=Object.keys(t);return!(e.length===1&&e[0]==="base")}function aJ(t){return typeof t=="object"&&t!==null?"base"in t?t.base:void 0:t}function lJ(t){return typeof t=="object"&&t!==null?cr(t).filter(e=>e!=="base"):[]}function cJ(t,e){return typeof t=="object"&&t!==null&&e in t?t[e]:t}function uJ({styleProps:t,data:e,theme:n}){return sJ(cr(t).reduce((i,r)=>{if(r==="hiddenFrom"||r==="visibleFrom"||r==="sx")return i;const s=e[r],a=Array.isArray(s.property)?s.property:[s.property],l=aJ(t[r]);if(!oJ(t[r]))return a.forEach(d=>{i.inlineStyles[d]=G_[s.type](l,n)}),i;i.hasResponsiveStyles=!0;const u=lJ(t[r]);return a.forEach(d=>{l!=null&&(i.styles[d]=G_[s.type](l,n)),u.forEach(f=>{const p=`(min-width: ${n.breakpoints[f]})`;i.media[p]={...i.media[p],[d]:G_[s.type](cJ(t[r],f),n)}})}),i},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function L8(){return`__m__-${T.useId().replace(/[:«»]/g,"")}`}function Fm(t,e){return Array.isArray(t)?[...t].reduce((n,i)=>({...n,...Fm(i,e)}),{}):typeof t=="function"?t(e):t??{}}function hJ(t){return t}const P8=hJ;function F8(t){return t}function Pe(t){const e=t;return e.extend=F8,e.withProps=n=>{const i=r=>o.jsx(e,{...n,...r});return i.extend=e.extend,i.displayName=`WithProps(${e.displayName})`,i},e}function md(t){return Pe(t)}function ss(t){const e=t;return e.withProps=n=>{const i=r=>o.jsx(e,{...n,...r});return i.extend=e.extend,i.displayName=`WithProps(${e.displayName})`,i},e.extend=F8,e}function $8(t){return`data-${(t.startsWith("data-")?t.slice(5):t).replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}`}function dJ(t){return Object.keys(t).reduce((e,n)=>{const i=t[n];return i===void 0||i===""||i===!1||i===null||(e[$8(n)]=t[n]),e},{})}function z8(t){return t?typeof t=="string"?{[$8(t)]:!0}:Array.isArray(t)?[...t].reduce((e,n)=>({...e,...z8(n)}),{}):dJ(t):null}function pO(t,e){return Array.isArray(t)?[...t].reduce((n,i)=>({...n,...pO(i,e)}),{}):typeof t=="function"?t(e):t??{}}function fJ({theme:t,style:e,vars:n,styleProps:i}){const r=pO(e,t),s=pO(n,t);return{...r,...s,...i}}function H8({component:t,style:e,__vars:n,className:i,variant:r,mod:s,size:a,hiddenFrom:l,visibleFrom:u,lightHidden:d,darkHidden:f,renderRoot:p,__size:m,ref:v,...y}){var D,F;const b=Ar(),A=t||"div",{styleProps:w,rest:S}=Sy(y),j=(F=(D=yZ())==null?void 0:D())==null?void 0:F(w.sx),C=L8(),k=uJ({styleProps:w,theme:b,data:UZ}),E=bZ(),M=E&&k.hasResponsiveStyles?WZ(k.styles,k.media):C,R={ref:v,style:fJ({theme:b,style:e,vars:n,styleProps:k.inlineStyles}),className:Yi(i,j,{[M]:k.hasResponsiveStyles,"mantine-light-hidden":d,"mantine-dark-hidden":f,[`mantine-hidden-from-${l}`]:l,[`mantine-visible-from-${u}`]:u}),"data-variant":r,"data-size":y8(a)?void 0:a||void 0,size:m,...z8(s),...S};return o.jsxs(o.Fragment,{children:[k.hasResponsiveStyles&&o.jsx(Pw,{selector:`.${M}`,styles:k.styles,media:k.media,deduplicate:E}),typeof p=="function"?p(R):o.jsx(A,{...R})]})}H8.displayName="@mantine/core/Box";const xe=P8(H8),pJ=T.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function vc(){return T.use(pJ)}const mJ={transitionDuration:200,transitionTimingFunction:"ease",animateOpacity:!0,orientation:"vertical",keepMounted:!0,keepMountedMode:"activity"},Fw=Pe(t=>{const{children:e,expanded:n,transitionDuration:i,transitionTimingFunction:r,style:s,onTransitionEnd:a,onTransitionStart:l,animateOpacity:u,keepMounted:d,keepMountedMode:f,ref:p,orientation:m,...v}=we("Collapse",mJ,t),y=wy(),b=Ar(),A=Ay(),w=b.respectReducedMotion&&A?0:i,S=(m==="horizontal"?ZK:XK)({expanded:n,transitionDuration:w,transitionTimingFunction:r,onTransitionEnd:a,onTransitionStart:l,keepMounted:!1});if(w===0)return d===!0&&(f==="display-none"||y!=="test")?f==="display-none"?o.jsx(xe,{...v,style:{...Fm(s,b),...n?{}:{display:"none"}},ref:p,children:e}):o.jsx(T.Activity,{mode:n?"visible":"hidden",children:o.jsx(xe,{...v,style:s,ref:p,children:e})}):n?o.jsx(xe,{...v,style:s,ref:p,children:e}):null;const j=S.state==="exited";let C;return d===!1?C=j?null:e:d===!0?C=f==="display-none"?e:o.jsx(T.Activity,{mode:j?"hidden":"visible",children:e}):C=e,o.jsx(xe,{...v,...S.getCollapseProps({style:{opacity:n||!u?1:0,transition:u?`opacity ${w}ms ${r}`:"none",...Fm(s,b),...d&&f==="display-none"&&j?{display:"none"}:{}},ref:p}),children:C})});Fw.displayName="@mantine/core/Collapse";const[gJ,Na]=rs("ScrollArea.Root component was not found in tree");function Zh(t,e){const n=T.useEffectEvent(e);uc(()=>{let i=0;if(t){const r=new ResizeObserver(()=>{cancelAnimationFrame(i),i=window.requestAnimationFrame(n)});return r.observe(t),()=>{window.cancelAnimationFrame(i),r.unobserve(t)}}},[t])}function vJ(t){const{style:e,...n}=t,i=Na(),[r,s]=T.useState(0),[a,l]=T.useState(0),u=!!(r&&a);return Zh(i.scrollbarX,()=>{var f;const d=((f=i.scrollbarX)==null?void 0:f.offsetHeight)||0;i.onCornerHeightChange(d),l(d)}),Zh(i.scrollbarY,()=>{var f;const d=((f=i.scrollbarY)==null?void 0:f.offsetWidth)||0;i.onCornerWidthChange(d),s(d)}),u?o.jsx("div",{...n,style:{...e,width:r,height:a}}):null}function yJ(t){const e=Na(),n=!!(e.scrollbarX&&e.scrollbarY);return e.type!=="scroll"&&n?o.jsx(vJ,{...t}):null}const xJ={scrollHideDelay:1e3,type:"hover"};function q8(t){const{type:e,scrollHideDelay:n,scrollbars:i,getStyles:r,ref:s,...a}=we("ScrollAreaRoot",xJ,t),[l,u]=T.useState(null),[d,f]=T.useState(null),[p,m]=T.useState(null),[v,y]=T.useState(null),[b,A]=T.useState(null),[w,S]=T.useState(0),[j,C]=T.useState(0),[k,E]=T.useState(!1),[M,R]=T.useState(!1),D=Dn(s,u);return o.jsx(gJ,{value:{type:e,scrollHideDelay:n,scrollArea:l,viewport:d,onViewportChange:f,content:p,onContentChange:m,scrollbarX:v,onScrollbarXChange:y,scrollbarXEnabled:k,onScrollbarXEnabledChange:E,scrollbarY:b,onScrollbarYChange:A,scrollbarYEnabled:M,onScrollbarYEnabledChange:R,onCornerWidthChange:S,onCornerHeightChange:C,getStyles:r},children:o.jsx(xe,{...a,ref:D,__vars:{"--sa-corner-width":i!=="xy"?"0px":`${w}px`,"--sa-corner-height":i!=="xy"?"0px":`${j}px`}})})}q8.displayName="@mantine/core/ScrollAreaRoot";function Q8(t,e){const n=t/e;return Number.isNaN(n)?0:n}function $w(t){const e=Q8(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=(t.scrollbar.size-n)*e;return Math.max(i,18)}function Y8(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const i=(e[1]-e[0])/(t[1]-t[0]);return e[0]+i*(n-t[0])}}function bJ(t,[e,n]){return Math.min(n,Math.max(e,t))}function YB(t,e,n="ltr"){const i=$w(e),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,s=e.scrollbar.size-r,a=e.content-e.viewport,l=s-i,u=bJ(t,n==="ltr"?[0,a]:[a*-1,0]);return Y8([0,a],[0,l])(u)}function AJ(t,e,n,i="ltr"){const r=$w(n),s=r/2,a=e||s,l=r-a,u=n.scrollbar.paddingStart+a,d=n.scrollbar.size-n.scrollbar.paddingEnd-l,f=n.content-n.viewport,p=i==="ltr"?[0,f]:[f*-1,0];return Y8([u,d],p)(t)}function W8(t,e){return t>0&&t<e}function Ph(t){return t?parseInt(t,10):0}function _f(t,e,{checkForDefaultPrevented:n=!0}={}){return i=>{t==null||t(i),(n===!1||!i.defaultPrevented)&&(e==null||e(i))}}const[wJ,U8]=rs("ScrollAreaScrollbar was not found in tree");function V8(t){const{sizes:e,hasThumb:n,onThumbChange:i,onThumbPointerUp:r,onThumbPointerDown:s,onThumbPositionChange:a,onDragScroll:l,onWheelScroll:u,onResize:d,ref:f,...p}=t,m=Na(),[v,y]=T.useState(null),b=Dn(f,y),A=T.useRef(null),w=T.useRef(""),{viewport:S}=m,j=e.content-e.viewport,C=T.useEffectEvent(u),k=Yp(a),E=Rw(d,10),M=R=>{if(A.current){const D=R.clientX-A.current.left,F=R.clientY-A.current.top;l({x:D,y:F})}};return T.useEffect(()=>{const R=D=>{const F=D.target;v!=null&&v.contains(F)&&C(D,j)};return document.addEventListener("wheel",R,{passive:!1}),()=>document.removeEventListener("wheel",R,{passive:!1})},[S,v,j]),T.useEffect(k,[e,k]),Zh(v,E),Zh(m.content,E),o.jsx(wJ,{value:{scrollbar:v,hasThumb:n,onThumbChange:Yp(i),onThumbPointerUp:Yp(r),onThumbPositionChange:k,onThumbPointerDown:Yp(s)},children:o.jsx("div",{...p,ref:b,"data-mantine-scrollbar":!0,style:{position:"absolute",...p.style},onPointerDown:_f(t.onPointerDown,R=>{R.preventDefault(),R.button===0&&(R.target.setPointerCapture(R.pointerId),A.current=v.getBoundingClientRect(),w.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",M(R))}),onPointerMove:_f(t.onPointerMove,M),onPointerUp:_f(t.onPointerUp,R=>{const D=R.target;D.hasPointerCapture(R.pointerId)&&(R.preventDefault(),D.releasePointerCapture(R.pointerId))}),onLostPointerCapture:()=>{document.body.style.webkitUserSelect=w.current,A.current=null}})})}const G8=t=>{const{sizes:e,onSizesChange:n,style:i,ref:r,...s}=t,a=Na(),[l,u]=T.useState(),d=T.useRef(null),f=Dn(r,d,a.onScrollbarXChange);return T.useEffect(()=>{d.current&&u(getComputedStyle(d.current))},[d]),o.jsx(V8,{"data-orientation":"horizontal",...s,ref:f,sizes:e,style:{...i,"--sa-thumb-width":`${$w(e)}px`},onThumbPointerDown:p=>t.onThumbPointerDown(p.x),onDragScroll:p=>t.onDragScroll(p.x),onWheelScroll:(p,m)=>{if(a.viewport){const v=a.viewport.scrollLeft+p.deltaX;t.onWheelScroll(v),W8(v,m)&&p.preventDefault()}},onResize:()=>{d.current&&a.viewport&&l&&n({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:Ph(l.paddingLeft),paddingEnd:Ph(l.paddingRight)}})}})};G8.displayName="@mantine/core/ScrollAreaScrollbarX";function X8(t){const{sizes:e,onSizesChange:n,style:i,ref:r,...s}=t,a=Na(),[l,u]=T.useState(),d=T.useRef(null),f=Dn(r,d,a.onScrollbarYChange);return T.useEffect(()=>{d.current&&u(window.getComputedStyle(d.current))},[]),o.jsx(V8,{...s,"data-orientation":"vertical",ref:f,sizes:e,style:{"--sa-thumb-height":`${$w(e)}px`,...i},onThumbPointerDown:p=>t.onThumbPointerDown(p.y),onDragScroll:p=>t.onDragScroll(p.y),onWheelScroll:(p,m)=>{if(a.viewport){const v=a.viewport.scrollTop+p.deltaY;t.onWheelScroll(v),W8(v,m)&&p.preventDefault()}},onResize:()=>{d.current&&a.viewport&&l&&n({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:Ph(l.paddingTop),paddingEnd:Ph(l.paddingBottom)}})}})}X8.displayName="@mantine/core/ScrollAreaScrollbarY";function zw(t){const{orientation:e="vertical",...n}=t,{dir:i}=vc(),r=Na(),s=T.useRef(null),a=T.useRef(0),[l,u]=T.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=Q8(l.viewport,l.content),f={...n,sizes:l,onSizesChange:u,hasThumb:d>0&&d<1,onThumbChange:m=>{s.current=m},onThumbPointerUp:()=>{a.current=0},onThumbPointerDown:m=>{a.current=m}},p=(m,v)=>AJ(m,a.current,l,v);return e==="horizontal"?o.jsx(G8,{...f,onThumbPositionChange:()=>{if(r.viewport&&s.current){const m=r.viewport.scrollLeft,v=YB(m,l,i);s.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:m=>{r.viewport&&(r.viewport.scrollLeft=m)},onDragScroll:m=>{r.viewport&&(r.viewport.scrollLeft=p(m,i))}}):e==="vertical"?o.jsx(X8,{...f,onThumbPositionChange:()=>{if(r.viewport&&s.current){const m=r.viewport.scrollTop,v=YB(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=>{r.viewport&&(r.viewport.scrollTop=m)},onDragScroll:m=>{r.viewport&&(r.viewport.scrollTop=p(m))}}):null}zw.displayName="@mantine/core/ScrollAreaScrollbarVisible";function JE(t){const e=Na(),{forceMount:n,...i}=t,[r,s]=T.useState(!1),a=t.orientation==="horizontal",l=Rw(()=>{if(e.viewport){const u=e.viewport.offsetWidth<e.viewport.scrollWidth,d=e.viewport.offsetHeight<e.viewport.scrollHeight;s(a?u:d)}},10);return Zh(e.viewport,l),Zh(e.content,l),n||r?o.jsx(zw,{"data-state":r?"visible":"hidden",...i}):null}JE.displayName="@mantine/core/ScrollAreaScrollbarAuto";function K8(t){const{forceMount:e,...n}=t,i=Na(),[r,s]=T.useState(!1);return T.useEffect(()=>{const{scrollArea:a}=i;let l=0;if(a){const u=()=>{window.clearTimeout(l),s(!0)},d=()=>{l=window.setTimeout(()=>s(!1),i.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",d)}}},[i.scrollArea,i.scrollHideDelay]),e||r?o.jsx(JE,{"data-state":r?"visible":"hidden",...n}):null}K8.displayName="@mantine/core/ScrollAreaScrollbarHover";function SJ(t){const{forceMount:e,...n}=t,i=Na(),r=t.orientation==="horizontal",[s,a]=T.useState("hidden"),l=Rw(()=>a("idle"),100);return T.useEffect(()=>{if(s==="idle"){const u=window.setTimeout(()=>a("hidden"),i.scrollHideDelay);return()=>window.clearTimeout(u)}},[s,i.scrollHideDelay]),T.useEffect(()=>{const{viewport:u}=i,d=r?"scrollLeft":"scrollTop";if(u){let f=u[d];const p=()=>{const m=u[d];f!==m&&(a("scrolling"),l()),f=m};return u.addEventListener("scroll",p),()=>u.removeEventListener("scroll",p)}},[i.viewport,r,l]),e||s!=="hidden"?o.jsx(zw,{"data-state":s==="hidden"?"hidden":"visible",...n,onPointerEnter:_f(t.onPointerEnter,()=>a("interacting")),onPointerLeave:_f(t.onPointerLeave,()=>a("idle"))}):null}function mO(t){const{forceMount:e,...n}=t,i=Na(),{onScrollbarXEnabledChange:r,onScrollbarYEnabledChange:s}=i,a=t.orientation==="horizontal";return T.useEffect(()=>(a?r(!0):s(!0),()=>{a?r(!1):s(!1)}),[a,r,s]),i.type==="hover"?o.jsx(K8,{...n,forceMount:e}):i.type==="scroll"?o.jsx(SJ,{...n,forceMount:e}):i.type==="auto"?o.jsx(JE,{...n,forceMount:e}):i.type==="always"?o.jsx(zw,{...n}):null}mO.displayName="@mantine/core/ScrollAreaScrollbar";function jJ(t,e=()=>{}){let n={left:t.scrollLeft,top:t.scrollTop},i=0;return(function r(){const s={left:t.scrollLeft,top:t.scrollTop},a=n.left!==s.left,l=n.top!==s.top;(a||l)&&e(),n=s,i=window.requestAnimationFrame(r)})(),()=>window.cancelAnimationFrame(i)}function Z8(t){const{style:e,ref:n,...i}=t,r=Na(),s=U8(),{onThumbPositionChange:a}=s,l=Dn(n,s.onThumbChange),u=T.useRef(void 0),d=Rw(()=>{u.current&&(u.current(),u.current=void 0)},100);return T.useEffect(()=>{const{viewport:f}=r;if(f){const p=()=>{if(d(),!u.current){const m=jJ(f,a);u.current=m,a()}};return a(),f.addEventListener("scroll",p),()=>f.removeEventListener("scroll",p)}},[r.viewport,d,a]),o.jsx("div",{"data-state":s.hasThumb?"visible":"hidden",...i,ref:l,style:{width:"var(--sa-thumb-width)",height:"var(--sa-thumb-height)",...e},onPointerDownCapture:_f(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:_f(t.onPointerUp,s.onThumbPointerUp)})}Z8.displayName="@mantine/core/ScrollAreaThumb";function gO(t){const{forceMount:e,...n}=t,i=U8();return e||i.hasThumb?o.jsx(Z8,{...n}):null}gO.displayName="@mantine/core/ScrollAreaThumb";function J8({children:t,style:e,ref:n,onWheel:i,...r}){const s=Na(),a=Dn(n,s.onViewportChange),l=u=>{if(i==null||i(u),s.scrollbarXEnabled&&s.viewport&&u.shiftKey){const{scrollTop:d,scrollHeight:f,clientHeight:p,scrollWidth:m,clientWidth:v}=s.viewport,y=d<1,b=d>=f-p-1;m>v&&(y||b)&&u.stopPropagation()}};return o.jsx(xe,{...r,ref:a,onWheel:l,"data-scrollarea-viewport":!0,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e},children:o.jsx("div",{...s.getStyles("content"),ref:s.onContentChange,children:t})})}J8.displayName="@mantine/core/ScrollAreaViewport";var eM={root:"m_d57069b5",content:"m_b1336c6",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};function Hw(){return typeof window<"u"}function dg(t){return e$(t)?(t.nodeName||"").toLowerCase():"#document"}function Js(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Cu(t){var e;return(e=(e$(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function e$(t){return Hw()?t instanceof Node||t instanceof Js(t).Node:!1}function Pi(t){return Hw()?t instanceof Element||t instanceof Js(t).Element:!1}function wl(t){return Hw()?t instanceof HTMLElement||t instanceof Js(t).HTMLElement:!1}function x1(t){return!Hw()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Js(t).ShadowRoot}function qw(t){const{overflow:e,overflowX:n,overflowY:i,display:r}=gl(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&r!=="inline"&&r!=="contents"}function CJ(t){return/^(table|td|th)$/.test(dg(t))}function Qw(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const _J=/transform|translate|scale|rotate|perspective|filter/,kJ=/paint|layout|strict|content/,Yd=t=>!!t&&t!=="none";let X_;function tM(t){const e=Pi(t)?gl(t):t;return Yd(e.transform)||Yd(e.translate)||Yd(e.scale)||Yd(e.rotate)||Yd(e.perspective)||!Yw()&&(Yd(e.backdropFilter)||Yd(e.filter))||_J.test(e.willChange||"")||kJ.test(e.contain||"")}function TJ(t){let e=Jh(t);for(;wl(e)&&!Wh(e);){if(tM(e))return e;if(Qw(e))return null;e=Jh(e)}return null}function Yw(){return X_==null&&(X_=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),X_}function Wh(t){return/^(html|body|#document)$/.test(dg(t))}function gl(t){return Js(t).getComputedStyle(t)}function Ww(t){return Pi(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Jh(t){if(dg(t)==="html")return t;const e=t.assignedSlot||t.parentNode||x1(t)&&t.host||Cu(t);return x1(e)?e.host:e}function t$(t){const e=Jh(t);return Wh(e)?(t.ownerDocument||t).body:wl(e)&&qw(e)?e:t$(e)}function cu(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=t$(t),s=r===((i=t.ownerDocument)==null?void 0:i.body),a=Js(r);if(s){const l=vO(a);return e.concat(a,a.visualViewport||[],qw(r)?r:[],l&&n?cu(l):[])}else return e.concat(r,cu(r,[],n))}function vO(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}const OJ=["top","right","bottom","left"],vl=Math.min,Oa=Math.max,b1=Math.round,Rb=Math.floor,uu=t=>({x:t,y:t}),EJ={left:"right",right:"left",bottom:"top",top:"bottom"};function n$(t,e,n){return Oa(t,vl(e,n))}function hc(t,e){return typeof t=="function"?t(e):t}function dc(t){return t.split("-")[0]}function fg(t){return t.split("-")[1]}function nM(t){return t==="x"?"y":"x"}function iM(t){return t==="y"?"height":"width"}function cl(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function rM(t){return nM(cl(t))}function MJ(t,e,n){n===void 0&&(n=!1);const i=fg(t),r=rM(t),s=iM(r);let a=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(a=A1(a)),[a,A1(a)]}function RJ(t){const e=A1(t);return[yO(t),e,yO(e)]}function yO(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const WB=["left","right"],UB=["right","left"],DJ=["top","bottom"],NJ=["bottom","top"];function IJ(t,e,n){switch(t){case"top":case"bottom":return n?e?UB:WB:e?WB:UB;case"left":case"right":return e?DJ:NJ;default:return[]}}function BJ(t,e,n,i){const r=fg(t);let s=IJ(dc(t),n==="start",i);return r&&(s=s.map(a=>a+"-"+r),e&&(s=s.concat(s.map(yO)))),s}function A1(t){const e=dc(t);return EJ[e]+t.slice(e.length)}function LJ(t){var e,n,i,r;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(i=t.bottom)!=null?i:0,left:(r=t.left)!=null?r:0}}function sM(t){return typeof t!="number"?LJ(t):{top:t,right:t,bottom:t,left:t}}function Uh(t){const{x:e,y:n,width:i,height:r}=t;return{width:i,height:r,top:n,left:e,right:e+i,bottom:n+r,x:e,y:n}}function PJ(){const t=navigator.userAgentData;return t!=null&&t.platform?t.platform:navigator.platform}function FJ(){const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(e=>{let{brand:n,version:i}=e;return n+"/"+i}).join(" "):navigator.userAgent}function $J(){return/apple/i.test(navigator.vendor)}function zJ(){return PJ().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function HJ(){return FJ().includes("jsdom/")}const VB="data-floating-ui-focusable",qJ="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function GB(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 kv(t,e){if(!t||!e)return!1;const n=e.getRootNode==null?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&x1(n)){let i=e;for(;i;){if(t===i)return!0;i=i.parentNode||i.host}}return!1}function Bp(t){return"composedPath"in t?t.composedPath()[0]:t.target}function K_(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 QJ(t){return t.matches("html,body")}function sf(t){return(t==null?void 0:t.ownerDocument)||document}function YJ(t){return wl(t)&&t.matches(qJ)}function WJ(t){if(!t||HJ())return!0;try{return t.matches(":focus-visible")}catch{return!0}}function UJ(t){return t?t.hasAttribute(VB)?t:t.querySelector("["+VB+"]")||t:null}function TA(t,e,n){return n===void 0&&(n=!0),t.filter(r=>{var s;return r.parentId===e&&(!n||((s=r.context)==null?void 0:s.open))}).flatMap(r=>[r,...TA(t,r.id,n)])}function VJ(t){return"nativeEvent"in t}function xO(t,e){const n=["mouse","pen"];return n.push("",void 0),n.includes(t)}var GJ=typeof document<"u",XJ=function(){},ac=GJ?T.useLayoutEffect:XJ;const KJ={...m8};function Db(t){const e=T.useRef(t);return ac(()=>{e.current=t}),e}const ZJ=KJ.useInsertionEffect,JJ=ZJ||(t=>t());function Ul(t){const e=T.useRef(()=>{});return JJ(()=>{e.current=t}),T.useCallback(function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return e.current==null?void 0:e.current(...i)},[])}function XB(t,e,n){let{reference:i,floating:r}=t;const s=cl(e),a=rM(e),l=iM(a),u=dc(e),d=s==="y",f=i.x+i.width/2-r.width/2,p=i.y+i.height/2-r.height/2,m=i[l]/2-r[l]/2;let v;switch(u){case"top":v={x:f,y:i.y-r.height};break;case"bottom":v={x:f,y:i.y+i.height};break;case"right":v={x:i.x+i.width,y:p};break;case"left":v={x:i.x-r.width,y:p};break;default:v={x:i.x,y:i.y}}const y=fg(e);return y&&(v[a]+=m*(y==="end"?1:-1)*(n&&d?-1:1)),v}async function eee(t,e){var n;e===void 0&&(e={});const{x:i,y:r,platform:s,rects:a,elements:l,strategy:u}=t,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:m=!1,padding:v=0}=hc(e,t),y=sM(v),A=l[m?p==="floating"?"reference":"floating":p],w=Uh(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(A)))==null||n?A:A.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:f,strategy:u})),S=p==="floating"?{x:i,y:r,width:a.floating.width,height:a.floating.height}:a.reference,j=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),C=await(s.isElement==null?void 0:s.isElement(j))&&await(s.getScale==null?void 0:s.getScale(j))||{x:1,y:1},k=Uh(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:S,offsetParent:j,strategy:u}):S);return{top:(w.top-k.top+y.top)/C.y,bottom:(k.bottom-w.bottom+y.bottom)/C.y,left:(w.left-k.left+y.left)/C.x,right:(k.right-w.right+y.right)/C.x}}const tee=50,nee=async(t,e,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:s=[],platform:a}=n,l=a.detectOverflow?a:{...a,detectOverflow:eee},u=await(a.isRTL==null?void 0:a.isRTL(e));let d=await a.getElementRects({reference:t,floating:e,strategy:r}),{x:f,y:p}=XB(d,i,u),m=i,v=0;const y={};for(let b=0;b<s.length;b++){const A=s[b];if(!A)continue;const{name:w,fn:S}=A,{x:j,y:C,data:k,reset:E}=await S({x:f,y:p,initialPlacement:i,placement:m,strategy:r,middlewareData:y,rects:d,platform:l,elements:{reference:t,floating:e}});f=j??f,p=C??p,y[w]={...y[w],...k},E&&v<tee&&(v++,typeof E=="object"&&(E.placement&&(m=E.placement),E.rects&&(d=E.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:r}):E.rects),{x:f,y:p}=XB(d,m,u)),b=-1)}return{x:f,y:p,placement:m,strategy:r,middlewareData:y}},iee=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:i,placement:r,rects:s,platform:a,elements:l,middlewareData:u}=e,{element:d,padding:f=0}=hc(t,e)||{};if(d==null)return{};const p=sM(f),m={x:n,y:i},v=rM(r),y=iM(v),b=await a.getDimensions(d),A=v==="y",w=A?"top":"left",S=A?"bottom":"right",j=A?"clientHeight":"clientWidth",C=s.reference[y]+s.reference[v]-m[v]-s.floating[y],k=m[v]-s.reference[v],E=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let M=E?E[j]:0;(!M||!await(a.isElement==null?void 0:a.isElement(E)))&&(M=l.floating[j]||s.floating[y]);const R=C/2-k/2,D=M/2-b[y]/2-1,F=vl(p[w],D),I=vl(p[S],D),Q=M-b[y]-I,G=M/2-b[y]/2+R,L=n$(F,G,Q),q=!u.arrow&&fg(r)!=null&&G!==L&&s.reference[y]/2-(G<F?F:I)-b[y]/2<0,N=q?G<F?G-F:G-Q:0;return{[v]:m[v]+N,data:{[v]:L,centerOffset:G-L-N,...q&&{alignmentOffset:N}},reset:q}}}),ree=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,i;const{placement:r,middlewareData:s,rects:a,initialPlacement:l,platform:u,elements:d}=e,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:b=!0,...A}=hc(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=dc(r),S=cl(l),j=dc(l)===l,C=await(u.isRTL==null?void 0:u.isRTL(d.floating)),k=m||(j||!b?[A1(l)]:RJ(l)),E=y!=="none";!m&&E&&k.push(...BJ(l,b,y,C));const M=[l,...k],R=await u.detectOverflow(e,A),D=[];let F=((i=s.flip)==null?void 0:i.overflows)||[];if(f&&D.push(R[w]),p){const L=MJ(r,a,C);D.push(R[L[0]],R[L[1]])}if(F=[...F,{placement:r,overflows:D}],!D.every(L=>L<=0)){var I,Q;const L=(((I=s.flip)==null?void 0:I.index)||0)+1,q=M[L];if(q&&(!(p==="alignment"?S!==cl(q):!1)||F.every(Y=>cl(Y.placement)===S?Y.overflows[0]>0:!0)))return{data:{index:L,overflows:F},reset:{placement:q}};let N=(Q=F.filter(P=>P.overflows[0]<=0).sort((P,Y)=>P.overflows[1]-Y.overflows[1])[0])==null?void 0:Q.placement;if(!N)switch(v){case"bestFit":{var G;const P=(G=F.filter(Y=>{if(E){const K=cl(Y.placement);return K===S||K==="y"}return!0}).map(Y=>[Y.placement,Y.overflows.filter(K=>K>0).reduce((K,W)=>K+W,0)]).sort((Y,K)=>Y[1]-K[1])[0])==null?void 0:G[0];P&&(N=P);break}case"initialPlacement":N=l;break}if(r!==N)return{reset:{placement:N}}}return{}}}};function KB(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function ZB(t){return OJ.some(e=>t[e]>=0)}const see=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:i}=e,{strategy:r="referenceHidden",...s}=hc(t,e);switch(r){case"referenceHidden":{const a=await i.detectOverflow(e,{...s,elementContext:"reference"}),l=KB(a,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:ZB(l)}}}case"escaped":{const a=await i.detectOverflow(e,{...s,altBoundary:!0}),l=KB(a,n.floating);return{data:{escapedOffsets:l,escaped:ZB(l)}}}default:return{}}}}};function i$(t){const e=vl(...t.map(s=>s.left)),n=vl(...t.map(s=>s.top)),i=Oa(...t.map(s=>s.right)),r=Oa(...t.map(s=>s.bottom));return{x:e,y:n,width:i-e,height:r-n}}function oee(t){const e=t.slice().sort((r,s)=>r.y-s.y),n=[];let i=null;for(let r=0;r<e.length;r++){const s=e[r];!i||s.y-i.y>i.height/2?n.push([s]):n[n.length-1].push(s),i=s}return n.map(r=>Uh(i$(r)))}const aee=function(t){return t===void 0&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:i,rects:r,platform:s,strategy:a}=e,{padding:l=2,x:u,y:d}=hc(t,e),f=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(i.reference))||[]);if(!f.length)return{};const p=oee(f),m=Uh(i$(f)),v=sM(l);function y(){if(p.length===2&&(p[0].left>p[1].right||p[1].left>p[0].right)&&u!=null&&d!=null)return p.find(A=>u>A.left-v.left&&u<A.right+v.right&&d>A.top-v.top&&d<A.bottom+v.bottom)||m;if(p.length>=2){if(cl(n)==="y"){const E=p[0],M=p[p.length-1],R=dc(n)==="top",D=E.top,F=M.bottom,I=R?E.left:M.left,Q=R?E.right:M.right;return Uh({x:I,y:D,width:Q-I,height:F-D})}const A=dc(n)==="left",w=Oa(...p.map(E=>E.right)),S=vl(...p.map(E=>E.left)),j=p.filter(E=>A?E.left===S:E.right===w),C=j[0].top,k=j[j.length-1].bottom;return Uh({x:S,y:C,width:w-S,height:k-C})}return m}const b=await s.getElementRects({reference:{getBoundingClientRect:y},floating:i.floating,strategy:a});return r.reference.x!==b.reference.x||r.reference.y!==b.reference.y||r.reference.width!==b.reference.width||r.reference.height!==b.reference.height?{reset:{rects:b}}:{}}}},r$=new Set(["left","top"]);async function lee(t,e){const{placement:n,platform:i,elements:r}=t,s=await(i.isRTL==null?void 0:i.isRTL(r.floating)),a=dc(n),l=fg(n),u=cl(n)==="y",d=r$.has(a)?-1:1,f=s&&u?-1:1,p=hc(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),u?{x:v*f,y:m*d}:{x:m*d,y:v*f}}const cee=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,i;const{x:r,y:s,placement:a,middlewareData:l}=e,u=await lee(e,t);return a===((n=l.offset)==null?void 0:n.placement)&&(i=l.arrow)!=null&&i.alignmentOffset?{}:{x:r+u.x,y:s+u.y,data:{...u,placement:a}}}}},uee=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:r,platform:s}=e,{mainAxis:a=!0,crossAxis:l=!1,limiter:u={fn:S=>{let{x:j,y:C}=S;return{x:j,y:C}}},...d}=hc(t,e),f={x:n,y:i},p=await s.detectOverflow(e,d),m=cl(r),v=nM(m);let y=f[v],b=f[m];const A=(S,j)=>n$(j+p[S==="y"?"top":"left"],j,j-p[S==="y"?"bottom":"right"]);a&&(y=A(v,y)),l&&(b=A(m,b));const w=u.fn({...e,[v]:y,[m]:b});return{...w,data:{x:w.x-n,y:w.y-i,enabled:{[v]:a,[m]:l}}}}}},hee=function(t){return t===void 0&&(t={}),{options:t,fn(e){var n,i;const{x:r,y:s,placement:a,rects:l,middlewareData:u}=e,{offset:d=0,mainAxis:f=!0,crossAxis:p=!0}=hc(t,e),m={x:r,y:s},v=cl(a),y=nM(v);let b=m[y],A=m[v];const w=hc(d,e),S=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:(n=w.mainAxis)!=null?n:0,crossAxis:(i=w.crossAxis)!=null?i:0};if(f){const k=y==="y"?"height":"width",E=l.reference[y]-l.floating[k]+S.mainAxis,M=l.reference[y]+l.reference[k]-S.mainAxis;b<E?b=E:b>M&&(b=M)}if(p){var j,C;const k=y==="y"?"width":"height",E=r$.has(dc(a)),M=l.reference[v]-l.floating[k]+(E&&((j=u.offset)==null?void 0:j[v])||0)+(E?0:S.crossAxis),R=l.reference[v]+l.reference[k]+(E?0:((C=u.offset)==null?void 0:C[v])||0)-(E?S.crossAxis:0);A<M?A=M:A>R&&(A=R)}return{[y]:b,[v]:A}}}},dee=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:i,platform:r,elements:s}=e,{apply:a=()=>{},...l}=hc(t,e),u=await r.detectOverflow(e,l),d=dc(n),f=fg(n),p=cl(n)==="y",{width:m,height:v}=i.floating;let y,b;d==="top"||d==="bottom"?(y=d,b=f===(await(r.isRTL==null?void 0:r.isRTL(s.floating))?"start":"end")?"left":"right"):(b=d,y=f==="end"?"top":"bottom");const A=v-u.top-u.bottom,w=m-u.left-u.right,S=vl(v-u[y],A),j=vl(m-u[b],w),C=e.middlewareData.shift,k=!C;let E=S,M=j;C!=null&&C.enabled.x&&(M=w),C!=null&&C.enabled.y&&(E=A),k&&!f&&(p?M=m-2*Oa(u.left,u.right):E=v-2*Oa(u.top,u.bottom)),await a({...e,availableWidth:M,availableHeight:E});const R=await r.getDimensions(s.floating);return m!==R.width||v!==R.height?{reset:{rects:!0}}:{}}}};function s$(t){const e=gl(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=wl(t),s=r?t.offsetWidth:n,a=r?t.offsetHeight:i,l=b1(n)!==s||b1(i)!==a;return l&&(n=s,i=a),{width:n,height:i,$:l}}function oM(t){return Pi(t)?t:t.contextElement}function Jp(t){const e=oM(t);if(!wl(e))return uu(1);const n=e.getBoundingClientRect(),{width:i,height:r,$:s}=s$(e);let a=(s?b1(n.width):n.width)/i,l=(s?b1(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const fee=uu(0);function o$(t){const e=Js(t);return!Yw()||!e.visualViewport?fee:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function pee(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===Js(t)}function Nf(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),s=oM(t);let a=uu(1);e&&(i?Pi(i)&&(a=Jp(i)):a=Jp(t));const l=pee(s,n,i)?o$(s):uu(0);let u=(r.left+l.x)/a.x,d=(r.top+l.y)/a.y,f=r.width/a.x,p=r.height/a.y;if(s&&i){const m=Js(s),v=Pi(i)?Js(i):i;let y=m,b=vO(y);for(;b&&v!==y;){const A=Jp(b),w=b.getBoundingClientRect(),S=gl(b),j=w.left+(b.clientLeft+parseFloat(S.paddingLeft))*A.x,C=w.top+(b.clientTop+parseFloat(S.paddingTop))*A.y;u*=A.x,d*=A.y,f*=A.x,p*=A.y,u+=j,d+=C,y=Js(b),b=vO(y)}}return Uh({width:f,height:p,x:u,y:d})}function Uw(t,e){const n=Ww(t).scrollLeft;return e?e.left+n:Nf(Cu(t)).left+n}function a$(t,e){const n=t.getBoundingClientRect(),i=n.left+e.scrollLeft-Uw(t,n),r=n.top+e.scrollTop;return{x:i,y:r}}function mee(t){let{elements:e,rect:n,offsetParent:i,strategy:r}=t;const s=r==="fixed",a=Cu(i),l=e?Qw(e.floating):!1;if(i===a||l&&s)return n;let u={scrollLeft:0,scrollTop:0},d=uu(1);const f=uu(0),p=wl(i);if((p||!s)&&((dg(i)!=="body"||qw(a))&&(u=Ww(i)),p)){const v=Nf(i);d=Jp(i),f.x=v.x+i.clientLeft,f.y=v.y+i.clientTop}const m=a&&!p&&!s?a$(a,u):uu(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+f.x+m.x,y:n.y*d.y-u.scrollTop*d.y+f.y+m.y}}function gee(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function vee(t){const e=Ww(t),n=t.ownerDocument.body,i=Oa(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),r=Oa(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-e.scrollLeft+Uw(t);const a=-e.scrollTop;return gl(n).direction==="rtl"&&(s+=Oa(t.clientWidth,n.clientWidth)-i),{width:i,height:r,x:s,y:a}}const yee=25;function xee(t,e,n){n===void 0&&(n="viewport");const i=n==="layoutViewport",r=Js(t),s=Cu(t),a=r.visualViewport;let l=s.clientWidth,u=s.clientHeight,d=0,f=0;if(a){const m=!Yw()||e==="fixed";i?m||(d=-a.offsetLeft,f=-a.offsetTop):(l=a.width,u=a.height,m&&(d=a.offsetLeft,f=a.offsetTop))}if(Uw(s)<=0){const m=s.ownerDocument,v=m.body,y=getComputedStyle(v),b=m.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,A=Math.abs(s.clientWidth-v.clientWidth-b),w=getComputedStyle(s).scrollbarGutter==="stable both-edges"?A/2:A;w<=yee&&(l-=w)}return{width:l,height:u,x:d,y:f}}function bee(t,e){const n=Nf(t,!0,e==="fixed"),i=n.top+t.clientTop,r=n.left+t.clientLeft,s=Jp(t),a=t.clientWidth*s.x,l=t.clientHeight*s.y,u=r*s.x,d=i*s.y;return{width:a,height:l,x:u,y:d}}function JB(t,e,n){let i;if(e==="viewport"||e==="layoutViewport")i=xee(t,n,e);else if(e==="document")i=vee(Cu(t));else if(Pi(e))i=bee(e,n);else{const r=o$(t);i={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return Uh(i)}function Aee(t,e){const n=e.get(t);if(n)return n;let i=cu(t,[],!1).filter(l=>Pi(l)&&dg(l)!=="body"),r=null;const s=gl(t).position==="fixed";let a=s?Jh(t):t;for(;Pi(a)&&!Wh(a);){const l=gl(a),u=tM(a),d=r?r.position:s?"fixed":"";!u&&(d==="fixed"||d==="absolute"&&l.position==="static")?i=i.filter(p=>p!==a):r=l,a=Jh(a)}return e.set(t,i),i}function wee(t){let{element:e,boundary:n,rootBoundary:i,strategy:r}=t;const a=[...n==="clippingAncestors"?Qw(e)?[]:Aee(e,this._c):[].concat(n),i],l=JB(e,a[0],r);let u=l.top,d=l.right,f=l.bottom,p=l.left;for(let m=1;m<a.length;m++){const v=JB(e,a[m],r);u=Oa(v.top,u),d=vl(v.right,d),f=vl(v.bottom,f),p=Oa(v.left,p)}return{width:d-p,height:f-u,x:p,y:u}}function See(t){const{width:e,height:n}=s$(t);return{width:e,height:n}}function jee(t,e,n){const i=wl(e),r=Cu(e),s=n==="fixed",a=Nf(t,!0,s,e);let l={scrollLeft:0,scrollTop:0};const u=uu(0);if((i||!s)&&((dg(e)!=="body"||qw(r))&&(l=Ww(e)),i)){const m=Nf(e,!0,s,e);u.x=m.x+e.clientLeft,u.y=m.y+e.clientTop}!i&&r&&(u.x=Uw(r));const d=r&&!i&&!s?a$(r,l):uu(0),f=a.left+l.scrollLeft-u.x-d.x,p=a.top+l.scrollTop-u.y-d.y;return{x:f,y:p,width:a.width,height:a.height}}function Z_(t){return gl(t).position==="static"}function e4(t,e){if(!wl(t)||gl(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Cu(t)===n&&(n=n.ownerDocument.body),n}function l$(t,e){const n=Js(t);if(Qw(t))return n;if(!wl(t)){let r=Jh(t);for(;r&&!Wh(r);){if(Pi(r)&&!Z_(r))return r;r=Jh(r)}return n}let i=e4(t,e);for(;i&&CJ(i)&&Z_(i);)i=e4(i,e);return i&&Wh(i)&&Z_(i)&&!tM(i)?n:i||TJ(t)||n}const Cee=async function(t){const e=this.getOffsetParent||l$,n=this.getDimensions,i=await n(t.floating);return{reference:jee(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function _ee(t){return gl(t).direction==="rtl"}const kee={convertOffsetParentRelativeRectToViewportRelativeRect:mee,getDocumentElement:Cu,getClippingRect:wee,getOffsetParent:l$,getElementRects:Cee,getClientRects:gee,getDimensions:See,getScale:Jp,isElement:Pi,isRTL:_ee};function c$(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Tee(t,e,n){let i=null,r;const s=Cu(t);function a(){var f;clearTimeout(r),(f=i)==null||f.disconnect(),i=null}function l(f,p){f===void 0&&(f=!1),p===void 0&&(p=1),a();const m=t.getBoundingClientRect(),{left:v,top:y,width:b,height:A}=m;if(f||e(),!b||!A)return;const w=Rb(y),S=Rb(s.clientWidth-(v+b)),j=Rb(s.clientHeight-(y+A)),C=Rb(v),E={rootMargin:-w+"px "+-S+"px "+-j+"px "+-C+"px",threshold:Oa(0,vl(1,p))||1};let M=!0;function R(D){const F=D[0].intersectionRatio;if(!c$(m,t.getBoundingClientRect()))return l();if(F!==p){if(!M)return l();F?l(!1,F):r=setTimeout(()=>{l(!1,1e-7)},1e3)}M=!1}try{i=new IntersectionObserver(R,{...E,root:s.ownerDocument})}catch{i=new IntersectionObserver(R,E)}i.observe(t)}const u=Js(t),d=()=>l(n);return u.addEventListener("resize",d),l(!0),()=>{u.removeEventListener("resize",d),a()}}function bO(t,e,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=i,d=oM(t),f=r||s?[...d?cu(d):[],...e?cu(e):[]]:[];f.forEach(w=>{r&&w.addEventListener("scroll",n),s&&w.addEventListener("resize",n)});const p=d&&l?Tee(d,n,s):null;let m=-1,v=null;a&&(v=new ResizeObserver(w=>{let[S]=w;S&&S.target===d&&v&&e&&(v.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var j;(j=v)==null||j.observe(e)})),n()}),d&&!u&&v.observe(d),e&&v.observe(e));let y,b=u?Nf(t):null;u&&A();function A(){const w=Nf(t);b&&!c$(b,w)&&n(),b=w,y=requestAnimationFrame(A)}return n(),()=>{var w;f.forEach(S=>{r&&S.removeEventListener("scroll",n),s&&S.removeEventListener("resize",n)}),p==null||p(),(w=v)==null||w.disconnect(),v=null,u&&cancelAnimationFrame(y)}}const u$=cee,h$=uee,d$=ree,Oee=dee,Eee=see,t4=iee,Mee=aee,Ree=hee,f$=(t,e,n)=>{const i=new Map,r=n??{},s={...kee,...r.platform,_c:i};return nee(t,e,{...r,platform:s})};var Dee=typeof document<"u",Nee=function(){},OA=Dee?T.useLayoutEffect:Nee;function w1(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,i,r;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(i=n;i--!==0;)if(!w1(t[i],e[i]))return!1;return!0}if(r=Object.keys(t),n=r.length,n!==Object.keys(e).length)return!1;for(i=n;i--!==0;)if(!{}.hasOwnProperty.call(e,r[i]))return!1;for(i=n;i--!==0;){const s=r[i];if(!(s==="_owner"&&t.$$typeof)&&!w1(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function p$(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function n4(t,e){const n=p$(t);return Math.round(e*n)/n}function J_(t){const e=T.useRef(t);return OA(()=>{e.current=t}),e}function Iee(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:i=[],platform:r,elements:{reference:s,floating:a}={},transform:l=!0,whileElementsMounted:u,open:d}=t,[f,p]=T.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,v]=T.useState(i);w1(m,i)||v(i);const[y,b]=T.useState(null),[A,w]=T.useState(null),S=T.useCallback(Y=>{Y!==E.current&&(E.current=Y,b(Y))},[]),j=T.useCallback(Y=>{Y!==M.current&&(M.current=Y,w(Y))},[]),C=s||y,k=a||A,E=T.useRef(null),M=T.useRef(null),R=T.useRef(f),D=u!=null,F=J_(u),I=J_(r),Q=J_(d),G=T.useCallback(()=>{if(!E.current||!M.current)return;const Y={placement:e,strategy:n,middleware:m};I.current&&(Y.platform=I.current),f$(E.current,M.current,Y).then(K=>{const W={...K,isPositioned:Q.current!==!1};L.current&&!w1(R.current,W)&&(R.current=W,lu.flushSync(()=>{p(W)}))})},[m,e,n,I,Q]);OA(()=>{d===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,p(Y=>({...Y,isPositioned:!1})))},[d]);const L=T.useRef(!1);OA(()=>(L.current=!0,()=>{L.current=!1}),[]),OA(()=>{if(C&&(E.current=C),k&&(M.current=k),C&&k){if(F.current)return F.current(C,k,G);G()}},[C,k,G,F,D]);const q=T.useMemo(()=>({reference:E,floating:M,setReference:S,setFloating:j}),[S,j]),N=T.useMemo(()=>({reference:C,floating:k}),[C,k]),P=T.useMemo(()=>{const Y={position:n,left:0,top:0};if(!N.floating)return Y;const K=n4(N.floating,f.x),W=n4(N.floating,f.y);return l?{...Y,transform:"translate("+K+"px, "+W+"px)",...p$(N.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:W}},[n,l,N.floating,f.x,f.y]);return T.useMemo(()=>({...f,update:G,refs:q,elements:N,floatingStyles:P}),[f,G,q,N,P])}const Bee=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:i,padding:r}=typeof t=="function"?t(n):t;return i&&e(i)?i.current!=null?t4({element:i.current,padding:r}).fn(n):{}:i?t4({element:i,padding:r}).fn(n):{}}}},m$=(t,e)=>{const n=u$(t);return{name:n.name,fn:n.fn,options:[t,e]}},aM=(t,e)=>{const n=h$(t);return{name:n.name,fn:n.fn,options:[t,e]}},Lee=(t,e)=>({fn:Ree(t).fn,options:[t,e]}),AO=(t,e)=>{const n=d$(t);return{name:n.name,fn:n.fn,options:[t,e]}},Pee=(t,e)=>{const n=Oee(t);return{name:n.name,fn:n.fn,options:[t,e]}},Fee=(t,e)=>{const n=Eee(t);return{name:n.name,fn:n.fn,options:[t,e]}},cv=(t,e)=>{const n=Mee(t);return{name:n.name,fn:n.fn,options:[t,e]}},g$=(t,e)=>{const n=Bee(t);return{name:n.name,fn:n.fn,options:[t,e]}};function v$(t){const e=T.useRef(void 0),n=T.useCallback(i=>{const r=t.map(s=>{if(s!=null){if(typeof s=="function"){const a=s,l=a(i);return typeof l=="function"?l:()=>{a(null)}}return s.current=i,()=>{s.current=null}}});return()=>{r.forEach(s=>s==null?void 0:s())}},t);return T.useMemo(()=>t.every(i=>i==null)?null:i=>{e.current&&(e.current(),e.current=void 0),i!=null&&(e.current=n(i))},t)}const $ee="data-floating-ui-focusable",i4="active",r4="selected",zee={...m8};let s4=!1,Hee=0;const o4=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Hee++;function qee(){const[t,e]=T.useState(()=>s4?o4():void 0);return ac(()=>{t==null&&e(o4())},[]),T.useEffect(()=>{s4=!0},[]),t}const Qee=zee.useId,y$=Qee||qee;function Yee(){const t=new Map;return{emit(e,n){var i;(i=t.get(e))==null||i.forEach(r=>r(n))},on(e,n){t.has(e)||t.set(e,new Set),t.get(e).add(n)},off(e,n){var i;(i=t.get(e))==null||i.delete(n)}}}const Wee=T.createContext(null),Uee=T.createContext(null),lM=()=>{var t;return((t=T.useContext(Wee))==null?void 0:t.id)||null},cM=()=>T.useContext(Uee);function uM(t){return"data-floating-ui-"+t}function mo(t){t.current!==-1&&(clearTimeout(t.current),t.current=-1)}const a4=uM("safe-polygon");function EA(t,e,n){if(n&&!xO(n))return 0;if(typeof t=="number")return t;if(typeof t=="function"){const i=t();return typeof i=="number"?i:i==null?void 0:i[e]}return t==null?void 0:t[e]}function ek(t){return typeof t=="function"?t():t}function x$(t,e){e===void 0&&(e={});const{open:n,onOpenChange:i,dataRef:r,events:s,elements:a}=t,{enabled:l=!0,delay:u=0,handleClose:d=null,mouseOnly:f=!1,restMs:p=0,move:m=!0}=e,v=cM(),y=lM(),b=Db(d),A=Db(u),w=Db(n),S=Db(p),j=T.useRef(),C=T.useRef(-1),k=T.useRef(),E=T.useRef(-1),M=T.useRef(!0),R=T.useRef(!1),D=T.useRef(()=>{}),F=T.useRef(!1),I=Ul(()=>{var P;const Y=(P=r.current.openEvent)==null?void 0:P.type;return(Y==null?void 0:Y.includes("mouse"))&&Y!=="mousedown"});T.useEffect(()=>{if(!l)return;function P(Y){let{open:K}=Y;K||(mo(C),mo(E),M.current=!0,F.current=!1)}return s.on("openchange",P),()=>{s.off("openchange",P)}},[l,s]),T.useEffect(()=>{if(!l||!b.current||!n)return;function P(K){I()&&i(!1,K,"hover")}const Y=sf(a.floating).documentElement;return Y.addEventListener("mouseleave",P),()=>{Y.removeEventListener("mouseleave",P)}},[a.floating,n,i,l,b,I]);const Q=T.useCallback(function(P,Y,K){Y===void 0&&(Y=!0),K===void 0&&(K="hover");const W=EA(A.current,"close",j.current);W&&!k.current?(mo(C),C.current=window.setTimeout(()=>i(!1,P,K),W)):Y&&(mo(C),i(!1,P,K))},[A,i]),G=Ul(()=>{D.current(),k.current=void 0}),L=Ul(()=>{if(R.current){const P=sf(a.floating).body;P.style.pointerEvents="",P.removeAttribute(a4),R.current=!1}}),q=Ul(()=>r.current.openEvent?["click","mousedown"].includes(r.current.openEvent.type):!1);T.useEffect(()=>{if(!l)return;function P(U){if(mo(C),M.current=!1,f&&!xO(j.current)||ek(S.current)>0&&!EA(A.current,"open"))return;const V=EA(A.current,"open",j.current);V?C.current=window.setTimeout(()=>{w.current||i(!0,U,"hover")},V):n||i(!0,U,"hover")}function Y(U){if(q()){L();return}D.current();const V=sf(a.floating);if(mo(E),F.current=!1,b.current&&r.current.floatingContext){n||mo(C),k.current=b.current({...r.current.floatingContext,tree:v,x:U.clientX,y:U.clientY,onClose(){L(),G(),q()||Q(U,!0,"safe-polygon")}});const ee=k.current;V.addEventListener("mousemove",ee),D.current=()=>{V.removeEventListener("mousemove",ee)};return}(j.current==="touch"?!kv(a.floating,U.relatedTarget):!0)&&Q(U)}function K(U){q()||r.current.floatingContext&&(b.current==null||b.current({...r.current.floatingContext,tree:v,x:U.clientX,y:U.clientY,onClose(){L(),G(),q()||Q(U)}})(U))}function W(){mo(C)}function z(U){q()||Q(U,!1)}if(Pi(a.domReference)){const U=a.domReference,V=a.floating;return n&&U.addEventListener("mouseleave",K),m&&U.addEventListener("mousemove",P,{once:!0}),U.addEventListener("mouseenter",P),U.addEventListener("mouseleave",Y),V&&(V.addEventListener("mouseleave",K),V.addEventListener("mouseenter",W),V.addEventListener("mouseleave",z)),()=>{n&&U.removeEventListener("mouseleave",K),m&&U.removeEventListener("mousemove",P),U.removeEventListener("mouseenter",P),U.removeEventListener("mouseleave",Y),V&&(V.removeEventListener("mouseleave",K),V.removeEventListener("mouseenter",W),V.removeEventListener("mouseleave",z))}}},[a,l,t,f,m,Q,G,L,i,n,w,v,A,b,r,q,S]),ac(()=>{var P;if(l&&n&&(P=b.current)!=null&&(P=P.__options)!=null&&P.blockPointerEvents&&I()){R.current=!0;const K=a.floating;if(Pi(a.domReference)&&K){var Y;const W=sf(a.floating).body;W.setAttribute(a4,"");const z=a.domReference,U=v==null||(Y=v.nodesRef.current.find(V=>V.id===y))==null||(Y=Y.context)==null?void 0:Y.elements.floating;return U&&(U.style.pointerEvents=""),W.style.pointerEvents="none",z.style.pointerEvents="auto",K.style.pointerEvents="auto",()=>{W.style.pointerEvents="",z.style.pointerEvents="",K.style.pointerEvents=""}}}},[l,n,y,a,v,b,I]),ac(()=>{n||(j.current=void 0,F.current=!1,G(),L())},[n,G,L]),T.useEffect(()=>()=>{G(),mo(C),mo(E),L()},[l,a.domReference,G,L]);const N=T.useMemo(()=>{function P(Y){j.current=Y.pointerType}return{onPointerDown:P,onPointerEnter:P,onMouseMove(Y){const{nativeEvent:K}=Y;function W(){!M.current&&!w.current&&i(!0,K,"hover")}f&&!xO(j.current)||n||ek(S.current)===0||F.current&&Y.movementX**2+Y.movementY**2<2||(mo(E),j.current==="touch"?W():(F.current=!0,E.current=window.setTimeout(W,ek(S.current))))}}},[f,i,n,w,S]);return T.useMemo(()=>l?{reference:N}:{},[l,N])}const wO=()=>{},b$=T.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:wO,setState:wO,isInstantPhase:!1}),Vee=()=>T.useContext(b$);function Gee(t){const{children:e,delay:n,timeoutMs:i=0}=t,[r,s]=T.useReducer((u,d)=>({...u,...d}),{delay:n,timeoutMs:i,initialDelay:n,currentId:null,isInstantPhase:!1}),a=T.useRef(null),l=T.useCallback(u=>{s({currentId:u})},[]);return ac(()=>{r.currentId?a.current===null?a.current=r.currentId:r.isInstantPhase||s({isInstantPhase:!0}):(r.isInstantPhase&&s({isInstantPhase:!1}),a.current=null)},[r.currentId,r.isInstantPhase]),o.jsx(b$.Provider,{value:T.useMemo(()=>({...r,setState:s,setCurrentId:l}),[r,l]),children:e})}function Xee(t,e){e===void 0&&(e={});const{open:n,onOpenChange:i,floatingId:r}=t,{id:s,enabled:a=!0}=e,l=s??r,u=Vee(),{currentId:d,setCurrentId:f,initialDelay:p,setState:m,timeoutMs:v}=u;return ac(()=>{a&&d&&(m({delay:{open:1,close:EA(p,"close")}}),d!==l&&i(!1))},[a,l,i,m,d,p]),ac(()=>{function y(){i(!1),m({delay:p,currentId:null})}if(a&&d&&!n&&d===l){if(v){const b=window.setTimeout(y,v);return()=>{clearTimeout(b)}}y()}},[a,n,m,d,l,i,p,v]),ac(()=>{a&&(f===wO||!n||f(l))},[a,n,f,l]),u}function tk(t,e){if(!t||!e)return!1;const n=e.getRootNode==null?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&x1(n)){let i=e;for(;i;){if(t===i)return!0;i=i.parentNode||i.host}}return!1}function Kee(t){return"composedPath"in t?t.composedPath()[0]:t.target}const Zee={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Jee={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},l4=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 ete(t,e){e===void 0&&(e={});const{open:n,onOpenChange:i,elements:r,dataRef:s}=t,{enabled:a=!0,escapeKey:l=!0,outsidePress:u=!0,outsidePressEvent:d="pointerdown",referencePress:f=!1,referencePressEvent:p="pointerdown",ancestorScroll:m=!1,bubbles:v,capture:y}=e,b=cM(),A=Ul(typeof u=="function"?u:()=>!1),w=typeof u=="function"?A:u,S=T.useRef(!1),{escapeKey:j,outsidePress:C}=l4(v),{escapeKey:k,outsidePress:E}=l4(y),M=T.useRef(!1),R=Ul(L=>{var q;if(!n||!a||!l||L.key!=="Escape"||M.current)return;const N=(q=s.current.floatingContext)==null?void 0:q.nodeId,P=b?TA(b.nodesRef.current,N):[];if(!j&&(L.stopPropagation(),P.length>0)){let Y=!0;if(P.forEach(K=>{var W;if((W=K.context)!=null&&W.open&&!K.context.dataRef.current.__escapeKeyBubbles){Y=!1;return}}),!Y)return}i(!1,VJ(L)?L.nativeEvent:L,"escape-key")}),D=Ul(L=>{var q;const N=()=>{var P;R(L),(P=Bp(L))==null||P.removeEventListener("keydown",N)};(q=Bp(L))==null||q.addEventListener("keydown",N)}),F=Ul(L=>{var q;const N=s.current.insideReactTree;s.current.insideReactTree=!1;const P=S.current;if(S.current=!1,d==="click"&&P||N||typeof w=="function"&&!w(L))return;const Y=Bp(L),K="["+uM("inert")+"]",W=sf(r.floating).querySelectorAll(K);let z=Pi(Y)?Y:null;for(;z&&!Wh(z);){const ee=Jh(z);if(Wh(ee)||!Pi(ee))break;z=ee}if(W.length&&Pi(Y)&&!QJ(Y)&&!kv(Y,r.floating)&&Array.from(W).every(ee=>!kv(z,ee)))return;if(wl(Y)&&G){const ee=Wh(Y),ce=gl(Y),he=/auto|scroll/,Oe=ee||he.test(ce.overflowX),Te=ee||he.test(ce.overflowY),Re=Oe&&Y.clientWidth>0&&Y.scrollWidth>Y.clientWidth,qe=Te&&Y.clientHeight>0&&Y.scrollHeight>Y.clientHeight,ie=ce.direction==="rtl",je=qe&&(ie?L.offsetX<=Y.offsetWidth-Y.clientWidth:L.offsetX>Y.clientWidth),se=Re&&L.offsetY>Y.clientHeight;if(je||se)return}const U=(q=s.current.floatingContext)==null?void 0:q.nodeId,V=b&&TA(b.nodesRef.current,U).some(ee=>{var ce;return K_(L,(ce=ee.context)==null?void 0:ce.elements.floating)});if(K_(L,r.floating)||K_(L,r.domReference)||V)return;const J=b?TA(b.nodesRef.current,U):[];if(J.length>0){let ee=!0;if(J.forEach(ce=>{var he;if((he=ce.context)!=null&&he.open&&!ce.context.dataRef.current.__outsidePressBubbles){ee=!1;return}}),!ee)return}i(!1,L,"outside-press")}),I=Ul(L=>{var q;const N=()=>{var P;F(L),(P=Bp(L))==null||P.removeEventListener(d,N)};(q=Bp(L))==null||q.addEventListener(d,N)});T.useEffect(()=>{if(!n||!a)return;s.current.__escapeKeyBubbles=j,s.current.__outsidePressBubbles=C;let L=-1;function q(W){i(!1,W,"ancestor-scroll")}function N(){window.clearTimeout(L),M.current=!0}function P(){L=window.setTimeout(()=>{M.current=!1},Yw()?5:0)}const Y=sf(r.floating);l&&(Y.addEventListener("keydown",k?D:R,k),Y.addEventListener("compositionstart",N),Y.addEventListener("compositionend",P)),w&&Y.addEventListener(d,E?I:F,E);let K=[];return m&&(Pi(r.domReference)&&(K=cu(r.domReference)),Pi(r.floating)&&(K=K.concat(cu(r.floating))),!Pi(r.reference)&&r.reference&&r.reference.contextElement&&(K=K.concat(cu(r.reference.contextElement)))),K=K.filter(W=>{var z;return W!==((z=Y.defaultView)==null?void 0:z.visualViewport)}),K.forEach(W=>{W.addEventListener("scroll",q,{passive:!0})}),()=>{l&&(Y.removeEventListener("keydown",k?D:R,k),Y.removeEventListener("compositionstart",N),Y.removeEventListener("compositionend",P)),w&&Y.removeEventListener(d,E?I:F,E),K.forEach(W=>{W.removeEventListener("scroll",q)}),window.clearTimeout(L)}},[s,r,l,w,d,n,i,m,a,j,C,R,k,D,F,E,I]),T.useEffect(()=>{s.current.insideReactTree=!1},[s,w,d]);const Q=T.useMemo(()=>({onKeyDown:R,...f&&{[Zee[p]]:L=>{i(!1,L.nativeEvent,"reference-press")},...p!=="click"&&{onClick(L){i(!1,L.nativeEvent,"reference-press")}}}}),[R,i,f,p]),G=T.useMemo(()=>{function L(q){q.button===0&&(S.current=!0)}return{onKeyDown:R,onMouseDown:L,onMouseUp:L,[Jee[d]]:()=>{s.current.insideReactTree=!0}}},[R,d,s]);return T.useMemo(()=>a?{reference:Q,floating:G}:{},[a,Q,G])}function tte(t){const{open:e=!1,onOpenChange:n,elements:i}=t,r=y$(),s=T.useRef({}),[a]=T.useState(()=>Yee()),l=lM()!=null,[u,d]=T.useState(i.reference),f=Ul((v,y,b)=>{s.current.openEvent=v?y:void 0,a.emit("openchange",{open:v,event:y,reason:b,nested:l}),n==null||n(v,y,b)}),p=T.useMemo(()=>({setPositionReference:d}),[]),m=T.useMemo(()=>({reference:u||i.reference||null,floating:i.floating||null,domReference:i.reference}),[u,i.reference,i.floating]);return T.useMemo(()=>({dataRef:s,open:e,onOpenChange:f,elements:m,events:a,floatingId:r,refs:p}),[e,f,m,a,r,p])}function Vw(t){t===void 0&&(t={});const{nodeId:e}=t,n=tte({...t,elements:{reference:null,floating:null,...t.elements}}),i=t.rootContext||n,r=i.elements,[s,a]=T.useState(null),[l,u]=T.useState(null),f=(r==null?void 0:r.domReference)||s,p=T.useRef(null),m=cM();ac(()=>{f&&(p.current=f)},[f]);const v=Iee({...t,elements:{...r,...l&&{reference:l}}}),y=T.useCallback(j=>{const C=Pi(j)?{getBoundingClientRect:()=>j.getBoundingClientRect(),getClientRects:()=>j.getClientRects(),contextElement:j}:j;u(C),v.refs.setReference(C)},[v.refs]),b=T.useCallback(j=>{(Pi(j)||j===null)&&(p.current=j,a(j)),(Pi(v.refs.reference.current)||v.refs.reference.current===null||j!==null&&!Pi(j))&&v.refs.setReference(j)},[v.refs]),A=T.useMemo(()=>({...v.refs,setReference:b,setPositionReference:y,domReference:p}),[v.refs,b,y]),w=T.useMemo(()=>({...v.elements,domReference:f}),[v.elements,f]),S=T.useMemo(()=>({...v,...i,refs:A,elements:w,nodeId:e}),[v,A,w,e,i]);return ac(()=>{i.dataRef.current.floatingContext=S;const j=m==null?void 0:m.nodesRef.current.find(C=>C.id===e);j&&(j.context=S)}),T.useMemo(()=>({...v,context:S,refs:A,elements:w}),[v,A,w,S])}function nk(){return zJ()&&$J()}function nte(t,e){e===void 0&&(e={});const{open:n,onOpenChange:i,events:r,dataRef:s,elements:a}=t,{enabled:l=!0,visibleOnly:u=!0}=e,d=T.useRef(!1),f=T.useRef(-1),p=T.useRef(!0);T.useEffect(()=>{if(!l)return;const v=Js(a.domReference);function y(){!n&&wl(a.domReference)&&a.domReference===GB(sf(a.domReference))&&(d.current=!0)}function b(){p.current=!0}function A(){p.current=!1}return v.addEventListener("blur",y),nk()&&(v.addEventListener("keydown",b,!0),v.addEventListener("pointerdown",A,!0)),()=>{v.removeEventListener("blur",y),nk()&&(v.removeEventListener("keydown",b,!0),v.removeEventListener("pointerdown",A,!0))}},[a.domReference,n,l]),T.useEffect(()=>{if(!l)return;function v(y){let{reason:b}=y;(b==="reference-press"||b==="escape-key")&&(d.current=!0)}return r.on("openchange",v),()=>{r.off("openchange",v)}},[r,l]),T.useEffect(()=>()=>{mo(f)},[]);const m=T.useMemo(()=>({onMouseLeave(){d.current=!1},onFocus(v){if(d.current)return;const y=Bp(v.nativeEvent);if(u&&Pi(y)){if(nk()&&!v.relatedTarget){if(!p.current&&!YJ(y))return}else if(!WJ(y))return}i(!0,v.nativeEvent,"focus")},onBlur(v){d.current=!1;const y=v.relatedTarget,b=v.nativeEvent,A=Pi(y)&&y.hasAttribute(uM("focus-guard"))&&y.getAttribute("data-type")==="outside";f.current=window.setTimeout(()=>{var w;const S=GB(a.domReference?a.domReference.ownerDocument:document);!y&&S===a.domReference||kv((w=s.current.floatingContext)==null?void 0:w.refs.floating.current,S)||kv(a.domReference,S)||A||i(!1,b,"focus")})}}),[s,a.domReference,i,u]);return T.useMemo(()=>l?{reference:m}:{},[l,m])}function ik(t,e,n){const i=new Map,r=n==="item";let s=t;if(r&&t){const{[i4]:a,[r4]:l,...u}=t;s=u}return{...n==="floating"&&{tabIndex:-1,[$ee]:""},...s,...e.map(a=>{const l=a?a[n]:null;return typeof l=="function"?t?l(t):null:l}).concat(t).reduce((a,l)=>(l&&Object.entries(l).forEach(u=>{let[d,f]=u;if(!(r&&[i4,r4].includes(d)))if(d.indexOf("on")===0){if(i.has(d)||i.set(d,[]),typeof f=="function"){var p;(p=i.get(d))==null||p.push(f),a[d]=function(){for(var m,v=arguments.length,y=new Array(v),b=0;b<v;b++)y[b]=arguments[b];return(m=i.get(d))==null?void 0:m.map(A=>A(...y)).find(A=>A!==void 0)}}}else a[d]=f}),a),{})}}function A$(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),i=t.map(l=>l==null?void 0:l.item),r=T.useCallback(l=>ik(l,t,"reference"),e),s=T.useCallback(l=>ik(l,t,"floating"),n),a=T.useCallback(l=>ik(l,t,"item"),i);return T.useMemo(()=>({getReferenceProps:r,getFloatingProps:s,getItemProps:a}),[r,s,a])}const ite=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function rte(t,e){var n,i;e===void 0&&(e={});const{open:r,elements:s,floatingId:a}=t,{enabled:l=!0,role:u="dialog"}=e,d=y$(),f=((n=s.domReference)==null?void 0:n.id)||d,p=T.useMemo(()=>{var S;return((S=UJ(s.floating))==null?void 0:S.id)||a},[s.floating,a]),m=(i=ite.get(u))!=null?i:u,y=lM()!=null,b=T.useMemo(()=>m==="tooltip"||u==="label"?{["aria-"+(u==="label"?"labelledby":"describedby")]:r?p:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":m==="alertdialog"?"dialog":m,"aria-controls":r?p:void 0,...m==="listbox"&&{role:"combobox"},...m==="menu"&&{id:f},...m==="menu"&&y&&{role:"menuitem"},...u==="select"&&{"aria-autocomplete":"none"},...u==="combobox"&&{"aria-autocomplete":"list"}},[m,p,y,r,f,u]),A=T.useMemo(()=>{const S={id:p,...m&&{role:m}};return m==="tooltip"||u==="label"?S:{...S,...m==="menu"&&{"aria-labelledby":f}}},[m,p,f,u]),w=T.useCallback(S=>{let{active:j,selected:C}=S;const k={role:"option",...j&&{id:p+"-fui-option"}};switch(u){case"select":case"combobox":return{...k,"aria-selected":C}}return{}},[p,u]);return T.useMemo(()=>l?{reference:b,floating:A,item:w}:{},[l,b,A,w])}function w$(t,e,n){return n===void 0&&(n=!0),t.filter(r=>{var s;return r.parentId===e&&(!n||((s=r.context)==null?void 0:s.open))}).flatMap(r=>[r,...w$(t,r.id,n)])}function c4(t,e){const[n,i]=t;let r=!1;const s=e.length;for(let a=0,l=s-1;a<s;l=a++){const[u,d]=e[a]||[0,0],[f,p]=e[l]||[0,0];d>=i!=p>=i&&n<=(f-u)*(i-d)/(p-d)+u&&(r=!r)}return r}function ste(t,e){return t[0]>=e.x&&t[0]<=e.x+e.width&&t[1]>=e.y&&t[1]<=e.y+e.height}function ote(t){t===void 0&&(t={});const{buffer:e=.5,blockPointerEvents:n=!1,requireIntent:i=!0}=t,r={current:-1};let s=!1,a=null,l=null,u=typeof performance<"u"?performance.now():0;function d(p,m){const v=performance.now(),y=v-u;if(a===null||l===null||y===0)return a=p,l=m,u=v,null;const b=p-a,A=m-l,S=Math.sqrt(b*b+A*A)/y;return a=p,l=m,u=v,S}const f=p=>{let{x:m,y:v,placement:y,elements:b,onClose:A,nodeId:w,tree:S}=p;return function(C){function k(){mo(r),A()}if(mo(r),!b.domReference||!b.floating||y==null||m==null||v==null)return;const{clientX:E,clientY:M}=C,R=[E,M],D=Kee(C),F=C.type==="mouseleave",I=tk(b.floating,D),Q=tk(b.domReference,D),G=b.domReference.getBoundingClientRect(),L=b.floating.getBoundingClientRect(),q=y.split("-")[0],N=m>L.right-L.width/2,P=v>L.bottom-L.height/2,Y=ste(R,G),K=L.width>G.width,W=L.height>G.height,z=(K?G:L).left,U=(K?G:L).right,V=(W?G:L).top,J=(W?G:L).bottom;if(I&&(s=!0,!F))return;if(Q&&(s=!1),Q&&!F){s=!0;return}if(F&&Pi(C.relatedTarget)&&tk(b.floating,C.relatedTarget)||S&&w$(S.nodesRef.current,w).length)return;if(q==="top"&&v>=G.bottom-1||q==="bottom"&&v<=G.top+1||q==="left"&&m>=G.right-1||q==="right"&&m<=G.left+1)return k();let ee=[];switch(q){case"top":ee=[[z,G.top+1],[z,L.bottom-1],[U,L.bottom-1],[U,G.top+1]];break;case"bottom":ee=[[z,L.top+1],[z,G.bottom-1],[U,G.bottom-1],[U,L.top+1]];break;case"left":ee=[[L.right-1,J],[L.right-1,V],[G.left+1,V],[G.left+1,J]];break;case"right":ee=[[G.right-1,J],[G.right-1,V],[L.left+1,V],[L.left+1,J]];break}function ce(he){let[Oe,Te]=he;switch(q){case"top":{const Re=[K?Oe+e/2:N?Oe+e*4:Oe-e*4,Te+e+1],qe=[K?Oe-e/2:N?Oe+e*4:Oe-e*4,Te+e+1],ie=[[L.left,N||K?L.bottom-e:L.top],[L.right,N?K?L.bottom-e:L.top:L.bottom-e]];return[Re,qe,...ie]}case"bottom":{const Re=[K?Oe+e/2:N?Oe+e*4:Oe-e*4,Te-e],qe=[K?Oe-e/2:N?Oe+e*4:Oe-e*4,Te-e],ie=[[L.left,N||K?L.top+e:L.bottom],[L.right,N?K?L.top+e:L.bottom:L.top+e]];return[Re,qe,...ie]}case"left":{const Re=[Oe+e+1,W?Te+e/2:P?Te+e*4:Te-e*4],qe=[Oe+e+1,W?Te-e/2:P?Te+e*4:Te-e*4];return[...[[P||W?L.right-e:L.left,L.top],[P?W?L.right-e:L.left:L.right-e,L.bottom]],Re,qe]}case"right":{const Re=[Oe-e,W?Te+e/2:P?Te+e*4:Te-e*4],qe=[Oe-e,W?Te-e/2:P?Te+e*4:Te-e*4],ie=[[P||W?L.left+e:L.right,L.top],[P?W?L.left+e:L.right:L.left+e,L.bottom]];return[Re,qe,...ie]}}}if(!c4([E,M],ee)){if(s&&!Y)return k();if(!F&&i){const he=d(C.clientX,C.clientY);if(he!==null&&he<.1)return k()}c4([E,M],ce([m,v]))?!s&&i&&(r.current=window.setTimeout(k,40)):k()}}};return f.__options={blockPointerEvents:n},f}const S$={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},j$=(t,{scrollbarSize:e,overscrollBehavior:n,scrollbars:i})=>{let r=n;return n&&i&&(i==="x"?r=`${n} auto`:i==="y"&&(r=`auto ${n}`)),{root:{"--scrollarea-scrollbar-size":ge(e),"--scrollarea-over-scroll-behavior":r}}},Co=Pe(t=>{const e=we("ScrollArea",S$,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,scrollbarSize:l,vars:u,type:d,scrollHideDelay:f,viewportProps:p,viewportRef:m,onScrollPositionChange:v,children:y,offsetScrollbars:b,scrollbars:A,onBottomReached:w,onTopReached:S,onLeftReached:j,onRightReached:C,overscrollBehavior:k,startScrollPosition:E,verticalScrollbarPosition:M,attributes:R,...D}=e,[F,I]=T.useState(!1),[Q,G]=T.useState(!1),[L,q]=T.useState(!1),N=T.useRef(!0),P=T.useRef(!1),Y=T.useRef(!0),K=T.useRef(!1),W=gt({name:"ScrollArea",props:e,classes:eM,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:R,vars:u,varsResolver:j$}),z=T.useRef(null),[U,V]=T.useState(null),J=v$([m,z,T.useCallback(ee=>{V(ce=>ce===ee?ce:ee)},[])]);return Zh(b==="present"?U:null,()=>{const ee=z.current;ee&&(G(ee.scrollHeight>ee.clientHeight),q(ee.scrollWidth>ee.clientWidth))}),uc(()=>{E&&z.current&&z.current.scrollTo({left:E.x??0,top:E.y??0})},[]),o.jsxs(q8,{getStyles:W,type:d==="never"?"always":d,scrollHideDelay:f,scrollbars:A,...W("root"),...D,children:[o.jsx(J8,{...p,...W("viewport",{style:p==null?void 0:p.style}),ref:J,"data-offset-scrollbars":b===!0?"xy":b||void 0,"data-scrollbars":A||void 0,"data-vertical-scrollbar-position":M||void 0,"data-horizontal-hidden":b==="present"&&!L?"true":void 0,"data-vertical-hidden":b==="present"&&!Q?"true":void 0,onScroll:ee=>{var Be;(Be=p==null?void 0:p.onScroll)==null||Be.call(p,ee),v==null||v({x:ee.currentTarget.scrollLeft,y:ee.currentTarget.scrollTop});const{scrollTop:ce,scrollHeight:he,clientHeight:Oe,scrollLeft:Te,scrollWidth:Re,clientWidth:qe}=ee.currentTarget,ie=ce-(he-Oe)>=-.8,je=ce===0;ie&&!P.current&&(w==null||w()),je&&!N.current&&(S==null||S()),P.current=ie,N.current=je;const se=Te-(Re-qe)>=-.8,be=Te===0;se&&!K.current&&(C==null||C()),be&&!Y.current&&(j==null||j()),K.current=se,Y.current=be},children:y}),(A==="xy"||A==="x")&&o.jsx(mO,{...W("scrollbar"),orientation:"horizontal","data-vertical-scrollbar-position":M||void 0,"data-hidden":d==="never"||b==="present"&&!L?!0:void 0,forceMount:!0,onMouseEnter:()=>I(!0),onMouseLeave:()=>I(!1),children:o.jsx(gO,{...W("thumb")})}),(A==="xy"||A==="y")&&o.jsx(mO,{...W("scrollbar"),orientation:"vertical","data-vertical-scrollbar-position":M||void 0,"data-hidden":d==="never"||b==="present"&&!Q?!0:void 0,forceMount:!0,onMouseEnter:()=>I(!0),onMouseLeave:()=>I(!1),children:o.jsx(gO,{...W("thumb")})}),o.jsx(yJ,{...W("corner"),"data-vertical-scrollbar-position":M||void 0,"data-hovered":F||void 0,"data-hidden":d==="never"||void 0})]})});Co.displayName="@mantine/core/ScrollArea";const hM=Pe(t=>{const{children:e,classNames:n,styles:i,scrollbarSize:r,scrollHideDelay:s,type:a,dir:l,offsetScrollbars:u,overscrollBehavior:d,viewportRef:f,onScrollPositionChange:p,unstyled:m,variant:v,viewportProps:y,scrollbars:b,style:A,vars:w,onBottomReached:S,onTopReached:j,startScrollPosition:C,verticalScrollbarPosition:k,onOverflowChange:E,...M}=we("ScrollAreaAutosize",S$,t),R=T.useRef(null),[D,F]=T.useState(null),I=v$([f,R,T.useCallback(q=>{F(N=>N===q?N:q)},[])]),Q=T.useRef(!1),G=T.useRef(!1),L=T.useEffectEvent(()=>{const q=R.current;if(!q||!E)return;const N=q.scrollHeight>q.clientHeight;N!==Q.current&&(G.current?E(N):(G.current=!0,N&&E(!0)),Q.current=N)});return Zh(E?D:null,L),o.jsx(xe,{...M,variant:v,style:[{display:"flex",overflow:"hidden"},A],children:o.jsx(xe,{style:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden",...b==="y"&&{minWidth:0},...b==="x"&&{minHeight:0},...b==="xy"&&{minWidth:0,minHeight:0},...b===!1&&{minWidth:0,minHeight:0}},children:o.jsx(Co,{classNames:n,styles:i,scrollHideDelay:s,scrollbarSize:r,type:a,dir:l,offsetScrollbars:u,overscrollBehavior:d,viewportRef:I,onScrollPositionChange:p,unstyled:m,variant:v,viewportProps:y,vars:w,scrollbars:b,onBottomReached:S,onTopReached:j,startScrollPosition:C,verticalScrollbarPosition:k,"data-autosize":"true",children:e})})})});Co.classes=eM;Co.varsResolver=j$;hM.displayName="@mantine/core/ScrollAreaAutosize";hM.classes=eM;Co.Autosize=hM;var C$={root:"m_87cf2631"};const ate={__staticSelector:"UnstyledButton"},Fi=ss(t=>{const e=we("UnstyledButton",ate,t),{className:n,component:i="button",__staticSelector:r,unstyled:s,classNames:a,styles:l,style:u,attributes:d,...f}=e;return o.jsx(xe,{...gt({name:r,props:e,classes:C$,className:n,style:u,classNames:a,styles:l,unstyled:s,attributes:d})("root",{focusable:!0}),component:i,type:i==="button"?"button":void 0,...f})});Fi.classes=C$;Fi.displayName="@mantine/core/UnstyledButton";var _$={root:"m_515a97f8"};const dM=Pe(t=>{const e=we("VisuallyHidden",null,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,attributes:u,...d}=e;return o.jsx(xe,{component:"span",...gt({name:"VisuallyHidden",classes:_$,props:e,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:u})("root"),...d})});dM.classes=_$;dM.displayName="@mantine/core/VisuallyHidden";var k$={root:"m_1b7284a3"};const T$=(t,{radius:e,shadow:n})=>({root:{"--paper-radius":e===void 0?void 0:ai(e),"--paper-shadow":QE(n)}}),jy=ss(t=>{const e=we("Paper",null,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,withBorder:l,vars:u,radius:d,shadow:f,variant:p,mod:m,attributes:v,...y}=e,b=gt({name:"Paper",props:e,classes:k$,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:v,vars:u,varsResolver:T$});return o.jsx(xe,{mod:[{"data-with-border":l},m],...b("root"),variant:p,...y})});jy.classes=k$;jy.varsResolver=T$;jy.displayName="@mantine/core/Paper";function u4(t,e,n,i){return t==="center"||i==="center"?{top:e}:t==="end"?{bottom:n}:t==="start"?{top:n}:{}}function h4(t,e,n,i,r){return t==="center"||i==="center"?{left:e}:t==="end"?{[r==="ltr"?"right":"left"]:n}:t==="start"?{[r==="ltr"?"left":"right"]:n}:{}}const lte={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function cte({position:t,arrowSize:e,dir:n}){const[i,r]=t.split("-");if(!r)return;const s={width:e,height:e,position:"absolute"};if(i==="bottom"){const a=r==="start",l=a?n==="ltr"?"left":"right":n==="ltr"?"right":"left";return{...s,top:-e,[l]:0,clipPath:a!==(n==="rtl")?"polygon(0% 0%, 0% 100%, 100% 100%)":"polygon(100% 0%, 0% 100%, 100% 100%)"}}if(i==="top"){const a=r==="start",l=a?n==="ltr"?"left":"right":n==="ltr"?"right":"left";return{...s,bottom:-e,[l]:0,clipPath:a!==(n==="rtl")?"polygon(0% 0%, 100% 0%, 0% 100%)":"polygon(0% 0%, 100% 0%, 100% 100%)"}}if(i==="left")return{...s,right:-e,[r==="start"?"top":"bottom"]:0,clipPath:r==="start"?"polygon(0% 0%, 100% 0%, 0% 100%)":"polygon(0% 0%, 0% 100%, 100% 100%)"};if(i==="right")return{...s,left:-e,[r==="start"?"top":"bottom"]:0,clipPath:r==="start"?"polygon(0% 0%, 100% 0%, 100% 100%)":"polygon(100% 0%, 0% 100%, 100% 100%)"}}function ute({position:t,arrowSize:e,arrowOffset:n,arrowRadius:i,arrowPosition:r,arrowX:s,arrowY:a,dir:l}){if(r==="merge"){const m=cte({position:t,arrowSize:e,dir:l});if(m)return m}const[u,d="center"]=t.split("-"),f={width:e,height:e,transform:"rotate(45deg)",position:"absolute",[lte[u]]:i},p=-e/2;return u==="left"?{...f,...u4(d,a,n,r),right:p,borderLeftColor:"transparent",borderBottomColor:"transparent",clipPath:"polygon(100% 0, 0 0, 100% 100%)"}:u==="right"?{...f,...u4(d,a,n,r),left:p,borderRightColor:"transparent",borderTopColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 100%)"}:u==="top"?{...f,...h4(d,s,n,r,l),bottom:p,borderTopColor:"transparent",borderLeftColor:"transparent",clipPath:"polygon(0 100%, 100% 100%, 100% 0)"}:u==="bottom"?{...f,...h4(d,s,n,r,l),top:p,borderBottomColor:"transparent",borderRightColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 0)"}:{}}function O$({position:t,dir:e}){const[n,i]=t.split("-");if(!i)return;const r=i==="start"&&e==="ltr"||i==="end"&&e==="rtl";if(n==="bottom")return r?{borderTopLeftRadius:0}:{borderTopRightRadius:0};if(n==="top")return r?{borderBottomLeftRadius:0}:{borderBottomRightRadius:0};if(n==="left")return i==="start"?{borderTopRightRadius:0}:{borderBottomRightRadius:0};if(n==="right")return i==="start"?{borderTopLeftRadius:0}:{borderBottomLeftRadius:0}}function S1({position:t,arrowSize:e,arrowOffset:n,arrowRadius:i,arrowPosition:r,visible:s,arrowX:a,arrowY:l,style:u,...d}){const{dir:f}=vc();return s?o.jsx("div",{role:"presentation",...d,style:{...u,...ute({position:t,arrowSize:e,arrowOffset:n,arrowRadius:i,arrowPosition:r,dir:f,arrowX:a,arrowY:l})}}):null}S1.displayName="@mantine/core/FloatingArrow";function fM(t,e){if(t==="rtl"&&(e.includes("right")||e.includes("left"))){const[n,i]=e.split("-"),r=n==="right"?"left":"right";return i===void 0?r:`${r}-${i}`}return e}function hte({open:t,close:e,openDelay:n,closeDelay:i}){const r=T.useRef(-1),s=T.useRef(-1),a=()=>{window.clearTimeout(r.current),window.clearTimeout(s.current)},l=()=>{a(),n===0||n===void 0?t():r.current=window.setTimeout(t,n)},u=()=>{a(),i===0||i===void 0?e():s.current=window.setTimeout(e,i)};return T.useEffect(()=>a,[]),{openDropdown:l,closeDropdown:u}}var E$={root:"m_9814e45f"};const dte={zIndex:Da("modal")},M$=(t,{gradient:e,color:n,backgroundOpacity:i,blur:r,radius:s,zIndex:a})=>({root:{"--overlay-bg":e||(n!==void 0||i!==void 0)&&Ah(n||"#000",i??.6)||void 0,"--overlay-filter":r?`blur(${ge(r)})`:void 0,"--overlay-radius":s===void 0?void 0:ai(s),"--overlay-z-index":a==null?void 0:a.toString()}}),If=ss(t=>{const e=we("Overlay",dte,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,fixed:u,center:d,children:f,radius:p,zIndex:m,gradient:v,blur:y,color:b,backgroundOpacity:A,mod:w,attributes:S,...j}=e;return o.jsx(xe,{...gt({name:"Overlay",props:e,classes:E$,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:S,vars:l,varsResolver:M$})("root"),mod:[{center:d,fixed:u},w],...j,children:f})});If.classes=E$;If.varsResolver=M$;If.displayName="@mantine/core/Overlay";function rk(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 fte({target:t,reuseTargetNode:e,...n}){if(t)return typeof t=="string"?document.querySelector(t)||rk(n):t;if(e){const i=document.querySelector("[data-mantine-shared-portal-node]");if(i)return i;const r=rk(n);return r.setAttribute("data-mantine-shared-portal-node","true"),document.body.appendChild(r),r}return rk(n)}const pte={reuseTargetNode:!0},R$=Pe(t=>{const{children:e,target:n,reuseTargetNode:i,ref:r,...s}=we("Portal",pte,t),[a,l]=T.useState(!1),u=T.useRef(null);return uc(()=>(l(!0),u.current=fte({target:n,reuseTargetNode:i,...s}),v1(r,u.current),!n&&!i&&u.current&&document.body.appendChild(u.current),()=>{!n&&!i&&u.current&&document.body.removeChild(u.current)}),[n]),!a||!u.current?null:lu.createPortal(o.jsx(o.Fragment,{children:e}),u.current)});R$.displayName="@mantine/core/Portal";const ed=Pe(({withinPortal:t=!0,children:e,...n})=>wy()==="test"||!t?o.jsx(o.Fragment,{children:e}):o.jsx(R$,{...n,children:e}));ed.displayName="@mantine/core/OptionalPortal";const O0=t=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${t==="bottom"?10:-10}px)`},transitionProperty:"transform, opacity"}),Nb={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:{...O0("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...O0("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...O0("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...O0("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...O0("top"),common:{transformOrigin:"top right"}}},d4={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function f4({transition:t,state:e,duration:n,timingFunction:i}){const r={WebkitBackfaceVisibility:"hidden",transitionDuration:`${n}ms`,transitionTimingFunction:i};return typeof t=="string"?t in Nb?{transitionProperty:Nb[t].transitionProperty,...r,...Nb[t].common,...Nb[t][d4[e]]}:{}:{transitionProperty:t.transitionProperty,...r,...t.common,...t[d4[e]]}}function mte({duration:t,exitDuration:e,timingFunction:n,mounted:i,onEnter:r,onExit:s,onEntered:a,onExited:l,enterDelay:u,exitDelay:d}){const f=Ar(),p=Ay(),m=f.respectReducedMotion?p:!1,[v,y]=T.useState(m?0:t),[b,A]=T.useState(i?"entered":"exited"),w=T.useRef(-1),S=T.useRef(-1),j=T.useRef(-1);function C(){window.clearTimeout(w.current),window.clearTimeout(S.current),cancelAnimationFrame(j.current)}const k=M=>{C();const R=M?r:s,D=M?a:l,F=m?0:M?t:e;y(F),F===0?(typeof R=="function"&&R(),typeof D=="function"&&D(),A(M?"entered":"exited")):j.current=requestAnimationFrame(()=>{Q0.flushSync(()=>{A(M?"pre-entering":"pre-exiting")}),j.current=requestAnimationFrame(()=>{typeof R=="function"&&R(),A(M?"entering":"exiting"),w.current=window.setTimeout(()=>{typeof D=="function"&&D(),A(M?"entered":"exited")},F)})})},E=M=>{if(C(),typeof(M?u:d)!="number"){k(M);return}S.current=window.setTimeout(()=>{k(M)},M?u:d)};return wu(()=>{E(i)},[i]),T.useEffect(()=>()=>{C()},[]),{transitionDuration:v,transitionStatus:b,transitionTimingFunction:n||"ease"}}function fc({keepMounted:t,keepMountedMode:e="activity",transition:n="fade",duration:i=250,exitDuration:r=i,mounted:s,children:a,timingFunction:l="ease",onExit:u,onEntered:d,onEnter:f,onExited:p,enterDelay:m,exitDelay:v}){const y=wy(),{transitionDuration:b,transitionStatus:A,transitionTimingFunction:w}=mte({mounted:s,exitDuration:r,duration:i,timingFunction:l,onExit:u,onEntered:d,onEnter:f,onExited:p,enterDelay:m,exitDelay:v});if(y==="test")return s?o.jsx(o.Fragment,{children:a({})}):t?a({display:"none"}):null;if(b===0)return t?e==="display-none"?s?o.jsx(o.Fragment,{children:a({})}):a({display:"none"}):o.jsx(T.Activity,{mode:s?"visible":"hidden",children:a({})}):s?o.jsx(o.Fragment,{children:a({})}):null;const S=A==="exited";if(t){const j=a(S?e==="display-none"?{display:"none"}:{}:f4({transition:n,duration:b,state:A,timingFunction:w}));return e==="display-none"?j:o.jsx(T.Activity,{mode:S?"hidden":"visible",children:j})}return S?null:o.jsx(o.Fragment,{children:a(f4({transition:n,duration:b,state:A,timingFunction:w}))})}fc.displayName="@mantine/core/Transition";const gte={duration:100,transition:"fade"};function p4(t,e){return{...gte,...e,...t}}const[vte,Gw]=rs("Popover component was not found in the tree");function D$({childProps:t,disabled:e,opened:n,longPressDelay:i=500,setReference:r,open:s}){const a=T.useRef(!1),l=T.useRef(!1),u=T.useRef(null),d=T.useRef(e);d.current=e;const f=(y,b,A)=>{r({getBoundingClientRect:()=>({x:y,y:b,width:0,height:0,top:b,left:y,right:y,bottom:b,toJSON:()=>{}}),contextElement:A}),s()},p=pi(t.onMouseDown,y=>{e||y.button===2&&y.stopPropagation()}),m=pi(t.onContextMenu,y=>{e||y.defaultPrevented||(y.preventDefault(),!l.current&&(f(y.clientX,y.clientY,y.currentTarget),a.current&&(l.current=!0)))}),v=VK(y=>{if(d.current||l.current)return;const b=y,A=b.touches[0]??b.changedTouches[0];A&&(f(A.clientX,A.clientY,u.current),l.current=!0)},{threshold:i,events:["touch"],cancelOnMove:!0,onStart:y=>{a.current=!0,l.current=!1,u.current=y.currentTarget},onFinish:y=>{a.current=!1,l.current=!1,d.current||y.preventDefault()},onCancel:()=>{a.current=!1,l.current=!1}});return{onContextMenu:m,onMouseDown:p,onTouchStart:pi(t.onTouchStart,v.onTouchStart),onTouchEnd:pi(t.onTouchEnd,v.onTouchEnd),onTouchCancel:pi(t.onTouchCancel,v.onTouchCancel),onTouchMove:pi(t.onTouchMove,v.onTouchMove),style:e?t.style:{...t.style,WebkitTouchCallout:"none",WebkitUserSelect:"none",userSelect:"none"},"data-expanded":n?!0:void 0}}function N$(t){const{children:e,disabled:n,longPressDelay:i}=we("PopoverContextMenu",null,t),r=Su(e);if(!r)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=Gw();return T.cloneElement(r,D$({childProps:r.props,disabled:n||s.disabled,opened:s.opened,longPressDelay:i,setReference:s.reference,open:()=>{s.opened||s.onToggle()}}))}N$.displayName="@mantine/core/PopoverContextMenu";function Xw({children:t,active:e=!0,refProp:n="ref",innerRef:i}){const r=Dn(OK(e),i),s=Su(t);return s?T.cloneElement(s,{[n]:r}):t}function I$(t){return o.jsx(dM,{tabIndex:-1,"data-autofocus":!0,...t})}Xw.displayName="@mantine/core/FocusTrap";I$.displayName="@mantine/core/FocusTrapInitialFocus";Xw.InitialFocus=I$;var B$={dropdown:"m_38a85659",arrow:"m_a31dc6c1",overlay:"m_3d7bc908"};const pM=Pe(t=>{var S,j,C,k;const e=we("PopoverDropdown",null,t),{className:n,style:i,vars:r,children:s,onKeyDownCapture:a,variant:l,classNames:u,styles:d,ref:f,...p}=e,m=Gw(),{dir:v}=vc(),y=m.arrowPosition==="merge"&&m.withArrow?O$({position:m.placement,dir:v}):void 0,b=S8({opened:m.opened,shouldReturnFocus:m.returnFocus}),A=m.withRoles?{"aria-labelledby":m.getTargetId(),id:m.getDropdownId(),role:"dialog",tabIndex:-1}:{},w=Dn(f,m.floating);return m.disabled?null:o.jsx(ed,{...m.portalProps,withinPortal:m.withinPortal,children:o.jsx(fc,{mounted:m.opened,...m.transitionProps,transition:((S=m.transitionProps)==null?void 0:S.transition)||"fade",duration:((j=m.transitionProps)==null?void 0:j.duration)??150,keepMounted:m.keepMounted,keepMountedMode:m.keepMountedMode,exitDuration:typeof((C=m.transitionProps)==null?void 0:C.exitDuration)=="number"?m.transitionProps.exitDuration:(k=m.transitionProps)==null?void 0:k.duration,children:E=>{var M;return o.jsx(Xw,{active:m.trapFocus&&m.opened,innerRef:w,children:o.jsxs(xe,{...A,...p,variant:l,onKeyDownCapture:yK(()=>{var R,D;(R=m.onClose)==null||R.call(m),(D=m.onDismiss)==null||D.call(m)},{active:m.closeOnEscape,onTrigger:b,onKeyDown:a}),"data-position":m.placement,"data-fixed":m.floatingStrategy==="fixed"||void 0,...m.getStyles("dropdown",{className:n,props:e,classNames:u,styles:d,style:[{...E,...y,zIndex:m.zIndex,top:m.y??0,left:m.x??0,width:m.width==="target"?void 0:ge(m.width),...m.referenceHidden?{display:"none"}:null},(M=m.resolvedStyles)==null?void 0:M.dropdown,d==null?void 0:d.dropdown,i]}),children:[s,o.jsx(S1,{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:u,styles:d})})]})})}})})});pM.classes=B$;pM.displayName="@mantine/core/PopoverDropdown";const yte={refProp:"ref",popupType:"dialog"},L$=Pe(t=>{const{children:e,refProp:n,popupType:i,ref:r,...s}=we("PopoverTarget",yte,t),a=Su(e);if(!a)throw new Error("Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const l=s,u=Gw(),d=Dn(u.reference,Nw(a),r),f=u.withRoles?{"aria-haspopup":i,"aria-expanded":u.opened,"aria-controls":u.opened?u.getDropdownId():void 0,id:u.getTargetId()}:{},p=a.props;return T.cloneElement(a,{...l,...f,...u.targetProps,className:Yi(u.targetProps.className,l.className,p.className),[n]:d,...u.controlled?null:{onClick:m=>{var v;u.onToggle(),(v=p.onClick)==null||v.call(p,m)}}})});L$.displayName="@mantine/core/PopoverTarget";function xte(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 bte(t,e,n,i){const r=xte(t.middlewares),s=[m$(t.offset),Fee()];if(r.flip&&!n){const a=typeof r.flip=="boolean"?{}:r.flip,l=i?{fallbackStrategy:"initialPlacement",...a}:a;s.push(AO(l))}if(r.shift){const a=typeof r.shift=="boolean"?{}:r.shift;s.push(aM(l=>{const u=l.placement.startsWith("top")||l.placement.startsWith("bottom");return{limiter:Lee(),padding:5,...t.width==="target"&&u?{mainAxis:!1}:null,...a}}))}return r.inline&&s.push(typeof r.inline=="boolean"?cv():cv(r.inline)),s.push(g$({element:t.arrowRef,padding:t.arrowOffset})),(r.size||t.width==="target")&&s.push(Pee({...typeof r.size=="boolean"?{}:r.size,apply({rects:a,availableWidth:l,availableHeight:u,...d}){var p;const f=((p=e().refs.floating.current)==null?void 0:p.style)??{};r.size&&(typeof r.size=="object"&&r.size.apply?r.size.apply({rects:a,availableWidth:l,availableHeight:u,...d}):Object.assign(f,{maxWidth:`${l}px`,maxHeight:`${u}px`})),t.width==="target"&&Object.assign(f,{width:`${a.reference.width}px`})}})),s}function Ate(t){const[e,n]=hr({value:t.opened,defaultValue:t.defaultOpened,finalValue:!1,onChange:t.onChange}),i=T.useRef(e),[r,s]=T.useState(null),a=t.preventPositionChangeWhenVisible!==!1,l=T.useRef(e);e!==l.current&&(l.current=e,e&&r!==null&&s(null));const u=T.useCallback(()=>s(null),[]),d=()=>{e&&!t.disabled&&n(!1)},f=()=>{t.disabled||n(!e)},p=Vw({open:e,strategy:t.strategy,placement:a?r??t.position:t.position,middleware:bte(t,()=>p,a&&r!==null,a),whileElementsMounted:t.keepMounted?void 0:bO});T.useEffect(()=>{if(!t.keepMounted)return;const y=p.refs.reference.current,b=p.refs.floating.current;if(e&&y&&b)return bO(y,b,p.update)},[t.keepMounted,e,p.update,p.elements.reference,p.elements.floating]);const m=T.useRef(!1);uc(()=>{if(!e){m.current=!1;return}if(!a||r!==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)}},[a,e,p.isPositioned,p.placement,r,p.update]);const v=T.useRef(p.placement);return uc(()=>{var y;v.current!==p.placement&&(v.current=p.placement,(y=t.onPositionChange)==null||y.call(t,p.placement))},[p.placement]),wu(()=>{var y,b;e!==i.current&&(e?(b=t.onOpen)==null||b.call(t):(y=t.onClose)==null||y.call(t)),i.current=e},[e,t.onClose,t.onOpen]),{floating:p,controlled:typeof t.opened=="boolean",opened:e,onClose:d,onToggle:f,resetLockedPlacement:u}}const wte={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:Da("popover"),__staticSelector:"Popover",width:"max-content"},P$=(t,{radius:e,shadow:n})=>({dropdown:{"--popover-radius":e===void 0?void 0:ai(e),"--popover-shadow":QE(n)}});function En(t){var pn,mn,un,Qt,ct,zt,on;const e=we("Popover",wte,t),{children:n,position:i,offset:r,onPositionChange:s,opened:a,transitionProps:l,onExitTransitionEnd:u,onEnterTransitionEnd:d,width:f,middlewares:p,withArrow:m,arrowSize:v,arrowOffset:y,arrowRadius:b,arrowPosition:A,unstyled:w,classNames:S,styles:j,closeOnClickOutside:C,withinPortal:k,portalProps:E,closeOnEscape:M,clickOutsideEvents:R,trapFocus:D,onClose:F,onDismiss:I,onOpen:Q,onChange:G,zIndex:L,radius:q,shadow:N,id:P,defaultOpened:Y,__staticSelector:K,withRoles:W,disabled:z,returnFocus:U,variant:V,keepMounted:J,keepMountedMode:ee,vars:ce,floatingStrategy:he,withOverlay:Oe,overlayProps:Te,hideDetached:Re,attributes:qe,preventPositionChangeWhenVisible:ie,...je}=e,se=gt({name:K,props:e,classes:B$,classNames:S,styles:j,unstyled:w,attributes:qe,rootSelector:"dropdown",vars:ce,varsResolver:P$}),{resolvedStyles:be}=na({classNames:S,styles:j,props:e}),Be=T.useRef(null),[Ce,Ve]=T.useState(null),[st,Ye]=T.useState(null),{dir:Ge}=vc(),dt=wy(),nt=zr(P),Ee=Ate({middlewares:p,width:f,position:fM(Ge,i),offset:typeof r=="number"?r+(m?v/2:0):r,arrowRef:Be,arrowOffset:y,onPositionChange:s,opened:a,defaultOpened:Y,onChange:G,onOpen:Q,onClose:F,onDismiss:I,strategy:he,disabled:z,preventPositionChangeWhenVisible:ie,keepMounted:J});wK(()=>{C&&(Ee.onClose(),I==null||I())},R,[Ce,st]);const Qe=T.useCallback(Lt=>{Ve(Lt),Ee.floating.refs.setReference(Lt)},[Ee.floating.refs.setReference]),Xe=T.useCallback(Lt=>{Ye(Lt),Ee.floating.refs.setFloating(Lt)},[Ee.floating.refs.setFloating]),Ze=T.useCallback(()=>{var Lt;(Lt=l==null?void 0:l.onExited)==null||Lt.call(l),u==null||u(),Ee.resetLockedPlacement()},[l==null?void 0:l.onExited,u,Ee.resetLockedPlacement]),vt=T.useCallback(()=>{var Lt;(Lt=l==null?void 0:l.onEntered)==null||Lt.call(l),d==null||d()},[l==null?void 0:l.onEntered,d]);return o.jsxs(vte,{value:{returnFocus:U,disabled:z,controlled:Ee.controlled,reference:Qe,floating:Xe,x:Ee.floating.x,y:Ee.floating.y,arrowX:(un=(mn=(pn=Ee.floating)==null?void 0:pn.middlewareData)==null?void 0:mn.arrow)==null?void 0:un.x,arrowY:(zt=(ct=(Qt=Ee.floating)==null?void 0:Qt.middlewareData)==null?void 0:ct.arrow)==null?void 0:zt.y,opened:Ee.opened,arrowRef:Be,transitionProps:{...l,onExited:Ze,onEntered:vt},width:f,withArrow:m,arrowSize:v,arrowOffset:y,arrowRadius:b,arrowPosition:A,placement:Ee.floating.placement,trapFocus:D,withinPortal:k,portalProps:E,zIndex:L,radius:q,shadow:N,closeOnEscape:M,onDismiss:I,onClose:Ee.onClose,onToggle:Ee.onToggle,getTargetId:()=>nt,getDropdownId:()=>`${nt}-dropdown`,withRoles:W,targetProps:je,__staticSelector:K,classNames:S,styles:j,unstyled:w,variant:V,keepMounted:J,keepMountedMode:ee,getStyles:se,resolvedStyles:be,floatingStrategy:he,referenceHidden:Re&&dt!=="test"?(on=Ee.floating.middlewareData.hide)==null?void 0:on.referenceHidden:!1},children:[n,Oe&&o.jsx(fc,{transition:"fade",mounted:Ee.opened,duration:(l==null?void 0:l.duration)||250,exitDuration:(l==null?void 0:l.exitDuration)||250,children:Lt=>o.jsx(ed,{withinPortal:k,children:o.jsx(If,{...Te,...se("overlay",{className:Te==null?void 0:Te.className,style:[Lt,Te==null?void 0:Te.style]})})})})]})}En.Target=L$;En.Dropdown=pM;En.ContextMenu=N$;En.varsResolver=P$;En.displayName="@mantine/core/Popover";En.extend=t=>t;En.withProps=t=>{const e=n=>o.jsx(En,{...t,...n});return e.extend=En.extend,e.displayName=`WithProps(${En.displayName})`,e};var ul={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 F$=({className:t,...e})=>o.jsxs(xe,{component:"span",className:Yi(ul.barsLoader,t),...e,children:[o.jsx("span",{className:ul.bar}),o.jsx("span",{className:ul.bar}),o.jsx("span",{className:ul.bar})]});F$.displayName="@mantine/core/Bars";const $$=({className:t,...e})=>o.jsxs(xe,{component:"span",className:Yi(ul.dotsLoader,t),...e,children:[o.jsx("span",{className:ul.dot}),o.jsx("span",{className:ul.dot}),o.jsx("span",{className:ul.dot})]});$$.displayName="@mantine/core/Dots";const z$=({className:t,...e})=>o.jsx(xe,{component:"span",className:Yi(ul.ovalLoader,t),...e});z$.displayName="@mantine/core/Oval";const H$={bars:F$,oval:z$,dots:$$},Ste={loaders:H$,type:"oval"},q$=(t,{size:e,color:n})=>({root:{"--loader-size":Zt(e,"loader-size"),"--loader-color":n?Oi(n,t):void 0}}),Ra=Pe(t=>{const e=we("Loader",Ste,t),{size:n,color:i,type:r,vars:s,className:a,style:l,classNames:u,styles:d,unstyled:f,loaders:p,variant:m,children:v,attributes:y,...b}=e,A=gt({name:"Loader",props:e,classes:ul,className:a,style:l,classNames:u,styles:d,unstyled:f,attributes:y,vars:s,varsResolver:q$});return v?o.jsx(xe,{...A("root"),...b,children:v}):o.jsx(xe,{...A("root"),component:p[r],variant:m,size:n,...b})});Ra.defaultLoaders=H$;Ra.classes=ul;Ra.varsResolver=q$;Ra.displayName="@mantine/core/Loader";var pg={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21",groupSection:"m_437b6484"};const jte={orientation:"horizontal"},Q$=(t,{borderWidth:e})=>({group:{"--ai-border-width":ge(e)}}),Kw=Pe(t=>{const e=we("ActionIconGroup",jte,t),{className:n,style:i,classNames:r,styles:s,unstyled:a,orientation:l,vars:u,borderWidth:d,variant:f,mod:p,attributes:m,...v}=e;return o.jsx(xe,{...gt({name:"ActionIconGroup",props:e,classes:pg,className:n,style:i,classNames:r,styles:s,unstyled:a,attributes:m,vars:u,varsResolver:Q$,rootSelector:"group"})("group"),variant:f,mod:[{"data-orientation":l},p],role:"group",...v})});Kw.classes=pg;Kw.varsResolver=Q$;Kw.displayName="@mantine/core/ActionIconGroup";const Y$=(t,{radius:e,color:n,gradient:i,variant:r,autoContrast:s,size:a})=>{const l=t.variantColorResolver({color:n||t.primaryColor,theme:t,gradient:i,variant:r||"filled",autoContrast:s});return{groupSection:{"--section-height":Zt(a,"section-height"),"--section-padding-x":Zt(a,"section-padding-x"),"--section-fz":Ai(a),"--section-radius":e===void 0?void 0:ai(e),"--section-bg":n||r?l.background:void 0,"--section-color":l.color,"--section-bd":n||r?l.border:void 0}}},Zw=Pe(t=>{const e=we("ActionIconGroupSection",null,t),{className:n,style:i,classNames:r,styles:s,unstyled:a,vars:l,variant:u,gradient:d,radius:f,autoContrast:p,attributes:m,...v}=e;return o.jsx(xe,{...gt({name:"ActionIconGroupSection",props:e,classes:pg,className:n,style:i,classNames:r,styles:s,unstyled:a,attributes:m,vars:l,varsResolver:Y$,rootSelector:"groupSection"})("groupSection"),variant:u,...v})});Zw.classes=pg;Zw.varsResolver=Y$;Zw.displayName="@mantine/core/ActionIconGroupSection";const W$=(t,{size:e,radius:n,variant:i,gradient:r,color:s,autoContrast:a})=>{const l=t.variantColorResolver({color:s||t.primaryColor,theme:t,gradient:r,variant:i||"filled",autoContrast:a});return{root:{"--ai-size":Zt(e,"ai-size"),"--ai-radius":n===void 0?void 0:ai(n),"--ai-bg":s||i?l.background:void 0,"--ai-hover":s||i?l.hover:void 0,"--ai-hover-color":s||i?l.hoverColor:void 0,"--ai-color":l.color,"--ai-bd":s||i?l.border:void 0}}},mi=ss(t=>{const e=we("ActionIcon",null,t),{className:n,unstyled:i,variant:r,classNames:s,styles:a,style:l,loading:u,loaderProps:d,size:f,color:p,radius:m,__staticSelector:v,gradient:y,vars:b,children:A,disabled:w,"data-disabled":S,autoContrast:j,mod:C,attributes:k,...E}=e,M=gt({name:["ActionIcon",v],props:e,className:n,style:l,classes:pg,classNames:s,styles:a,unstyled:i,attributes:k,vars:b,varsResolver:W$});return o.jsxs(Fi,{...M("root",{active:!w&&!u&&!S}),"aria-busy":u||void 0,...E,unstyled:i,variant:r,size:f,disabled:w||u,mod:[{loading:u,disabled:w||S},C],children:[typeof u=="boolean"&&o.jsx(fc,{mounted:u,transition:"slide-down",duration:150,children:R=>o.jsx(xe,{component:"span",...M("loader",{style:R}),"aria-hidden":!0,children:o.jsx(Ra,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...d})})}),o.jsx(xe,{component:"span",mod:{loading:u},...M("icon"),children:A})]})});mi.classes=pg;mi.varsResolver=W$;mi.displayName="@mantine/core/ActionIcon";mi.Group=Kw;mi.GroupSection=Zw;function U$({size:t="var(--cb-icon-size, 70%)",style:e,...n}){return o.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...e,width:t,height:t},...n,children:o.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"})})}U$.displayName="@mantine/core/CloseIcon";var V$={root:"m_86a44da5","root--subtle":"m_220c80f2"};const Cte={variant:"subtle"},G$=(t,{size:e,radius:n,iconSize:i})=>({root:{"--cb-size":Zt(e,"cb-size"),"--cb-radius":n===void 0?void 0:ai(n),"--cb-icon-size":ge(i)}}),Sl=ss(t=>{const e=we("CloseButton",Cte,t),{iconSize:n,children:i,vars:r,radius:s,className:a,classNames:l,style:u,styles:d,unstyled:f,"data-disabled":p,disabled:m,variant:v,icon:y,mod:b,attributes:A,__staticSelector:w,...S}=e,j=gt({name:w||"CloseButton",props:e,className:a,style:u,classes:V$,classNames:l,styles:d,unstyled:f,attributes:A,vars:r,varsResolver:G$});return o.jsxs(Fi,{...S,unstyled:f,variant:v,disabled:m,mod:[{disabled:m||p},b],...j("root",{variant:v,active:!m&&!p}),children:[y||o.jsx(U$,{}),i]})});Sl.classes=V$;Sl.varsResolver=G$;Sl.displayName="@mantine/core/CloseButton";function _te(t){return T.Children.toArray(t).filter(Boolean)}var X$={root:"m_4081bf90"};const kte={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},K$=(t,{grow:e,preventGrowOverflow:n,gap:i,align:r,justify:s,wrap:a},{childWidth:l})=>({root:{"--group-child-width":e&&n?l:void 0,"--group-gap":ns(i),"--group-align":r,"--group-justify":s,"--group-wrap":a}}),pt=Pe(t=>{const e=we("Group",kte,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,children:l,gap:u,align:d,justify:f,wrap:p,grow:m,preventGrowOverflow:v,vars:y,variant:b,__size:A,mod:w,attributes:S,...j}=e,C=_te(l),k=C.length,E=ns(u??"md");return o.jsx(xe,{...gt({name:"Group",props:e,stylesCtx:{childWidth:`calc(${100/k}% - (${E} - ${E} / ${k}))`},className:i,style:r,classes:X$,classNames:n,styles:s,unstyled:a,attributes:S,vars:y,varsResolver:K$})("root"),variant:b,mod:[{grow:m},w],size:A,...j,children:C})});pt.classes=X$;pt.varsResolver=K$;pt.displayName="@mantine/core/Group";const[Tte,_u]=rs("ModalBase component was not found in tree");function Ote({opened:t,transitionDuration:e}){const[n,i]=T.useState(t),r=T.useRef(-1),s=Ay()?0:e;return T.useEffect(()=>(t?(i(!0),window.clearTimeout(r.current)):s===0?i(!1):r.current=window.setTimeout(()=>i(!1),s),()=>window.clearTimeout(r.current)),[t,s]),n}function Ete({id:t,transitionProps:e,opened:n,trapFocus:i,closeOnEscape:r,onClose:s,returnFocus:a}){const l=zr(t),[u,d]=T.useState(!1),[f,p]=T.useState(!1),m=Ote({opened:n,transitionDuration:typeof(e==null?void 0:e.duration)=="number"?e==null?void 0:e.duration:200});return g1("keydown",v=>{var y;v.key==="Escape"&&r&&!v.isComposing&&n&&((y=v.target)==null?void 0:y.getAttribute("data-mantine-stop-propagation"))!=="true"&&s()},{capture:!0}),S8({opened:n,shouldReturnFocus:i&&a}),{_id:l,titleMounted:u,bodyMounted:f,shouldLockScroll:m,setTitleMounted:d,setBodyMounted:p}}var Vl=function(){return Vl=Object.assign||function(e){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Vl.apply(this,arguments)};function Z$(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]]);return n}function Mte(t,e,n){if(n||arguments.length===2)for(var i=0,r=e.length,s;i<r;i++)(s||!(i in e))&&(s||(s=Array.prototype.slice.call(e,0,i)),s[i]=e[i]);return t.concat(s||Array.prototype.slice.call(e))}var MA="right-scroll-bar-position",RA="width-before-scroll-bar",Rte="with-scroll-bars-hidden",Dte="--removed-body-scroll-bar-size";function sk(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function Nte(t,e){var n=T.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(i){var r=n.value;r!==i&&(n.value=i,n.callback(i,r))}}}})[0];return n.callback=e,n.facade}var Ite=typeof window<"u"?T.useLayoutEffect:T.useEffect,m4=new WeakMap;function Bte(t,e){var n=Nte(null,function(i){return t.forEach(function(r){return sk(r,i)})});return Ite(function(){var i=m4.get(n);if(i){var r=new Set(i),s=new Set(t),a=n.current;r.forEach(function(l){s.has(l)||sk(l,null)}),s.forEach(function(l){r.has(l)||sk(l,a)})}m4.set(n,t)},[t]),n}function Lte(t){return t}function Pte(t,e){e===void 0&&(e=Lte);var n=[],i=!1,r={read:function(){if(i)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 a=e(s,i);return n.push(a),function(){n=n.filter(function(l){return l!==a})}},assignSyncMedium:function(s){for(i=!0;n.length;){var a=n;n=[],a.forEach(s)}n={push:function(l){return s(l)},filter:function(){return n}}},assignMedium:function(s){i=!0;var a=[];if(n.length){var l=n;n=[],l.forEach(s),a=n}var u=function(){var f=a;a=[],f.forEach(s)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(f){a.push(f),d()},filter:function(f){return a=a.filter(f),n}}}};return r}function Fte(t){t===void 0&&(t={});var e=Pte(null);return e.options=Vl({async:!0,ssr:!1},t),e}var J$=function(t){var e=t.sideCar,n=Z$(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=e.read();if(!i)throw new Error("Sidecar medium not found");return T.createElement(i,Vl({},n))};J$.isSideCarExport=!0;function $te(t,e){return t.useMedium(e),J$}var ez=Fte(),ok=function(){},Jw=T.forwardRef(function(t,e){var n=T.useRef(null),i=T.useState({onScrollCapture:ok,onWheelCapture:ok,onTouchMoveCapture:ok}),r=i[0],s=i[1],a=t.forwardProps,l=t.children,u=t.className,d=t.removeScrollBar,f=t.enabled,p=t.shards,m=t.sideCar,v=t.noRelative,y=t.noIsolation,b=t.inert,A=t.allowPinchZoom,w=t.as,S=w===void 0?"div":w,j=t.gapMode,C=Z$(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=m,E=Bte([n,e]),M=Vl(Vl({},C),r);return T.createElement(T.Fragment,null,f&&T.createElement(k,{sideCar:ez,removeScrollBar:d,shards:p,noRelative:v,noIsolation:y,inert:b,setCallbacks:s,allowPinchZoom:!!A,lockRef:n,gapMode:j}),a?T.cloneElement(T.Children.only(l),Vl(Vl({},M),{ref:E})):T.createElement(S,Vl({},M,{className:u,ref:E}),l))});Jw.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Jw.classNames={fullWidth:RA,zeroRight:MA};var zte=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Hte(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=zte();return e&&t.setAttribute("nonce",e),t}function qte(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function Qte(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var Yte=function(){var t=0,e=null;return{add:function(n){t==0&&(e=Hte())&&(qte(e,n),Qte(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},Wte=function(){var t=Yte();return function(e,n){T.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},tz=function(){var t=Wte(),e=function(n){var i=n.styles,r=n.dynamic;return t(i,r),null};return e},Ute={left:0,top:0,right:0,gap:0},ak=function(t){return parseInt(t||"",10)||0},Vte=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],i=e[t==="padding"?"paddingTop":"marginTop"],r=e[t==="padding"?"paddingRight":"marginRight"];return[ak(n),ak(i),ak(r)]},Gte=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return Ute;var e=Vte(t),n=document.documentElement.clientWidth,i=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,i-n+e[2]-e[0])}},Xte=tz(),em="data-scroll-locked",Kte=function(t,e,n,i){var r=t.left,s=t.top,a=t.right,l=t.gap;return n===void 0&&(n="margin"),`
  .`.concat(Rte,` {
   overflow: hidden `).concat(i,`;
   padding-right: `).concat(l,"px ").concat(i,`;
  }
  body[`).concat(em,`] {
    overflow: hidden `).concat(i,`;
    overscroll-behavior: contain;
    `).concat([e&&"position: relative ".concat(i,";"),n==="margin"&&`
    padding-left: `.concat(r,`px;
    padding-top: `).concat(s,`px;
    padding-right: `).concat(a,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(l,"px ").concat(i,`;
    `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(i,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(MA,` {
    right: `).concat(l,"px ").concat(i,`;
  }
  
  .`).concat(RA,` {
    margin-right: `).concat(l,"px ").concat(i,`;
  }
  
  .`).concat(MA," .").concat(MA,` {
    right: 0 `).concat(i,`;
  }
  
  .`).concat(RA," .").concat(RA,` {
    margin-right: 0 `).concat(i,`;
  }
  
  body[`).concat(em,`] {
    `).concat(Dte,": ").concat(l,`px;
  }
`)},g4=function(){var t=parseInt(document.body.getAttribute(em)||"0",10);return isFinite(t)?t:0},Zte=function(){T.useEffect(function(){return document.body.setAttribute(em,(g4()+1).toString()),function(){var t=g4()-1;t<=0?document.body.removeAttribute(em):document.body.setAttribute(em,t.toString())}},[])},Jte=function(t){var e=t.noRelative,n=t.noImportant,i=t.gapMode,r=i===void 0?"margin":i;Zte();var s=T.useMemo(function(){return Gte(r)},[r]);return T.createElement(Xte,{styles:Kte(s,!e,r,n?"":"!important")})},SO=!1;if(typeof window<"u")try{var Ib=Object.defineProperty({},"passive",{get:function(){return SO=!0,!0}});window.addEventListener("test",Ib,Ib),window.removeEventListener("test",Ib,Ib)}catch{SO=!1}var kp=SO?{passive:!1}:!1,ene=function(t){return t.tagName==="TEXTAREA"},nz=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!ene(t)&&n[e]==="visible")},tne=function(t){return nz(t,"overflowY")},nne=function(t){return nz(t,"overflowX")},v4=function(t,e){var n=e.ownerDocument,i=e;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var r=iz(t,i);if(r){var s=rz(t,i),a=s[1],l=s[2];if(a>l)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},ine=function(t){var e=t.scrollTop,n=t.scrollHeight,i=t.clientHeight;return[e,n,i]},rne=function(t){var e=t.scrollLeft,n=t.scrollWidth,i=t.clientWidth;return[e,n,i]},iz=function(t,e){return t==="v"?tne(e):nne(e)},rz=function(t,e){return t==="v"?ine(e):rne(e)},sne=function(t,e){return t==="h"&&e==="rtl"?-1:1},one=function(t,e,n,i,r){var s=sne(t,window.getComputedStyle(e).direction),a=s*i,l=n.target,u=e.contains(l),d=!1,f=a>0,p=0,m=0;do{if(!l)break;var v=rz(t,l),y=v[0],b=v[1],A=v[2],w=b-A-s*y;(y||w)&&iz(t,l)&&(p+=w,m+=y);var S=l.parentNode;l=S&&S.nodeType===Node.DOCUMENT_FRAGMENT_NODE?S.host:S}while(!u&&l!==document.body||u&&(e.contains(l)||e===l));return(f&&Math.abs(p)<1||!f&&Math.abs(m)<1)&&(d=!0),d},Bb=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},y4=function(t){return[t.deltaX,t.deltaY]},x4=function(t){return t&&"current"in t?t.current:t},ane=function(t,e){return t[0]===e[0]&&t[1]===e[1]},lne=function(t){return`
  .block-interactivity-`.concat(t,` {pointer-events: none;}
  .allow-interactivity-`).concat(t,` {pointer-events: all;}
`)},cne=0,Tp=[];function une(t){var e=T.useRef([]),n=T.useRef([0,0]),i=T.useRef(),r=T.useState(cne++)[0],s=T.useState(tz)[0],a=T.useRef(t);T.useEffect(function(){a.current=t},[t]),T.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(r));var b=Mte([t.lockRef.current],(t.shards||[]).map(x4),!0).filter(Boolean);return b.forEach(function(A){return A.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),b.forEach(function(A){return A.classList.remove("allow-interactivity-".concat(r))})}}},[t.inert,t.lockRef.current,t.shards]);var l=T.useCallback(function(b,A){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!a.current.allowPinchZoom;var w=Bb(b),S=n.current,j="deltaX"in b?b.deltaX:S[0]-w[0],C="deltaY"in b?b.deltaY:S[1]-w[1],k,E=b.target,M=Math.abs(j)>Math.abs(C)?"h":"v";if("touches"in b&&M==="h"&&E.type==="range")return!1;var R=window.getSelection(),D=R&&R.anchorNode,F=D?D===E||D.contains(E):!1;if(F)return!1;var I=v4(M,E);if(!I)return!0;if(I?k=M:(k=M==="v"?"h":"v",I=v4(M,E)),!I)return!1;if(!i.current&&"changedTouches"in b&&(j||C)&&(i.current=k),!k)return!0;var Q=i.current||k;return one(Q,A,b,Q==="h"?j:C)},[]),u=T.useCallback(function(b){var A=b;if(!(!Tp.length||Tp[Tp.length-1]!==s)){var w="deltaY"in A?y4(A):Bb(A),S=e.current.filter(function(k){return k.name===A.type&&(k.target===A.target||A.target===k.shadowParent)&&ane(k.delta,w)})[0];if(S&&S.should){A.cancelable&&A.preventDefault();return}if(!S){var j=(a.current.shards||[]).map(x4).filter(Boolean).filter(function(k){return k.contains(A.target)}),C=j.length>0?l(A,j[0]):!a.current.noIsolation;C&&A.cancelable&&A.preventDefault()}}},[]),d=T.useCallback(function(b,A,w,S){var j={name:b,delta:A,target:w,should:S,shadowParent:hne(w)};e.current.push(j),setTimeout(function(){e.current=e.current.filter(function(C){return C!==j})},1)},[]),f=T.useCallback(function(b){n.current=Bb(b),i.current=void 0},[]),p=T.useCallback(function(b){d(b.type,y4(b),b.target,l(b,t.lockRef.current))},[]),m=T.useCallback(function(b){d(b.type,Bb(b),b.target,l(b,t.lockRef.current))},[]);T.useEffect(function(){return Tp.push(s),t.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",u,kp),document.addEventListener("touchmove",u,kp),document.addEventListener("touchstart",f,kp),function(){Tp=Tp.filter(function(b){return b!==s}),document.removeEventListener("wheel",u,kp),document.removeEventListener("touchmove",u,kp),document.removeEventListener("touchstart",f,kp)}},[]);var v=t.removeScrollBar,y=t.inert;return T.createElement(T.Fragment,null,y?T.createElement(s,{styles:lne(r)}):null,v?T.createElement(Jte,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function hne(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const dne=$te(ez,une);var Bf=T.forwardRef(function(t,e){return T.createElement(Jw,Vl({},t,{ref:e,sideCar:dne}))});Bf.classNames=Jw.classNames;function sz({keepMounted:t,keepMountedMode:e="activity",opened:n,onClose:i,id:r,transitionProps:s,onExitTransitionEnd:a,onEnterTransitionEnd:l,trapFocus:u,closeOnEscape:d,returnFocus:f,closeOnClickOutside:p,withinPortal:m,portalProps:v,lockScroll:y,children:b,zIndex:A,shadow:w,padding:S,__vars:j,unstyled:C,removeScrollProps:k,...E}){const{_id:M,titleMounted:R,bodyMounted:D,shouldLockScroll:F,setTitleMounted:I,setBodyMounted:Q}=Ete({id:r,transitionProps:s,opened:n,trapFocus:u,closeOnEscape:d,onClose:i,returnFocus:f}),{key:G,...L}=k||{};return o.jsx(ed,{...v,withinPortal:m,children:o.jsx(Tte,{value:{opened:n,onClose:i,closeOnClickOutside:p,onExitTransitionEnd:a,onEnterTransitionEnd:l,transitionProps:{...s,keepMounted:t,keepMountedMode:e},getTitleId:()=>`${M}-title`,getBodyId:()=>`${M}-body`,titleMounted:R,bodyMounted:D,setTitleMounted:I,setBodyMounted:Q,trapFocus:u,closeOnEscape:d,zIndex:A,unstyled:C},children:o.jsx(Bf,{enabled:F&&y,...L,children:o.jsx(xe,{...E,id:M,__vars:{...j,"--mb-z-index":(A||Da("modal")).toString(),"--mb-shadow":QE(w),"--mb-padding":ns(S)},children:b})},G)})})}sz.displayName="@mantine/core/ModalBase";function fne(){const t=_u();return T.useEffect(()=>(t.setBodyMounted(!0),()=>t.setBodyMounted(!1)),[]),t.getBodyId()}var $m={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};function oz({className:t,...e}){const n=fne(),i=_u();return o.jsx(xe,{id:n,className:Yi({[$m.body]:!i.unstyled},t),...e})}oz.displayName="@mantine/core/ModalBaseBody";function az({className:t,onClick:e,...n}){const i=_u();return o.jsx(Sl,{...n,onClick:r=>{i.onClose(),e==null||e(r)},className:Yi({[$m.close]:!i.unstyled},t),unstyled:i.unstyled})}az.displayName="@mantine/core/ModalBaseCloseButton";function lz({transitionProps:t,className:e,innerProps:n,onKeyDown:i,style:r,ref:s,...a}){const l=_u();return o.jsx(fc,{mounted:l.opened,transition:"pop",...l.transitionProps,onExited:()=>{var u,d,f;(u=l.onExitTransitionEnd)==null||u.call(l),(f=(d=l.transitionProps)==null?void 0:d.onExited)==null||f.call(d)},onEntered:()=>{var u,d,f;(u=l.onEnterTransitionEnd)==null||u.call(l),(f=(d=l.transitionProps)==null?void 0:d.onEntered)==null||f.call(d)},...t,children:u=>o.jsx("div",{...n,className:Yi({[$m.inner]:!l.unstyled},n.className),children:o.jsx(Xw,{active:l.opened&&l.trapFocus,innerRef:s,children:o.jsx(jy,{...a,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:[r,u],className:Yi({[$m.content]:!l.unstyled},e),unstyled:l.unstyled,children:a.children})})})})}lz.displayName="@mantine/core/ModalBaseContent";function cz({className:t,...e}){const n=_u();return o.jsx(xe,{component:"header",className:Yi({[$m.header]:!n.unstyled},t),...e})}cz.displayName="@mantine/core/ModalBaseHeader";const pne={duration:200,timingFunction:"ease",transition:"fade"};function mne(t){const e=_u();return{...pne,...e.transitionProps,...t}}function uz({onClick:t,transitionProps:e,style:n,visible:i,...r}){const s=_u(),a=mne(e);return o.jsx(fc,{mounted:i!==void 0?i:s.opened,...a,transition:"fade",children:l=>o.jsx(If,{fixed:!0,style:[n,l],zIndex:s.zIndex,unstyled:s.unstyled,onClick:u=>{t==null||t(u),s.closeOnClickOutside&&s.onClose()},...r})})}uz.displayName="@mantine/core/ModalBaseOverlay";function gne(){const t=_u();return T.useEffect(()=>(t.setTitleMounted(!0),()=>t.setTitleMounted(!1)),[]),t.getTitleId()}function hz({className:t,...e}){const n=gne(),i=_u();return o.jsx(xe,{component:"h2",className:Yi({[$m.title]:!i.unstyled},t),id:n,...e})}hz.displayName="@mantine/core/ModalBaseTitle";function vne({children:t}){return o.jsx(o.Fragment,{children:t})}const dz=T.createContext({size:"sm"}),fz=Pe(t=>{const e=we("InputClearButton",null,t),{size:n,variant:i,vars:r,classNames:s,styles:a,...l}=e,u=T.use(dz),{resolvedClassNames:d,resolvedStyles:f}=na({classNames:s,styles:a,props:e});return o.jsx(Sl,{variant:i||"transparent",size:n||(u==null?void 0:u.size)||"sm",classNames:d,styles:f,__staticSelector:"InputClearButton",style:{pointerEvents:"all",background:"var(--input-bg)",...l.style},...l})});fz.displayName="@mantine/core/InputClearButton";const yne={xs:7,sm:8,md:10,lg:12,xl:15};function xne({__clearable:t,__clearSection:e,rightSection:n,__defaultRightSection:i,size:r="sm",__clearSectionMode:s="both"}){const a=t&&e;return s==="rightSection"?n===null?null:n||i:s==="clear"?n===null?null:a||i:a&&(n||i)?o.jsxs("div",{"data-combined-clear-section":!0,style:{display:"flex",gap:2,alignItems:"center",paddingInlineEnd:yne[r]},children:[a,n||i]}):n===null?null:n||a||i}const gd=T.createContext({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var ko={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",success:"m_9d9d40e0",description:"m_fe47ce59"};const pz=(t,{size:e})=>({description:{"--input-description-size":e===void 0?void 0:`calc(${Ai(e)} - ${ge(2)})`}}),Cy=Pe(t=>{const e=we("InputDescription",null,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,__staticSelector:u,__inheritStyles:d=!0,attributes:f,...p}=we("InputDescription",null,e),m=T.use(gd),v=gt({name:["InputWrapper",u],props:e,classes:ko,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:f,rootSelector:"description",vars:l,varsResolver:pz});return o.jsx(xe,{component:"p",...(d&&(m==null?void 0:m.getStyles)||v)("description",m!=null&&m.getStyles?{className:i,style:r}:void 0),...p})});Cy.classes=ko;Cy.varsResolver=pz;Cy.displayName="@mantine/core/InputDescription";const mz=(t,{size:e})=>({error:{"--input-error-size":e===void 0?void 0:`calc(${Ai(e)} - ${ge(2)})`}}),_y=Pe(t=>{const e=we("InputError",null,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,attributes:u,__staticSelector:d,__inheritStyles:f=!0,...p}=e,m=gt({name:["InputWrapper",d],props:e,classes:ko,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:u,rootSelector:"error",vars:l,varsResolver:mz}),v=T.use(gd);return o.jsx(xe,{component:"p",...(f&&(v==null?void 0:v.getStyles)||m)("error",v!=null&&v.getStyles?{className:i,style:r}:void 0),...p})});_y.classes=ko;_y.varsResolver=mz;_y.displayName="@mantine/core/InputError";const bne={labelElement:"label"},gz=(t,{size:e})=>({label:{"--input-label-size":Ai(e),"--input-asterisk-color":void 0}}),ky=Pe(t=>{const e=we("InputLabel",bne,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,labelElement:u,required:d,htmlFor:f,onMouseDown:p,children:m,__staticSelector:v,mod:y,attributes:b,...A}=e,w=gt({name:["InputWrapper",v],props:e,classes:ko,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:b,rootSelector:"label",vars:l,varsResolver:gz}),S=T.use(gd),j=(S==null?void 0:S.getStyles)||w;return o.jsxs(xe,{...j("label",S!=null&&S.getStyles?{className:i,style:r}:void 0),component:u,htmlFor:u==="label"?f:void 0,mod:[{required:d},y],onMouseDown:C=>{p==null||p(C),!C.defaultPrevented&&C.detail>1&&C.preventDefault()},...A,children:[m,d&&o.jsx("span",{...j("required"),"aria-hidden":!0,children:" *"})]})});ky.classes=ko;ky.varsResolver=gz;ky.displayName="@mantine/core/InputLabel";const mM=Pe(t=>{const e=we("InputPlaceholder",null,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,__staticSelector:u,error:d,mod:f,attributes:p,...m}=e;return o.jsx(xe,{...gt({name:["InputPlaceholder",u],props:e,classes:ko,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:p,rootSelector:"placeholder"})("placeholder"),mod:[{error:!!d},f],component:"span",...m})});mM.classes=ko;mM.displayName="@mantine/core/InputPlaceholder";const vz=(t,{size:e})=>({success:{"--input-success-size":e===void 0?void 0:`calc(${Ai(e)} - ${ge(2)})`}}),Ty=Pe(t=>{const e=we("InputSuccess",null,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,attributes:u,__staticSelector:d,__inheritStyles:f=!0,...p}=e,m=gt({name:["InputWrapper",d],props:e,classes:ko,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:u,rootSelector:"success",vars:l,varsResolver:vz}),v=T.use(gd);return o.jsx(xe,{component:"p",...(f&&(v==null?void 0:v.getStyles)||m)("success",v!=null&&v.getStyles?{className:i,style:r}:void 0),...p})});Ty.classes=ko;Ty.varsResolver=vz;Ty.displayName="@mantine/core/InputSuccess";function Ane(t,{hasDescription:e,hasError:n}){const i=t.findIndex(l=>l==="input"),r=t.slice(0,i),s=t.slice(i+1),a=e&&r.includes("description")||n&&r.includes("error");return{offsetBottom:e&&s.includes("description")||n&&s.includes("error"),offsetTop:a}}const wne={labelElement:"label",inputContainer:t=>t,inputWrapperOrder:["label","description","input","error"]},yz=(t,{size:e})=>({label:{"--input-label-size":Ai(e),"--input-asterisk-color":void 0},error:{"--input-error-size":e===void 0?void 0:`calc(${Ai(e)} - ${ge(2)})`},success:{"--input-success-size":e===void 0?void 0:`calc(${Ai(e)} - ${ge(2)})`},description:{"--input-description-size":e===void 0?void 0:`calc(${Ai(e)} - ${ge(2)})`}}),eS=Pe(t=>{const e=we("InputWrapper",wne,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,size:u,variant:d,__staticSelector:f,inputContainer:p,inputWrapperOrder:m,label:v,error:y,success:b,description:A,labelProps:w,descriptionProps:S,errorProps:j,successProps:C,labelElement:k,children:E,withAsterisk:M,id:R,required:D,__stylesApiProps:F,mod:I,attributes:Q,...G}=e,L=gt({name:["InputWrapper",f],props:F||e,classes:ko,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:Q,vars:l,varsResolver:yz}),q={size:u,variant:d,__staticSelector:f},N=zr(R),P=typeof M=="boolean"?M:D,Y=(j==null?void 0:j.id)||`${N}-error`,K=(C==null?void 0:C.id)||`${N}-success`,W=(S==null?void 0:S.id)||`${N}-description`,z=N,U=!!y&&typeof y!="boolean",V=!!b&&typeof b!="boolean"&&!y,J=!!A,ee=U&&m.includes("error"),ce=V&&m.includes("error"),he=J&&m.includes("description"),Oe=`${ee?Y:""} ${ce?K:""} ${he?W:""}`,Te=Oe.trim().length>0?Oe.trim():void 0,Re=(w==null?void 0:w.id)||`${N}-label`,qe=v&&o.jsx(ky,{labelElement:k,id:Re,htmlFor:z,required:P,...q,...w,children:v},"label"),ie=J&&o.jsx(Cy,{...S,...q,size:(S==null?void 0:S.size)||q.size,id:(S==null?void 0:S.id)||W,children:A},"description"),je=o.jsx(T.Fragment,{children:p(E)},"input"),se=U&&T.createElement(_y,{...j,...q,size:(j==null?void 0:j.size)||q.size,key:"error",id:(j==null?void 0:j.id)||Y},y),be=V&&T.createElement(Ty,{...C,...q,size:(C==null?void 0:C.size)||q.size,key:"success",id:(C==null?void 0:C.id)||K},b),Be=m.map(Ce=>{switch(Ce){case"label":return qe;case"input":return je;case"description":return ie;case"error":return se||be;default:return null}});return o.jsx(gd,{value:{getStyles:L,describedBy:Te,inputId:z,labelId:Re,...Ane(m,{hasDescription:J,hasError:U||V})},children:o.jsx(xe,{variant:d,size:u,mod:[{error:!!y,success:!!b&&!y},I],id:k==="label"?void 0:R,...L("root"),...G,children:Be})})});eS.classes=ko;eS.varsResolver=yz;eS.displayName="@mantine/core/InputWrapper";const Sne={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0,withSuccessStyles:!0,size:"sm",loading:!1,loadingPosition:"right"},xz=(t,e,n)=>({wrapper:{"--input-margin-top":n.offsetTop?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-margin-bottom":n.offsetBottom?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-height":Zt(e.size,"input-height"),"--input-fz":Ai(e.size),"--input-radius":e.radius===void 0?void 0:ai(e.radius),"--input-left-section-width":e.leftSectionWidth!==void 0?ge(e.leftSectionWidth):void 0,"--input-right-section-width":e.rightSectionWidth!==void 0?ge(e.rightSectionWidth):void 0,"--input-padding-y":e.multiline?Zt(e.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":e.leftSectionPointerEvents,"--input-right-section-pointer-events":e.rightSectionPointerEvents}}),wi=ss(t=>{const e=we("Input",Sne,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,required:l,__staticSelector:u,__stylesApiProps:d,size:f,wrapperProps:p,error:m,success:v,disabled:y,leftSection:b,leftSectionProps:A,leftSectionWidth:w,rightSection:S,rightSectionProps:j,rightSectionWidth:C,rightSectionPointerEvents:k,leftSectionPointerEvents:E,variant:M,vars:R,pointer:D,multiline:F,radius:I,id:Q,withAria:G,withErrorStyles:L,withSuccessStyles:q,mod:N,inputSize:P,attributes:Y,__clearSection:K,__clearable:W,__clearSectionMode:z,__defaultRightSection:U,loading:V,loadingPosition:J,__bottomSection:ee,__bottomSectionProps:ce,rootRef:he,dir:Oe,...Te}=e,{styleProps:Re,rest:qe}=Sy(Te),ie=T.use(gd),je={offsetBottom:ie==null?void 0:ie.offsetBottom,offsetTop:ie==null?void 0:ie.offsetTop},se=gt({name:["Input",u],props:d||e,classes:ko,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:Y,stylesCtx:je,rootSelector:"wrapper",vars:R,varsResolver:xz}),be=G?{required:l,disabled:y,"aria-invalid":m?!0:void 0,"aria-describedby":ie==null?void 0:ie.describedBy,id:(ie==null?void 0:ie.inputId)||Q}:{},Be=V?o.jsx(Ra,{size:J==="left"?"calc(var(--input-left-section-size) / 2)":"calc(var(--input-right-section-size) / 2)"}):null,Ce=V&&J==="left"?Be:b,Ve=xne({__clearable:W,__clearSection:K,rightSection:V&&J==="right"?Be:S,__defaultRightSection:U,size:f,__clearSectionMode:z});return o.jsx(dz,{value:{size:f||"sm"},children:o.jsxs(xe,{ref:he,dir:Oe,...se("wrapper"),...Re,...p,mod:[{error:!!m&&L,success:!!v&&!m&&q,pointer:D,disabled:y,multiline:F,"data-with-right-section":!!Ve,"data-with-left-section":!!Ce,"data-with-bottom-section":!!ee},N],variant:M,size:f,children:[Ce&&o.jsx("div",{...A,"data-position":"left",...se("section",{className:A==null?void 0:A.className,style:A==null?void 0:A.style}),children:Ce}),o.jsx(xe,{component:"input",...qe,...be,required:l,mod:{disabled:y,error:!!m&&L,success:!!v&&!m&&q},variant:M,__size:P,...se("input")}),ee&&o.jsx("div",{...ce,...se("bottomSection",{className:ce==null?void 0:ce.className,style:ce==null?void 0:ce.style}),children:ee}),Ve&&o.jsx("div",{...j,"data-position":"right",...se("section",{className:j==null?void 0:j.className,style:j==null?void 0:j.style}),children:Ve})]})})});wi.classes=ko;wi.varsResolver=xz;wi.Wrapper=eS;wi.Label=ky;wi.Error=_y;wi.Success=Ty;wi.Description=Cy;wi.Placeholder=mM;wi.ClearButton=fz;wi.displayName="@mantine/core/Input";function bz(t,e,n){const i=we(["Input","InputWrapper",t],e,n),{label:r,description:s,error:a,success:l,required:u,classNames:d,styles:f,className:p,unstyled:m,__staticSelector:v,__stylesApiProps:y,errorProps:b,successProps:A,labelProps:w,descriptionProps:S,wrapperProps:j,id:C,size:k,style:E,inputContainer:M,inputWrapperOrder:R,withAsterisk:D,variant:F,vars:I,mod:Q,attributes:G,...L}=i,{styleProps:q,rest:N}=Sy(L),P={label:r,description:s,error:a,success:l,required:u,classNames:d,className:p,__staticSelector:v,__stylesApiProps:y||i,errorProps:b,successProps:A,labelProps:w,descriptionProps:S,unstyled:m,styles:f,size:k,style:E,inputContainer:M,inputWrapperOrder:R,withAsterisk:D,variant:F,id:C,mod:Q,attributes:G,...j};return{...N,classNames:d,styles:f,unstyled:m,wrapperProps:{...P,...q},inputProps:{required:u,classNames:d,styles:f,unstyled:m,size:k,__staticSelector:v,__stylesApiProps:y||i,error:a,success:l,variant:F,id:C,attributes:G}}}const jne={__staticSelector:"InputBase",withAria:!0,size:"sm"},Fs=ss(t=>{const{inputProps:e,wrapperProps:n,...i}=bz("InputBase",jne,t);return o.jsx(wi.Wrapper,{...n,children:o.jsx(wi,{...e,...i})})});Fs.classes={...wi.classes,...wi.Wrapper.classes};Fs.displayName="@mantine/core/InputBase";function Cne(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 _ne({target:t,parent:e,ref:n,displayAfterTransitionEnd:i,onTransitionStart:r,onTransitionEnd:s}){const a=T.useRef(-1),l=T.useRef(t),[u,d]=T.useState(!1),[f,p]=T.useState(typeof i=="boolean"?i:!1),m=()=>{if(!t||!e||!n.current)return;const A=t.getBoundingClientRect(),w=e.getBoundingClientRect(),S=window.getComputedStyle(t),j=window.getComputedStyle(e),C=Ph(S.borderTopWidth)+Ph(j.borderTopWidth),k=Ph(S.borderLeftWidth)+Ph(j.borderLeftWidth),E={top:A.top-w.top-C,left:A.left-w.left-k,width:A.width,height:A.height};n.current.style.transform=`translateY(${E.top}px) translateX(${E.left}px)`,n.current.style.width=`${E.width}px`,n.current.style.height=`${E.height}px`},v=()=>{window.clearTimeout(a.current),n.current&&(n.current.style.transitionDuration="0ms"),m(),a.current=window.setTimeout(()=>{n.current&&(n.current.style.transitionDuration="")},30)},y=T.useRef(null),b=T.useRef(null);return T.useEffect(()=>{if(u&&l.current!==t&&r&&r(),l.current=t,m(),t)return y.current=new ResizeObserver(v),y.current.observe(t),e&&(b.current=new ResizeObserver(v),b.current.observe(e)),()=>{var A,w;(A=y.current)==null||A.disconnect(),(w=b.current)==null||w.disconnect()}},[e,t]),T.useEffect(()=>{if(e){const A=w=>{Cne(w.target,e)&&(v(),p(!1))};return e.addEventListener("transitionend",A),()=>{e.removeEventListener("transitionend",A)}}},[e]),T.useEffect(()=>{if(n.current&&s){const A=w=>{w.propertyName==="transform"&&s()};return n.current.addEventListener("transitionend",A),()=>{var w;(w=n.current)==null||w.removeEventListener("transitionend",A)}}},[s]),HK(()=>{T8()!=="test"&&d(!0)},20,{autoInvoke:!0}),QK(A=>{A.forEach(w=>{w.type==="attributes"&&w.attributeName==="dir"&&v()})},{attributes:!0,attributeFilter:["dir"]},()=>document.documentElement),{initialized:u,hidden:f}}var Az={root:"m_96b553a6"};const wz=(t,{transitionDuration:e},{shouldReduceMotion:n})=>({root:{"--transition-duration":t.respectReducedMotion&&n?"0ms":typeof e=="number"?`${e}ms`:e||"150ms"}}),tS=Pe(t=>{const e=we("FloatingIndicator",null,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,target:u,parent:d,transitionDuration:f,mod:p,displayAfterTransitionEnd:m,onTransitionStart:v,onTransitionEnd:y,attributes:b,ref:A,...w}=e,S=Ay(),j=gt({name:"FloatingIndicator",classes:Az,props:e,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:b,vars:l,varsResolver:wz,stylesCtx:{shouldReduceMotion:S}}),C=T.useRef(null),{initialized:k,hidden:E}=_ne({target:u,parent:d,ref:C,displayAfterTransitionEnd:m,onTransitionStart:v,onTransitionEnd:y}),M=Dn(A,C);return!u||!d?null:o.jsx(xe,{ref:M,mod:[{initialized:k,hidden:E},p],...j("root"),...w})});tS.displayName="@mantine/core/FloatingIndicator";tS.classes=Az;tS.varsResolver=wz;const[kne,gM]=rs("Accordion component was not found in the tree");function zm({style:t,size:e=16,...n}){return o.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...t,width:ge(e),height:ge(e),display:"block"},...n,children:o.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"})})}zm.displayName="@mantine/core/AccordionChevron";const[Tne,Sz]=rs("Accordion.Item component was not found in the tree");var Oy={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 vM=Pe(t=>{const{classNames:e,className:n,style:i,styles:r,vars:s,chevron:a,icon:l,onClick:u,onKeyDown:d,children:f,disabled:p,mod:m,...v}=we("AccordionControl",null,t),{value:y}=Sz(),b=gM(),A=b.isItemActive(y),w=typeof b.order=="number",S=`h${b.order}`,j=o.jsxs(Fi,{...b.getStyles("control",{className:n,classNames:e,style:i,styles:r,variant:b.variant}),unstyled:b.unstyled,mod:["accordion-control",{active:A,"chevron-position":b.chevronPosition,disabled:p},m],onClick:C=>{u==null||u(C),b.onChange(y)},type:"button",disabled:p,"aria-expanded":A,"aria-controls":b.getRegionId(y),id:b.getControlId(y),onKeyDown:yy({siblingSelector:"[data-accordion-control]",parentSelector:"[data-accordion]",activateOnFocus:!1,loop:b.loop,orientation:"vertical",onKeyDown:d}),...v,children:[o.jsx(xe,{component:"span",mod:{rotate:!b.disableChevronRotation&&A,position:b.chevronPosition},...b.getStyles("chevron",{classNames:e,styles:r}),children:a||b.chevron}),o.jsx("span",{...b.getStyles("label",{classNames:e,styles:r}),children:f}),l&&o.jsx(xe,{component:"span",mod:{"chevron-position":b.chevronPosition},...b.getStyles("icon",{classNames:e,styles:r}),children:l})]});return w?o.jsx(S,{...b.getStyles("itemTitle",{classNames:e,styles:r}),children:j}):j});vM.displayName="@mantine/core/AccordionControl";vM.classes=Oy;const yM=Pe(t=>{const{classNames:e,className:n,style:i,styles:r,vars:s,value:a,mod:l,...u}=we("AccordionItem",null,t),d=gM();return o.jsx(Tne,{value:{value:a},children:o.jsx(xe,{mod:[{active:d.isItemActive(a)},l],...d.getStyles("item",{className:n,classNames:e,styles:r,style:i,variant:d.variant}),...u})})});yM.displayName="@mantine/core/AccordionItem";yM.classes=Oy;const xM=Pe(t=>{const{classNames:e,className:n,style:i,styles:r,vars:s,children:a,keepMounted:l,keepMountedMode:u,...d}=we("AccordionPanel",null,t),{value:f}=Sz(),p=gM();return o.jsx(Fw,{...p.getStyles("panel",{className:n,classNames:e,style:i,styles:r}),expanded:p.isItemActive(f),transitionDuration:p.transitionDuration??200,role:"region",id:p.getRegionId(f),"aria-labelledby":p.getControlId(f),keepMounted:l??p.keepMounted,keepMountedMode:u??p.keepMountedMode,...d,children:o.jsx("div",{...p.getStyles("content",{classNames:e,styles:r}),children:a})})});xM.displayName="@mantine/core/AccordionPanel";xM.classes=Oy;const One={multiple:!1,loop:!0,disableChevronRotation:!1,disableCollapse:!1,chevronPosition:"right",variant:"default",chevronSize:"auto",chevronIconSize:16,keepMountedMode:"activity"},jz=(t,{transitionDuration:e,chevronSize:n,radius:i})=>({root:{"--accordion-transition-duration":e===void 0?void 0:`${e}ms`,"--accordion-chevron-size":n===void 0?void 0:ge(n),"--accordion-radius":i===void 0?void 0:ai(i)}}),Ki=md(t=>{const e=we("Accordion",One,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,children:u,multiple:d,value:f,defaultValue:p,onChange:m,id:v,loop:y,transitionDuration:b,disableChevronRotation:A,disableCollapse:w,chevronPosition:S,chevronSize:j,order:C,chevron:k,variant:E,radius:M,chevronIconSize:R,attributes:D,keepMounted:F,keepMountedMode:I,...Q}=e,G=zr(v),[L,q]=hr({value:f,defaultValue:p,finalValue:d?[]:null,onChange:m}),N=K=>Array.isArray(L)?L.includes(K):K===L,P=K=>{if(!Array.isArray(L)&&w&&K===L)return;const W=Array.isArray(L)?L.includes(K)?L.filter(z=>z!==K):[...L,K]:K===L?null:K;q(W)},Y=gt({name:"Accordion",classes:Oy,props:e,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:D,vars:l,varsResolver:jz});return o.jsx(kne,{value:{isItemActive:N,onChange:P,getControlId:f1(`${G}-control`,"Accordion.Item component was rendered with invalid value or without value"),getRegionId:f1(`${G}-panel`,"Accordion.Item component was rendered with invalid value or without value"),chevron:k===null?null:k||o.jsx(zm,{size:R}),transitionDuration:b,disableChevronRotation:A,chevronPosition:S,order:C,loop:y,getStyles:Y,variant:E,unstyled:a,keepMounted:F,keepMountedMode:I},children:o.jsx(xe,{...Y("root"),id:G,...Q,variant:E,"data-accordion":!0,children:u})})});Ki.classes=Oy;Ki.varsResolver=jz;Ki.displayName="@mantine/core/Accordion";Ki.Item=yM;Ki.Panel=xM;Ki.Control=vM;Ki.Chevron=zm;var Cz={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 _z=(t,{radius:e,color:n,variant:i,autoContrast:r})=>{const s=t.variantColorResolver({color:n||t.primaryColor,theme:t,variant:i||"light",autoContrast:r});return{root:{"--alert-radius":e===void 0?void 0:ai(e),"--alert-bg":n||i?s.background:void 0,"--alert-color":s.color,"--alert-bd":n||i?s.border:void 0}}},Pt=Pe(t=>{const e=we("Alert",null,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,radius:u,color:d,title:f,children:p,id:m,icon:v,withCloseButton:y,onClose:b,closeButtonLabel:A,variant:w,autoContrast:S,role:j,attributes:C,...k}=e,E=gt({name:"Alert",classes:Cz,props:e,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:C,vars:l,varsResolver:_z}),M=zr(m),R=f&&`${M}-title`||void 0,D=`${M}-body`;return o.jsx(xe,{id:M,...E("root",{variant:w}),variant:w,...k,role:j||"alert","aria-describedby":p?D:void 0,"aria-labelledby":f?R:void 0,children:o.jsxs("div",{...E("wrapper"),children:[v&&o.jsx("div",{...E("icon"),children:v}),o.jsxs("div",{...E("body"),children:[f&&o.jsx("div",{...E("title"),"data-with-close-button":y||void 0,children:o.jsx("span",{id:R,...E("label"),children:f})}),p&&o.jsx("div",{id:D,...E("message"),"data-variant":w,children:p})]}),y&&o.jsx(Sl,{...E("closeButton"),onClick:b,variant:"transparent",size:16,iconSize:16,"aria-label":A,unstyled:a})]})})});Pt.classes=Cz;Pt.varsResolver=_z;Pt.displayName="@mantine/core/Alert";var kz={root:"m_b6d8b162"};function Ene(t){if(t==="start")return"start";if(t==="end"||t)return"end"}const Mne={inherit:!1},Tz=(t,{variant:e,lineClamp:n,gradient:i,size:r,textWrap:s})=>({root:{"--text-fz":Ai(r),"--text-lh":x8(r),"--text-gradient":e==="gradient"?dO(i,t):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0,"--text-text-wrap":s}}),ft=ss(t=>{const e=we("Text",Mne,t),{lineClamp:n,truncate:i,inline:r,inherit:s,gradient:a,span:l,textWrap:u,__staticSelector:d,vars:f,className:p,style:m,classNames:v,styles:y,unstyled:b,variant:A,mod:w,size:S,attributes:j,...C}=e;return o.jsx(xe,{...gt({name:["Text",d],props:e,classes:kz,className:p,style:m,classNames:v,styles:y,unstyled:b,attributes:j,vars:f,varsResolver:Tz})("root",{focusable:!0}),component:l?"span":"p",variant:A,mod:[{"data-truncate":Ene(i),"data-line-clamp":typeof n=="number","data-inline":r,"data-inherit":s},w],size:S,...C})});ft.classes=kz;ft.varsResolver=Tz;ft.displayName="@mantine/core/Text";var Oz={root:"m_849cf0da"};const Rne={underline:"hover"},Zi=ss(t=>{const{underline:e,className:n,unstyled:i,mod:r,...s}=we("Anchor",Rne,t);return o.jsx(ft,{component:"a",className:Yi({[Oz.root]:!i},n),...s,mod:[{underline:e},r],__staticSelector:"Anchor",unstyled:i})});Zi.classes=Oz;Zi.displayName="@mantine/core/Anchor";const[Dne,mg]=rs("AppShell was not found in tree");var vd={root:"m_89ab340",navbar:"m_45252eee",aside:"m_9cdde9a",header:"m_3b16f56b",main:"m_8983817",footer:"m_3840c879",section:"m_6dcfc7c7"};const bM=Pe(t=>{const{classNames:e,className:n,style:i,styles:r,unstyled:s,vars:a,withBorder:l,zIndex:u,mod:d,...f}=we("AppShellAside",null,t),p=mg();return p.disabled?null:o.jsx(xe,{component:"aside",mod:[{"with-border":l??p.withBorder},d],...p.getStyles("aside",{className:Yi({[Bf.classNames.zeroRight]:p.offsetScrollbars},n),classNames:e,styles:r,style:i}),...f,__vars:{"--app-shell-aside-z-index":`calc(${u??p.zIndex} + 1)`}})});bM.classes=vd;bM.displayName="@mantine/core/AppShellAside";const AM=Pe(t=>{var m;const{classNames:e,className:n,style:i,styles:r,unstyled:s,vars:a,withBorder:l,zIndex:u,mod:d,...f}=we("AppShellFooter",null,t),p=mg();return p.disabled?null:o.jsx(xe,{component:"footer",mod:[{"with-border":l??p.withBorder},d],...p.getStyles("footer",{className:Yi({[Bf.classNames.zeroRight]:p.offsetScrollbars},n),classNames:e,styles:r,style:i}),...f,__vars:{"--app-shell-footer-z-index":(m=u??p.zIndex)==null?void 0:m.toString()}})});AM.classes=vd;AM.displayName="@mantine/core/AppShellFooter";const wM=Pe(t=>{var m;const{classNames:e,className:n,style:i,styles:r,unstyled:s,vars:a,withBorder:l,zIndex:u,mod:d,...f}=we("AppShellHeader",null,t),p=mg();return p.disabled?null:o.jsx(xe,{component:"header",mod:[{"with-border":l??p.withBorder},d],...p.getStyles("header",{className:Yi({[Bf.classNames.zeroRight]:p.offsetScrollbars},n),classNames:e,styles:r,style:i}),...f,__vars:{"--app-shell-header-z-index":(m=u??p.zIndex)==null?void 0:m.toString()}})});wM.classes=vd;wM.displayName="@mantine/core/AppShellHeader";const SM=Pe(t=>{const{classNames:e,className:n,style:i,styles:r,vars:s,...a}=we("AppShellMain",null,t);return o.jsx(xe,{component:"main",...mg().getStyles("main",{className:n,style:i,classNames:e,styles:r}),...a})});SM.classes=vd;SM.displayName="@mantine/core/AppShellMain";const jM=Pe(t=>{const{classNames:e,className:n,style:i,styles:r,unstyled:s,vars:a,withBorder:l,zIndex:u,mod:d,...f}=we("AppShellNavbar",null,t),p=mg();return p.disabled?null:o.jsx(xe,{component:"nav",mod:[{"with-border":l??p.withBorder},d],...p.getStyles("navbar",{className:n,classNames:e,styles:r,style:i}),...f,__vars:{"--app-shell-navbar-z-index":`calc(${u??p.zIndex} + 1)`}})});jM.classes=vd;jM.displayName="@mantine/core/AppShellNavbar";const CM=ss(t=>{const{classNames:e,className:n,style:i,styles:r,vars:s,grow:a,mod:l,...u}=we("AppShellSection",null,t),d=mg();return o.jsx(xe,{mod:[{grow:a},l],...d.getStyles("section",{className:n,style:i,classNames:e,styles:r}),...u})});CM.classes=vd;CM.displayName="@mantine/core/AppShellSection";function Ey(t){return typeof t=="object"?t.base:t}function My(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 Ry(t){return!(typeof t!="object"||t===null||Object.keys(t).length===1&&"base"in t)}function Nne({baseStyles:t,minMediaStyles:e,maxMediaStyles:n,aside:i,theme:r,mode:s}){var d,f,p;const a=i==null?void 0:i.width,l="translateX(var(--app-shell-aside-width))",u="translateX(calc(var(--app-shell-aside-width) * -1))";if((i==null?void 0:i.breakpoint)!==void 0&&!((d=i==null?void 0:i.collapsed)!=null&&d.mobile)&&(n[i==null?void 0:i.breakpoint]=n[i==null?void 0:i.breakpoint]||{},s==="fixed"?(n[i==null?void 0:i.breakpoint]["--app-shell-aside-width"]="100%",n[i==null?void 0:i.breakpoint]["--app-shell-aside-offset"]="0px"):(n[i==null?void 0:i.breakpoint]["--app-shell-aside-width"]="0px",n[i==null?void 0:i.breakpoint]["--app-shell-aside-offset"]="0px")),My(a)){const m=ge(Ey(a));t["--app-shell-aside-width"]=m,t["--app-shell-aside-offset"]=m}if(Ry(a)&&(typeof a.base<"u"&&(t["--app-shell-aside-width"]=ge(a.base),t["--app-shell-aside-offset"]=ge(a.base)),cr(a).forEach(m=>{m!=="base"&&(e[m]=e[m]||{},e[m]["--app-shell-aside-width"]=ge(a[m]),e[m]["--app-shell-aside-offset"]=ge(a[m]))})),(i==null?void 0:i.breakpoint)!==void 0&&s==="static"&&(e[i.breakpoint]=e[i.breakpoint]||{},e[i.breakpoint]["--app-shell-aside-position"]="sticky",e[i.breakpoint]["--app-shell-aside-grid-row"]="2",e[i.breakpoint]["--app-shell-aside-grid-column"]="3",e[i.breakpoint]["--app-shell-main-column-end"]="3"),(f=i==null?void 0:i.collapsed)!=null&&f.desktop){const m=i.breakpoint;e[m]=e[m]||{},e[m]["--app-shell-aside-transform"]=l,e[m]["--app-shell-aside-transform-rtl"]=u,s==="fixed"?e[m]["--app-shell-aside-offset"]="0px !important":(e[m]["--app-shell-aside-width"]="0px",e[m]["--app-shell-aside-display"]="none",e[m]["--app-shell-main-column-end"]="-1"),e[m]["--app-shell-aside-scroll-locked-visibility"]="hidden"}if((p=i==null?void 0:i.collapsed)!=null&&p.mobile){const m=YE(i.breakpoint,r.breakpoints)-.1;n[m]=n[m]||{},s==="fixed"?(n[m]["--app-shell-aside-width"]="100%",n[m]["--app-shell-aside-offset"]="0px"):n[m]["--app-shell-aside-width"]="0px",n[m]["--app-shell-aside-transform"]=l,n[m]["--app-shell-aside-transform-rtl"]=u,n[m]["--app-shell-aside-scroll-locked-visibility"]="hidden"}}function Ine({baseStyles:t,minMediaStyles:e,footer:n,mode:i}){const r=n==null?void 0:n.height,s="translateY(var(--app-shell-footer-height))",a=i==="static"?!0:(n==null?void 0:n.offset)??!0;if(i==="static"&&n&&(t["--app-shell-footer-position"]="sticky",t["--app-shell-footer-grid-column"]="1 / -1",t["--app-shell-footer-grid-row"]="3"),My(r)){const l=ge(Ey(r));t["--app-shell-footer-height"]=l,a&&(t["--app-shell-footer-offset"]=l)}Ry(r)&&(typeof r.base<"u"&&(t["--app-shell-footer-height"]=ge(r.base),a&&(t["--app-shell-footer-offset"]=ge(r.base))),cr(r).forEach(l=>{l!=="base"&&(e[l]=e[l]||{},e[l]["--app-shell-footer-height"]=ge(r[l]),a&&(e[l]["--app-shell-footer-offset"]=ge(r[l])))})),n!=null&&n.collapsed&&(t["--app-shell-footer-transform"]=s,i==="fixed"&&(t["--app-shell-footer-offset"]="0px !important"))}function Bne({baseStyles:t,minMediaStyles:e,header:n,mode:i}){const r=n==null?void 0:n.height,s="translateY(calc(var(--app-shell-header-height) * -1))",a=i==="static"?!0:(n==null?void 0:n.offset)??!0;if(i==="static"&&n&&(t["--app-shell-header-position"]="sticky",t["--app-shell-header-grid-column"]="1 / -1",t["--app-shell-header-grid-row"]="1"),My(r)){const l=ge(Ey(r));t["--app-shell-header-height"]=l,a&&(t["--app-shell-header-offset"]=l)}Ry(r)&&(typeof r.base<"u"&&(t["--app-shell-header-height"]=ge(r.base),a&&(t["--app-shell-header-offset"]=ge(r.base))),cr(r).forEach(l=>{l!=="base"&&(e[l]=e[l]||{},e[l]["--app-shell-header-height"]=ge(r[l]),a&&(e[l]["--app-shell-header-offset"]=ge(r[l])))})),n!=null&&n.collapsed&&(t["--app-shell-header-transform"]=s,i==="fixed"&&(t["--app-shell-header-offset"]="0px !important"))}function Lne({baseStyles:t,minMediaStyles:e,maxMediaStyles:n,navbar:i,theme:r,mode:s}){var d,f,p;const a=i==null?void 0:i.width,l="translateX(calc(var(--app-shell-navbar-width) * -1))",u="translateX(var(--app-shell-navbar-width))";if((i==null?void 0:i.breakpoint)!==void 0&&!((d=i==null?void 0:i.collapsed)!=null&&d.mobile)&&(n[i==null?void 0:i.breakpoint]=n[i==null?void 0:i.breakpoint]||{},n[i==null?void 0:i.breakpoint]["--app-shell-navbar-offset"]="0px",n[i==null?void 0:i.breakpoint]["--app-shell-navbar-width"]="100%",s==="static"&&(n[i==null?void 0:i.breakpoint]["--app-shell-navbar-grid-width"]="0px")),My(a)){const m=ge(Ey(a));t["--app-shell-navbar-width"]=m,t["--app-shell-navbar-offset"]=m,s==="static"&&(t["--app-shell-navbar-grid-width"]=m)}if(Ry(a)&&(typeof a.base<"u"&&(t["--app-shell-navbar-width"]=ge(a.base),t["--app-shell-navbar-offset"]=ge(a.base),s==="static"&&(t["--app-shell-navbar-grid-width"]=ge(a.base))),cr(a).forEach(m=>{m!=="base"&&(e[m]=e[m]||{},e[m]["--app-shell-navbar-width"]=ge(a[m]),e[m]["--app-shell-navbar-offset"]=ge(a[m]),s==="static"&&(e[m]["--app-shell-navbar-grid-width"]=ge(a[m])))})),(i==null?void 0:i.breakpoint)!==void 0&&s==="static"&&(e[i.breakpoint]=e[i.breakpoint]||{},e[i.breakpoint]["--app-shell-navbar-position"]="sticky",e[i.breakpoint]["--app-shell-navbar-grid-row"]="2",e[i.breakpoint]["--app-shell-navbar-grid-column"]="1",e[i.breakpoint]["--app-shell-main-column-start"]="2"),(f=i==null?void 0:i.collapsed)!=null&&f.desktop){const m=i.breakpoint;e[m]=e[m]||{},e[m]["--app-shell-navbar-transform"]=l,e[m]["--app-shell-navbar-transform-rtl"]=u,s==="fixed"?e[m]["--app-shell-navbar-offset"]="0px !important":(e[m]["--app-shell-navbar-width"]="0px",e[m]["--app-shell-navbar-display"]="none",e[m]["--app-shell-main-column-start"]="1")}if((p=i==null?void 0:i.collapsed)!=null&&p.mobile){const m=YE(i.breakpoint,r.breakpoints)-.1;n[m]=n[m]||{},n[m]["--app-shell-navbar-width"]="100%",n[m]["--app-shell-navbar-offset"]="0px",s==="static"&&(n[m]["--app-shell-navbar-grid-width"]="0px"),n[m]["--app-shell-navbar-transform"]=l,n[m]["--app-shell-navbar-transform-rtl"]=u}}function lk(t){return Number(t)===0?"0px":ns(t)}function Pne({padding:t,baseStyles:e,minMediaStyles:n}){My(t)&&(e["--app-shell-padding"]=lk(Ey(t))),Ry(t)&&(t.base&&(e["--app-shell-padding"]=lk(t.base)),cr(t).forEach(i=>{i!=="base"&&(n[i]=n[i]||{},n[i]["--app-shell-padding"]=lk(t[i]))}))}function Fne({navbar:t,header:e,footer:n,aside:i,padding:r,theme:s,mode:a}){const l={},u={},d={};a==="static"&&(d["--app-shell-main-grid-column"]="1 / -1",d["--app-shell-main-grid-row"]="2"),Lne({baseStyles:d,minMediaStyles:l,maxMediaStyles:u,navbar:t,theme:s,mode:a}),Nne({baseStyles:d,minMediaStyles:l,maxMediaStyles:u,aside:i,theme:s,mode:a}),Bne({baseStyles:d,minMediaStyles:l,header:e,mode:a}),Ine({baseStyles:d,minMediaStyles:l,footer:n,mode:a}),Pne({baseStyles:d,minMediaStyles:l,padding:r});const f=cO(cr(l),s.breakpoints).map(m=>({query:`(min-width: ${Ps(m.px)})`,styles:l[m.value]})),p=cO(cr(u),s.breakpoints).map(m=>({query:`(max-width: ${Ps(m.px)})`,styles:u[m.value]}));return{baseStyles:d,media:[...f,...p]}}function $ne({navbar:t,header:e,aside:n,footer:i,padding:r,mode:s,selector:a}){const l=Ar(),u=gc(),{media:d,baseStyles:f}=Fne({navbar:t,header:e,footer:i,aside:n,padding:r,theme:l,mode:s});return o.jsx(Pw,{media:d,styles:f,selector:a||u.cssVariablesSelector})}function zne({transitionDuration:t,disabled:e}){const[n,i]=T.useState(!0),r=T.useRef(-1),s=T.useRef(-1);return g1("resize",()=>{i(!0),clearTimeout(r.current),r.current=window.setTimeout(()=>T.startTransition(()=>{i(!1)}),200)}),uc(()=>{i(!0),clearTimeout(s.current),s.current=window.setTimeout(()=>T.startTransition(()=>{i(!1)}),t||0)},[e,t]),n}const Hne={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:"ease",zIndex:Da("app"),mode:"fixed"},Ez=(t,{transitionDuration:e,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${e}ms`,"--app-shell-transition-timing-function":n}}),Xo=Pe(t=>{const e=we("AppShell",Hne,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,navbar:u,withBorder:d,padding:f,transitionDuration:p,transitionTimingFunction:m,header:v,zIndex:y,layout:b,disabled:A,aside:w,footer:S,offsetScrollbars:j=!0,mode:C,mod:k,attributes:E,id:M,...R}=e,D=gt({name:"AppShell",classes:vd,props:e,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:E,vars:l,varsResolver:Ez}),F=zne({disabled:A,transitionDuration:p}),I=zr(M);return o.jsxs(Dne,{value:{getStyles:D,withBorder:d,zIndex:y,disabled:A,offsetScrollbars:j,mode:C},children:[o.jsx($ne,{navbar:u,header:v,aside:w,footer:S,padding:f,mode:C,selector:C==="static"?`#${I}`:void 0}),o.jsx(xe,{...D("root"),id:I,mod:[{resizing:F,layout:b,disabled:A,mode:C},k],...R})]})});Xo.classes=vd;Xo.varsResolver=Ez;Xo.displayName="@mantine/core/AppShell";Xo.Navbar=jM;Xo.Header=wM;Xo.Main=SM;Xo.Aside=bM;Xo.Footer=AM;Xo.Section=CM;function Mz(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=>Mz(e))}:typeof t=="number"||typeof t=="bigint"||typeof t=="boolean"?{value:t,label:`${t}`}:t}function Rz(t){return t?t.map(e=>Mz(e)):[]}function _M(t){return t.reduce((e,n)=>"group"in n?{...e,..._M(n.items)}:(e[`${n.value}`]=n,e),{})}var eo={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 qne={error:null},Dz=(t,{size:e,color:n})=>({chevron:{"--combobox-chevron-size":Zt(e,"combobox-chevron-size"),"--combobox-chevron-color":n?Oi(n,t):void 0}}),Dy=Pe(t=>{const e=we("ComboboxChevron",qne,t),{size:n,error:i,style:r,className:s,classNames:a,styles:l,unstyled:u,vars:d,attributes:f,mod:p,...m}=e,v=gt({name:"ComboboxChevron",classes:eo,props:e,style:r,className:s,classNames:a,styles:l,unstyled:u,vars:d,varsResolver:Dz,attributes:f,rootSelector:"chevron"});return o.jsx(xe,{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:i},p],children:o.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"})})});Dy.classes=eo;Dy.varsResolver=Dz;Dy.displayName="@mantine/core/ComboboxChevron";const[Qne,ia]=rs("Combobox component was not found in tree");function kM({onMouseDown:t,onClick:e,onClear:n,...i}){return o.jsx(wi.ClearButton,{tabIndex:-1,"aria-hidden":!0,...i,onMouseDown:r=>{r.preventDefault(),t==null||t(r)},onClick:r=>{n(),e==null||e(r)}})}kM.displayName="@mantine/core/ComboboxClearButton";const TM=Pe(t=>{const{classNames:e,styles:n,className:i,style:r,hidden:s,...a}=we("ComboboxDropdown",null,t),l=ia();return o.jsx(En.Dropdown,{...a,role:"presentation","data-hidden":s||void 0,"data-floating-height":l.floatingHeight||void 0,...l.getStyles("dropdown",{className:i,style:r,classNames:e,styles:n})})});TM.classes=eo;TM.displayName="@mantine/core/ComboboxDropdown";const Yne={refProp:"ref"},Nz=Pe(t=>{const{children:e,refProp:n,ref:i}=we("ComboboxDropdownTarget",Yne,t);if(ia(),!qE(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 o.jsx(En.Target,{ref:i,refProp:n,children:e})});Nz.displayName="@mantine/core/ComboboxDropdownTarget";const OM=Pe(t=>{const{classNames:e,className:n,style:i,styles:r,vars:s,...a}=we("ComboboxEmpty",null,t);return o.jsx(xe,{...ia().getStyles("empty",{className:n,classNames:e,styles:r,style:i}),...a})});OM.classes=eo;OM.displayName="@mantine/core/ComboboxEmpty";function EM({onKeyDown:t,onClick:e,withKeyboardNavigation:n,withAriaAttributes:i,withExpandedAttribute:r,targetType:s,autoComplete:a}){const l=ia(),[u,d]=T.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?d(l.store.selectNextOption()):(l.store.openDropdown("keyboard"),d(l.store.selectActiveOption()),l.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),v.nativeEvent.code==="ArrowUp"&&(v.preventDefault(),l.store.dropdownOpened?d(l.store.selectPreviousOption()):(l.store.openDropdown("keyboard"),d(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{...i?{...r?{role:"combobox"}:{},"aria-haspopup":"listbox","aria-expanded":r?!!(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&&u||void 0,autoComplete:a,"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 Wne={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},Iz=Pe(t=>{const{children:e,refProp:n,withKeyboardNavigation:i,withAriaAttributes:r,withExpandedAttribute:s,targetType:a,autoComplete:l,ref:u,...d}=we("ComboboxEventsTarget",Wne,t),f=Su(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=ia();return T.cloneElement(f,{...EM({targetType:a,withAriaAttributes:r,withKeyboardNavigation:i,withExpandedAttribute:s,onKeyDown:f.props.onKeyDown,onClick:f.props.onClick,autoComplete:l}),...d,[n]:Dn(u,p.store.targetRef,Nw(f))})});Iz.displayName="@mantine/core/ComboboxEventsTarget";const MM=Pe(t=>{const{classNames:e,className:n,style:i,styles:r,vars:s,...a}=we("ComboboxFooter",null,t);return o.jsx(xe,{...ia().getStyles("footer",{className:n,classNames:e,style:i,styles:r}),...a,onMouseDown:l=>{l.preventDefault()}})});MM.classes=eo;MM.displayName="@mantine/core/ComboboxFooter";const RM=Pe(t=>{const{classNames:e,className:n,style:i,styles:r,vars:s,children:a,label:l,id:u,...d}=we("ComboboxGroup",null,t),f=ia(),p=zr(u),m=l!=null&&l!==!1&&l!=="";return o.jsxs(xe,{role:"group","aria-labelledby":m?p:void 0,...f.getStyles("group",{className:n,classNames:e,style:i,styles:r}),...d,children:[m&&o.jsx("div",{id:p,...f.getStyles("groupLabel",{classNames:e,styles:r}),children:l}),a]})});RM.classes=eo;RM.displayName="@mantine/core/ComboboxGroup";const DM=Pe(t=>{const{classNames:e,className:n,style:i,styles:r,vars:s,...a}=we("ComboboxHeader",null,t);return o.jsx(xe,{...ia().getStyles("header",{className:n,classNames:e,style:i,styles:r}),...a,onMouseDown:l=>{l.preventDefault()}})});DM.classes=eo;DM.displayName="@mantine/core/ComboboxHeader";function Bz({value:t,valuesDivider:e=",",...n}){return o.jsx("input",{type:"hidden",value:Array.isArray(t)?t.join(e):t?`${t}`:"",...n})}Bz.displayName="@mantine/core/ComboboxHiddenInput";const NM=Pe(t=>{const e=we("ComboboxOption",null,t),{classNames:n,className:i,style:r,styles:s,vars:a,onClick:l,id:u,active:d,onMouseDown:f,onMouseOver:p,disabled:m,selected:v,mod:y,...b}=e,A=ia(),w=T.useId(),S=u||w;return o.jsx(xe,{...A.getStyles("option",{className:i,classNames:n,styles:s,style:r}),...b,id:S,mod:["combobox-option",{"combobox-active":d,"combobox-disabled":m,"combobox-selected":v},y],role:"option",onClick:j=>{var C;m?j.preventDefault():((C=A.onOptionSubmit)==null||C.call(A,e.value,e),l==null||l(j))},onMouseDown:j=>{j.preventDefault(),f==null||f(j)},onMouseOver:j=>{A.resetSelectionOnOptionHover&&A.store.resetSelectedOption(),p==null||p(j)}})});NM.classes=eo;NM.displayName="@mantine/core/ComboboxOption";const IM=Pe(t=>{const{classNames:e,className:n,style:i,styles:r,id:s,onMouseDown:a,labelledBy:l,...u}=we("ComboboxOptions",null,t),d=ia(),f=zr(s);return T.useEffect(()=>{d.store.setListId(f)},[f]),o.jsx(xe,{...d.getStyles("options",{className:n,style:i,classNames:e,styles:r}),...u,id:f,role:"listbox","aria-labelledby":l,onMouseDown:p=>{p.preventDefault(),a==null||a(p)}})});IM.classes=eo;IM.displayName="@mantine/core/ComboboxOptions";const Une={withAriaAttributes:!0,withKeyboardNavigation:!0},BM=Pe(t=>{const{classNames:e,styles:n,unstyled:i,vars:r,withAriaAttributes:s,onKeyDown:a,onClick:l,withKeyboardNavigation:u,size:d,ref:f,...p}=we("ComboboxSearch",Une,t),m=ia(),v=m.getStyles("search"),y=EM({targetType:"input",withAriaAttributes:s,withKeyboardNavigation:u,withExpandedAttribute:!1,onKeyDown:a,onClick:l,autoComplete:"off"});return o.jsx(wi,{ref:Dn(f,m.store.searchRef),classNames:[{input:v.className},e],styles:[{input:v.style},n],size:d||m.size,...y,...p,__staticSelector:"Combobox"})});BM.classes=eo;BM.displayName="@mantine/core/ComboboxSearch";const Vne={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},Lz=Pe(t=>{const{children:e,refProp:n,withKeyboardNavigation:i,withAriaAttributes:r,withExpandedAttribute:s,targetType:a,autoComplete:l,ref:u,...d}=we("ComboboxTarget",Vne,t),f=Su(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=ia(),m=T.cloneElement(f,{...EM({targetType:a,withAriaAttributes:r,withKeyboardNavigation:i,withExpandedAttribute:s,onKeyDown:f.props.onKeyDown,onClick:f.props.onClick,autoComplete:l}),...d});return o.jsx(En.Target,{refProp:n,ref:Dn(u,p.store.targetRef),children:m})});Lz.displayName="@mantine/core/ComboboxTarget";function Gne(t,e,n){for(let i=t-1;i>=0;i-=1)if(!e[i].hasAttribute("data-combobox-disabled"))return i;if(n){for(let i=e.length-1;i>-1;i-=1)if(!e[i].hasAttribute("data-combobox-disabled"))return i}return t}function Xne(t,e,n){for(let i=t+1;i<e.length;i+=1)if(!e[i].hasAttribute("data-combobox-disabled"))return i;if(n){for(let i=0;i<e.length;i+=1)if(!e[i].hasAttribute("data-combobox-disabled"))return i}return t}function Kne(t){for(let e=0;e<t.length;e+=1)if(!t[e].hasAttribute("data-combobox-disabled"))return e;return-1}function nS({defaultOpened:t,opened:e,onOpenedChange:n,onDropdownClose:i,onDropdownOpen:r,loop:s=!0,scrollBehavior:a="instant"}={}){const[l,u]=hr({value:e,defaultValue:t,finalValue:!1,onChange:n}),d=T.useRef(null),f=T.useRef(-1),p=T.useRef(null),m=T.useRef(null),v=T.useRef(-1),y=T.useRef(-1),b=T.useRef(-1),A=T.useCallback((N="unknown")=>{l||(u(!0),r==null||r(N))},[u,r,l]),w=T.useCallback((N="unknown")=>{l&&(u(!1),i==null||i(N))},[u,i,l]),S=T.useCallback((N="unknown")=>{l?w(N):A(N)},[w,A,l]),j=T.useCallback(()=>{const N=Xc(m.current),P=kA(`#${d.current} [data-combobox-selected]`,N);P==null||P.removeAttribute("data-combobox-selected"),P==null||P.removeAttribute("aria-selected")},[]),C=T.useCallback(N=>{const P=Xc(m.current),Y=kA(`#${d.current}`,P),K=Y?Kc("[data-combobox-option]",Y):null;if(!K)return null;const W=N>=K.length?0:N<0?K.length-1:N;return f.current=W,K!=null&&K[W]&&!K[W].hasAttribute("data-combobox-disabled")?(j(),K[W].setAttribute("data-combobox-selected","true"),K[W].setAttribute("aria-selected","true"),K[W].scrollIntoView({block:"nearest",behavior:a}),K[W].id):null},[a,j]),k=T.useCallback(()=>{const N=Xc(m.current),P=kA(`#${d.current} [data-combobox-active]`,N);if(P){const Y=Kc(`#${d.current} [data-combobox-option]`,N).findIndex(K=>K===P);return C(Y)}return C(0)},[C]),E=T.useCallback(()=>{const N=Xc(m.current),P=Kc(`#${d.current} [data-combobox-option]`,N);return C(Xne(f.current,P,s))},[C,s]),M=T.useCallback(()=>{const N=Xc(m.current),P=Kc(`#${d.current} [data-combobox-option]`,N);return C(Gne(f.current,P,s))},[C,s]),R=T.useCallback(()=>{const N=Xc(m.current),P=Kc(`#${d.current} [data-combobox-option]`,N);return C(Kne(P))},[C]),D=T.useCallback((N="selected",P)=>{var Y;if(typeof N=="number"){f.current=N;const K=Xc(m.current),W=Kc(`#${d.current} [data-combobox-option]`,K);P!=null&&P.scrollIntoView&&((Y=W[N])==null||Y.scrollIntoView({block:"nearest",behavior:a}));return}b.current=window.setTimeout(()=>{var U;const K=Xc(m.current),W=Kc(`#${d.current} [data-combobox-option]`,K),z=W.findIndex(V=>V.hasAttribute(`data-combobox-${N}`));f.current=z,P!=null&&P.scrollIntoView&&((U=W[z])==null||U.scrollIntoView({block:"nearest",behavior:a}))},0)},[]),F=T.useCallback(()=>{f.current=-1,j()},[j]),I=T.useCallback(()=>{var P,Y;const N=Xc(m.current);(Y=(P=Kc(`#${d.current} [data-combobox-option]`,N))==null?void 0:P[f.current])==null||Y.click()},[]),Q=T.useCallback(N=>{d.current=N},[]),G=T.useCallback(()=>{v.current=window.setTimeout(()=>{var N;return(N=p.current)==null?void 0:N.focus()},0)},[]),L=T.useCallback(()=>{y.current=window.setTimeout(()=>{var N;return(N=m.current)==null?void 0:N.focus()},0)},[]),q=T.useCallback(()=>f.current,[]);return T.useEffect(()=>()=>{window.clearTimeout(v.current),window.clearTimeout(y.current),window.clearTimeout(b.current)},[]),{dropdownOpened:l,openDropdown:A,closeDropdown:w,toggleDropdown:S,selectedOptionIndex:f.current,getSelectedOptionIndex:q,selectOption:C,selectFirstOption:R,selectActiveOption:k,selectNextOption:E,selectPreviousOption:M,resetSelectedOption:F,updateSelectedOptionIndex:D,listId:d.current,setListId:Q,clickSelectedOption:I,searchRef:p,focusSearchInput:G,targetRef:m,focusTarget:L}}const Zne={keepMounted:!0,keepMountedMode:"display-none",withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0},size:"sm"},Pz=(t,{size:e,dropdownPadding:n})=>({options:{"--combobox-option-fz":Ai(e),"--combobox-option-padding":Zt(e,"combobox-option-padding")},dropdown:{"--combobox-padding":n===void 0?void 0:ge(n),"--combobox-option-fz":Ai(e),"--combobox-option-padding":Zt(e,"combobox-option-padding")}}),fn=t=>{const e=we("Combobox",Zne,t),{classNames:n,styles:i,unstyled:r,children:s,store:a,vars:l,onOptionSubmit:u,onClose:d,size:f,dropdownPadding:p,resetSelectionOnOptionHover:m,__staticSelector:v,readOnly:y,attributes:b,floatingHeight:A,middlewares:w,...S}=e,j=A==="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:D,elements:F,...I})=>{F.floating.style.setProperty("--combobox-floating-max-height",`${R}px`);const Q=w==null?void 0:w.size;typeof Q=="object"&&Q.apply?Q.apply({availableHeight:R,availableWidth:D,elements:F,...I}):Q&&Object.assign(F.floating.style,{maxWidth:`${D}px`,maxHeight:`${R}px`})}}}:w,C=nS(),k=a||C,E=gt({name:v||"Combobox",classes:eo,props:e,classNames:n,styles:i,unstyled:r,attributes:b,vars:l,varsResolver:Pz}),M=()=>{d==null||d(),k.closeDropdown()};return o.jsx(Qne,{value:{getStyles:E,store:k,onOptionSubmit:u,size:f,resetSelectionOnOptionHover:m,readOnly:y,floatingHeight:A},children:o.jsx(En,{opened:k.dropdownOpened,...S,middlewares:j,onChange:R=>!R&&M(),withRoles:!1,unstyled:r,children:s})})},Jne=t=>t;fn.extend=Jne;fn.classes=eo;fn.varsResolver=Pz;fn.displayName="@mantine/core/Combobox";fn.Target=Lz;fn.Dropdown=TM;fn.Options=IM;fn.Option=NM;fn.Search=BM;fn.Empty=OM;fn.Chevron=Dy;fn.Footer=MM;fn.Header=DM;fn.EventsTarget=Iz;fn.DropdownTarget=Nz;fn.Group=RM;fn.ClearButton=kM;fn.HiddenInput=Bz;function Fz({children:t,role:e}){const n=T.use(gd);return n?o.jsx("div",{role:e,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:t}):o.jsx(o.Fragment,{children:t})}const LM=T.createContext(null),eie={hiddenInputValuesSeparator:","},PM=md((t=>{const{value:e,defaultValue:n,onChange:i,size:r,wrapperProps:s,children:a,readOnly:l,name:u,hiddenInputValuesSeparator:d,hiddenInputProps:f,maxSelectedValues:p,disabled:m,...v}=we("CheckboxGroup",eie,t),[y,b]=hr({value:e,defaultValue:n,finalValue:[],onChange:i}),A=j=>{const C=typeof j=="string"?j:j.currentTarget.value;if(l)return;const k=y.includes(C);!k&&p&&y.length>=p||b(k?y.filter(E=>E!==C):[...y,C])},w=j=>{if(m)return!0;if(!p)return!1;const C=y.includes(j),k=y.length>=p;return!C&&k},S=y.join(d);return o.jsx(LM,{value:{value:y,onChange:A,size:r,isDisabled:w},children:o.jsxs(wi.Wrapper,{size:r,...s,...v,labelElement:"div",__staticSelector:"CheckboxGroup",children:[o.jsx(Fz,{role:"group",children:a}),o.jsx("input",{type:"hidden",name:u,value:S,...f})]})})}));PM.classes=wi.Wrapper.classes;PM.displayName="@mantine/core/CheckboxGroup";var $z={card:"m_26775b0a"};const zz=T.createContext(null),tie={withBorder:!0},Hz=(t,{radius:e})=>({card:{"--card-radius":ai(e)}}),iS=Pe(t=>{const e=we("CheckboxCard",tie,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,checked:u,mod:d,withBorder:f,value:p,onClick:m,defaultChecked:v,onChange:y,attributes:b,...A}=e,w=gt({name:"CheckboxCard",classes:$z,props:e,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:b,vars:l,varsResolver:Hz,rootSelector:"card"}),S=T.use(LM),[j,C]=hr({value:typeof u=="boolean"?u:S?S.value.includes(p||""):void 0,defaultValue:v,finalValue:!1,onChange:y});return o.jsx(zz,{value:{checked:j},children:o.jsx(Fi,{mod:[{"with-border":f,checked:j},d],...w("card"),...A,role:"checkbox","aria-checked":j,onClick:k=>{m==null||m(k),S==null||S.onChange(p||""),C(!j)}})})});iS.displayName="@mantine/core/CheckboxCard";iS.classes=$z;iS.varsResolver=Hz;function Hm({size:t,style:e,...n}){return o.jsx("svg",{viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:t!==void 0?{width:ge(t),height:ge(t),...e}:e,"aria-hidden":!0,...n,children:o.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 qz({indeterminate:t,...e}){return t?o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6","aria-hidden":!0,...e,children:o.jsx("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})}):o.jsx(Hm,{...e})}var Qz={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const nie={icon:qz,variant:"filled",radius:"sm"},Yz=(t,{radius:e,color:n,size:i,iconColor:r,variant:s,autoContrast:a})=>{const l=mc({color:n||t.primaryColor,theme:t}),u=l.isThemeColor&&l.shade===void 0?`var(--mantine-color-${l.color}-outline)`:l.color;return{indicator:{"--checkbox-size":Zt(i,"checkbox-size"),"--checkbox-radius":e===void 0?void 0:ai(e),"--checkbox-color":s==="outline"?u:Oi(n,t),"--checkbox-icon-color":r?Oi(r,t):hg(a,t)?ju({color:n,theme:t,autoContrast:a}):void 0}}},rS=Pe(t=>{const e=we("CheckboxIndicator",nie,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,icon:u,indeterminate:d,radius:f,color:p,iconColor:m,autoContrast:v,checked:y,mod:b,variant:A,disabled:w,attributes:S,...j}=e,C=gt({name:"CheckboxIndicator",classes:Qz,props:e,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:S,vars:l,varsResolver:Yz,rootSelector:"indicator"}),k=T.use(zz),E=typeof y=="boolean"||typeof d=="boolean"?y||d:(k==null?void 0:k.checked)||!1;return o.jsx(xe,{...C("indicator",{variant:A}),variant:A,mod:[{checked:E,disabled:w},b],...j,children:o.jsx(u,{indeterminate:d,...C("icon")})})});rS.displayName="@mantine/core/CheckboxIndicator";rS.classes=Qz;rS.varsResolver=Yz;var Wz={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const Uz=Wz;function FM({__staticSelector:t,__stylesApiProps:e,className:n,classNames:i,styles:r,unstyled:s,children:a,label:l,description:u,id:d,disabled:f,error:p,size:m,labelPosition:v="left",bodyElement:y="div",labelElement:b="label",variant:A,style:w,vars:S,mod:j,attributes:C,...k}){const E=gt({name:t,props:e,className:n,style:w,classes:Wz,classNames:i,styles:r,unstyled:s,attributes:C}),M=u?`${d}-description`:void 0,R=p&&typeof p!="boolean"?`${d}-error`:void 0;return o.jsx(xe,{...E("root"),__vars:{"--label-fz":Ai(m),"--label-lh":Zt(m,"label-lh")},mod:[{"label-position":v},j],variant:A,size:m,...k,children:o.jsxs(xe,{component:y,htmlFor:y==="label"?d:void 0,...E("body"),children:[a,o.jsxs("div",{...E("labelWrapper"),"data-disabled":f||void 0,children:[l&&o.jsx(xe,{component:b,htmlFor:b==="label"?d:void 0,...E("label"),"data-disabled":f||void 0,children:l}),u&&o.jsx(wi.Description,{id:M,size:m,__inheritStyles:!1,...E("description"),children:u}),p&&typeof p!="boolean"&&o.jsx(wi.Error,{id:R,size:m,__inheritStyles:!1,...E("error"),children:p})]})]})})}FM.displayName="@mantine/core/InlineInput";var Vz={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const iie={labelPosition:"right",icon:qz,withErrorStyles:!0,variant:"filled",radius:"sm"},Gz=(t,{radius:e,color:n,size:i,iconColor:r,variant:s,autoContrast:a})=>{const l=mc({color:n||t.primaryColor,theme:t}),u=l.isThemeColor&&l.shade===void 0?`var(--mantine-color-${l.color}-outline)`:l.color;return{root:{"--checkbox-size":Zt(i,"checkbox-size"),"--checkbox-radius":e===void 0?void 0:ai(e),"--checkbox-color":s==="outline"?u:Oi(n,t),"--checkbox-icon-color":r?Oi(r,t):hg(a,t)?ju({color:n,theme:t,autoContrast:a}):void 0}}},Vs=Pe(t=>{var Oe;const e=we("Checkbox",iie,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,color:u,label:d,id:f,size:p,radius:m,wrapperProps:v,checked:y,labelPosition:b,description:A,error:w,disabled:S,variant:j,indeterminate:C,icon:k,rootRef:E,iconColor:M,onChange:R,autoContrast:D,mod:F,attributes:I,readOnly:Q,onClick:G,withErrorStyles:L,ref:q,...N}=e,P=T.useRef(null),Y=T.use(LM),K=p||(Y==null?void 0:Y.size),W=gt({name:"Checkbox",props:e,classes:Vz,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:I,vars:l,varsResolver:Gz}),{styleProps:z,rest:U}=Sy(N),V=zr(f),J=[A?`${V}-description`:void 0,w&&typeof w!="boolean"?`${V}-error`:void 0,U["aria-describedby"]].filter(Boolean).join(" ")||void 0,ee={checked:(Y==null?void 0:Y.value.includes(U.value))??y,onChange:Te=>{Q||(Y==null||Y.onChange(Te),R==null||R(Te))}},ce=((Oe=Y==null?void 0:Y.isDisabled)==null?void 0:Oe.call(Y,U.value))??!1,he=S||ce;return T.useEffect(()=>{P.current&&(P.current.indeterminate=C||!1,C?P.current.setAttribute("data-indeterminate","true"):P.current.removeAttribute("data-indeterminate"))},[C]),o.jsx(FM,{...W("root"),__staticSelector:"Checkbox",__stylesApiProps:e,id:V,size:K,labelPosition:b,label:d,description:A,error:w,disabled:he,classNames:n,styles:s,unstyled:a,"data-checked":ee.checked||y||void 0,variant:j,ref:E,mod:F,attributes:I,inert:U.inert,...z,...v,children:o.jsxs(xe,{...W("inner"),mod:{"data-label-position":b},children:[o.jsx(xe,{component:"input",id:V,ref:Dn(P,q),mod:{error:!!w,"with-error-styles":L},...W("input",{focusable:!0,variant:j}),...U,...ee,"aria-describedby":J,disabled:he,inert:U.inert,type:"checkbox",onClick:Te=>{Q&&ee.checked===void 0&&Te.preventDefault(),G==null||G(Te)}}),o.jsx(k,{indeterminate:C,...W("icon")})]})})});Vs.classes={...Vz,...Uz};Vs.varsResolver=Gz;Vs.displayName="@mantine/core/Checkbox";Vs.Group=PM;Vs.Indicator=rS;Vs.Card=iS;function Tv(t){return"group"in t}function Xz({options:t,search:e,limit:n}){const i=e.trim().toLowerCase(),r=[];for(let s=0;s<t.length;s+=1){const a=t[s];if(r.length===n)return r;Tv(a)&&r.push({group:a.group,items:Xz({options:a.items,search:e,limit:n-r.length})}),Tv(a)||a.label.toLowerCase().includes(i)&&r.push(a)}return r}function rie(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 Kz(t,e=new Set){if(Array.isArray(t))for(const n of t)if(Tv(n))Kz(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 sie(t,e){return Array.isArray(t)?t.includes(e):t===e}function Zz({data:t,withCheckIcon:e,withAlignedLabels:n,value:i,checkIconPosition:r,unstyled:s,renderOption:a}){if(!Tv(t)){const u=sie(i,t.value),d=e&&(u?o.jsx(Hm,{className:eo.optionsDropdownCheckIcon}):n?o.jsx("div",{className:eo.optionsDropdownCheckPlaceholder}):null),f=o.jsxs(o.Fragment,{children:[r==="left"&&d,o.jsx("span",{children:t.label}),r==="right"&&d]});return o.jsx(fn.Option,{value:t.value,disabled:t.disabled,className:Yi({[eo.optionsDropdownOption]:!s}),"data-reverse":r==="right"||void 0,"data-checked":u||void 0,"aria-selected":u,active:u,children:typeof a=="function"?a({option:t,checked:u}):f})}const l=t.items.map(u=>o.jsx(Zz,{data:u,value:i,unstyled:s,withCheckIcon:e,withAlignedLabels:n,checkIconPosition:r,renderOption:a},`${u.value}`));return o.jsx(fn.Group,{label:t.group,children:l})}function Jz({data:t,hidden:e,hiddenWhenEmpty:n,filter:i,search:r,limit:s,maxDropdownHeight:a,floatingHeight:l,withScrollArea:u=!0,filterOptions:d=!0,withCheckIcon:f=!1,withAlignedLabels:p=!1,value:m,checkIconPosition:v,nothingFoundMessage:y,unstyled:b,labelId:A,renderOption:w,scrollAreaProps:S,"aria-label":j}){const C=ia();Kz(t);const k=typeof r=="string"?(i||Xz)({options:t,search:d?r:"",limit:s??1/0}):t,E=rie(k),M=k.map((R,D)=>o.jsx(Zz,{data:R,withCheckIcon:f,withAlignedLabels:p,value:m,checkIconPosition:v,unstyled:b,renderOption:w},Tv(R)?`group-${typeof R.group=="string"?R.group:D}`:`${R.value}`));return o.jsx(fn.Dropdown,{hidden:e||n&&E,"data-composed":!0,children:o.jsxs(fn.Options,{labelledBy:A,"aria-label":j,children:[u?o.jsx(Co.Autosize,{mah:(l??C.floatingHeight)==="viewport"?"var(--combobox-floating-options-max-height)":a??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...S,children:M}):M,E&&y&&o.jsx(fn.Empty,{children:y})]})})}const $M=Pe(t=>{const e=we(["Input","InputWrapper","Autocomplete"],{size:"sm"},t),{classNames:n,styles:i,unstyled:r,vars:s,dropdownOpened:a,defaultDropdownOpened:l,onDropdownClose:u,onDropdownOpen:d,onFocus:f,onBlur:p,onClick:m,onChange:v,data:y,value:b,defaultValue:A,selectFirstOptionOnChange:w,selectFirstOptionOnDropdownOpen:S,onOptionSubmit:j,comboboxProps:C,readOnly:k,disabled:E,filter:M,limit:R,withScrollArea:D,maxDropdownHeight:F,floatingHeight:I,size:Q,id:G,renderOption:L,autoComplete:q,scrollAreaProps:N,onClear:P,clearButtonProps:Y,error:K,clearable:W,clearSectionMode:z,rightSection:U,autoSelectOnBlur:V,openOnFocus:J=!0,attributes:ee,...ce}=e,he=zr(G),Oe=Rz(y),Te=_M(Oe),[Re,qe]=hr({value:b,defaultValue:A,finalValue:"",onChange:v}),ie=nS({opened:a,defaultOpened:l,onDropdownOpen:()=>{d==null||d(),S&&ie.selectFirstOption()},onDropdownClose:()=>{u==null||u(),setTimeout(ie.resetSelectedOption,0)}}),je=Ce=>{qe(Ce),ie.resetSelectedOption()},{resolvedClassNames:se,resolvedStyles:be}=na({props:e,styles:i,classNames:n});T.useEffect(()=>{w&&ie.selectFirstOption()},[w,Re]);const Be=o.jsx(fn.ClearButton,{...Y,onClear:()=>{je(""),P==null||P()}});return o.jsxs(fn,{store:ie,__staticSelector:"Autocomplete",classNames:se,styles:be,unstyled:r,readOnly:k,size:Q,attributes:ee,floatingHeight:I,keepMounted:V,onOptionSubmit:Ce=>{j==null||j(Ce),je(Te[Ce].label),ie.closeDropdown()},...C,children:[o.jsx(fn.Target,{autoComplete:q,withExpandedAttribute:!0,children:o.jsx(Fs,{...ce,size:Q,__staticSelector:"Autocomplete",__clearSection:Be,__clearable:W&&!!Re&&!E&&!k,__clearSectionMode:z,rightSection:U,disabled:E,readOnly:k,value:Re,error:K,onChange:Ce=>{je(Ce.currentTarget.value),ie.openDropdown(),w&&ie.selectFirstOption()},onFocus:Ce=>{J&&ie.openDropdown(),f==null||f(Ce)},onBlur:Ce=>{V&&ie.clickSelectedOption(),ie.closeDropdown(),p==null||p(Ce)},onClick:Ce=>{ie.openDropdown(),m==null||m(Ce)},classNames:se,styles:be,unstyled:r,attributes:ee,id:he})}),o.jsx(Jz,{data:Oe,hidden:k||E,filter:M,search:Re,limit:R,hiddenWhenEmpty:!0,withScrollArea:D,maxDropdownHeight:F,unstyled:r,labelId:ce.label?`${he}-label`:void 0,"aria-label":ce.label?void 0:ce["aria-label"],renderOption:L,scrollAreaProps:N})]})});$M.classes={...Fs.classes,...fn.classes};$M.displayName="@mantine/core/Autocomplete";var eH={root:"m_347db0ec","root--dot":"m_fbd81e3d",label:"m_5add502a",section:"m_91fdda9b"};const tH=(t,{radius:e,color:n,gradient:i,variant:r,size:s,autoContrast:a,circle:l})=>{const u=t.variantColorResolver({color:n||t.primaryColor,theme:t,gradient:i,variant:r||"filled",autoContrast:a});return{root:{"--badge-height":Zt(s,"badge-height"),"--badge-padding-x":Zt(s,"badge-padding-x"),"--badge-fz":Zt(s,"badge-fz"),"--badge-radius":l||e===void 0?void 0:ai(e),"--badge-bg":n||r?u.background:void 0,"--badge-color":n||r?u.color:void 0,"--badge-bd":n||r?u.border:void 0,"--badge-dot-color":r==="dot"?Oi(n,t):void 0}}},Hi=ss(t=>{const e=we("Badge",null,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,radius:u,color:d,gradient:f,leftSection:p,rightSection:m,children:v,variant:y,fullWidth:b,autoContrast:A,circle:w,mod:S,attributes:j,...C}=e,k=gt({name:"Badge",props:e,classes:eH,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:j,vars:l,varsResolver:tH});return o.jsxs(xe,{variant:y,mod:[{block:b,circle:w,"with-right-section":!!m,"with-left-section":!!p},S],...k("root",{variant:y}),...C,children:[p&&o.jsx("span",{...k("section"),"data-position":"left",children:p}),o.jsx("span",{...k("label"),children:v}),m&&o.jsx("span",{...k("section"),"data-position":"right",children:m})]})});Hi.classes=eH;Hi.varsResolver=tH;Hi.displayName="@mantine/core/Badge";var nH={root:"m_fea6bf1a",burger:"m_d4fb9cad"};const iH=(t,{color:e,size:n,lineSize:i,transitionDuration:r,transitionTimingFunction:s})=>({root:{"--burger-color":e?Oi(e,t):void 0,"--burger-size":Zt(n,"burger-size"),"--burger-line-size":i?ge(i):void 0,"--burger-transition-duration":r===void 0?void 0:`${r}ms`,"--burger-transition-timing-function":s}}),sS=Pe(t=>{const e=we("Burger",null,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,opened:u,children:d,transitionDuration:f,transitionTimingFunction:p,lineSize:m,attributes:v,...y}=e,b=gt({name:"Burger",classes:nH,props:e,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:v,vars:l,varsResolver:iH});return o.jsxs(Fi,{...b("root"),...y,children:[o.jsx(xe,{mod:["reduce-motion",{opened:u}],...b("burger")}),d]})});sS.classes=nH;sS.varsResolver=iH;sS.displayName="@mantine/core/Burger";var gg={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844",groupSection:"m_70be2a01"};const b4={orientation:"horizontal"},rH=(t,{borderWidth:e})=>({group:{"--button-border-width":ge(e)}}),oS=Pe(t=>{const e=we("ButtonGroup",b4,t),{className:n,style:i,classNames:r,styles:s,unstyled:a,orientation:l,vars:u,borderWidth:d,mod:f,attributes:p,...m}=we("ButtonGroup",b4,t);return o.jsx(xe,{...gt({name:"ButtonGroup",props:e,classes:gg,className:n,style:i,classNames:r,styles:s,unstyled:a,attributes:p,vars:u,varsResolver:rH,rootSelector:"group"})("group"),mod:[{"data-orientation":l},f],role:"group",...m})});oS.classes=gg;oS.varsResolver=rH;oS.displayName="@mantine/core/ButtonGroup";const sH=(t,{radius:e,color:n,gradient:i,variant:r,autoContrast:s,size:a})=>{const l=t.variantColorResolver({color:n||t.primaryColor,theme:t,gradient:i,variant:r||"filled",autoContrast:s});return{groupSection:{"--section-height":Zt(a,"section-height"),"--section-padding-x":Zt(a,"section-padding-x"),"--section-fz":a!=null&&a.includes("compact")?Ai(a.replace("compact-","")):Ai(a),"--section-radius":e===void 0?void 0:ai(e),"--section-bg":n||r?l.background:void 0,"--section-color":l.color,"--section-bd":n||r?l.border:void 0}}},aS=Pe(t=>{const e=we("ButtonGroupSection",null,t),{className:n,style:i,classNames:r,styles:s,unstyled:a,vars:l,gradient:u,radius:d,autoContrast:f,attributes:p,...m}=e;return o.jsx(xe,{...gt({name:"ButtonGroupSection",props:e,classes:gg,className:n,style:i,classNames:r,styles:s,unstyled:a,attributes:p,vars:l,varsResolver:sH,rootSelector:"groupSection"})("groupSection"),...m})});aS.classes=gg;aS.varsResolver=sH;aS.displayName="@mantine/core/ButtonGroupSection";const oie={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${ge(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},oH=(t,{radius:e,color:n,gradient:i,variant:r,size:s,justify:a,autoContrast:l})=>{const u=t.variantColorResolver({color:n||t.primaryColor,theme:t,gradient:i,variant:r||"filled",autoContrast:l});return{root:{"--button-justify":a,"--button-height":Zt(s,"button-height"),"--button-padding-x":Zt(s,"button-padding-x"),"--button-fz":s!=null&&s.includes("compact")?Ai(s.replace("compact-","")):Ai(s),"--button-radius":e===void 0?void 0:ai(e),"--button-bg":n||r?u.background:void 0,"--button-hover":n||r?u.hover:void 0,"--button-color":u.color,"--button-bd":n||r?u.border:void 0,"--button-hover-color":n||r?u.hoverColor:void 0}}},Lr=ss(t=>{const e=we("Button",null,t),{style:n,vars:i,className:r,color:s,disabled:a,children:l,leftSection:u,rightSection:d,fullWidth:f,variant:p,radius:m,loading:v,loaderProps:y,gradient:b,classNames:A,styles:w,unstyled:S,"data-disabled":j,autoContrast:C,mod:k,attributes:E,...M}=e,R=gt({name:"Button",props:e,classes:gg,className:r,style:n,classNames:A,styles:w,unstyled:S,attributes:E,vars:i,varsResolver:oH}),D=!!u,F=!!d;return o.jsxs(Fi,{...R("root",{active:!a&&!v&&!j}),unstyled:S,variant:p,disabled:a||v,mod:[{disabled:a||j,loading:v,block:f,"with-left-section":D,"with-right-section":F},k],...M,children:[typeof v=="boolean"&&o.jsx(fc,{mounted:v,transition:oie,duration:150,children:I=>o.jsx(xe,{component:"span",...R("loader",{style:I}),"aria-hidden":!0,children:o.jsx(Ra,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...y})})}),o.jsxs("span",{...R("inner"),children:[u&&o.jsx(xe,{component:"span",...R("section"),mod:{position:"left"},children:u}),o.jsx(xe,{component:"span",mod:{loading:v},...R("label"),children:l}),d&&o.jsx(xe,{component:"span",...R("section"),mod:{position:"right"},children:d})]})]})});Lr.classes=gg;Lr.varsResolver=oH;Lr.displayName="@mantine/core/Button";Lr.Group=oS;Lr.GroupSection=aS;const[aie,lie]=rs("Card component was not found in tree");var zM={root:"m_e615b15f",section:"m_599a2148"};const lS=ss(t=>{const{classNames:e,className:n,style:i,styles:r,vars:s,withBorder:a,inheritPadding:l,mod:u,...d}=we("CardSection",null,t),f=lie();return o.jsx(xe,{mod:[{"with-border":a,"inherit-padding":l},u],...f.getStyles("section",{className:n,style:i,styles:r,classNames:e}),...d})});lS.classes=zM;lS.displayName="@mantine/core/CardSection";const aH=(t,{padding:e})=>({root:{"--card-padding":ns(e)}}),cie={orientation:"vertical"},Xi=ss(t=>{const e=we("Card",cie,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,children:u,padding:d,attributes:f,orientation:p,...m}=e,v=gt({name:"Card",props:e,classes:zM,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:f,vars:l,varsResolver:aH}),y=T.Children.toArray(u),b=y.map((A,w)=>{var S;return typeof A=="object"&&A&&"type"in A&&(A.type===lS||((S=A.type)==null?void 0:S.displayName)==="@mantine/core/CardSection")?T.cloneElement(A,{"data-orientation":p,"data-first-section":w===0||void 0,"data-last-section":w===y.length-1||void 0}):A});return o.jsx(aie,{value:{getStyles:v},children:o.jsx(jy,{unstyled:a,"data-orientation":p,...v("root"),...m,children:b})})});Xi.classes=zM;Xi.varsResolver=aH;Xi.displayName="@mantine/core/Card";Xi.Section=lS;var lH={root:"m_4451eb3a"};const Ov=ss(t=>{const e=we("Center",null,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,inline:u,mod:d,attributes:f,...p}=e,m=gt({name:"Center",props:e,classes:lH,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:f,vars:l});return o.jsx(xe,{mod:[{inline:u},d],...m("root"),...p})});Ov.classes=lH;Ov.displayName="@mantine/core/Center";var cH={root:"m_b183c0a2"};const uH=(t,{color:e})=>({root:{"--code-bg":e?Oi(e,t):void 0}}),cS=Pe(t=>{const e=we("Code",null,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,color:u,block:d,mod:f,attributes:p,...m}=e,v=gt({name:"Code",props:e,classes:cH,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:p,vars:l,varsResolver:uH});return o.jsx(xe,{component:d?"pre":"code",mod:[{block:d},f],...v("root"),...m,dir:"ltr"})});cS.classes=cH;cS.varsResolver=uH;cS.displayName="@mantine/core/Code";const uie={timeout:1e3};function Ny(t){const{children:e,timeout:n,value:i,...r}=we("CopyButton",uie,t),s=b8({timeout:n}),a=()=>s.copy(i);return o.jsx(o.Fragment,{children:e({copy:a,copied:s.copied,...r})})}Ny.displayName="@mantine/core/CopyButton";var hH={root:"m_3eebeb36",label:"m_9e365f20"};const hie={orientation:"horizontal"},dH=(t,{color:e,variant:n,size:i})=>({root:{"--divider-color":e?Oi(e,t):void 0,"--divider-border-style":n,"--divider-size":Zt(i,"divider-size")}}),vg=Pe(t=>{const e=we("Divider",hie,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,color:u,orientation:d,label:f,labelPosition:p,mod:m,attributes:v,...y}=e,b=gt({name:"Divider",classes:hH,props:e,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:v,vars:l,varsResolver:dH});return o.jsx(xe,{mod:[{orientation:d,withLabel:!!f},m],role:"separator",...b("root"),...y,children:f&&o.jsx(xe,{component:"span",mod:{position:p},...b("label"),children:f})})});vg.classes=hH;vg.varsResolver=dH;vg.displayName="@mantine/core/Divider";var fH={root:"m_e9408a47","root--default":"m_84c9523a","root--filled":"m_ef274e49","root--unstyled":"m_eda993d3",legend:"m_90794832","legend--unstyled":"m_74ca27fe"};const die={variant:"default"},pH=(t,{radius:e})=>({root:{"--fieldset-radius":e===void 0?void 0:ai(e)}}),of=Pe(t=>{const e=we("Fieldset",die,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,legend:u,variant:d,children:f,attributes:p,...m}=e,v=gt({name:"Fieldset",classes:fH,props:e,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:p,vars:l,varsResolver:pH});return o.jsxs(xe,{component:"fieldset",variant:d,...v("root",{variant:d}),...m,children:[u&&o.jsx("legend",{...v("legend",{variant:d}),children:u}),f]})});of.classes=fH;of.varsResolver=pH;of.displayName="@mantine/core/Fieldset";function fie(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},i=typeof e=="number"?e:e.x,r=typeof e=="number"?e:e.y,s=ge(i),a=ge(r),[l,u]=t.split("-");return l==="top"&&(n["--indicator-top"]=a,n["--indicator-translate-y"]="-50%"),l==="middle"&&(n["--indicator-top"]="50%",n["--indicator-translate-y"]="-50%"),l==="bottom"&&(n["--indicator-bottom"]=a,n["--indicator-translate-y"]="50%"),u==="start"&&(n["--indicator-left"]=s,n["--indicator-translate-x"]="-50%"),u==="center"&&(n["--indicator-left"]="50%",n["--indicator-translate-x"]="-50%"),u==="end"&&(n["--indicator-right"]=s,n["--indicator-translate-x"]="50%"),n}var mH={root:"m_e5262200",indicator:"m_760d1fb1",processing:"m_885901b1"};const pie={position:"top-end",offset:0,showZero:!0},gH=(t,{color:e,position:n,offset:i,size:r,radius:s,zIndex:a,autoContrast:l})=>({root:{"--indicator-color":e?Oi(e,t):void 0,"--indicator-text-color":hg(l,t)?ju({color:e,theme:t,autoContrast:l}):void 0,"--indicator-size":ge(r),"--indicator-radius":s===void 0?void 0:ai(s),"--indicator-z-index":a==null?void 0:a.toString(),...fie(n,i)}}),uS=Pe(t=>{const e=we("Indicator",pie,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,children:u,position:d,offset:f,inline:p,label:m,radius:v,color:y,withBorder:b,disabled:A,processing:w,zIndex:S,autoContrast:j,maxValue:C,showZero:k,mod:E,attributes:M,...R}=e,D=gt({name:"Indicator",classes:mH,props:e,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:M,vars:l,varsResolver:gH}),F=!k&&(m===0||m==="0"),I=C!==void 0&&typeof m=="number"&&m>C?`${C}+`:m;return o.jsxs(xe,{...D("root"),mod:[{inline:p},E],...R,children:[!A&&!F&&o.jsx(xe,{mod:{"with-label":!!m,"with-border":b,processing:w},...D("indicator"),children:I}),u]})});uS.classes=mH;uS.varsResolver=gH;uS.displayName="@mantine/core/Indicator";const mie=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],A4={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"};function w4(t){Object.keys(A4).forEach(e=>{t.style.setProperty(e,A4[e],"important")})}function gie(t){const e=window.getComputedStyle(t);if(e===null)return null;const n={};for(const i of mie)n[i]=e[i];return n.boxSizing===""?null:{sizingStyle:n,paddingSize:parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),borderSize:parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth)}}let Gr=null;function vie(t,e,n=1,i=1/0){Gr||(Gr=document.createElement("textarea"),Gr.setAttribute("tabindex","-1"),Gr.setAttribute("aria-hidden","true"),Gr.setAttribute("aria-label","autosize measurement"),w4(Gr)),Gr.parentNode===null&&document.body.appendChild(Gr);const{paddingSize:r,borderSize:s,sizingStyle:a}=t,{boxSizing:l}=a;Object.keys(a).forEach(m=>{Gr.style[m]=a[m]}),w4(Gr),Gr.value=e;let u=l==="border-box"?Gr.scrollHeight+s:Gr.scrollHeight-r;Gr.value=e,u=l==="border-box"?Gr.scrollHeight+s:Gr.scrollHeight-r,Gr.value="x";const d=Gr.scrollHeight-r;let f=d*n;l==="border-box"&&(f=f+r+s),u=Math.max(f,u);let p=d*i;return l==="border-box"&&(p=p+r+s),u=Math.min(p,u),[u,d]}function yie({maxRows:t,minRows:e,onChange:n,ref:i,...r}){const s=r.value!==void 0,a=T.useRef(null),l=Dn(a,i),u=T.useRef(0),d=T.useRef(0),f=()=>{const m=a.current;if(!m)return;const v=gie(m);if(!v)return;const[y]=vie(v,m.value||m.placeholder||"x",e,t);u.current!==y&&(u.current=y,m.style.setProperty("height",`${y}px`,"important"))},p=m=>{s||f(),n==null||n(m)};return T.useLayoutEffect(f),T.useEffect(()=>{const m=()=>f();return window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[]),T.useEffect(()=>{const m=a.current;if(!m||typeof ResizeObserver>"u")return;d.current=m.offsetWidth;const v=new ResizeObserver(()=>{a.current&&a.current.offsetWidth!==d.current&&(d.current=a.current.offsetWidth,f())});return v.observe(m),()=>v.disconnect()},[]),T.useEffect(()=>{const m=()=>f();return document.fonts.addEventListener("loadingdone",m),()=>document.fonts.removeEventListener("loadingdone",m)},[]),T.useEffect(()=>{const m=v=>{var y;if(((y=a.current)==null?void 0:y.form)===v.target&&!s){const b=a.current.value;requestAnimationFrame(()=>{a.current&&b!==a.current.value&&f()})}};return document.body.addEventListener("reset",m),()=>document.body.removeEventListener("reset",m)},[s]),o.jsx("textarea",{rows:e,...r,onChange:p,ref:l})}const HM=Pe(t=>{const{autosize:e,maxRows:n,minRows:i,__staticSelector:r,resize:s,bottomSection:a,bottomSectionProps:l,...u}=we(["Input","InputWrapper","Textarea"],null,t),d=e&&T8()!=="test",f=d?{maxRows:n,minRows:i}:{};return o.jsx(Fs,{component:d?yie:"textarea",...u,__staticSelector:r||"Textarea",__bottomSection:a,__bottomSectionProps:l,multiline:!0,"data-no-overflow":e&&n===void 0||void 0,__vars:{"--input-resize":s},...f})});HM.classes=Fs.classes;HM.displayName="@mantine/core/Textarea";const[xie,bie]=rs("List component was not found in tree");var qM={root:"m_abbac491",item:"m_abb6bec2",itemWrapper:"m_75cd9f71",itemIcon:"m_60f83e5b"};const QM=Pe(t=>{const{classNames:e,className:n,style:i,styles:r,vars:s,icon:a,children:l,mod:u,...d}=we("ListItem",null,t),f=bie(),p=a||f.icon,m={classNames:e,styles:r};return o.jsx(xe,{...f.getStyles("item",{...m,className:n,style:i}),component:"li",mod:[{"with-icon":!!p,centered:f.center},u],...d,children:o.jsxs("div",{...f.getStyles("itemWrapper",m),children:[p&&o.jsx("span",{...f.getStyles("itemIcon",m),children:p}),o.jsx("span",{...f.getStyles("itemLabel",m),children:l})]})})});QM.classes=qM;QM.displayName="@mantine/core/ListItem";const Aie={type:"unordered"},vH=(t,{size:e,spacing:n})=>({root:{"--list-fz":Ai(e),"--list-lh":x8(e),"--list-spacing":ns(n)}}),Un=Pe(t=>{const e=we("List",Aie,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,children:u,type:d,withPadding:f,icon:p,spacing:m,center:v,listStyleType:y,mod:b,attributes:A,...w}=e,S=gt({name:"List",classes:qM,props:e,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:A,vars:l,varsResolver:vH});return o.jsx(xie,{value:{center:v,icon:p,getStyles:S},children:o.jsx(xe,{...S("root",{style:{listStyleType:y}}),component:d==="unordered"?"ul":"ol",mod:[{"with-padding":f,type:p?"none":y},b],...w,children:u})})});Un.classes=qM;Un.varsResolver=vH;Un.displayName="@mantine/core/List";Un.Item=QM;var yH={root:"m_6e45937b",loader:"m_e8eb006c",overlay:"m_df587f17"};const S4={transitionProps:{transition:"fade",duration:0},overlayProps:{backgroundOpacity:.75},zIndex:Da("overlay")},xH=(t,{zIndex:e})=>({root:{"--lo-z-index":e==null?void 0:e.toString()}}),hS=Pe(t=>{const e=we("LoadingOverlay",S4,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,transitionProps:u,loaderProps:d,overlayProps:f,visible:p,zIndex:m,attributes:v,onEnter:y,onEntered:b,onExit:A,onExited:w,...S}=e,j=Ar(),C=gt({name:"LoadingOverlay",classes:yH,props:e,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:v,vars:l,varsResolver:xH}),k={...S4.overlayProps,...f};return o.jsx(fc,{transition:"fade",...u,mounted:!!p,onEnter:y,onEntered:b,onExit:A,onExited:w,children:E=>o.jsxs(xe,{...C("root",{style:E}),...S,children:[o.jsx(Ra,{unstyled:a,...d,...C("loader",{className:d==null?void 0:d.className,style:d==null?void 0:d.style})}),o.jsx(If,{...k,...C("overlay",{className:k==null?void 0:k.className,style:k==null?void 0:k.style}),darkHidden:!0,unstyled:a,color:(f==null?void 0:f.color)||j.white}),o.jsx(If,{...k,...C("overlay",{className:k==null?void 0:k.className,style:k==null?void 0:k.style}),lightHidden:!0,unstyled:a,color:(f==null?void 0:f.color)||j.colors.dark[5]})]})})});hS.classes=yH;hS.varsResolver=xH;hS.displayName="@mantine/core/LoadingOverlay";const[wie,To]=rs("Menu component was not found in the tree"),bH=T.createContext(null);function AH(t){const{value:e,defaultValue:n,onChange:i,children:r}=we("MenuCheckboxGroup",null,t),[s,a]=hr({value:e,defaultValue:n,finalValue:[],onChange:i});return o.jsx(bH,{value:{values:s,onChange:T.useCallback(l=>{a(s.includes(l)?s.filter(u=>u!==l):[...s,l])},[s,a])},children:r})}AH.displayName="@mantine/core/MenuCheckboxGroup";const qm=T.createContext(null);function wH({role:t,checked:e,indicator:n,onSelect:i,color:r,closeMenuOnClick:s,rightSection:a,children:l,disabled:u,dataDisabled:d,className:f,style:p,styles:m,classNames:v,buttonRef:y,others:b}){const A=To(),w=T.use(qm),S=Ar(),{dir:j}=vc(),C=T.useRef(null),k=pi(b.onClick,()=>{d||(i(),s&&A.closeDropdownImmediately())}),E=pi(b.onMouseMove,()=>{var Q;if(!A.hasSearch)return;const I=(Q=C.current)==null?void 0:Q.closest("[data-menu-dropdown]");I&&I.querySelectorAll("[data-menu-active]").forEach(G=>{G!==C.current&&G.closest("[data-menu-dropdown]")===I&&G.removeAttribute("data-menu-active")})}),M=pi(b.onKeyDown,I=>{I.key==="ArrowLeft"&&w&&(w.close(),w.focusParentItem())}),R=r?S.variantColorResolver({color:r,theme:S,variant:"light"}):void 0,D=r?mc({color:r,theme:S}):null,F=A.alignItemsLabels!=="none"||e;return o.jsxs(Fi,{onMouseDown:I=>I.preventDefault(),...b,unstyled:A.unstyled,tabIndex:A.menuItemTabIndex,...A.getStyles("item",{className:f,style:p,styles:m,classNames:v}),ref:Dn(C,y),role:t,"aria-checked":e,disabled:u,"data-menu-item":!0,"data-checked":e||void 0,"data-disabled":u||d||void 0,"data-mantine-stop-propagation":!0,onClick:k,onMouseMove:E,onKeyDown:yy({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:A.loop,dir:j,orientation:"vertical",onKeyDown:M}),__vars:{"--menu-item-color":D!=null&&D.isThemeColor&&(D==null?void 0:D.shade)===void 0?`var(--mantine-color-${D.color}-6)`:R==null?void 0:R.color,"--menu-item-hover":R==null?void 0:R.hover},children:[F&&o.jsx("div",{...A.getStyles("itemIndicator",{styles:m,classNames:v}),"data-checked":e||void 0,children:e?n:null}),l&&o.jsx("div",{...A.getStyles("itemLabel",{styles:m,classNames:v}),"data-menu-item-label":!0,children:l}),a&&o.jsx("div",{...A.getStyles("itemSection",{styles:m,classNames:v}),"data-position":"right",children:a})]})}var jl={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 YM=Pe(t=>{const{classNames:e,className:n,style:i,styles:r,vars:s,color:a,closeMenuOnClick:l,rightSection:u,children:d,disabled:f,"data-disabled":p,value:m,checked:v,defaultChecked:y,onChange:b,checkIcon:A,ref:w,...S}=we("MenuCheckboxItem",null,t),j=To(),C=T.use(bH),k=C&&m!==void 0?C.values.includes(m):void 0,[E,M]=hr({value:v??k,defaultValue:y,finalValue:!1,onChange:b});return o.jsx(wH,{role:"menuitemcheckbox",checked:E,indicator:A??j.checkIcon??o.jsx(Hm,{size:10}),onSelect:()=>{b?M(!E):C&&m!==void 0?C.onChange(m):M(!E)},color:a,closeMenuOnClick:l,rightSection:u,disabled:f,dataDisabled:p,className:n,style:i,styles:r,classNames:e,buttonRef:w,others:S,children:d})});YM.classes=jl;YM.displayName="@mantine/core/MenuCheckboxItem";function SH(t){const{children:e,disabled:n,longPressDelay:i}=we("MenuContextMenu",null,t),r=Su(e);if(!r)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=To(),a=Gw();return T.cloneElement(r,D$({childProps:r.props,disabled:n||a.disabled,opened:s.opened,longPressDelay:i,setReference:a.reference,open:()=>s.openDropdown()}))}SH.displayName="@mantine/core/MenuContextMenu";const WM=Pe(t=>{const{classNames:e,className:n,style:i,styles:r,vars:s,...a}=we("MenuDivider",null,t);return o.jsx(xe,{...To().getStyles("divider",{className:n,style:i,styles:r,classNames:e}),...a})});WM.classes=jl;WM.displayName="@mantine/core/MenuDivider";const Sie=500;function j4(t){return((t.querySelector("[data-menu-item-label]")??t).textContent??"").trim().toLowerCase()}function jie(t){return t.length>1&&t.split("").every(e=>e===t[0])}function jH({enabled:t,opened:e,getDropdown:n}){const i=T.useRef({buffer:"",timeoutId:null});return T.useEffect(()=>{if(e&&t)return;const r=i.current;r.timeoutId!==null&&(window.clearTimeout(r.timeoutId),r.timeoutId=null),r.buffer=""},[e,t]),T.useEffect(()=>()=>{const{timeoutId:r}=i.current;r!==null&&window.clearTimeout(r)},[]),r=>{if(!t||r.defaultPrevented||r.ctrlKey||r.metaKey||r.altKey||r.key.length!==1||r.key===" ")return;const s=r.target;if(s&&(s.tagName==="INPUT"||s.tagName==="TEXTAREA"||s.tagName==="SELECT"||s.isContentEditable))return;const a=n();if(!a)return;const l=Array.from(a.querySelectorAll("[data-menu-item]:not([data-disabled])")).filter(m=>m.closest("[data-menu-dropdown]")===a);if(l.length===0)return;const u=i.current;u.buffer=(u.buffer+r.key).toLowerCase(),u.timeoutId!==null&&window.clearTimeout(u.timeoutId),u.timeoutId=window.setTimeout(()=>{u.buffer="",u.timeoutId=null},Sie);const d=document.activeElement,f=d?l.indexOf(d):-1;let p=null;if(u.buffer.length===1||jie(u.buffer)){const m=u.buffer[0],v=f+1;for(let y=0;y<l.length;y+=1){const b=(v+y)%l.length;if(j4(l[b]).startsWith(m)){p=l[b];break}}}else for(let m=0;m<l.length;m+=1)if(j4(l[m]).startsWith(u.buffer)){p=l[m];break}p&&(r.preventDefault(),p.focus())}}const UM=Pe(t=>{const{classNames:e,className:n,style:i,styles:r,vars:s,onMouseEnter:a,onMouseLeave:l,onKeyDown:u,children:d,ref:f,...p}=we("MenuDropdown",null,t),m=T.useRef(null),v=To(),y=jH({enabled:!v.hasSearch,opened:v.opened,getDropdown:()=>m.current}),b=pi(u,S=>{var j,C;y(S),!(S.defaultPrevented||v.hasSearch)&&(S.key==="ArrowUp"||S.key==="ArrowDown")&&(S.preventDefault(),(C=(j=m.current)==null?void 0:j.querySelectorAll("[data-menu-item]:not(:disabled)")[0])==null||C.focus())}),A=pi(a,()=>(v.trigger==="hover"||v.trigger==="click-hover")&&v.openDropdown()),w=pi(l,()=>(v.trigger==="hover"||v.trigger==="click-hover")&&v.closeDropdown());return o.jsxs(En.Dropdown,{...p,onMouseEnter:A,onMouseLeave:w,role:"menu","aria-orientation":"vertical",ref:Dn(f,m),...v.getStyles("dropdown",{className:n,style:i,styles:r,classNames:e,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:b,children:[v.withInitialFocusPlaceholder&&!v.hasSearch&&o.jsx("div",{role:"presentation",tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),d]})});UM.classes=jl;UM.displayName="@mantine/core/MenuDropdown";const VM=ss(t=>{const{classNames:e,className:n,style:i,styles:r,vars:s,color:a,closeMenuOnClick:l,leftSection:u,rightSection:d,children:f,disabled:p,"data-disabled":m,ref:v,...y}=we("MenuItem",null,t),b=To(),A=T.use(qm),w=Ar(),{dir:S}=vc(),j=T.useRef(null),C=y,k=pi(C.onClick,()=>{m||(typeof l=="boolean"?l&&b.closeDropdownImmediately():b.closeOnItemClick&&b.closeDropdownImmediately())}),E=pi(C.onMouseMove,()=>{var I;if(!b.hasSearch)return;const F=(I=j.current)==null?void 0:I.closest("[data-menu-dropdown]");F&&F.querySelectorAll("[data-menu-active]").forEach(Q=>{Q!==j.current&&Q.closest("[data-menu-dropdown]")===F&&Q.removeAttribute("data-menu-active")})}),M=a?w.variantColorResolver({color:a,theme:w,variant:"light"}):void 0,R=a?mc({color:a,theme:w}):null,D=pi(C.onKeyDown,F=>{F.key==="ArrowLeft"&&A&&(A.close(),A.focusParentItem())});return o.jsxs(Fi,{onMouseDown:F=>F.preventDefault(),...y,unstyled:b.unstyled,tabIndex:b.menuItemTabIndex,...b.getStyles("item",{className:n,style:i,styles:r,classNames:e}),ref:Dn(j,v),role:"menuitem",disabled:p,"data-menu-item":!0,"data-disabled":p||m||void 0,"data-mantine-stop-propagation":!0,onClick:k,onMouseMove:E,onKeyDown:yy({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:b.loop,dir:S,orientation:"vertical",onKeyDown:D}),__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:[b.alignItemsLabels==="all"&&o.jsx("div",{...b.getStyles("itemIndicator",{styles:r,classNames:e}),"data-placeholder":!0}),u&&o.jsx("div",{...b.getStyles("itemSection",{styles:r,classNames:e}),"data-position":"left",children:u}),f&&o.jsx("div",{...b.getStyles("itemLabel",{styles:r,classNames:e}),"data-menu-item-label":!0,children:f}),d&&o.jsx("div",{...b.getStyles("itemSection",{styles:r,classNames:e}),"data-position":"right",children:d})]})});VM.classes=jl;VM.displayName="@mantine/core/MenuItem";const GM=Pe(t=>{const{classNames:e,className:n,style:i,styles:r,vars:s,...a}=we("MenuLabel",null,t);return o.jsx(xe,{...To().getStyles("label",{className:n,style:i,styles:r,classNames:e}),...a})});GM.classes=jl;GM.displayName="@mantine/core/MenuLabel";const CH=T.createContext(null);function _H(t){const{value:e,defaultValue:n,onChange:i,children:r}=we("MenuRadioGroup",null,t),[s,a]=hr({value:e,defaultValue:n,finalValue:null,onChange:i});return o.jsx(CH,{value:{value:s,onChange:l=>a(l)},children:r})}_H.displayName="@mantine/core/MenuRadioGroup";function Cie({size:t,style:e,...n}){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 5 5",style:{width:ge(t),height:ge(t),...e},"aria-hidden":!0,...n,children:o.jsx("circle",{cx:"2.5",cy:"2.5",r:"2.5",fill:"currentColor"})})}const XM=Pe(t=>{const{classNames:e,className:n,style:i,styles:r,vars:s,color:a,closeMenuOnClick:l,rightSection:u,children:d,disabled:f,"data-disabled":p,value:m,checked:v,onChange:y,checkIcon:b,ref:A,...w}=we("MenuRadioItem",null,t),S=To(),j=T.use(CH),C=v??(j?j.value===m:!1);return o.jsx(wH,{role:"menuitemradio",checked:C,indicator:b??S.checkIcon??o.jsx(Cie,{size:5}),onSelect:()=>{C||(y?y(m):j&&j.onChange(m))},color:a,closeMenuOnClick:l,rightSection:u,disabled:f,dataDisabled:p,className:n,style:i,styles:r,classNames:e,buttonRef:A,others:w,children:d})});XM.classes=jl;XM.displayName="@mantine/core/MenuRadioItem";const _ie="[data-menu-item]:not([data-disabled])",kie="[data-menu-active]";function ck(t){return t==null?void 0:t.closest("[data-menu-dropdown]")}function Tie(t){return t?Array.from(t.querySelectorAll(_ie)).filter(e=>e.closest("[data-menu-dropdown]")===t):[]}function jO(t){t&&t.querySelectorAll(kie).forEach(e=>{e.closest("[data-menu-dropdown]")===t&&e.removeAttribute("data-menu-active")})}function Lb(t,e){jO(e),t&&(t.setAttribute("data-menu-active","true"),t.scrollIntoView({block:"nearest"}))}function uk(t){return t.findIndex(e=>e.hasAttribute("data-menu-active"))}const Oie={clearSearchOnClose:!0},KM=Pe(t=>{const{classNames:e,styles:n,onKeyDown:i,onChange:r,size:s,clearSearchOnClose:a,ref:l,...u}=we("MenuSearch",Oie,t),d=To(),f=T.useRef(null),p=Dn(l,f),m=T.useRef(r);m.current=r,T.useEffect(()=>d.registerSearch(),[d.registerSearch]),T.useEffect(()=>{a?d.searchExitClearRef.current=()=>{var A;(A=m.current)==null||A.call(m,{currentTarget:{value:""}})}:d.searchExitClearRef.current=null},[a,d.searchExitClearRef]),T.useEffect(()=>{d.opened||jO(ck(f.current))},[d.opened]);const v=pi(r,A=>{jO(ck(A.currentTarget))}),y=pi(i,A=>{if(A.defaultPrevented)return;const w=ck(A.currentTarget),S=Tie(w);if(A.key==="ArrowDown"){if(A.preventDefault(),S.length===0)return;const j=uk(S);Lb(S[j>=S.length-1?d.loop?0:j:j+1]??null,w)}else if(A.key==="ArrowUp"){if(A.preventDefault(),S.length===0)return;const j=uk(S);Lb(S[j<=0?j===-1||d.loop?S.length-1:0:j-1]??null,w)}else if(A.key==="Home")A.preventDefault(),S.length>0&&Lb(S[0],w);else if(A.key==="End")A.preventDefault(),S.length>0&&Lb(S[S.length-1],w);else if(A.key==="Enter"){if(A.nativeEvent.isComposing||A.nativeEvent.keyCode===229)return;const j=S[uk(S)];j&&(A.preventDefault(),j.hasAttribute("data-sub-menu-item")?(j.focus(),j.dispatchEvent(new KeyboardEvent("keydown",{key:"ArrowRight",bubbles:!0}))):j.click())}}),b=d.getStyles("search");return o.jsx(wi,{"data-autofocus":!0,"data-mantine-stop-propagation":!0,type:"search",size:s,...u,ref:p,classNames:[{input:b.className},e],styles:[{input:b.style},n],onKeyDown:y,onChange:v,__staticSelector:"Menu"})});KM.classes=jl;KM.displayName="@mantine/core/MenuSearch";const ZM=Pe(t=>{const{classNames:e,className:n,style:i,styles:r,vars:s,onMouseEnter:a,onMouseLeave:l,onPointerEnter:u,onPointerLeave:d,onKeyDown:f,children:p,ref:m,...v}=we("MenuSubDropdown",null,t),y=T.useRef(null),b=To(),A=T.use(qm),w=jH({enabled:!b.hasSearch,opened:(A==null?void 0:A.opened)??!1,getDropdown:()=>y.current}),S=pi(f,C=>{w(C),!C.ctrlKey&&!C.metaKey&&!C.altKey&&C.key.length===1&&C.key!==" "&&C.stopPropagation()}),j=A==null?void 0:A.getFloatingProps({onMouseEnter:a,onMouseLeave:l,onPointerEnter:u,onPointerLeave:d});return o.jsx(En.Dropdown,{...v,...j,role:"menu","aria-orientation":"vertical",ref:Dn(m,y,A==null?void 0:A.setFloating),...b.getStyles("dropdown",{className:n,style:i,styles:r,classNames:e,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:S,children:p})});ZM.classes=jl;ZM.displayName="@mantine/core/MenuSubDropdown";const JM=ss(t=>{const{classNames:e,className:n,style:i,styles:r,vars:s,color:a,leftSection:l,rightSection:u,children:d,disabled:f,"data-disabled":p,closeMenuOnClick:m,ref:v,...y}=we("MenuSubItem",null,t),b=To(),A=T.use(qm),w=Ar(),{dir:S}=vc(),j=T.useRef(null),C=y,k=a?w.variantColorResolver({color:a,theme:w,variant:"light"}):void 0,E=a?mc({color:a,theme:w}):null,M=pi(C.onKeyDown,I=>{I.key==="ArrowRight"&&(A==null||A.open(),A==null||A.focusFirstItem()),I.key==="ArrowLeft"&&(A!=null&&A.parentContext)&&(A.parentContext.close(),A.parentContext.focusParentItem())}),R=pi(C.onClick,()=>{!p&&m&&b.closeDropdownImmediately()}),D=pi(C.onMouseMove,()=>{var Q;if(!b.hasSearch)return;const I=(Q=j.current)==null?void 0:Q.closest("[data-menu-dropdown]");I&&I.querySelectorAll("[data-menu-active]").forEach(G=>{G!==j.current&&G.closest("[data-menu-dropdown]")===I&&G.removeAttribute("data-menu-active")})}),F=A==null?void 0:A.getReferenceProps({onMouseEnter:C.onMouseEnter,onMouseLeave:C.onMouseLeave,onPointerEnter:C.onPointerEnter,onPointerLeave:C.onPointerLeave});return o.jsxs(Fi,{onMouseDown:I=>I.preventDefault(),...y,...F,unstyled:b.unstyled,tabIndex:b.menuItemTabIndex,...b.getStyles("item",{className:n,style:i,styles:r,classNames:e}),ref:Dn(j,v,A==null?void 0:A.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:D,onKeyDown:yy({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:b.loop,dir:S,orientation:"vertical",onKeyDown:M}),__vars:{"--menu-item-color":E!=null&&E.isThemeColor&&(E==null?void 0:E.shade)===void 0?`var(--mantine-color-${E.color}-6)`:k==null?void 0:k.color,"--menu-item-hover":k==null?void 0:k.hover},children:[b.alignItemsLabels==="all"&&o.jsx("div",{...b.getStyles("itemIndicator",{styles:r,classNames:e}),"data-placeholder":!0}),l&&o.jsx("div",{...b.getStyles("itemSection",{styles:r,classNames:e}),"data-position":"left",children:l}),d&&o.jsx("div",{...b.getStyles("itemLabel",{styles:r,classNames:e}),"data-menu-item-label":!0,children:d}),o.jsx("div",{...b.getStyles("itemSection",{styles:r,classNames:e}),"data-position":"right",children:u||o.jsx(zm,{...b.getStyles("chevron"),size:14})})]})});JM.classes=jl;JM.displayName="@mantine/core/MenuSubItem";function kH({children:t,refProp:e}){if(!qE(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 To(),o.jsx(En.Target,{refProp:e,popupType:"menu",children:t})}kH.displayName="@mantine/core/MenuSubTarget";const Eie={offset:0,position:"right-start",safeAreaPolygon:!0,transitionProps:{duration:0},openDelay:0,middlewares:{shift:{crossAxis:!0}}};function yg(t){const{children:e,closeDelay:n,openDelay:i,position:r,safeAreaPolygon:s,opened:a,onChange:l,...u}=we("MenuSub",Eie,t),d=zr(),[f,p]=hr({value:a,finalValue:!1,onChange:l}),m=T.use(qm),v=To(),{dir:y}=vc(),b=fM(y,r),A=(m==null?void 0:m.registerOpenSub)??v.registerOpenSub,w=T.useRef(null),S=T.useCallback(Q=>{const G=w.current;return G&&G!==Q&&G(),w.current=Q,()=>{w.current===Q&&(w.current=null)}},[]),j=T.useRef(p);j.current=p;const C=T.useCallback(()=>j.current(!0),[]),k=T.useCallback(()=>j.current(!1),[]);T.useEffect(()=>{if(f)return A(k)},[f,A,k]);const{context:E,refs:M}=Vw({placement:b,open:f,onOpenChange:Q=>{Q?C():k()}}),{getReferenceProps:R,getFloatingProps:D}=A$([x$(E,{handleClose:s?ote(typeof s=="object"?s:void 0):void 0,delay:{open:i,close:n}})]),F=()=>window.setTimeout(()=>{var Q,G;(G=(Q=document.getElementById(`${d}-dropdown`))==null?void 0:Q.querySelectorAll("[data-menu-item]:not([data-disabled])")[0])==null||G.focus()},16),I=()=>window.setTimeout(()=>{var Q;(Q=document.getElementById(`${d}-target`))==null||Q.focus()},16);return o.jsx(qm,{value:{opened:f,close:k,open:C,focusFirstItem:F,focusParentItem:I,parentContext:m,setReference:M.setReference,setFloating:M.setFloating,getReferenceProps:R,getFloatingProps:D,registerOpenSub:S},children:o.jsx(En,{opened:f,onChange:Q=>Q?C():k(),withinPortal:!1,withArrow:!1,id:d,position:r,...u,children:e})})}yg.extend=t=>t;yg.displayName="@mantine/core/MenuSub";yg.Target=kH;yg.Dropdown=ZM;yg.Item=JM;const Mie={refProp:"ref"};function TH(t){const{children:e,refProp:n,...i}=we("MenuTarget",Mie,t),r=Su(e);if(!r)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=To(),a=r.props,l=pi(a.onClick,()=>{s.trigger==="click"?s.toggleDropdown():s.trigger==="click-hover"&&(s.setOpenedViaClick(!0),s.opened||s.openDropdown())}),u=pi(a.onMouseEnter,()=>(s.trigger==="hover"||s.trigger==="click-hover")&&s.openDropdown()),d=pi(a.onMouseLeave,()=>{(s.trigger==="hover"||s.trigger==="click-hover"&&!s.openedViaClick)&&s.closeDropdown()});return o.jsx(En.Target,{refProp:n,popupType:"menu",...i,children:T.cloneElement(r,{onClick:l,onMouseEnter:u,onMouseLeave:d,"data-expanded":s.opened?!0:void 0})})}TH.displayName="@mantine/core/MenuTarget";const Rie={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:["mousedown","touchstart","keydown"],loop:!0,trigger:"click",openDelay:0,closeDelay:100,menuItemTabIndex:-1,alignItemsLabels:"with-indicators"},Fn=Pe(t=>{const e=we("Menu",Rie,t),{children:n,onOpen:i,onClose:r,opened:s,defaultOpened:a,trapFocus:l,onChange:u,closeOnItemClick:d,loop:f,closeOnEscape:p,trigger:m,openDelay:v,closeDelay:y,classNames:b,styles:A,unstyled:w,variant:S,vars:j,menuItemTabIndex:C,keepMounted:k,withInitialFocusPlaceholder:E,attributes:M,onExitTransitionEnd:R,alignItemsLabels:D,checkIcon:F,...I}=e,Q=gt({name:"Menu",classes:jl,props:e,classNames:b,styles:A,unstyled:w,attributes:M}),[G,L]=hr({value:s,defaultValue:a,finalValue:!1,onChange:u}),[q,N]=T.useState(!1),P=()=>{L(!1),N(!1),G&&(r==null||r())},Y=()=>{L(!0),!G&&(i==null||i())},K=()=>{G?P():Y()},{openDropdown:W,closeDropdown:z}=hte({open:Y,close:P,closeDelay:y,openDelay:v}),U=T.useRef(null),V=T.useCallback(je=>{const se=U.current;return se&&se!==je&&se(),U.current=je,()=>{U.current===je&&(U.current=null)}},[]),J=T.useRef(0),[ee,ce]=T.useState(!1),he=T.useCallback(()=>(J.current+=1,J.current===1&&ce(!0),()=>{J.current-=1,J.current===0&&ce(!1)}),[]),Oe=T.useRef(null),Te=()=>{var je;(je=Oe.current)==null||je.call(Oe),R==null||R()},Re=je=>xK("[data-menu-item]","[data-menu-dropdown]",je),{resolvedClassNames:qe,resolvedStyles:ie}=na({classNames:b,styles:A,props:e});return o.jsx(wie,{value:{getStyles:Q,opened:G,toggleDropdown:K,getItemIndex:Re,openedViaClick:q,setOpenedViaClick:N,closeOnItemClick:d,closeDropdown:m==="click"?P:z,openDropdown:m==="click"?Y:W,closeDropdownImmediately:P,loop:f,trigger:m,unstyled:w,menuItemTabIndex:C,withInitialFocusPlaceholder:E,registerOpenSub:V,hasSearch:ee,registerSearch:he,searchExitClearRef:Oe,alignItemsLabels:D,checkIcon:F},children:o.jsx(En,{returnFocus:!0,...I,opened:G,onChange:K,defaultOpened:a,trapFocus:k?!1:l,closeOnEscape:p,__staticSelector:"Menu",classNames:qe,styles:ie,unstyled:w,variant:S,keepMounted:k,onExitTransitionEnd:Te,children:n})})});Fn.displayName="@mantine/core/Menu";Fn.classes=jl;Fn.Item=VM;Fn.Label=GM;Fn.Dropdown=UM;Fn.Target=TH;Fn.Divider=WM;Fn.Search=KM;Fn.Sub=yg;Fn.CheckboxItem=YM;Fn.CheckboxGroup=AH;Fn.RadioItem=XM;Fn.RadioGroup=_H;Fn.ContextMenu=SH;const[Die,xg]=rs("Modal component was not found in tree");var ku={root:"m_9df02822",content:"m_54c44539",inner:"m_1f958f16",header:"m_d0e2b9cd"};const dS=Pe(t=>{const{classNames:e,className:n,style:i,styles:r,vars:s,...a}=we("ModalBody",null,t);return o.jsx(oz,{...xg().getStyles("body",{classNames:e,style:i,styles:r,className:n}),...a})});dS.classes=ku;dS.displayName="@mantine/core/ModalBody";const fS=Pe(t=>{const{classNames:e,className:n,style:i,styles:r,vars:s,...a}=we("ModalCloseButton",null,t);return o.jsx(az,{...xg().getStyles("close",{classNames:e,style:i,styles:r,className:n}),...a})});fS.classes=ku;fS.displayName="@mantine/core/ModalCloseButton";const pS=Pe(t=>{const{classNames:e,className:n,style:i,styles:r,vars:s,children:a,__hidden:l,...u}=we("ModalContent",null,t),d=xg(),f=d.scrollAreaComponent||vne;return o.jsx(lz,{...d.getStyles("content",{className:n,style:i,styles:r,classNames:e}),innerProps:d.getStyles("inner",{className:n,style:i,styles:r,classNames:e}),"data-full-screen":d.fullScreen||void 0,"data-modal-content":!0,"data-hidden":l||void 0,...u,children:o.jsx(f,{style:{maxHeight:d.fullScreen?"100dvh":`calc(100dvh - (${ge(d.yOffset)} * 2))`},children:a})})});pS.classes=ku;pS.displayName="@mantine/core/ModalContent";const mS=Pe(t=>{const{classNames:e,className:n,style:i,styles:r,vars:s,...a}=we("ModalHeader",null,t);return o.jsx(cz,{...xg().getStyles("header",{classNames:e,style:i,styles:r,className:n}),...a})});mS.classes=ku;mS.displayName="@mantine/core/ModalHeader";const gS=Pe(t=>{const{classNames:e,className:n,style:i,styles:r,vars:s,...a}=we("ModalOverlay",null,t);return o.jsx(uz,{...xg().getStyles("overlay",{classNames:e,style:i,styles:r,className:n}),...a})});gS.classes=ku;gS.displayName="@mantine/core/ModalOverlay";const Nie={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Da("modal"),transitionProps:{duration:200,transition:"fade-down"},yOffset:"5dvh"},OH=(t,{radius:e,size:n,yOffset:i,xOffset:r})=>({root:{"--modal-radius":e===void 0?void 0:ai(e),"--modal-size":Zt(n,"modal-size"),"--modal-y-offset":ge(i),"--modal-x-offset":ge(r)}}),Iy=Pe(t=>{const e=we("ModalRoot",Nie,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,yOffset:u,scrollAreaComponent:d,radius:f,fullScreen:p,centered:m,xOffset:v,__staticSelector:y,attributes:b,...A}=e,w=gt({name:y,classes:ku,props:e,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:b,vars:l,varsResolver:OH});return o.jsx(Die,{value:{yOffset:u,scrollAreaComponent:d,getStyles:w,fullScreen:p},children:o.jsx(sz,{...w("root"),"data-full-screen":p||void 0,"data-centered":m||void 0,"data-offset-scrollbars":d===Co.Autosize||void 0,unstyled:a,...A})})});Iy.classes=ku;Iy.varsResolver=OH;Iy.displayName="@mantine/core/ModalRoot";const EH=T.createContext(null);function MH({children:t}){const[e,n]=T.useState([]),[i,r]=T.useState(Da("modal"));return o.jsx(EH,{value:{stack:e,addModal:(s,a)=>{n(l=>[...new Set([...l,s])]),r(l=>typeof a=="number"&&typeof l=="number"?Math.max(l,a):l)},removeModal:s=>n(a=>a.filter(l=>l!==s)),getZIndex:s=>`calc(${i} + ${e.indexOf(s)} + 1)`,currentId:e[e.length-1],maxZIndex:i},children:t})}MH.displayName="@mantine/core/ModalStack";const vS=Pe(t=>{const{classNames:e,className:n,style:i,styles:r,vars:s,...a}=we("ModalTitle",null,t);return o.jsx(hz,{...xg().getStyles("title",{classNames:e,style:i,styles:r,className:n}),...a})});vS.classes=ku;vS.displayName="@mantine/core/ModalTitle";const Iie={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Da("modal"),transitionProps:{duration:200,transition:"fade-down"},withOverlay:!0,withCloseButton:!0},ra=Pe(t=>{const{title:e,withOverlay:n,overlayProps:i,withCloseButton:r,closeButtonProps:s,children:a,radius:l,opened:u,stackId:d,zIndex:f,...p}=we("Modal",Iie,t),m=T.use(EH),v=!!e||r,y=m&&d?{closeOnEscape:m.currentId===d,trapFocus:m.currentId===d,zIndex:m.getZIndex(d)}:{},b=n===!1?!1:d&&m?m.currentId===d:u;return T.useEffect(()=>{m&&d&&(u?m.addModal(d,f||Da("modal")):m.removeModal(d))},[u,d,f]),o.jsxs(Iy,{radius:l,opened:u,zIndex:m&&d?m.getZIndex(d):f,...p,...y,children:[n&&o.jsx(gS,{visible:b,transitionProps:m&&d?{duration:0}:void 0,...i}),o.jsxs(pS,{radius:l,__hidden:m&&d&&u?d!==m.currentId:!1,children:[v&&o.jsxs(mS,{children:[e&&o.jsx(vS,{children:e}),r&&o.jsx(fS,{...s})]}),o.jsx(dS,{children:a})]})]})});ra.classes=ku;ra.displayName="@mantine/core/Modal";ra.Root=Iy;ra.Overlay=gS;ra.Content=pS;ra.Body=dS;ra.Header=mS;ra.Title=vS;ra.CloseButton=fS;ra.Stack=MH;const yS=T.createContext(null);var xS={root:"m_7cda1cd6","root--default":"m_44da308b","root--contrast":"m_e3a01f8",label:"m_1e0e6180",remove:"m_ae386778",group:"m_1dcfd90b"};const RH=T.createContext(null),DH=(t,{gap:e},{size:n})=>({group:{"--pg-gap":e!==void 0?Zt(e):Zt(n,"pg-gap")}}),bS=Pe(t=>{var y;const e=we("PillGroup",null,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,size:u,disabled:d,attributes:f,...p}=e,m=((y=T.use(yS))==null?void 0:y.size)||u||void 0,v=gt({name:"PillGroup",classes:xS,props:e,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:f,vars:l,varsResolver:DH,stylesCtx:{size:m},rootSelector:"group"});return o.jsx(RH,{value:{size:m,disabled:d},children:o.jsx(xe,{size:m,...v("group"),...p})})});bS.classes=xS;bS.varsResolver=DH;bS.displayName="@mantine/core/PillGroup";const Bie={variant:"default"},NH=(t,{radius:e},{size:n})=>({root:{"--pill-fz":Zt(n,"pill-fz"),"--pill-height":Zt(n,"pill-height"),"--pill-radius":e===void 0?void 0:ai(e)}}),tc=Pe(t=>{const e=we("Pill",Bie,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,variant:u,children:d,withRemoveButton:f,onRemove:p,removeButtonProps:m,radius:v,size:y,disabled:b,mod:A,attributes:w,...S}=e,j=T.use(RH),C=T.use(yS),k=y||(j==null?void 0:j.size)||void 0,E=(C==null?void 0:C.variant)==="filled"?"contrast":u||"default",M=gt({name:"Pill",classes:xS,props:e,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:w,vars:l,varsResolver:NH,stylesCtx:{size:k}});return o.jsxs(xe,{component:"span",variant:E,size:k,...M("root",{variant:E}),mod:[{"with-remove":f&&!b,disabled:b||(j==null?void 0:j.disabled)},A],...S,children:[o.jsx("span",{...M("label"),children:d}),f&&o.jsx(Sl,{variant:"transparent",radius:v,tabIndex:-1,"aria-hidden":!0,unstyled:a,...m,...M("remove",{className:m==null?void 0:m.className,style:m==null?void 0:m.style}),onMouseDown:R=>{var D;R.preventDefault(),R.stopPropagation(),(D=m==null?void 0:m.onMouseDown)==null||D.call(m,R)},onClick:R=>{var D;R.stopPropagation(),p==null||p(),(D=m==null?void 0:m.onClick)==null||D.call(m,R)}})]})});tc.classes=xS;tc.varsResolver=NH;tc.displayName="@mantine/core/Pill";tc.Group=bS;var IH={field:"m_45c4369d"};const Lie={type:"visible"},eR=Pe(t=>{const e=we("PillsInputField",Lie,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,type:u,disabled:d,id:f,pointer:p,mod:m,attributes:v,ref:y,...b}=e,A=T.use(yS),w=T.use(gd),S=gt({name:"PillsInputField",classes:IH,props:e,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:v,rootSelector:"field"}),j=d||(A==null?void 0:A.disabled);return o.jsx(xe,{component:"input",ref:Dn(y,A==null?void 0:A.fieldRef),"data-type":u,disabled:j,mod:[{disabled:j,pointer:p},m],...S("field"),...b,id:(w==null?void 0:w.inputId)||f,"aria-invalid":A==null?void 0:A.hasError,"aria-describedby":w==null?void 0:w.describedBy,type:"text",onMouseDown:C=>!p&&C.stopPropagation()})});eR.classes=IH;eR.displayName="@mantine/core/PillsInputField";const Pie={size:"sm"},tm=Pe(t=>{const{children:e,onMouseDown:n,onClick:i,size:r,disabled:s,__staticSelector:a,error:l,variant:u,...d}=we(["Input","InputWrapper","PillsInput"],Pie,t),f=T.useRef(null);return o.jsx(yS,{value:{fieldRef:f,size:r,disabled:s,hasError:!!l,variant:u},children:o.jsx(Fs,{size:r,error:l,variant:u,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(),i==null||i(p))},...d,multiline:!0,disabled:s,__staticSelector:a||"PillsInput",withAria:!1,children:e})})});tm.displayName="@mantine/core/PillsInput";tm.classes=Fs.classes;tm.Field=eR;var BH={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};const Fie={withCloseButton:!0},LH=(t,{radius:e,color:n})=>({root:{"--notification-radius":e===void 0?void 0:ai(e),"--notification-color":n?Oi(n,t):void 0}}),AS=Pe(t=>{const e=we("Notification",Fie,t),{className:n,color:i,radius:r,loading:s,withCloseButton:a,withBorder:l,title:u,icon:d,children:f,onClose:p,closeButtonProps:m,classNames:v,style:y,styles:b,unstyled:A,vars:w,mod:S,loaderProps:j,role:C,attributes:k,...E}=e,M=gt({name:"Notification",classes:BH,props:e,className:n,style:y,classNames:v,styles:b,unstyled:A,attributes:k,vars:w,varsResolver:LH});return o.jsxs(xe,{...M("root"),mod:[{"data-with-icon":!!d||s,"data-with-border":l},S],role:C||"alert",...E,children:[d&&!s&&o.jsx("div",{...M("icon"),children:d}),s&&o.jsx(Ra,{size:28,color:i,...M("loader"),...j}),o.jsxs("div",{...M("body"),children:[u&&o.jsx("div",{...M("title"),children:u}),o.jsx(xe,{...M("description"),mod:{"data-with-title":!!u},children:f})]}),a&&o.jsx(Sl,{iconSize:16,color:"gray",...m,unstyled:A,onClick:R=>{var D;(D=m==null?void 0:m.onClick)==null||D.call(m,R),p==null||p()},...M("closeButton")})]})});AS.classes=BH;AS.varsResolver=LH;AS.displayName="@mantine/core/Notification";function PH(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]]);return n}var Qm;(function(t){t.event="event",t.props="prop"})(Qm||(Qm={}));function kh(){}function $ie(t){var e,n=void 0;return function(){for(var i=[],r=arguments.length;r--;)i[r]=arguments[r];return e&&i.length===e.length&&i.every(function(s,a){return s===e[a]})||(e=i,n=t.apply(void 0,i)),n}}function Ev(t){return!!(t||"").match(/\d/)}function Fh(t){return t==null}function zie(t){return typeof t=="number"&&isNaN(t)}function FH(t){return Fh(t)||zie(t)||typeof t=="number"&&!isFinite(t)}function $H(t){return t.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function Hie(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 qie(t,e,n){var i=Hie(n),r=t.search(/[1-9]/);return r=r===-1?t.length:r,t.substring(0,r)+t.substring(r,t.length).replace(i,"$1"+e)}function C4(t){var e=T.useRef(t);e.current=t;var n=T.useRef(function(){for(var i=[],r=arguments.length;r--;)i[r]=arguments[r];return e.current.apply(e,i)});return n.current}function tR(t,e){e===void 0&&(e=!0);var n=t[0]==="-",i=n&&e;t=t.replace("-","");var r=t.split("."),s=r[0],a=r[1]||"";return{beforeDecimal:s,afterDecimal:a,hasNegation:n,addNegation:i}}function Qie(t){if(!t)return t;var e=t[0]==="-";e&&(t=t.substring(1,t.length));var n=t.split("."),i=n[0].replace(/^0+/,"")||"0",r=n[1]||"";return(e?"-":"")+i+(r?"."+r:"")}function zH(t,e,n){for(var i="",r=n?"0":"",s=0;s<=e-1;s++)i+=t[s]||r;return i}function _4(t,e){return Array(e+1).join(t)}function HH(t){var e=t+"",n=e[0]==="-"?"-":"";n&&(e=e.substring(1));var i=e.split(/[eE]/g),r=i[0],s=i[1];if(s=Number(s),!s)return n+r;r=r.replace(".","");var a=1+s,l=r.length;return a<0?r="0."+_4("0",Math.abs(a))+r:a>=l?r=r+_4("0",a-l):r=(r.substring(0,a)||"0")+"."+r.substring(a),n+r}function k4(t,e,n){if(["","-"].indexOf(t)!==-1)return t;var i=(t.indexOf(".")!==-1||n)&&e,r=tR(t),s=r.beforeDecimal,a=r.afterDecimal,l=r.hasNegation,u=parseFloat("0."+(a||"0")),d=a.length<=e?"0."+a:u.toFixed(e),f=d.split("."),p=s;s&&Number(f[0])&&(p=s.split("").reverse().reduce(function(b,A,w){return b.length>w?(Number(b[0])+Number(A)).toString()+b.substring(1,b.length):A+b},f[0]));var m=zH(f[1]||"",e,n),v=l?"-":"",y=i?".":"";return""+v+p+y+m}function ef(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 qH=$ie(function(t,e){for(var n=0,i=0,r=t.length,s=e.length;t[n]===e[n]&&n<r;)n++;for(;t[r-1-i]===e[s-1-i]&&s-i>n&&r-i>n;)i++;return{from:{start:n,end:r-i},to:{start:n,end:s-i}}}),Yie=function(t,e){var n=Math.min(t.selectionStart,e);return{from:{start:n,end:t.selectionEnd},to:{start:n,end:e}}};function Wie(t,e,n){return Math.min(Math.max(t,e),n)}function hk(t){return Math.max(t.selectionStart,t.selectionEnd)}function Uie(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function Vie(t){return{from:{start:0,end:0},to:{start:0,end:t.length},lastValue:""}}function Gie(t){var e=t.currentValue,n=t.formattedValue,i=t.currentValueIndex,r=t.formattedValueIndex;return e[i]===n[r]}function Xie(t,e,n,i,r,s,a){a===void 0&&(a=Gie);var l=r.findIndex(function(C){return C}),u=t.slice(0,l);!e&&!n.startsWith(u)&&(e=u,n=u+n,i=i+u.length);for(var d=n.length,f=t.length,p={},m=new Array(d),v=0;v<d;v++){m[v]=-1;for(var y=0,b=f;y<b;y++){var A=a({currentValue:n,lastValue:e,formattedValue:t,currentValueIndex:v,formattedValueIndex:y});if(A&&p[y]!==!0){m[v]=y,p[y]=!0;break}}}for(var w=i;w<d&&(m[w]===-1||!s(n[w]));)w++;var S=w===d||m[w]===-1?f:m[w];for(w=i-1;w>0&&m[w]===-1;)w--;var j=w===-1||m[w]===-1?0:m[w]+1;return j>S?S:i-j<S-i?j:S}function T4(t,e,n,i){var r=t.length;if(e=Wie(e,0,r),i==="left"){for(;e>=0&&!n[e];)e--;e===-1&&(e=n.indexOf(!0))}else{for(;e<=r&&!n[e];)e++;e>r&&(e=n.lastIndexOf(!0))}return e===-1&&(e=r),e}function Kie(t){for(var e=Array.from({length:t.length+1}).map(function(){return!0}),n=0,i=e.length;n<i;n++)e[n]=!!(Ev(t[n])||Ev(t[n-1]));return e}function QH(t,e,n,i,r,s){s===void 0&&(s=kh);var a=C4(function(y,b){var A,w;return FH(y)?(w="",A=""):typeof y=="number"||b?(w=typeof y=="number"?HH(y):y,A=i(w)):(w=r(y,void 0),A=i(w)),{formattedValue:A,numAsString:w}}),l=T.useState(function(){return a(Fh(t)?e:t,n)}),u=l[0],d=l[1],f=C4(function(y,b){y.formattedValue!==u.formattedValue&&d({formattedValue:y.formattedValue,numAsString:y.value}),s(y,b)}),p=t,m=n;Fh(t)&&(p=u.numAsString,m=!0);var v=a(p,m);return T.useMemo(function(){d(v)},[v.formattedValue]),T.useEffect(function(){if(!Fh(e)&&Fh(t)&&u.formattedValue!==""){var y=parseFloat(u.numAsString);f({formattedValue:u.formattedValue,value:u.numAsString,floatValue:isNaN(y)?void 0:y},{event:void 0,source:Qm.props})}},[]),[u,f]}function Zie(t){return t.replace(/[^0-9]/g,"")}function Jie(t){return t}function ere(t){var e=t.type;e===void 0&&(e="text");var n=t.displayType;n===void 0&&(n="input");var i=t.customInput,r=t.renderText,s=t.getInputRef,a=t.format;a===void 0&&(a=Jie);var l=t.removeFormatting;l===void 0&&(l=Zie);var u=t.defaultValue,d=t.valueIsNumericString,f=t.onValueChange,p=t.isAllowed,m=t.onChange;m===void 0&&(m=kh);var v=t.onKeyDown;v===void 0&&(v=kh);var y=t.onMouseUp;y===void 0&&(y=kh);var b=t.onFocus;b===void 0&&(b=kh);var A=t.onBlur;A===void 0&&(A=kh);var w=t.value,S=t.getCaretBoundary;S===void 0&&(S=Kie);var j=t.isValidInputCharacter;j===void 0&&(j=Ev);var C=t.isCharacterSame,k=PH(t,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),E=QH(w,u,!!d,a,l,f),M=E[0],R=M.formattedValue,D=M.numAsString,F=E[1],I=T.useRef(),Q=T.useRef({formattedValue:R,numAsString:D}),G=function(Ce,Ve){Q.current={formattedValue:Ce.formattedValue,numAsString:Ce.value},F(Ce,Ve)},L=T.useState(!1),q=L[0],N=L[1],P=T.useRef(null),Y=T.useRef({setCaretTimeout:null,focusTimeout:null});T.useEffect(function(){return N(!0),function(){clearTimeout(Y.current.setCaretTimeout),clearTimeout(Y.current.focusTimeout)}},[]);var K=a,W=function(Ce,Ve){var st=parseFloat(Ve);return{formattedValue:Ce,value:Ve,floatValue:isNaN(st)?void 0:st}},z=function(Ce,Ve,st){Ce.selectionStart===0&&Ce.selectionEnd===Ce.value.length||(ef(Ce,Ve),Y.current.setCaretTimeout=setTimeout(function(){Ce.value===st&&Ce.selectionStart!==Ve&&ef(Ce,Ve)},0))},U=function(Ce,Ve,st){return T4(Ce,Ve,S(Ce),st)},V=function(Ce,Ve,st){var Ye=S(Ve),Ge=Xie(Ve,R,Ce,st,Ye,j,C);return Ge=T4(Ve,Ge,Ye),Ge},J=function(Ce){var Ve=Ce.formattedValue;Ve===void 0&&(Ve="");var st=Ce.input,Ye=Ce.source,Ge=Ce.event,dt=Ce.numAsString,nt;if(st){var Ee=Ce.inputValue||st.value,Qe=hk(st);st.value=Ve,nt=V(Ee,Ve,Qe),nt!==void 0&&z(st,nt,Ve)}Ve!==R&&G(W(Ve,dt),{event:Ge,source:Ye})};T.useEffect(function(){var Ce=Q.current,Ve=Ce.formattedValue,st=Ce.numAsString;(R!==Ve||D!==st)&&G(W(R,D),{event:void 0,source:Qm.props})},[R,D]);var ee=P.current?hk(P.current):void 0,ce=typeof window<"u"?T.useLayoutEffect:T.useEffect;ce(function(){var Ce=P.current;if(R!==Q.current.formattedValue&&Ce){var Ve=V(Q.current.formattedValue,R,ee);Ce.value=R,z(Ce,Ve,R)}},[R]);var he=function(Ce,Ve,st){var Ye=Ve.target,Ge=I.current?Yie(I.current,Ye.selectionEnd):qH(R,Ce),dt=Object.assign(Object.assign({},Ge),{lastValue:R}),nt=l(Ce,dt),Ee=K(nt);if(nt=l(Ee,void 0),p&&!p(W(Ee,nt))){var Qe=Ve.target,Xe=hk(Qe),Ze=V(Ce,R,Xe);return Qe.value=R,z(Qe,Ze,R),!1}return J({formattedValue:Ee,numAsString:nt,inputValue:Ce,event:Ve,source:st,input:Ve.target}),!0},Oe=function(Ce,Ve){Ve===void 0&&(Ve=0);var st=Ce.selectionStart,Ye=Ce.selectionEnd;I.current={selectionStart:st,selectionEnd:Ye+Ve}},Te=function(Ce){var Ve=Ce.target,st=Ve.value,Ye=he(st,Ce,Qm.event);Ye&&m(Ce),I.current=void 0},Re=function(Ce){var Ve=Ce.target,st=Ce.key,Ye=Ve.selectionStart,Ge=Ve.selectionEnd,dt=Ve.value;dt===void 0&&(dt="");var nt;st==="ArrowLeft"||st==="Backspace"?nt=Math.max(Ye-1,0):st==="ArrowRight"?nt=Math.min(Ye+1,dt.length):st==="Delete"&&(nt=Ye);var Ee=0;st==="Delete"&&Ye===Ge&&(Ee=1);var Qe=st==="ArrowLeft"||st==="ArrowRight";if(nt===void 0||Ye!==Ge&&!Qe){v(Ce),Oe(Ve,Ee);return}var Xe=nt;if(Qe){var Ze=st==="ArrowLeft"?"left":"right";Xe=U(dt,nt,Ze),Xe!==nt&&Ce.preventDefault()}else st==="Delete"&&!j(dt[nt])?Xe=U(dt,nt,"right"):st==="Backspace"&&!j(dt[nt])&&(Xe=U(dt,nt,"left"));Xe!==nt&&z(Ve,Xe,dt),v(Ce),Oe(Ve,Ee)},qe=function(Ce){var Ve=Ce.target,st=function(){var Ye=Ve.selectionStart,Ge=Ve.selectionEnd,dt=Ve.value;if(dt===void 0&&(dt=""),Ye===Ge){var nt=U(dt,Ye);nt!==Ye&&z(Ve,nt,dt)}};st(),requestAnimationFrame(function(){st()}),y(Ce),Oe(Ve)},ie=function(Ce){Ce.persist&&Ce.persist();var Ve=Ce.target,st=Ce.currentTarget;P.current=Ve,Y.current.focusTimeout=setTimeout(function(){var Ye=Ve.selectionStart,Ge=Ve.selectionEnd,dt=Ve.value;dt===void 0&&(dt="");var nt=U(dt,Ye);nt!==Ye&&!(Ye===0&&Ge===dt.length)&&z(Ve,nt,dt),b(Object.assign(Object.assign({},Ce),{currentTarget:st}))},0)},je=function(Ce){P.current=null,clearTimeout(Y.current.focusTimeout),clearTimeout(Y.current.setCaretTimeout),A(Ce)},se=q&&Uie()?"numeric":void 0,be=Object.assign({inputMode:se},k,{type:e,value:R,onChange:Te,onKeyDown:Re,onMouseUp:qe,onFocus:ie,onBlur:je});if(n==="text")return r?Vn.createElement(Vn.Fragment,null,r(R,k)||null):Vn.createElement("span",Object.assign({},k,{ref:s}),R);if(i){var Be=i;return Vn.createElement(Be,Object.assign({},be,{ref:s}))}return Vn.createElement("input",Object.assign({},be,{ref:s}))}function O4(t,e){var n=e.decimalScale,i=e.fixedDecimalScale,r=e.prefix;r===void 0&&(r="");var s=e.suffix;s===void 0&&(s="");var a=e.allowNegative,l=e.thousandsGroupStyle;if(l===void 0&&(l="thousand"),t===""||t==="-")return t;var u=wS(e),d=u.thousandSeparator,f=u.decimalSeparator,p=n!==0&&t.indexOf(".")!==-1||n&&i,m=tR(t,a),v=m.beforeDecimal,y=m.afterDecimal,b=m.addNegation;return n!==void 0&&(y=zH(y,n,!!i)),d&&(v=qie(v,d,l)),r&&(v=r+v),s&&(y=y+s),b&&(v="-"+v),t=v+(p&&f||"")+y,t}function wS(t){var e=t.decimalSeparator;e===void 0&&(e=".");var n=t.thousandSeparator,i=t.allowedDecimalSeparators;return n===!0&&(n=","),i||(i=[e,"."]),{decimalSeparator:e,thousandSeparator:n,allowedDecimalSeparators:i}}function tre(t,e){t===void 0&&(t="");var n=new RegExp("(-)"),i=new RegExp("(-)(.)*(-)"),r=n.test(t),s=i.test(t);return t=t.replace(/-/g,""),r&&!s&&e&&(t="-"+t),t}function nre(t,e){return new RegExp("(^-)|[0-9]|"+$H(t),"g")}function ire(t,e,n){return t===""?!0:!(e!=null&&e.match(/\d/))&&!(n!=null&&n.match(/\d/))&&typeof t=="string"&&!isNaN(Number(t))}function rre(t,e,n){var i;e===void 0&&(e=Vie(t));var r=n.allowNegative,s=n.prefix;s===void 0&&(s="");var a=n.suffix;a===void 0&&(a="");var l=n.decimalScale,u=e.from,d=e.to,f=d.start,p=d.end,m=wS(n),v=m.allowedDecimalSeparators,y=m.decimalSeparator,b=t[p]===y;if(Ev(t)&&(t===s||t===a)&&e.lastValue==="")return t;if(p-f===1&&v.indexOf(t[f])!==-1){var A=l===0?"":y;t=t.substring(0,f)+A+t.substring(f+1,t.length)}var w=function(P,Y,K){var W=!1,z=!1;s.startsWith("-")?W=!1:P.startsWith("--")?(W=!1,z=!0):a.startsWith("-")&&P.length===a.length?W=!1:P[0]==="-"&&(W=!0);var U=W?1:0;return z&&(U=2),U&&(P=P.substring(U),Y-=U,K-=U),{value:P,start:Y,end:K,hasNegation:W}},S=w(t,f,p),j=S.hasNegation;i=S,t=i.value,f=i.start,p=i.end;var C=w(e.lastValue,u.start,u.end),k=C.start,E=C.end,M=C.value,R=t.substring(f,p);t.length&&M.length&&(k>M.length-a.length||E<s.length)&&!(R&&a.startsWith(R))&&(t=M);var D=0;t.startsWith(s)?D+=s.length:f<s.length&&(D=f),t=t.substring(D),p-=D;var F=t.length,I=t.length-a.length;t.endsWith(a)?F=I:(p>I||p>t.length-a.length)&&(F=p),t=t.substring(0,F),t=tre(j?"-"+t:t,r),t=(t.match(nre(y))||[]).join("");var Q=t.indexOf(y);t=t.replace(new RegExp($H(y),"g"),function(P,Y){return Y===Q?".":""});var G=tR(t,r),L=G.beforeDecimal,q=G.afterDecimal,N=G.addNegation;return d.end-d.start<u.end-u.start&&L===""&&b&&!parseFloat(q)&&(t=N?"-":""),t}function sre(t,e){var n=e.prefix;n===void 0&&(n="");var i=e.suffix;i===void 0&&(i="");var r=Array.from({length:t.length+1}).map(function(){return!0}),s=t[0]==="-";r.fill(!1,0,Math.min(n.length+(s?1:0),t.length));var a=t.length;return r.fill(!1,a-i.length+1,a+1),r}function ore(t){var e=wS(t),n=e.thousandSeparator,i=e.decimalSeparator,r=t.prefix;r===void 0&&(r="");var s=t.allowNegative;if(s===void 0&&(s=!0),n===i)throw new Error(`
        Decimal separator can't be same as thousand separator.
        thousandSeparator: `+n+` (thousandSeparator = {true} is same as thousandSeparator = ",")
        decimalSeparator: `+i+` (default value for decimalSeparator is .)
     `);return r.startsWith("-")&&s&&(console.error(`
      Prefix can't start with '-' when allowNegative is true.
      prefix: `+r+`
      allowNegative: `+s+`
    `),s=!1),Object.assign(Object.assign({},t),{allowNegative:s})}function are(t){t=ore(t),t.decimalSeparator,t.allowedDecimalSeparators,t.thousandsGroupStyle;var e=t.suffix,n=t.allowNegative,i=t.allowLeadingZeros,r=t.onKeyDown;r===void 0&&(r=kh);var s=t.onBlur;s===void 0&&(s=kh);var a=t.thousandSeparator,l=t.decimalScale,u=t.fixedDecimalScale,d=t.prefix;d===void 0&&(d="");var f=t.defaultValue,p=t.value,m=t.valueIsNumericString,v=t.onValueChange,y=PH(t,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),b=wS(t),A=b.decimalSeparator,w=b.allowedDecimalSeparators,S=function(N){return O4(N,t)},j=function(N,P){return rre(N,P,t)},C=Fh(p)?f:p,k=m??ire(C,d,e);Fh(p)?Fh(f)||(k=k||typeof f=="number"):k=k||typeof p=="number";var E=function(N){return FH(N)?N:(typeof N=="number"&&(N=HH(N)),k&&typeof l=="number"?k4(N,l,!!u):N)},M=QH(E(p),E(f),!!k,S,j,v),R=M[0],D=R.numAsString,F=R.formattedValue,I=M[1],Q=function(N){var P=N.target,Y=N.key,K=P.selectionStart,W=P.selectionEnd,z=P.value;if(z===void 0&&(z=""),(Y==="Backspace"||Y==="Delete")&&W<d.length&&z!=="-"){N.preventDefault();return}if(K!==W){r(N);return}Y==="Backspace"&&z[0]==="-"&&K===d.length+1&&n&&ef(P,1),l&&u&&(Y==="Backspace"&&z[K-1]===A?(ef(P,K-1),N.preventDefault()):Y==="Delete"&&z[K]===A&&N.preventDefault()),w!=null&&w.includes(Y)&&z[K]===A&&ef(P,K+1);var U=a===!0?",":a;Y==="Backspace"&&z[K-1]===U&&ef(P,K-1),Y==="Delete"&&z[K]===U&&ef(P,K+1),r(N)},G=function(N){var P=D;if(P.match(/\d/g)||(P=""),i||(P=Qie(P)),u&&l&&(P=k4(P,l,u)),P!==D){var Y=O4(P,t);I({formattedValue:Y,value:P,floatValue:parseFloat(P)},{event:N,source:Qm.event})}s(N)},L=function(N){return N===A?!0:Ev(N)},q=function(N){var P=N.currentValue,Y=N.lastValue,K=N.formattedValue,W=N.currentValueIndex,z=N.formattedValueIndex,U=P[W],V=K[z],J=qH(Y,P),ee=J.to,ce=function(he){return j(he).indexOf(".")+d.length};return p===0&&u&&l&&P[ee.start]===A&&ce(P)<W&&ce(K)>z?!1:W>=ee.start&&W<ee.end&&w&&w.includes(U)&&V===A?!0:U===V};return Object.assign(Object.assign({},y),{value:F,valueIsNumericString:!1,isValidInputCharacter:L,isCharacterSame:q,onValueChange:I,format:S,removeFormatting:j,getCaretBoundary:function(N){return sre(N,t)},onKeyDown:Q,onBlur:G})}function lre(t){var e=are(t);return Vn.createElement(ere,Object.assign({},e))}function E4({direction:t,style:e,...n}){return o.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:o.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 CO={root:"m_e2f5cd4e",controls:"m_95e17d22",control:"m_80b4b171"};const cre=/^(0\.0*|-0(\.0*)?)$/,M4=/^-?0\d+(\.\d+)?\.?$/,ure=/\.\d*0$/,YH=/^-?\d+\.$/;function _O(t){return typeof t=="string"&&t!==""&&!Number.isNaN(Number(t))}function dk(t){return typeof t=="bigint"}function fk(t){return typeof t=="number"?t<Number.MAX_SAFE_INTEGER:t===""||_O(t)&&Number(t)<Number.MAX_SAFE_INTEGER}function WH(t,e){return t===""||t==="-"||!e&&t.startsWith("-")?!1:/^-?\d+$/.test(t)}function pk(t,e){return typeof t=="bigint"?!0:t===""||WH(t,e)}function Y0(t){if(!/^-?\d+$/.test(t))return null;try{return BigInt(t)}catch{return null}}function Pb(t){if(typeof t=="bigint")return t;if(typeof t=="number"&&Number.isFinite(t)&&Number.isInteger(t))return BigInt(t)}function DA(t,e,n){return e!==void 0&&t<e?e:n!==void 0&&t>n?n:t}function hre(t){return t.toString().replace(".","").length}function dre(t,e){return(typeof t=="number"?t<Number.MAX_SAFE_INTEGER:!Number.isNaN(Number(t)))&&!Number.isNaN(t)&&hre(e)<14&&e!==""}function fre(t,e,n){return t===void 0?!0:(e===void 0||t>=e)&&(n===void 0||t<=n)}const mk={size:"sm",step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,allowLeadingZeros:!0,trimLeadingZeroesOnBlur:!0,startValue:0,allowedDecimalSeparators:[".",","]},UH=(t,{size:e})=>({controls:{"--ni-chevron-size":Zt(e,"ni-chevron-size")}});function pre(t,e,n){const i=t.toString(),r=YH.test(i),s=i.replace(/^0+(?=\d)/,""),a=parseFloat(s);if(Number.isNaN(a))return s;if(a>Number.MAX_SAFE_INTEGER)return e!==void 0?e:s;const l=Yh(a,n,e);return r?`${l.toString().replace(/^0+(?=\d)/,"")}.`:l}function mre(t,e){if(t===""||t==="-")return t;const n=Y0(t);return n===null?t:e.clampBehavior==="blur"?DA(n,e.min,e.max):n}const Mv=md(t=>{const e=we(["Input","InputWrapper","NumberInput"],mk,t),{className:n,classNames:i,styles:r,unstyled:s,vars:a,onChange:l,onValueChange:u,value:d,defaultValue:f,max:p,min:m,step:v,hideControls:y,rightSection:b,isAllowed:A,clampBehavior:w,onBlur:S,allowDecimal:j,decimalScale:C,onKeyDown:k,onKeyDownCapture:E,handlersRef:M,startValue:R,disabled:D,rightSectionPointerEvents:F,allowNegative:I,readOnly:Q,size:G,rightSectionWidth:L,stepHoldInterval:q,stepHoldDelay:N,allowLeadingZeros:P,withKeyboardEvents:Y,trimLeadingZeroesOnBlur:K,allowedDecimalSeparators:W,selectAllOnFocus:z,onMinReached:U,onMaxReached:V,onFocus:J,attributes:ee,ref:ce,...he}=e,Oe=I??!0,Te=P??!0,Re=gt({name:"NumberInput",classes:CO,props:e,classNames:i,styles:r,unstyled:s,attributes:ee,vars:a,varsResolver:UH}),{resolvedClassNames:qe,resolvedStyles:ie}=na({classNames:i,styles:r,props:e}),je=T.useRef(dk(d)||dk(f)?"bigint":"number");dk(d)?je.current="bigint":typeof d=="number"&&(je.current="number");const se=je.current==="bigint",[be,Be]=hr({value:d,defaultValue:f,finalValue:"",onChange:l}),Ce=N!==void 0&&q!==void 0,Ve=T.useRef(null),st=T.useRef(null),Ye=T.useRef(0),Ge=typeof m=="number"?m:void 0,dt=typeof p=="number"?p:void 0,nt=typeof v=="number"?v:mk.step,Ee=typeof R=="number"?R:mk.startValue,Qe=Pb(m),Xe=Pb(p),Ze=Pb(v)??BigInt(1),vt=Pb(R)??BigInt(0),pn=pe=>!WH(pe,Oe)||Te&&M4.test(pe)?pe:Y0(pe)??pe,mn=pe=>{const Ne=Number(pe);return Number.isSafeInteger(Ne)?Ne:void 0},un=(pe,Ne)=>{Ne.source==="event"&&Be(se?pn(pe.value):dre(pe.floatValue,pe.value)&&!cre.test(pe.value)&&!(Te&&M4.test(pe.value))&&!ure.test(pe.value)&&!YH.test(pe.value)?pe.floatValue:pe.value),u==null||u(pe,Ne)},Qt=pe=>{const Ne=String(pe).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return Ne?Math.max(0,(Ne[1]?Ne[1].length:0)-(Ne[2]?+Ne[2]:0)):0},ct=pe=>{Ve.current&&typeof pe<"u"&&Ve.current.setSelectionRange(pe,pe)},zt=T.useRef(m1);zt.current=()=>{if(se){if(!pk(be,Oe))return;let ht;const Et=be;if(typeof Et=="bigint"){const Ct=Et+Ze;Xe!==void 0&&Ct>Xe&&(V==null||V()),ht=Xe!==void 0&&Ct>Xe?Xe:Ct}else if(typeof Et=="string"&&Et!==""){const Ct=Y0(Et);if(Ct===null)return;const vn=Ct+Ze;Xe!==void 0&&vn>Xe&&(V==null||V()),ht=Xe!==void 0&&vn>Xe?Xe:vn}else ht=DA(vt,Qe,Xe);const Tt=ht.toString();Be(ht),u==null||u({floatValue:mn(ht),formattedValue:Tt,value:Tt},{source:"increment"}),setTimeout(()=>{var Ct;return ct((Ct=Ve.current)==null?void 0:Ct.value.length)},0);return}if(!fk(be))return;let pe;const Ne=Qt(be),Ut=Qt(nt),Kt=Math.max(Ne,Ut),it=10**Kt;if(!_O(be)&&(typeof be!="number"||Number.isNaN(be)))pe=Yh(Ee,Ge,dt);else if(dt!==void 0){const ht=(Math.round(Number(be)*it)+Math.round(nt*it))/it;ht>dt&&(V==null||V()),pe=ht<=dt?ht:dt}else pe=(Math.round(Number(be)*it)+Math.round(nt*it))/it;const rt=pe.toFixed(Kt);Be(parseFloat(rt)),u==null||u({floatValue:parseFloat(rt),formattedValue:rt,value:rt},{source:"increment"}),setTimeout(()=>{var ht;return ct((ht=Ve.current)==null?void 0:ht.value.length)},0)};const on=T.useRef(m1);on.current=()=>{if(se){if(!pk(be,Oe))return;let Et;const Tt=Qe!==void 0?Qe:Oe?void 0:BigInt(0),Ct=be;if(typeof Ct=="bigint"){const gi=Ct-Ze;Tt!==void 0&&gi<Tt&&(U==null||U()),Et=Tt!==void 0&&gi<Tt?Tt:gi}else if(typeof Ct=="string"&&Ct!==""){const gi=Y0(Ct);if(gi===null)return;const er=gi-Ze;Tt!==void 0&&er<Tt&&(U==null||U()),Et=Tt!==void 0&&er<Tt?Tt:er}else Et=DA(vt,Tt,Xe);const vn=Et.toString();Be(Et),u==null||u({floatValue:mn(Et),formattedValue:vn,value:vn},{source:"decrement"}),setTimeout(()=>{var gi;return ct((gi=Ve.current)==null?void 0:gi.value.length)},0);return}if(!fk(be))return;let pe;const Ne=Ge!==void 0?Ge:Oe?Number.MIN_SAFE_INTEGER:0,Ut=Qt(be),Kt=Qt(nt),it=Math.max(Ut,Kt),rt=10**it;if(!_O(be)&&typeof be!="number"||Number.isNaN(be))pe=Yh(Ee,Ne,dt);else{const Et=(Math.round(Number(be)*rt)-Math.round(nt*rt))/rt;Ne!==void 0&&Et<Ne&&(U==null||U()),pe=Ne!==void 0&&Et<Ne?Ne:Et}const ht=pe.toFixed(it);Be(parseFloat(ht)),u==null||u({floatValue:parseFloat(ht),formattedValue:ht,value:ht},{source:"decrement"}),setTimeout(()=>{var Et;return ct((Et=Ve.current)==null?void 0:Et.value.length)},0)};const Lt=pe=>{var it,rt,ht;const Ne=pe.clipboardData.getData("text"),Ut=he.decimalSeparator||".",Kt=(W||[".",","]).filter(Et=>Et!==Ut);if(Kt.some(Et=>Ne.includes(Et))){pe.preventDefault();let Et=Ne;Kt.forEach(Ct=>{Et=Et.split(Ct).join(Ut)});const Tt=Ve.current;if(Tt){const Ct=Tt.selectionStart??0,vn=Tt.selectionEnd??0,gi=Tt.value,er=gi.substring(0,Ct)+Et+gi.substring(vn);(rt=(it=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:it.set)==null||rt.call(Tt,er),Tt.dispatchEvent(new Event("change",{bubbles:!0}));const li=Ct+Et.length;setTimeout(()=>ct(li),0)}}(ht=he.onPaste)==null||ht.call(he,pe)},It=pe=>{var Ne,Ut;k==null||k(pe),!(Q||!Y)&&(pe.key==="ArrowUp"&&(pe.preventDefault(),(Ne=zt.current)==null||Ne.call(zt)),pe.key==="ArrowDown"&&(pe.preventDefault(),(Ut=on.current)==null||Ut.call(on)))},$t=pe=>{if(E==null||E(pe),pe.key==="Backspace"){const Ne=Ve.current;Ne&&Ne.selectionStart===0&&Ne.selectionStart===Ne.selectionEnd&&(pe.preventDefault(),window.setTimeout(()=>ct(0),0))}},dn=pe=>{z&&setTimeout(()=>pe.currentTarget.select(),0),J==null||J(pe)},ji=pe=>{let Ne=be;se?(w==="blur"&&typeof Ne=="bigint"&&(Ne=DA(Ne,Qe,Xe)),K&&typeof Ne=="string"&&(Ne=mre(Ne,{min:Qe,max:Xe,clampBehavior:w}))):(w==="blur"&&typeof Ne=="number"&&(Ne=Yh(Ne,Ge,dt)),K&&typeof Ne=="string"&&Qt(Ne)<15&&(Ne=pre(Ne,dt,Ge))),be!==Ne&&Be(Ne),S==null||S(pe)};v1(M,{increment:zt.current,decrement:on.current});const tn=pe=>{var Ne,Ut;pe?(Ne=zt.current)==null||Ne.call(zt):(Ut=on.current)==null||Ut.call(on),Ye.current+=1},an=pe=>{if(tn(pe),Ce){const Ne=typeof q=="number"?q:q(Ye.current);st.current=window.setTimeout(()=>an(pe),Ne)}},gn=(pe,Ne)=>{var Ut;pe.preventDefault(),(Ut=Ve.current)==null||Ut.focus(),tn(Ne),Ce&&(st.current=window.setTimeout(()=>an(Ne),N))},re=()=>{st.current&&window.clearTimeout(st.current),st.current=null,Ye.current=0},ve=o.jsxs("div",{...Re("controls"),children:[o.jsx(Fi,{...Re("control"),tabIndex:-1,"aria-hidden":!0,disabled:D||typeof be=="number"&&dt!==void 0&&be>=dt||typeof be=="bigint"&&Xe!==void 0&&be>=Xe,mod:{direction:"up"},onMouseDown:pe=>pe.preventDefault(),onPointerDown:pe=>{gn(pe,!0)},onPointerUp:re,onPointerLeave:re,children:o.jsx(E4,{direction:"up"})}),o.jsx(Fi,{...Re("control"),tabIndex:-1,"aria-hidden":!0,disabled:D||typeof be=="number"&&Ge!==void 0&&be<=Ge||typeof be=="bigint"&&Qe!==void 0&&be<=Qe,mod:{direction:"down"},onMouseDown:pe=>pe.preventDefault(),onPointerDown:pe=>{gn(pe,!1)},onPointerUp:re,onPointerLeave:re,children:o.jsx(E4,{direction:"down"})})]});return o.jsx(Fs,{component:lre,allowNegative:I,className:Yi(CO.root,n),size:G,...he,inputMode:se?"numeric":"decimal",readOnly:Q,disabled:D,value:typeof be=="bigint"?be.toString():be,getInputRef:Dn(ce,Ve),onValueChange:un,rightSection:y||Q||!(se?pk(be,Oe):fk(be))?b:b||ve,classNames:qe,styles:ie,unstyled:s,__staticSelector:"NumberInput",decimalScale:se?0:j?C:0,onPaste:Lt,onFocus:dn,onKeyDown:It,onKeyDownCapture:$t,rightSectionPointerEvents:F??(D?"none":void 0),rightSectionWidth:L??`var(--ni-right-section-width-${G||"sm"})`,allowLeadingZeros:P,allowedDecimalSeparators:W,onBlur:ji,attributes:ee,isAllowed:pe=>{if(!(!A||A(pe)))return!1;if(w!=="strict")return!0;if(!se)return fre(pe.floatValue,Ge,dt);if(pe.value===""||pe.value==="-")return!0;const Ne=Y0(pe.value);return Ne===null?!0:(Qe===void 0||Ne>=Qe)&&(Xe===void 0||Ne<=Xe)}})});Mv.classes={...Fs.classes,...CO};Mv.varsResolver=UH;Mv.displayName="@mantine/core/NumberInput";const[gre,bg]=rs("Pagination.Root component was not found in tree");var Ag={root:"m_4addd315",control:"m_326d024a",dots:"m_4ad7767d",items:"m_105fdbed",label:"m_10817321"};const vre={withPadding:!0},By=Pe(t=>{const{classNames:e,className:n,style:i,styles:r,vars:s,active:a,disabled:l,withPadding:u,mod:d,...f}=we("PaginationControl",vre,t),p=bg(),m=l||p.disabled;return o.jsx(Fi,{disabled:m,mod:[{active:a,disabled:m,"with-padding":u},d],...p.getStyles("control",{className:n,style:i,classNames:e,styles:r,active:!m}),...f})});By.classes=Ag;By.displayName="@mantine/core/PaginationControl";function Ly({style:t,children:e,path:n,...i}){return o.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},...i,children:o.jsx("path",{d:n,fill:"currentColor"})})}const yre=t=>o.jsx(Ly,{...t,path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"}),xre=t=>o.jsx(Ly,{...t,path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"}),bre=t=>o.jsx(Ly,{...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"}),Are=t=>o.jsx(Ly,{...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"}),wre=t=>o.jsx(Ly,{...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"}),Sre={icon:wre},SS=Pe(t=>{const{classNames:e,className:n,style:i,styles:r,vars:s,icon:a,...l}=we("PaginationDots",Sre,t);return o.jsx(xe,{...bg().getStyles("dots",{className:n,style:i,styles:r,classNames:e}),...l,children:o.jsx(a,{style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});SS.classes=Ag;SS.displayName="@mantine/core/PaginationDots";function jS({icon:t,name:e,action:n,type:i}){const r={icon:t},s=a=>{const{icon:l,...u}=we(e,r,a),d=bg(),f=i==="next"?d.active===d.total:d.active===1;return o.jsx(By,{disabled:d.disabled||f,onClick:d[n],withPadding:!1,...u,children:o.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}`,P8(s)}const VH=jS({icon:yre,name:"PaginationNext",action:"onNext",type:"next"}),GH=jS({icon:xre,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),XH=jS({icon:bre,name:"PaginationFirst",action:"onFirst",type:"previous"}),KH=jS({icon:Are,name:"PaginationLast",action:"onLast",type:"next"});function j1({dotsIcon:t}){const e=bg();return o.jsx(o.Fragment,{children:e.range.map((n,i)=>{var r,s,a;return n==="dots"?o.jsx(SS,{icon:t},i):o.jsx(By,{active:n===e.active,"aria-current":n===e.active?"page":void 0,onClick:()=>e.onChange(n),disabled:e.disabled,...(r=e.getItemProps)==null?void 0:r.call(e,n),children:((a=(s=e.getItemProps)==null?void 0:s.call(e,n))==null?void 0:a.children)??n},i)})})}j1.displayName="@mantine/core/PaginationItems";const jre={formatLabel:({page:t,totalPages:e})=>`Page ${t} of ${e}`},CS=Pe(t=>{const{classNames:e,className:n,style:i,styles:r,vars:s,formatLabel:a,...l}=we("PaginationLabel",jre,t),u=bg();return o.jsx(xe,{...u.getStyles("label",{className:n,style:i,styles:r,classNames:e}),...l,children:a({page:u.active,totalPages:u.total})})});CS.classes=Ag;CS.displayName="@mantine/core/PaginationLabel";const Cre={siblings:1,boundaries:1},ZH=(t,{size:e,radius:n,color:i,autoContrast:r})=>({root:{"--pagination-control-radius":n===void 0?void 0:ai(n),"--pagination-control-size":Zt(e,"pagination-control-size"),"--pagination-control-fz":Ai(e),"--pagination-active-bg":i?Oi(i,t):void 0,"--pagination-active-color":hg(r,t)?ju({color:i,theme:t,autoContrast:r}):void 0}}),Py=Pe(t=>{const e=we("PaginationRoot",Cre,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,total:u,value:d,defaultValue:f,onChange:p,disabled:m,siblings:v,boundaries:y,color:b,radius:A,onNextPage:w,onPreviousPage:S,onFirstPage:j,onLastPage:C,getItemProps:k,autoContrast:E,startValue:M,layout:R,mod:D,attributes:F,...I}=e,Q=gt({name:"Pagination",classes:Ag,props:e,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:F,vars:l,varsResolver:ZH}),{range:G,setPage:L,next:q,previous:N,active:P,first:Y,last:K}=IK({page:d,initialPage:f,onChange:p,total:u,siblings:v,boundaries:y,startValue:M});return o.jsx(gre,{value:{total:u,range:G,active:P,disabled:m,layout:R,getItemProps:k,onChange:L,onNext:pi(w,q),onPrevious:pi(S,N),onFirst:pi(j,Y),onLast:pi(C,K),getStyles:Q},children:o.jsx(xe,{...Q("root"),mod:[{layout:R},D],...I})})});Py.classes=Ag;Py.varsResolver=ZH;Py.displayName="@mantine/core/PaginationRoot";const _re={withControls:!0,withPages:!0,siblings:1,boundaries:1,gap:8};function kre({children:t}){return o.jsx(xe,{...bg().getStyles("items"),children:t})}const sa=Pe(t=>{const{withEdges:e,withControls:n,getControlProps:i,nextIcon:r,previousIcon:s,lastIcon:a,firstIcon:l,dotsIcon:u,total:d,gap:f,hideWithOnePage:p,withPages:m,layout:v,formatLabel:y,...b}=we("Pagination",_re,t);if(d<=0||p&&d===1)return null;const A=m?v==="responsive"?o.jsxs(o.Fragment,{children:[o.jsx(kre,{children:o.jsx(j1,{dotsIcon:u})}),o.jsx(CS,{formatLabel:y})]}):o.jsx(j1,{dotsIcon:u}):null;return o.jsx(Py,{total:d,layout:v,...b,children:o.jsxs(pt,{gap:f,children:[e&&o.jsx(XH,{icon:l,...i==null?void 0:i("first")}),n&&o.jsx(GH,{icon:s,...i==null?void 0:i("previous")}),A,n&&o.jsx(VH,{icon:r,...i==null?void 0:i("next")}),e&&o.jsx(KH,{icon:a,...i==null?void 0:i("last")})]})})});sa.classes=Ag;sa.displayName="@mantine/core/Pagination";sa.Root=Py;sa.Control=By;sa.Dots=SS;sa.First=XH;sa.Last=KH;sa.Next=VH;sa.Previous=GH;sa.Items=j1;sa.Label=CS;const[Tre,JH]=rs("Progress.Root component was not found in tree");var Fy={root:"m_db6d6462",section:"m_2242eb65","stripes-animation":"m_81a374bd","stripes-animation-vertical":"m_e0fb7a86",label:"m_91e40b74"};const nR=Pe(t=>{const{classNames:e,className:n,style:i,styles:r,vars:s,...a}=we("ProgressLabel",null,t);return o.jsx(xe,{...JH().getStyles("label",{className:n,style:i,classNames:e,styles:r}),...a})});nR.classes=Fy;nR.displayName="@mantine/core/ProgressLabel";const e9=(t,{size:e,radius:n,transitionDuration:i})=>({root:{"--progress-size":Zt(e,"progress-size"),"--progress-radius":n===void 0?void 0:ai(n),"--progress-transition-duration":typeof i=="number"?`${i}ms`:void 0}}),$y=Pe(t=>{const e=we("ProgressRoot",null,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,autoContrast:u,transitionDuration:d,orientation:f,attributes:p,mod:m,...v}=e,y=gt({name:"Progress",classes:Fy,props:e,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:p,vars:l,varsResolver:e9});return o.jsx(Tre,{value:{getStyles:y,autoContrast:u},children:o.jsx(xe,{mod:[{orientation:f},m],...y("root"),...v})})});$y.classes=Fy;$y.varsResolver=e9;$y.displayName="@mantine/core/ProgressRoot";const Ore={withAria:!0},_S=Pe(t=>{const{classNames:e,className:n,style:i,styles:r,vars:s,value:a,withAria:l,color:u,striped:d,animated:f,mod:p,...m}=we("ProgressSection",Ore,t),v=JH(),y=Ar(),b=l?{role:"progressbar","aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":a,"aria-valuetext":`${a}%`}:{};return o.jsx(xe,{...v.getStyles("section",{className:n,classNames:e,styles:r,style:i}),...m,...b,mod:[{striped:d||f,animated:f},p],__vars:{"--progress-section-size":`${a}%`,"--progress-section-color":Oi(u,y),"--progress-label-color":hg(v.autoContrast,y)?ju({color:u,theme:y,autoContrast:v.autoContrast}):void 0}})});_S.classes=Fy;_S.displayName="@mantine/core/ProgressSection";const wg=Pe(t=>{const e=we("Progress",null,t),{value:n,classNames:i,styles:r,vars:s,color:a,striped:l,animated:u,"aria-label":d,...f}=e,{resolvedClassNames:p,resolvedStyles:m}=na({classNames:i,styles:r,props:e});return o.jsx($y,{classNames:p,styles:m,vars:s,...f,children:o.jsx(_S,{value:n,color:a,striped:l,animated:u,"aria-label":d})})});wg.classes=Fy;wg.displayName="@mantine/core/Progress";wg.Section=_S;wg.Root=$y;wg.Label=nR;function Ere({offset:t,position:e,defaultOpened:n}){const[i,r]=T.useState(n),s=T.useRef(null),{x:a,y:l,elements:u,refs:d,update:f,placement:p}=Vw({placement:e,middleware:[aM({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=T.useCallback(({clientX:b,clientY:A})=>{d.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:b,y:A,left:b+m,top:A+v,right:b,bottom:A}}})},[u.reference]);return T.useEffect(()=>{if(d.floating.current){const b=s.current;b.addEventListener("mousemove",y);const A=cu(d.floating.current);return A.forEach(w=>{w.addEventListener("scroll",f)}),()=>{b.removeEventListener("mousemove",y),A.forEach(w=>{w.removeEventListener("scroll",f)})}}},[u.reference,d.floating.current,f,y,i]),{handleMouseMove:y,x:a,y:l,opened:i,setOpened:r,boundaryRef:s,floating:d.setFloating}}var kS={tooltip:"m_1b3c8819",arrow:"m_f898399f"};const Mre={refProp:"ref",withinPortal:!0,offset:10,position:"right",zIndex:Da("popover")},t9=(t,{radius:e,color:n})=>({tooltip:{"--tooltip-radius":e===void 0?void 0:ai(e),"--tooltip-bg":n?Oi(n,t):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),TS=Pe(t=>{const e=we("TooltipFloating",Mre,t),{children:n,refProp:i,withinPortal:r,style:s,className:a,classNames:l,styles:u,unstyled:d,radius:f,color:p,label:m,offset:v,position:y,multiline:b,zIndex:A,disabled:w,defaultOpened:S,variant:j,vars:C,portalProps:k,attributes:E,ref:M,...R}=e,D=Ar(),F=gt({name:"TooltipFloating",props:e,classes:kS,className:a,style:s,classNames:l,styles:u,unstyled:d,attributes:E,rootSelector:"tooltip",vars:C,varsResolver:t9}),{handleMouseMove:I,x:Q,y:G,opened:L,boundaryRef:q,floating:N,setOpened:P}=Ere({offset:v,position:y,defaultOpened:S}),Y=Su(n);if(!Y)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 K=Dn(q,Nw(Y),M),W=Y.props,z=V=>{var J;(J=W.onMouseEnter)==null||J.call(W,V),I(V),P(!0)},U=V=>{var J;(J=W.onMouseLeave)==null||J.call(W,V),P(!1)};return o.jsxs(o.Fragment,{children:[o.jsx(ed,{...k,withinPortal:r,children:o.jsx(xe,{...R,...F("tooltip",{style:{...Fm(s,D),zIndex:A,display:!w&&L?"block":"none",top:(G&&Math.round(G))??"",left:(Q&&Math.round(Q))??""}}),variant:j,ref:N,mod:{multiline:b},children:m})}),T.cloneElement(Y,{...W,[i]:K,onMouseEnter:z,onMouseLeave:U})]})});TS.classes=kS;TS.varsResolver=t9;TS.displayName="@mantine/core/TooltipFloating";const n9=T.createContext({withinGroup:!1}),Rre={openDelay:0,closeDelay:0};function iR(t){const{openDelay:e,closeDelay:n,children:i}=we("TooltipGroup",Rre,t);return o.jsx(n9,{value:{withinGroup:!0},children:o.jsx(Gee,{delay:{open:e,close:n},children:i})})}iR.displayName="@mantine/core/TooltipGroup";iR.extend=t=>t;function Dre(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 Nre(t){const e=Dre(t.middlewares),n=[m$(t.offset)];return e.shift&&n.push(aM(typeof e.shift=="boolean"?{padding:8}:{padding:8,...e.shift})),e.flip&&n.push(typeof e.flip=="boolean"?AO():AO(e.flip)),n.push(g$({element:t.arrowRef,padding:t.arrowOffset})),e.inline?n.push(typeof e.inline=="boolean"?cv():cv(e.inline)):t.inline&&n.push(cv()),n}function Ire(t){var k,E,M;const[e,n]=T.useState(t.defaultOpened),i=typeof t.opened=="boolean"?t.opened:e,r=T.use(n9).withinGroup,s=zr(),a=T.useCallback(R=>{n(R),R&&A(s)},[s]),{x:l,y:u,context:d,refs:f,placement:p,middlewareData:{arrow:{x:m,y:v}={}}}=Vw({strategy:t.strategy,placement:t.position,open:i,onOpenChange:a,middleware:Nre(t),whileElementsMounted:bO}),{delay:y,currentId:b,setCurrentId:A}=Xee(d,{id:s}),{getReferenceProps:w,getFloatingProps:S}=A$([x$(d,{enabled:(k=t.events)==null?void 0:k.hover,delay:r?y:{open:t.openDelay,close:t.closeDelay},mouseOnly:!((E=t.events)!=null&&E.touch)}),nte(d,{enabled:(M=t.events)==null?void 0:M.focus,visibleOnly:!0}),rte(d,{role:"tooltip"}),ete(d,{enabled:typeof t.opened>"u"})]),j=T.useRef(p);uc(()=>{var R;j.current!==p&&(j.current=p,(R=t.onPositionChange)==null||R.call(t,p))},[p]);const C=i&&b&&b!==s;return{x:l,y:u,arrowX:m,arrowY:v,reference:f.setReference,floating:f.setFloating,getFloatingProps:S,getReferenceProps:w,isGroupPhase:C,opened:i,placement:p}}const Bre={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:Da("popover"),middlewares:{flip:!0,shift:!0,inline:!1}},i9=(t,{radius:e,color:n,variant:i,autoContrast:r})=>{const s=t.variantColorResolver({theme:t,color:n||t.primaryColor,autoContrast:r,variant:i||"filled"});return{tooltip:{"--tooltip-radius":e===void 0?void 0:ai(e),"--tooltip-bg":n?s.background:void 0,"--tooltip-color":n?s.color:void 0}}},Gi=Pe(t=>{const e=we("Tooltip",Bre,t),{children:n,position:i,refProp:r,label:s,openDelay:a,closeDelay:l,onPositionChange:u,opened:d,defaultOpened:f,withinPortal:p,radius:m,color:v,classNames:y,styles:b,unstyled:A,style:w,className:S,withArrow:j,arrowSize:C,arrowOffset:k,arrowRadius:E,arrowPosition:M,offset:R,transitionProps:D,multiline:F,events:I,zIndex:Q,disabled:G,onClick:L,onMouseEnter:q,onMouseLeave:N,inline:P,variant:Y,keepMounted:K,vars:W,portalProps:z,mod:U,floatingStrategy:V,middlewares:J,autoContrast:ee,attributes:ce,target:he,ref:Oe,...Te}=e,{dir:Re}=vc(),qe=T.useRef(null),ie=Ire({position:fM(Re,i),closeDelay:l,openDelay:a,onPositionChange:u,opened:d,defaultOpened:f,events:I,arrowRef:qe,arrowOffset:k,offset:typeof R=="number"?R+(j?C/2:0):R,inline:P,strategy:V,middlewares:J});T.useEffect(()=>{const Ye=he instanceof HTMLElement?he:typeof he=="string"?document.querySelector(he):(he==null?void 0:he.current)||null;Ye&&ie.reference(Ye)},[he,ie]);const je=gt({name:"Tooltip",props:e,classes:kS,className:S,style:w,classNames:y,styles:b,unstyled:A,attributes:ce,rootSelector:"tooltip",vars:W,varsResolver:i9}),se=Su(n);if(!he&&!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 be=je("tooltip"),Be=M==="merge"&&j?O$({position:ie.placement,dir:Re}):void 0;if(he){const Ye=p4(D,{duration:100,transition:"fade"});return o.jsx(o.Fragment,{children:o.jsx(ed,{...z,withinPortal:p,children:o.jsx(fc,{...Ye,keepMounted:K,mounted:!G&&!!ie.opened,duration:ie.isGroupPhase?10:Ye.duration,children:Ge=>o.jsxs(xe,{...Te,"data-fixed":V==="fixed"||void 0,variant:Y,mod:[{multiline:F},U],...be,...ie.getFloatingProps({ref:ie.floating,className:be.className,style:{...be.style,...Ge,...Be,zIndex:Q,top:ie.y??0,left:ie.x??0}}),children:[s,o.jsx(S1,{ref:qe,arrowX:ie.arrowX,arrowY:ie.arrowY,visible:j,position:ie.placement,arrowSize:C,arrowOffset:k,arrowRadius:E,arrowPosition:M,...je("arrow")})]})})})})}const Ce=se.props,Ve=Dn(ie.reference,Nw(se),Oe),st=p4(D,{duration:100,transition:"fade"});return o.jsxs(o.Fragment,{children:[o.jsx(ed,{...z,withinPortal:p,children:o.jsx(fc,{...st,keepMounted:K,mounted:!G&&!!ie.opened,duration:ie.isGroupPhase?10:st.duration,children:Ye=>o.jsxs(xe,{...Te,"data-fixed":V==="fixed"||void 0,variant:Y,mod:[{multiline:F},U],...ie.getFloatingProps({ref:ie.floating,className:je("tooltip").className,style:{...je("tooltip").style,...Ye,...Be,zIndex:Q,top:ie.y??0,left:ie.x??0}}),children:[s,o.jsx(S1,{ref:qe,arrowX:ie.arrowX,arrowY:ie.arrowY,visible:j,position:ie.placement,arrowSize:C,arrowOffset:k,arrowRadius:E,arrowPosition:M,...je("arrow")})]})})}),T.cloneElement(se,ie.getReferenceProps({onClick:L,onMouseEnter:q,onMouseLeave:N,onMouseMove:e.onMouseMove,onPointerDown:e.onPointerDown,onPointerEnter:e.onPointerEnter,...Ce,className:Yi(S,Ce.className),[r]:Ve}))]})});Gi.classes=kS;Gi.varsResolver=i9;Gi.displayName="@mantine/core/Tooltip";Gi.Floating=TS;Gi.Group=iR;function Lre({size:t,thickness:e,sum:n,value:i,root:r,offset:s}){const a=(t*.9-e*2)/2,l=Math.PI*a*2/100,u=r||i===void 0?`${(100-n)*l}, ${n*l}`:`${i*l}, ${(100-i)*l}`;return{strokeWidth:Number.isNaN(e)?12:e,cx:t/2||0,cy:t/2||0,r:a||0,transform:r?`scale(1, -1) translate(0, -${t})`:void 0,strokeDasharray:u,strokeDashoffset:r?0:s||0}}function r9({size:t,value:e,offset:n,sum:i,thickness:r,root:s,color:a,lineRoundCaps:l,tooltip:u,getStyles:d,display:f,...p}){const m=Ar();return o.jsx(Gi.Floating,{disabled:!u,label:u,children:o.jsx(xe,{component:"circle",...p,...d("curve"),__vars:{"--curve-color":a?Oi(a,m):void 0},fill:"none",strokeLinecap:l?"round":"butt",...Lre({sum:i,size:t,thickness:r,value:e,offset:n,root:s})})})}r9.displayName="@mantine/core/Curve";function Pre({size:t,thickness:e,sections:n,renderRoundedLineCaps:i,rootColor:r,sectionGap:s=0}){const a=n.reduce((m,v)=>m+v.value,0),l=Math.PI*((t*.9-e*2)/2)*2;let u=l;const d=[],f=[],p=s/360*100;for(let m=0;m<n.length;m+=1){const v=Math.max(0,n[m].value-p);d.push({sum:a,offset:u,data:{...n[m],value:v},root:!1}),u-=n[m].value/100*l}if(d.push({sum:a,offset:u,data:{color:r},root:!0}),f.push({...d[d.length-1],lineRoundCaps:!1}),d.length>2){f.push({...d[0],lineRoundCaps:i}),f.push({...d[d.length-2],lineRoundCaps:i});for(let m=1;m<=d.length-3;m+=1)f.push({...d[m],lineRoundCaps:!1})}else f.push({...d[0],lineRoundCaps:i});return f}var s9={root:"m_b32e4812",svg:"m_d43b5134",curve:"m_b1ca1fbf",label:"m_b23f9dc4"};function Fre(t,e){return Math.min(t||12,(e||120)/4)}const $re={size:120,thickness:12,startAngle:270},o9=(t,{size:e,thickness:n,transitionDuration:i,startAngle:r})=>({root:{"--rp-size":ge(e),"--rp-label-offset":ge(n*2),"--rp-transition-duration":i?`${i}ms`:void 0},svg:{"--rp-start-angle":`${r}deg`}}),zy=Pe(t=>{const e=we("RingProgress",$re,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,label:u,sections:d,size:f,thickness:p,roundCaps:m,rootColor:v,transitionDuration:y,sectionGap:b,startAngle:A,attributes:w,...S}=e,j=gt({name:"RingProgress",classes:s9,props:e,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:w,vars:l,varsResolver:o9}),C=Fre(p,f),k=Pre({size:f,thickness:C,sections:d,renderRoundedLineCaps:m,rootColor:v,sectionGap:b}).map(({data:E,sum:M,root:R,lineRoundCaps:D,offset:F},I)=>T.createElement(r9,{...E,key:I,size:f,thickness:C,sum:M,offset:F,color:E==null?void 0:E.color,root:R,lineRoundCaps:D,getStyles:j}));return o.jsxs(xe,{...j("root"),size:f,...S,children:[o.jsx("svg",{...j("svg"),viewBox:`0 0 ${f} ${f}`,children:k}),u&&o.jsx("div",{...j("label"),children:u})]})});zy.classes=s9;zy.varsResolver=o9;zy.displayName="@mantine/core/RingProgress";var a9={root:"m_cf365364",indicator:"m_9e182ccd",label:"m_1738fcb2",input:"m_1714d588",control:"m_69686b9b",innerLabel:"m_78882f40"};const zre={withItemsBorders:!0},l9=(t,{radius:e,color:n,transitionDuration:i,size:r,transitionTimingFunction:s})=>({root:{"--sc-radius":e===void 0?void 0:ai(e),"--sc-color":n?Oi(n,t):void 0,"--sc-shadow":n?void 0:"var(--mantine-shadow-xs)","--sc-transition-duration":i===void 0?void 0:`${i}ms`,"--sc-transition-timing-function":s,"--sc-padding":Zt(r,"sc-padding"),"--sc-font-size":Ai(r)}}),Sg=md(t=>{var Te,Re;const e=we("SegmentedControl",zre,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,data:u,value:d,defaultValue:f,onChange:p,size:m,name:v,disabled:y,readOnly:b,fullWidth:A,orientation:w,radius:S,color:j,transitionDuration:C,transitionTimingFunction:k,variant:E,autoContrast:M,withItemsBorders:R,mod:D,attributes:F,ref:I,...Q}=e,G=gt({name:"SegmentedControl",props:e,classes:a9,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:F,vars:l,varsResolver:l9}),L=Ar(),q=u.map(qe=>iZ(qe)?{label:`${qe}`,value:qe}:qe),N=YK(),[P,Y]=T.useState(Pm()),[K,W]=T.useState(null),[z,U]=T.useState({}),V=(qe,ie)=>{z[ie]=qe,U(z)},[J,ee]=hr({value:d,defaultValue:f,finalValue:Array.isArray(u)?((Te=q.find(qe=>!qe.disabled))==null?void 0:Te.value)??((Re=u[0])==null?void 0:Re.value)??null:null,onChange:p}),ce=zr(v),he=q.map(qe=>T.createElement(xe,{...G("control"),mod:{active:J===qe.value,orientation:w},key:`${qe.value}`},T.createElement("input",{...G("input"),disabled:y||qe.disabled,type:"radio",name:ce,value:`${qe.value}`,id:`${ce}-${qe.value}`,checked:J===qe.value,onChange:()=>!b&&ee(qe.value),"data-focus-ring":L.focusRing,key:`${qe.value}-input`}),T.createElement(xe,{component:"label",...G("label"),mod:{active:J===qe.value&&!(y||qe.disabled),disabled:y||qe.disabled,"read-only":b},htmlFor:`${ce}-${qe.value}`,ref:ie=>V(ie,`${qe.value}`),__vars:{"--sc-label-color":j!==void 0?ju({color:j,theme:L,autoContrast:M}):void 0},key:`${qe.value}-label`},o.jsx("span",{...G("innerLabel"),children:qe.label})))),Oe=Dn(I,W);return zK(()=>{Y(Pm())},[u.length]),u.length===0?null:o.jsxs(xe,{...G("root"),variant:E,size:m,ref:Oe,mod:[{"full-width":A,orientation:w,initialized:N,"with-items-borders":R},D],...Q,role:"radiogroup","data-disabled":y,children:[typeof J<"u"&&o.jsx(tS,{target:z[`${J}`],parent:K,component:"span",transitionDuration:"var(--sc-transition-duration)",...G("indicator")},P),he]})});Sg.classes=a9;Sg.varsResolver=l9;Sg.displayName="@mantine/core/SegmentedControl";const Hre={size:"sm",withCheckIcon:!0,allowDeselect:!0,checkIconPosition:"left",openOnFocus:!0},jg=md(t=>{const e=we(["Input","InputWrapper","Select"],Hre,t),{classNames:n,styles:i,unstyled:r,vars:s,dropdownOpened:a,defaultDropdownOpened:l,onDropdownClose:u,onDropdownOpen:d,onFocus:f,onBlur:p,onClick:m,onChange:v,data:y,value:b,defaultValue:A,selectFirstOptionOnChange:w,selectFirstOptionOnDropdownOpen:S,onOptionSubmit:j,comboboxProps:C,readOnly:k,disabled:E,filter:M,limit:R,withScrollArea:D,maxDropdownHeight:F,floatingHeight:I,size:Q,searchable:G,rightSection:L,checkIconPosition:q,withCheckIcon:N,withAlignedLabels:P,nothingFoundMessage:Y,name:K,form:W,searchValue:z,defaultSearchValue:U,onSearchChange:V,allowDeselect:J,error:ee,rightSectionPointerEvents:ce,id:he,clearable:Oe,clearSectionMode:Te,clearButtonProps:Re,hiddenInputProps:qe,renderOption:ie,onClear:je,autoComplete:se,scrollAreaProps:be,__defaultRightSection:Be,__clearSection:Ce,__clearable:Ve,chevronColor:st,autoSelectOnBlur:Ye,openOnFocus:Ge,attributes:dt,...nt}=e,Ee=T.useMemo(()=>Rz(y),[y]),Qe=T.useRef({}),Xe=T.useMemo(()=>_M(Ee),[Ee]),Ze=zr(he),[vt,pn,mn]=hr({value:b,defaultValue:A,finalValue:null,onChange:v}),un=vt!=null?`${vt}`in Xe?Xe[`${vt}`]:Qe.current[`${vt}`]:void 0,Qt=qK(un),[ct,zt,on]=hr({value:z,defaultValue:U,finalValue:un?un.label:"",onChange:V}),Lt=nS({opened:a,defaultOpened:l,onDropdownOpen:()=>{d==null||d(),S?Lt.selectFirstOption():Lt.updateSelectedOptionIndex("active",{scrollIntoView:!0})},onDropdownClose:()=>{u==null||u(),setTimeout(Lt.resetSelectedOption,0)}}),It=an=>{zt(an),Lt.resetSelectedOption()},{resolvedClassNames:$t,resolvedStyles:dn}=na({props:e,styles:i,classNames:n});T.useEffect(()=>{w&&Lt.selectFirstOption()},[w,ct]),T.useEffect(()=>{b===null&&It(""),b!=null&&un&&((Qt==null?void 0:Qt.value)!==un.value||(Qt==null?void 0:Qt.label)!==un.label)&&It(un.label)},[b,un]),T.useEffect(()=>{var an,gn;!mn&&!on&&It(vt!=null?`${vt}`in Xe?(an=Xe[`${vt}`])==null?void 0:an.label:((gn=Qe.current[`${vt}`])==null?void 0:gn.label)||"":"")},[Xe,vt]),T.useEffect(()=>{vt&&`${vt}`in Xe&&(Qe.current[`${vt}`]=Xe[`${vt}`])},[Xe,vt]);const ji=o.jsx(fn.ClearButton,{...Re,onClear:()=>{pn(null,null),It(""),je==null||je()}}),tn=Oe&&vt!=null&&!E&&!k;return o.jsxs(o.Fragment,{children:[o.jsxs(fn,{store:Lt,__staticSelector:"Select",classNames:$t,styles:dn,unstyled:r,readOnly:k,size:Q,attributes:dt,floatingHeight:I,keepMounted:Ye,onOptionSubmit:an=>{j==null||j(an);const gn=J&&`${Xe[an].value}`==`${vt}`?null:Xe[an],re=gn?gn.value:null;re!==vt&&pn(re,gn),!mn&&It(re!=null&&(gn==null?void 0:gn.label)||""),Lt.closeDropdown()},...C,children:[o.jsx(fn.Target,{targetType:G?"input":"button",autoComplete:se,withExpandedAttribute:!0,children:o.jsx(Fs,{id:Ze,__defaultRightSection:o.jsx(fn.Chevron,{size:Q,error:ee,unstyled:r,color:st}),__clearSection:ji,__clearable:tn,__clearSectionMode:Te,rightSection:L,rightSectionPointerEvents:ce||"none",...nt,size:Q,__staticSelector:"Select",disabled:E,readOnly:k||!G,value:ct,onChange:an=>{It(an.currentTarget.value),Lt.openDropdown(),w&&Lt.selectFirstOption()},onFocus:an=>{Ge&&G&&Lt.openDropdown(),f==null||f(an)},onBlur:an=>{Ye&&Lt.clickSelectedOption(),G&&Lt.closeDropdown();const gn=vt!=null&&(`${vt}`in Xe?Xe[`${vt}`]:Qe.current[`${vt}`]);It(gn&&gn.label||""),p==null||p(an)},onClick:an=>{G?Lt.openDropdown():Lt.toggleDropdown(),m==null||m(an)},classNames:$t,styles:dn,unstyled:r,pointer:!G,error:ee,attributes:dt})}),o.jsx(Jz,{data:Ee,hidden:k||E,filter:M,search:ct,limit:R,hiddenWhenEmpty:!Y,withScrollArea:D,maxDropdownHeight:F,filterOptions:!!G&&(un==null?void 0:un.label)!==ct,value:vt,checkIconPosition:q,withCheckIcon:N,withAlignedLabels:P,nothingFoundMessage:Y,unstyled:r,labelId:nt.label?`${Ze}-label`:void 0,"aria-label":nt.label?void 0:nt["aria-label"],renderOption:ie,scrollAreaProps:be})]}),o.jsx(fn.HiddenInput,{value:vt,name:K,form:W,disabled:E,...qe})]})});jg.classes={...Fs.classes,...fn.classes};jg.displayName="@mantine/core/Select";function c9(t){if(t!==void 0)return typeof t=="number"?ge(t):t}function qre({spacing:t,verticalSpacing:e,cols:n,minColWidth:i,autoRows:r,selector:s}){var p;const a=Ar(),l=e===void 0?t:e,u=i!==void 0,d=vy({"--sg-spacing-x":ns(Zp(t)),"--sg-spacing-y":ns(Zp(l)),"--sg-auto-rows":r,...u?{"--sg-min-col-width":c9(i)}:{"--sg-cols":(p=Zp(n))==null?void 0:p.toString()}}),f=cr(a.breakpoints).reduce((m,v)=>(m[v]||(m[v]={}),typeof t=="object"&&t[v]!==void 0&&(m[v]["--sg-spacing-x"]=ns(t[v])),typeof l=="object"&&l[v]!==void 0&&(m[v]["--sg-spacing-y"]=ns(l[v])),!u&&typeof n=="object"&&n[v]!==void 0&&(m[v]["--sg-cols"]=n[v]),m),{});return o.jsx(Pw,{styles:d,media:cO(cr(f),a.breakpoints).filter(m=>cr(f[m.value]).length>0).map(m=>({query:`(min-width: ${a.breakpoints[m.value]})`,styles:f[m.value]})),selector:s})}function gk(t){return typeof t=="object"&&t!==null?cr(t):[]}function Qre(t){return t.sort((e,n)=>jv(e)-jv(n))}function Yre({spacing:t,verticalSpacing:e,cols:n,minColWidth:i}){return Qre(Array.from(new Set([...gk(t),...gk(e),...i!==void 0?[]:gk(n)])))}function Wre({spacing:t,verticalSpacing:e,cols:n,minColWidth:i,autoRows:r,selector:s}){var p;const a=e===void 0?t:e,l=i!==void 0,u=vy({"--sg-spacing-x":ns(Zp(t)),"--sg-spacing-y":ns(Zp(a)),"--sg-auto-rows":r,...l?{"--sg-min-col-width":c9(i)}:{"--sg-cols":(p=Zp(n))==null?void 0:p.toString()}}),d=Yre({spacing:t,verticalSpacing:e,cols:n,minColWidth:i}),f=d.reduce((m,v)=>(m[v]||(m[v]={}),typeof t=="object"&&t[v]!==void 0&&(m[v]["--sg-spacing-x"]=ns(t[v])),typeof a=="object"&&a[v]!==void 0&&(m[v]["--sg-spacing-y"]=ns(a[v])),!l&&typeof n=="object"&&n[v]!==void 0&&(m[v]["--sg-cols"]=n[v]),m),{});return o.jsx(Pw,{styles:u,container:d.map(m=>({query:`simple-grid (min-width: ${m})`,styles:f[m]})),selector:s})}var u9={container:"m_925c2d2c",root:"m_2415a157"};const Ure={cols:1,spacing:"md",type:"media"},OS=Pe(t=>{const e=we("SimpleGrid",Ure,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,cols:u,verticalSpacing:d,spacing:f,type:p,minColWidth:m,autoFlow:v,autoRows:y,attributes:b,...A}=e,w=gt({name:"SimpleGrid",classes:u9,props:e,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:b,vars:l}),S=L8(),j=m!==void 0?v||"auto-fill":void 0;return p==="container"?o.jsxs(o.Fragment,{children:[o.jsx(Wre,{...e,selector:`.${S}`}),o.jsx("div",{...w("container"),children:o.jsx(xe,{...w("root",{className:S}),...A,"data-auto-cols":j})})]}):o.jsxs(o.Fragment,{children:[o.jsx(qre,{...e,selector:`.${S}`}),o.jsx(xe,{...w("root",{className:S}),...A,"data-auto-cols":j})]})});OS.classes=u9;OS.displayName="@mantine/core/SimpleGrid";var h9={root:"m_18320242","skeleton-fade":"m_299c329c"};const Vre={visible:!0,animate:!0},d9=(t,{width:e,height:n,radius:i,circle:r})=>({root:{"--skeleton-height":ge(n),"--skeleton-width":ge(r?n:e),"--skeleton-radius":r?"1000px":i===void 0?void 0:ai(i)}}),ta=Pe(t=>{const e=we("Skeleton",Vre,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,width:u,height:d,circle:f,visible:p,radius:m,animate:v,mod:y,attributes:b,...A}=e;return o.jsx(xe,{...gt({name:"Skeleton",classes:h9,props:e,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:b,vars:l,varsResolver:d9})("root"),mod:[{visible:p,animate:v},y],...A})});ta.classes=h9;ta.varsResolver=d9;ta.displayName="@mantine/core/Skeleton";const f9=Pe(t=>{const{w:e,h:n,miw:i,mih:r,...s}=we("Space",null,t);return o.jsx(xe,{...s,w:e,miw:i??e,h:n,mih:r??n})});f9.displayName="@mantine/core/Space";var p9={root:"m_6d731127"};const Gre={gap:"md",align:"stretch",justify:"flex-start"},m9=(t,{gap:e,align:n,justify:i})=>({root:{"--stack-gap":ns(e),"--stack-align":n,"--stack-justify":i}}),Mn=Pe(t=>{const e=we("Stack",Gre,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,align:u,justify:d,gap:f,variant:p,attributes:m,...v}=e;return o.jsx(xe,{...gt({name:"Stack",props:e,classes:p9,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:m,vars:l,varsResolver:m9})("root"),variant:p,...v})});Mn.classes=p9;Mn.varsResolver=m9;Mn.displayName="@mantine/core/Stack";const g9=T.createContext(null),Xre={hiddenInputValuesSeparator:","},rR=md((t=>{const{value:e,defaultValue:n,onChange:i,size:r,wrapperProps:s,children:a,readOnly:l,name:u,hiddenInputValuesSeparator:d,hiddenInputProps:f,maxSelectedValues:p,disabled:m,...v}=we("SwitchGroup",Xre,t),[y,b]=hr({value:e,defaultValue:n,finalValue:[],onChange:i}),A=j=>{const C=j.currentTarget.value;if(l)return;const k=y.includes(C);!k&&p&&y.length>=p||b(k?y.filter(E=>E!==C):[...y,C])},w=j=>{if(m)return!0;if(!p)return!1;const C=y.includes(j),k=y.length>=p;return!C&&k},S=y.join(d);return o.jsx(g9,{value:{value:y,onChange:A,size:r,isDisabled:w},children:o.jsxs(wi.Wrapper,{size:r,...s,...v,labelElement:"div",__staticSelector:"SwitchGroup",children:[o.jsx(Fz,{role:"group",children:a}),o.jsx("input",{type:"hidden",name:u,value:S,...f})]})})}));rR.classes=wi.Wrapper.classes;rR.displayName="@mantine/core/SwitchGroup";var v9={root:"m_5f93f3bb",input:"m_926b4011",track:"m_9307d992",thumb:"m_93039a1d",trackLabel:"m_8277e082"};const Kre={labelPosition:"right",withThumbIndicator:!0},y9=(t,{radius:e,color:n,size:i})=>({root:{"--switch-radius":e===void 0?void 0:ai(e),"--switch-height":Zt(i,"switch-height"),"--switch-width":Zt(i,"switch-width"),"--switch-thumb-size":Zt(i,"switch-thumb-size"),"--switch-label-font-size":Zt(i,"switch-label-font-size"),"--switch-track-label-padding":Zt(i,"switch-track-label-padding"),"--switch-color":n?Oi(n,t):void 0}}),Hy=Pe(t=>{var ee;const e=we("Switch",Kre,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,color:u,label:d,offLabel:f,onLabel:p,id:m,size:v,radius:y,wrapperProps:b,thumbIcon:A,checked:w,defaultChecked:S,onChange:j,labelPosition:C,description:k,error:E,disabled:M,variant:R,rootRef:D,mod:F,withThumbIndicator:I,attributes:Q,...G}=e,L=T.use(g9),q=v||(L==null?void 0:L.size),N=gt({name:"Switch",props:e,classes:v9,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:Q,vars:l,varsResolver:y9}),{styleProps:P,rest:Y}=Sy(G),K=zr(m),W=[k?`${K}-description`:void 0,E&&typeof E!="boolean"?`${K}-error`:void 0,Y["aria-describedby"]].filter(Boolean).join(" ")||void 0,z={checked:(L==null?void 0:L.value.includes(Y.value))??w,onChange:ce=>{L==null||L.onChange(ce),j==null||j(ce)}},U=M||((ee=L==null?void 0:L.isDisabled)==null?void 0:ee.call(L,Y.value)),[V,J]=hr({value:z.checked??w,defaultValue:S,finalValue:!1});return o.jsxs(FM,{...N("root"),__staticSelector:"Switch",__stylesApiProps:e,id:K,size:q,labelPosition:C,label:d,description:k,error:E,disabled:U,bodyElement:"label",labelElement:"span",classNames:n,styles:s,unstyled:a,"data-checked":z.checked,variant:R,ref:D,mod:F,attributes:Q,inert:Y.inert,...P,...b,children:[o.jsx("input",{...Y,...z,disabled:U,checked:V,"data-checked":z.checked,onChange:ce=>{var he;(he=z.onChange)==null||he.call(z,ce),J(ce.currentTarget.checked)},id:K,type:"checkbox",role:"switch",inert:Y.inert,"aria-describedby":W,...N("input")}),o.jsxs(xe,{"aria-hidden":"true",component:"span",mod:{error:E,"label-position":C,"without-labels":!p&&!f},...N("track"),children:[o.jsx(xe,{component:"span",mod:{"reduce-motion":!0,"with-thumb-indicator":I&&!A},...N("thumb"),children:A}),o.jsx("span",{...N("trackLabel"),children:V?p:f})]})]})});Hy.classes={...v9,...Uz};Hy.varsResolver=y9;Hy.displayName="@mantine/core/Switch";Hy.Group=rR;const[Zre,Jre]=rs("Table component was not found in the tree");var qy={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 ese(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 Qf(t,e){const n=`Table${t.charAt(0).toUpperCase()}${t.slice(1)}`,i=Pe(r=>{const s=we(n,{},r),{classNames:a,className:l,style:u,styles:d,...f}=s,p=Jre();return o.jsx(xe,{component:t,...ese(p,e),...p.getStyles(t,{className:l,classNames:a,style:u,styles:d,props:s}),...f})});return i.displayName=`@mantine/core/${n}`,i.classes=qy,i}const kO=Qf("th",{columnBorder:!0}),x9=Qf("td",{columnBorder:!0}),NA=Qf("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),b9=Qf("thead",{stickyHeader:!0}),A9=Qf("tbody"),w9=Qf("tfoot"),S9=Qf("caption",{captionSide:!0}),tse={type:"scrollarea"},j9=(t,{minWidth:e,maxHeight:n,type:i})=>({scrollContainer:{"--table-min-width":ge(e),"--table-max-height":ge(n),"--table-overflow":i==="native"?"auto":void 0}}),ES=Pe(t=>{const e=we("TableScrollContainer",tse,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,children:u,minWidth:d,maxHeight:f,type:p,scrollAreaProps:m,attributes:v,...y}=e,b=gt({name:"TableScrollContainer",classes:qy,props:e,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:v,vars:l,varsResolver:j9,rootSelector:"scrollContainer"});return o.jsx(xe,{component:p==="scrollarea"?Co:"div",...p==="scrollarea"?f?{offsetScrollbars:"xy",...m}:{offsetScrollbars:"x",...m}:{},...b("scrollContainer"),...y,children:o.jsx("div",{...b("scrollContainerInner"),children:u})})});ES.classes=qy;ES.varsResolver=j9;ES.displayName="@mantine/core/TableScrollContainer";function sR({data:t}){return o.jsxs(o.Fragment,{children:[t.caption&&o.jsx(S9,{children:t.caption}),t.head&&o.jsx(b9,{children:o.jsx(NA,{children:t.head.map((e,n)=>o.jsx(kO,{children:e},n))})}),t.body&&o.jsx(A9,{children:t.body.map((e,n)=>o.jsx(NA,{children:e.map((i,r)=>o.jsx(x9,{children:i},r))},n))}),t.foot&&o.jsx(w9,{children:o.jsx(NA,{children:t.foot.map((e,n)=>o.jsx(kO,{children:e},n))})})]})}sR.displayName="@mantine/core/TableDataRenderer";const nse={withRowBorders:!0,verticalSpacing:7},C9=(t,{layout:e,captionSide:n,horizontalSpacing:i,verticalSpacing:r,borderColor:s,stripedColor:a,highlightOnHoverColor:l,striped:u,highlightOnHover:d,stickyHeaderOffset:f,stickyHeader:p})=>({table:{"--table-layout":e,"--table-caption-side":n,"--table-horizontal-spacing":ns(i),"--table-vertical-spacing":ns(r),"--table-border-color":s?Oi(s,t):void 0,"--table-striped-color":u&&a?Oi(a,t):void 0,"--table-highlight-on-hover-color":d&&l?Oi(l,t):void 0,"--table-sticky-header-offset":p?ge(f):void 0}}),le=Pe(t=>{const e=we("Table",nse,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,horizontalSpacing:u,verticalSpacing:d,captionSide:f,stripedColor:p,highlightOnHoverColor:m,striped:v,highlightOnHover:y,withColumnBorders:b,withRowBorders:A,withTableBorder:w,borderColor:S,layout:j,data:C,children:k,stickyHeader:E,stickyHeaderOffset:M,mod:R,tabularNums:D,attributes:F,...I}=e,Q=gt({name:"Table",props:e,className:i,style:r,classes:qy,classNames:n,styles:s,unstyled:a,attributes:F,rootSelector:"table",vars:l,varsResolver:C9});return o.jsx(Zre,{value:{getStyles:Q,stickyHeader:E,striped:v===!0?"odd":v||void 0,highlightOnHover:y,withColumnBorders:b,withRowBorders:A,captionSide:f||"bottom"},children:o.jsx(xe,{component:"table",mod:[{"data-with-table-border":w,"data-tabular-nums":D},R],...Q("table"),...I,children:k||!!C&&o.jsx(sR,{data:C})})})});le.classes=qy;le.varsResolver=C9;le.displayName="@mantine/core/Table";le.Td=x9;le.Th=kO;le.Tr=NA;le.Thead=b9;le.Tbody=A9;le.Tfoot=w9;le.Caption=S9;le.ScrollContainer=ES;le.DataRenderer=sR;const[ise,oR]=rs("Tabs component was not found in the tree");var Qy={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 aR=Pe(t=>{const e=we("TabsList",null,t),{children:n,className:i,grow:r,justify:s,classNames:a,styles:l,style:u,mod:d,...f}=e,p=oR();return o.jsx(xe,{...p.getStyles("list",{className:i,style:u,classNames:a,styles:l,props:e,variant:p.variant}),role:"tablist",variant:p.variant,mod:[{grow:r,orientation:p.orientation,placement:p.orientation==="vertical"&&p.placement,inverted:p.inverted},d],"aria-orientation":p.orientation,__vars:{"--tabs-justify":s},...f,children:n})});aR.classes=Qy;aR.displayName="@mantine/core/TabsList";const lR=Pe(t=>{const e=we("TabsPanel",null,t),{children:n,className:i,value:r,classNames:s,styles:a,style:l,mod:u,keepMounted:d,...f}=e,p=wy(),m=oR();T.useEffect(()=>(m.setMountedPanel(r,!0),()=>{m.setMountedPanel(r,!1)}),[r]);const v=m.value===r,y=m.keepMounted||d,b=m.keepMountedMode!=="display-none",A=y&&b&&p!=="test"?o.jsx(T.Activity,{mode:v?"visible":"hidden",children:n}):y||v?n:null;return o.jsx(xe,{...m.getStyles("panel",{className:i,classNames:s,styles:a,style:[l,v?void 0:{display:"none"}],props:e}),mod:[{orientation:m.orientation},u],role:"tabpanel",id:m.getPanelId(r),"aria-labelledby":m.getTabId(r),...f,children:A})});lR.classes=Qy;lR.displayName="@mantine/core/TabsPanel";const cR=Pe(t=>{const e=we("TabsTab",null,t),{className:n,children:i,rightSection:r,leftSection:s,value:a,onClick:l,onKeyDown:u,disabled:d,color:f,style:p,classNames:m,styles:v,vars:y,mod:b,tabIndex:A,...w}=e,S=Ar(),{dir:j}=vc(),C=oR(),k=a===C.value,E=R=>{C.onChange(C.allowTabDeactivation&&a===C.value?null:a),l==null||l(R)},M={classNames:m,styles:v,props:e};return o.jsxs(Fi,{...C.getStyles("tab",{className:n,style:p,variant:C.variant,...M}),disabled:d,unstyled:C.unstyled,variant:C.variant,mod:[{active:k,disabled:d,orientation:C.orientation,inverted:C.inverted,placement:C.orientation==="vertical"&&C.placement},b],role:"tab",id:C.getTabId(a),"aria-selected":k,tabIndex:A!==void 0?A:k||C.value===null?0:-1,"aria-controls":C.mountedPanels.current.has(a)?C.getPanelId(a):void 0,onClick:E,__vars:{"--tabs-color":f?Oi(f,S):void 0},onKeyDown:yy({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:C.activateTabWithKeyboard,loop:C.loop,orientation:C.orientation||"horizontal",dir:j,onKeyDown:u}),...w,children:[s&&o.jsx("span",{...C.getStyles("tabSection",M),"data-position":"left",children:s}),i&&o.jsx("span",{...C.getStyles("tabLabel",M),children:i}),r&&o.jsx("span",{...C.getStyles("tabSection",M),"data-position":"right",children:r})]})});cR.classes=Qy;cR.displayName="@mantine/core/TabsTab";const R4="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",rse={keepMounted:!0,keepMountedMode:"activity",orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,variant:"default",placement:"left"},_9=(t,{radius:e,color:n,autoContrast:i})=>({root:{"--tabs-radius":ai(e),"--tabs-color":Oi(n,t),"--tabs-text-color":hg(i,t)?ju({color:n,theme:t,autoContrast:i}):void 0}}),vo=Pe(t=>{const e=we("Tabs",rse,t),{defaultValue:n,value:i,onChange:r,orientation:s,children:a,loop:l,id:u,activateTabWithKeyboard:d,allowTabDeactivation:f,variant:p,color:m,radius:v,inverted:y,placement:b,keepMounted:A,keepMountedMode:w,classNames:S,styles:j,unstyled:C,className:k,style:E,vars:M,autoContrast:R,mod:D,attributes:F,...I}=e,Q=zr(u),G=T.useRef(new Set),L=k8(),q=T.useCallback((K,W)=>{const z=G.current;W&&!z.has(K)?(z.add(K),L()):!W&&z.has(K)&&(z.delete(K),L())},[]),[N,P]=hr({value:i,defaultValue:n,finalValue:null,onChange:r}),Y=gt({name:"Tabs",props:e,classes:Qy,className:k,style:E,classNames:S,styles:j,unstyled:C,attributes:F,vars:M,varsResolver:_9});return o.jsx(ise,{value:{placement:b,value:N,orientation:s,id:Q,loop:l,activateTabWithKeyboard:d,getTabId:f1(`${Q}-tab`,R4),getPanelId:f1(`${Q}-panel`,R4),onChange:P,allowTabDeactivation:f,variant:p,color:m,radius:v,inverted:y,keepMounted:A,keepMountedMode:w,unstyled:C,getStyles:Y,mountedPanels:G,setMountedPanel:q},children:o.jsx(xe,{id:Q,variant:p,mod:[{orientation:s,inverted:s==="horizontal"&&y,placement:s==="vertical"&&b},D],...Y("root"),...I,children:a})})});vo.classes=Qy;vo.varsResolver=_9;vo.displayName="@mantine/core/Tabs";vo.Tab=cR;vo.Panel=lR;vo.List=aR;const yc=Pe(t=>o.jsx(Fs,{component:"input",...we(["Input","InputWrapper","TextInput"],null,t),__staticSelector:"TextInput"}));yc.classes=Fs.classes;yc.displayName="@mantine/core/TextInput";/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */var sse={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.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ot=(t,e,n,i)=>{const r=T.forwardRef(({color:s="currentColor",size:a=24,stroke:l=2,title:u,className:d,children:f,...p},m)=>T.createElement("svg",{ref:m,...sse[t],width:a,height:a,className:["tabler-icon",`tabler-icon-${e}`,d].join(" "),...t==="filled"?{fill:s}:{strokeWidth:l,stroke:s},...p},[u&&T.createElement("title",{key:"svg-title"},u),...i.map(([v,y])=>T.createElement(v,y)),...Array.isArray(f)?f:[f]]));return r.displayName=`${n}`,r};/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const ose=[["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"}]],ase=Ot("outline","adjustments-horizontal","AdjustmentsHorizontal",ose);/**
 * @license @tabler/icons-react v3.45.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:"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"}]],cse=Ot("outline","alert-circle","AlertCircle",lse);/**
 * @license @tabler/icons-react v3.45.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 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"}]],Fr=Ot("outline","alert-triangle","AlertTriangle",use);/**
 * @license @tabler/icons-react v3.45.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:"M4 6l16 0",key:"svg-0"}],["path",{d:"M4 12l16 0",key:"svg-1"}],["path",{d:"M4 18l12 0",key:"svg-2"}]],dse=Ot("outline","align-justified","AlignJustified",hse);/**
 * @license @tabler/icons-react v3.45.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:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 13l-6 6",key:"svg-1"}],["path",{d:"M6 13l6 6",key:"svg-2"}]],D4=Ot("outline","arrow-down","ArrowDown",fse);/**
 * @license @tabler/icons-react v3.45.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:"M5 12l14 0",key:"svg-0"}],["path",{d:"M5 12l6 6",key:"svg-1"}],["path",{d:"M5 12l6 -6",key:"svg-2"}]],mse=Ot("outline","arrow-left","ArrowLeft",pse);/**
 * @license @tabler/icons-react v3.45.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:"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"}]],vse=Ot("outline","bell-off","BellOff",gse);/**
 * @license @tabler/icons-react v3.45.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:"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"}]],uR=Ot("outline","bell","Bell",yse);/**
 * @license @tabler/icons-react v3.45.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:"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"}]],bse=Ot("outline","binary-tree","BinaryTree",xse);/**
 * @license @tabler/icons-react v3.45.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:"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"}]],wse=Ot("outline","book","Book",Ase);/**
 * @license @tabler/icons-react v3.45.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:"M4 19l16 0",key:"svg-0"}],["path",{d:"M4 15l4 -6l4 2l4 -5l4 4",key:"svg-1"}]],jse=Ot("outline","chart-line","ChartLine",Sse);/**
 * @license @tabler/icons-react v3.45.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:"M5 12l5 5l10 -10",key:"svg-0"}]],Ym=Ot("outline","check","Check",Cse);/**
 * @license @tabler/icons-react v3.45.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:"M6 9l6 6l6 -6",key:"svg-0"}]],Rv=Ot("outline","chevron-down","ChevronDown",_se);/**
 * @license @tabler/icons-react v3.45.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:"M15 6l-6 6l6 6",key:"svg-0"}]],Tse=Ot("outline","chevron-left","ChevronLeft",kse);/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ose=[["path",{d:"M9 6l6 6l-6 6",key:"svg-0"}]],k9=Ot("outline","chevron-right","ChevronRight",Ose);/**
 * @license @tabler/icons-react v3.45.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:"M6 15l6 -6l6 6",key:"svg-0"}]],hR=Ot("outline","chevron-up","ChevronUp",Ese);/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Mse=[["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"}]],Rse=Ot("outline","circle-minus","CircleMinus",Mse);/**
 * @license @tabler/icons-react v3.45.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"}]],Nse=Ot("outline","circle-plus","CirclePlus",Dse);/**
 * @license @tabler/icons-react v3.45.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:"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"}]],Bse=Ot("outline","clock-pause","ClockPause",Ise);/**
 * @license @tabler/icons-react v3.45.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:"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"}]],Pse=Ot("outline","clock-play","ClockPlay",Lse);/**
 * @license @tabler/icons-react v3.45.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 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"}]],$se=Ot("outline","cloud-data-connection","CloudDataConnection",Fse);/**
 * @license @tabler/icons-react v3.45.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:"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"}]],T9=Ot("outline","code-plus","CodePlus",zse);/**
 * @license @tabler/icons-react v3.45.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:"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"}]],Yy=Ot("outline","copy","Copy",Hse);/**
 * @license @tabler/icons-react v3.45.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:"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"}]],Qse=Ot("outline","database","Database",qse);/**
 * @license @tabler/icons-react v3.45.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:"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"}]],Wse=Ot("outline","device-desktop-analytics","DeviceDesktopAnalytics",Yse);/**
 * @license @tabler/icons-react v3.45.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:"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"}]],Vse=Ot("outline","dots-vertical","DotsVertical",Use);/**
 * @license @tabler/icons-react v3.45.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:"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"}]],Xse=Ot("outline","flag","Flag",Gse);/**
 * @license @tabler/icons-react v3.45.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:"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"}]],Zse=Ot("outline","graph","Graph",Kse);/**
 * @license @tabler/icons-react v3.45.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:"M7 10h2l2 3l2 -6l1 3h3",key:"svg-4"}]],O9=Ot("outline","heart-rate-monitor","HeartRateMonitor",Jse);/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const eoe=[["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"}]],TO=Ot("outline","hourglass","Hourglass",eoe);/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const toe=[["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"}]],oi=Ot("outline","info-circle","InfoCircle",toe);/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const noe=[["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"}]],E9=Ot("outline","layout-navbar-collapse","LayoutNavbarCollapse",noe);/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const ioe=[["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"}]],M9=Ot("outline","layout-navbar-expand","LayoutNavbarExpand",ioe);/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const roe=[["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"}]],soe=Ot("outline","message-exclamation","MessageExclamation",roe);/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const ooe=[["path",{d:"M5 12l14 0",key:"svg-0"}]],aoe=Ot("outline","minus","Minus",ooe);/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const loe=[["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"}]],coe=Ot("outline","network-off","NetworkOff",loe);/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const uoe=[["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"}]],hoe=Ot("outline","plug-connected-x","PlugConnectedX",uoe);/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const doe=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]],R9=Ot("outline","plus","Plus",doe);/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const foe=[["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"}]],OO=Ot("outline","refresh","Refresh",foe);/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const poe=[["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"}]],D9=Ot("outline","repeat","Repeat",poe);/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const moe=[["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"}]],N9=Ot("outline","replace","Replace",moe);/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const goe=[["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"}]],voe=Ot("outline","run","Run",goe);/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const yoe=[["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"}]],yd=Ot("outline","search","Search",yoe);/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const xoe=[["path",{d:"M8 9l4 -4l4 4",key:"svg-0"}],["path",{d:"M16 15l-4 4l-4 -4",key:"svg-1"}]],boe=Ot("outline","selector","Selector",xoe);/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Aoe=[["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"}]],woe=Ot("outline","server-cog","ServerCog",Aoe);/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Soe=[["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"}]],joe=Ot("outline","server","Server",Soe);/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Coe=[["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"}]],_oe=Ot("outline","settings","Settings",Coe);/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const koe=[["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"}]],Toe=Ot("outline","spy","Spy",koe);/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ooe=[["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"}]],I9=Ot("outline","table","Table",Ooe);/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Eoe=[["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"}]],Moe=Ot("outline","tags","Tags",Eoe);/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Roe=[["path",{d:"M5 7l5 5l-5 5",key:"svg-0"}],["path",{d:"M12 19l7 0",key:"svg-1"}]],Doe=Ot("outline","terminal","Terminal",Roe);/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Noe=[["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"}]],Ioe=Ot("outline","timeline","Timeline",Noe);/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Boe=[["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"}]],EO=Ot("outline","trash","Trash",Boe);/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Loe=[["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"}]],Poe=Ot("outline","wall","Wall",Loe);/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Foe=[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]],$oe=Ot("outline","x","X",Foe);/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const zoe=[["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"}]],Hoe=Ot("outline","zoom-code","ZoomCode",zoe);/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const qoe=[["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"}]],Qoe=Ot("filled","bell-filled","BellFilled",qoe);/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Yoe=[["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"}]],Woe=Ot("filled","brightness-filled","BrightnessFilled",Yoe);/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Uoe=[["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"}]],Voe=Ot("filled","chart-area-filled","ChartAreaFilled",Uoe);/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Goe=[["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"}]],Xoe=Ot("filled","moon-filled","MoonFilled",Goe);/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Koe=[["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"}]],vk=Ot("filled","point-filled","PointFilled",Koe);/**
 * @license @tabler/icons-react v3.45.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Zoe=[["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"}]],Joe=Ot("filled","sun-filled","SunFilled",Zoe);/**
 * react-router v7.18.1
 *
 * 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 dR=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,B9=/^[\\/]{2}/;function eae(t,e){return e+t.replace(/\\/g,"/")}var N4="popstate";function I4(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function tae(t={}){function e(i,r){var d;let s=(d=r.state)==null?void 0:d.masked,{pathname:a,search:l,hash:u}=s||i.location;return MO("",{pathname:a,search:l,hash:u},r.state&&r.state.usr||null,r.state&&r.state.key||"default",s?{pathname:i.location.pathname,search:i.location.search,hash:i.location.hash}:void 0)}function n(i,r){return typeof r=="string"?r:Dv(r)}return iae(e,n,null,t)}function Qi(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function yl(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 B4(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 MO(t,e,n=null,i,r){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?Cg(e):e,state:n,key:e&&e.key||i||nae(),mask:r}}function Dv({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 Cg(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substring(n),t=t.substring(0,n));let i=t.indexOf("?");i>=0&&(e.search=t.substring(i),t=t.substring(0,i)),t&&(e.pathname=t)}return e}function iae(t,e,n,i={}){let{window:r=document.defaultView,v5Compat:s=!1}=i,a=r.history,l="POP",u=null,d=f();d==null&&(d=0,a.replaceState({...a.state,idx:d},""));function f(){return(a.state||{idx:null}).idx}function p(){l="POP";let A=f(),w=A==null?null:A-d;d=A,u&&u({action:l,location:b.location,delta:w})}function m(A,w){l="PUSH";let S=I4(A)?A:MO(b.location,A,w);d=f()+1;let j=B4(S,d),C=b.createHref(S.mask||S);try{a.pushState(j,"",C)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;r.location.assign(C)}s&&u&&u({action:l,location:b.location,delta:1})}function v(A,w){l="REPLACE";let S=I4(A)?A:MO(b.location,A,w);d=f();let j=B4(S,d),C=b.createHref(S.mask||S);a.replaceState(j,"",C),s&&u&&u({action:l,location:b.location,delta:0})}function y(A){return rae(r,A)}let b={get action(){return l},get location(){return t(r,a)},listen(A){if(u)throw new Error("A history only accepts one active listener");return r.addEventListener(N4,p),u=A,()=>{r.removeEventListener(N4,p),u=null}},createHref(A){return e(r,A)},createURL:y,encodeLocation(A){let w=y(A);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:m,replace:v,go(A){return a.go(A)}};return b}function rae(t,e,n=!1){let i="http://localhost";t&&(i=t.location.origin!=="null"?t.location.origin:t.location.href),Qi(i,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Dv(e);return r=r.replace(/ $/,"%20"),!n&&B9.test(r)&&(r=i+r),new URL(r,i)}function L9(t,e,n="/"){return sae(t,e,n,!1)}function sae(t,e,n,i,r){let s=typeof e=="string"?Cg(e):e,a=gu(s.pathname||"/",n);if(a==null)return null;let l=oae(t),u=null,d=vae(a);for(let f=0;u==null&&f<l.length;++f)u=gae(l[f],d,i);return u}function oae(t){let e=P9(t);return aae(e),e}function P9(t,e=[],n=[],i="",r=!1){let s=(a,l,u=r,d)=>{let f={relativePath:d===void 0?a.path||"":d,caseSensitive:a.caseSensitive===!0,childrenIndex:l,route:a};if(f.relativePath.startsWith("/")){if(!f.relativePath.startsWith(i)&&u)return;Qi(f.relativePath.startsWith(i),`Absolute route path "${f.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(i.length)}let p=pl([i,f.relativePath]),m=n.concat(f);a.children&&a.children.length>0&&(Qi(a.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),P9(a.children,e,m,p,u)),!(a.path==null&&!a.index)&&e.push({path:p,score:pae(p,a.index),routesMeta:m.map((v,y)=>{let[b,A]=z9(v.relativePath,v.caseSensitive,y===m.length-1);return{...v,matcher:b,compiledParams:A}})})};return t.forEach((a,l)=>{var u;if(a.path===""||!((u=a.path)!=null&&u.includes("?")))s(a,l);else for(let d of F9(a.path))s(a,l,!0,d)}),e}function F9(t){let e=t.split("/");if(e.length===0)return[];let[n,...i]=e,r=n.endsWith("?"),s=n.replace(/\?$/,"");if(i.length===0)return r?[s,""]:[s];let a=F9(i.join("/")),l=[];return l.push(...a.map(u=>u===""?s:[s,u].join("/"))),r&&l.push(...a),l.map(u=>t.startsWith("/")&&u===""?"/":u)}function aae(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:mae(e.routesMeta.map(i=>i.childrenIndex),n.routesMeta.map(i=>i.childrenIndex)))}var lae=/^:[\w-]+$/,cae=3,uae=2,hae=1,dae=10,fae=-2,L4=t=>t==="*";function pae(t,e){let n=t.split("/"),i=n.length;return n.some(L4)&&(i+=fae),e&&(i+=uae),n.filter(r=>!L4(r)).reduce((r,s)=>r+(lae.test(s)?cae:s===""?hae:dae),i)}function mae(t,e){return t.length===e.length&&t.slice(0,-1).every((i,r)=>i===e[r])?t[t.length-1]-e[e.length-1]:0}function gae(t,e,n=!1){let{routesMeta:i}=t,r={},s="/",a=[];for(let l=0;l<i.length;++l){let u=i[l],d=l===i.length-1,f=s==="/"?e:e.slice(s.length)||"/",p={path:u.relativePath,caseSensitive:u.caseSensitive,end:d},m=u.matcher&&u.compiledParams?$9(p,f,u.matcher,u.compiledParams):C1(p,f),v=u.route;if(!m&&d&&n&&!i[i.length-1].route.index&&(m=C1({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},f)),!m)return null;Object.assign(r,m.params),a.push({params:r,pathname:pl([s,m.pathname]),pathnameBase:bae(pl([s,m.pathnameBase])),route:v}),m.pathnameBase!=="/"&&(s=pl([s,m.pathnameBase]))}return a}function C1(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,i]=z9(t.path,t.caseSensitive,t.end);return $9(t,e,n,i)}function $9(t,e,n,i){let r=e.match(n);if(!r)return null;let s=r[0],a=s.replace(/(.)\/+$/,"$1"),l=r.slice(1);return{params:i.reduce((d,{paramName:f,isOptional:p},m)=>{if(f==="*"){let y=l[m]||"";a=s.slice(0,s.length-y.length).replace(/(.)\/+$/,"$1")}const v=l[m];return p&&!v?d[f]=void 0:d[f]=(v||"").replace(/%2F/g,"/"),d},{}),pathname:s,pathnameBase:a,pattern:t}}function z9(t,e=!1,n=!0){yl(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 i=[],r="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,l,u,d,f)=>{if(i.push({paramName:l,isOptional:u!=null}),u){let p=f.charAt(d+a.length);return p&&p!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(i.push({paramName:"*"}),r+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":t!==""&&t!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,e?void 0:"i"),i]}function vae(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return yl(!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 gu(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,i=t.charAt(n);return i&&i!=="/"?null:t.slice(n)||"/"}function yae(t,e="/"){let{pathname:n,search:i="",hash:r=""}=typeof t=="string"?Cg(t):t,s;return n?(n=H9(n),n.startsWith("/")?s=P4(n.substring(1),"/"):s=P4(n,e)):s=e,{pathname:s,search:Aae(i),hash:wae(r)}}function P4(t,e){let n=_1(e).split("/");return t.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function yk(t,e,n,i){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(i)}].  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 xae(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function fR(t){let e=xae(t);return e.map((n,i)=>i===e.length-1?n.pathname:n.pathnameBase)}function MS(t,e,n,i=!1){let r;typeof t=="string"?r=Cg(t):(r={...t},Qi(!r.pathname||!r.pathname.includes("?"),yk("?","pathname","search",r)),Qi(!r.pathname||!r.pathname.includes("#"),yk("#","pathname","hash",r)),Qi(!r.search||!r.search.includes("#"),yk("#","search","hash",r)));let s=t===""||r.pathname==="",a=s?"/":r.pathname,l;if(a==null)l=n;else{let p=e.length-1;if(!i&&a.startsWith("..")){let m=a.split("/");for(;m[0]==="..";)m.shift(),p-=1;r.pathname=m.join("/")}l=p>=0?e[p]:"/"}let u=yae(r,l),d=a&&a!=="/"&&a.endsWith("/"),f=(s||a===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(d||f)&&(u.pathname+="/"),u}var H9=t=>t.replace(/[\\/]{2,}/g,"/"),pl=t=>H9(t.join("/")),_1=t=>t.replace(/\/+$/,""),bae=t=>_1(t).replace(/^\/*/,"/"),Aae=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,wae=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,Sae=class{constructor(t,e,n,i=!1){this.status=t,this.statusText=e||"",this.internal=i,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function jae(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function Cae(t){let e=t.map(n=>n.route.path).filter(Boolean);return pl(e)||"/"}var q9=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Q9(t,e){let n=t;if(typeof n!="string"||!dR.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let i=n,r=!1;if(q9)try{let s=new URL(window.location.href),a=B9.test(n)?new URL(eae(n,s.protocol)):new URL(n),l=gu(a.pathname,e);a.origin===s.origin&&l!=null?n=l+a.search+a.hash:r=!0}catch{yl(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:r,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Y9=["POST","PUT","PATCH","DELETE"];new Set(Y9);var _ae=["GET",...Y9];new Set(_ae);var kae=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function Tae(t){try{return kae.includes(new URL(t).protocol)}catch{return!1}}var Yf=T.createContext(null);Yf.displayName="DataRouter";var RS=T.createContext(null);RS.displayName="DataRouterState";var W9=T.createContext(!1);function Oae(){return T.useContext(W9)}var U9=T.createContext({isTransitioning:!1});U9.displayName="ViewTransition";var Eae=T.createContext(new Map);Eae.displayName="Fetchers";var Mae=T.createContext(null);Mae.displayName="Await";var Oo=T.createContext(null);Oo.displayName="Navigation";var Wy=T.createContext(null);Wy.displayName="Location";var xc=T.createContext({outlet:null,matches:[],isDataRoute:!1});xc.displayName="Route";var pR=T.createContext(null);pR.displayName="RouteError";var V9="REACT_ROUTER_ERROR",Rae="REDIRECT",Dae="ROUTE_ERROR_RESPONSE";function Nae(t){if(t.startsWith(`${V9}:${Rae}:{`))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 Iae(t){if(t.startsWith(`${V9}:${Dae}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new Sae(e.status,e.statusText,e.data)}catch{}}function Bae(t,{relative:e}={}){Qi(_g(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:i}=T.useContext(Oo),{hash:r,pathname:s,search:a}=Uy(t,{relative:e}),l=s;return n!=="/"&&(l=s==="/"?n:pl([n,s])),i.createHref({pathname:l,search:a,hash:r})}function _g(){return T.useContext(Wy)!=null}function Ia(){return Qi(_g(),"useLocation() may be used only in the context of a <Router> component."),T.useContext(Wy).location}var G9="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function X9(t){T.useContext(Oo).static||T.useLayoutEffect(t)}function mR(){let{isDataRoute:t}=T.useContext(xc);return t?Gae():Lae()}function Lae(){Qi(_g(),"useNavigate() may be used only in the context of a <Router> component.");let t=T.useContext(Yf),{basename:e,navigator:n}=T.useContext(Oo),{matches:i}=T.useContext(xc),{pathname:r}=Ia(),s=JSON.stringify(fR(i)),a=T.useRef(!1);return X9(()=>{a.current=!0}),T.useCallback((u,d={})=>{if(yl(a.current,G9),!a.current)return;if(typeof u=="number"){n.go(u);return}let f=MS(u,JSON.parse(s),r,d.relative==="path");t==null&&e!=="/"&&(f.pathname=f.pathname==="/"?e:pl([e,f.pathname])),(d.replace?n.replace:n.push)(f,d.state,d)},[e,n,s,r,t])}T.createContext(null);function Uy(t,{relative:e}={}){let{matches:n}=T.useContext(xc),{pathname:i}=Ia(),r=JSON.stringify(fR(n));return T.useMemo(()=>MS(t,JSON.parse(r),i,e==="path"),[t,r,i,e])}function Pae(t,e){return K9(t,e)}function K9(t,e,n){var A;Qi(_g(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=T.useContext(Oo),{matches:r}=T.useContext(xc),s=r[r.length-1],a=s?s.params:{},l=s?s.pathname:"/",u=s?s.pathnameBase:"/",d=s&&s.route;{let w=d&&d.path||"";J9(l,!d||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=Ia(),p;if(e){let w=typeof e=="string"?Cg(e):e;Qi(u==="/"||((A=w.pathname)==null?void 0:A.startsWith(u)),`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 "${u}" but pathname "${w.pathname}" was given in the \`location\` prop.`),p=w}else p=f;let m=p.pathname||"/",v=m;if(u!=="/"){let w=u.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})):L9(t,{pathname:v});yl(d||y!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),yl(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 b=qae(y&&y.map(w=>Object.assign({},w,{params:Object.assign({},a,w.params),pathname:pl([u,i.encodeLocation?i.encodeLocation(w.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?u:pl([u,i.encodeLocation?i.encodeLocation(w.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathnameBase])})),r,n);return e&&b?T.createElement(Wy.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...p},navigationType:"POP"}},b):b}function Fae(){let t=Vae(),e=jae(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:i},s={padding:"2px 4px",backgroundColor:i},a=null;return console.error("Error handled by React Router default ErrorBoundary:",t),a=T.createElement(T.Fragment,null,T.createElement("p",null,"💿 Hey developer 👋"),T.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",T.createElement("code",{style:s},"ErrorBoundary")," or"," ",T.createElement("code",{style:s},"errorElement")," prop on your route.")),T.createElement(T.Fragment,null,T.createElement("h2",null,"Unexpected Application Error!"),T.createElement("h3",{style:{fontStyle:"italic"}},e),n?T.createElement("pre",{style:r},n):null,a)}var $ae=T.createElement(Fae,null),Z9=class extends T.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=Iae(t.digest);n&&(t=n)}let e=t!==void 0?T.createElement(xc.Provider,{value:this.props.routeContext},T.createElement(pR.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?T.createElement(zae,{error:t},e):e}};Z9.contextType=W9;var xk=new WeakMap;function zae({children:t,error:e}){let{basename:n}=T.useContext(Oo);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let i=Nae(e.digest);if(i){let r=xk.get(e);if(r)throw r;let s=Q9(i.location,n),a=s.absoluteURL||s.to;if(Tae(a))throw new Error("Invalid redirect location");if(q9&&!xk.get(e))if(s.isExternal||i.reloadDocument)window.location.href=a;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:i.replace}));throw xk.set(e,l),l}return T.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a}`})}}return t}function Hae({routeContext:t,match:e,children:n}){let i=T.useContext(Yf);return i&&i.static&&i.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=e.route.id),T.createElement(xc.Provider,{value:t},n)}function qae(t,e=[],n){let i=n==null?void 0:n.state;if(t==null){if(!i)return null;if(i.errors)t=i.matches;else if(e.length===0&&!i.initialized&&i.matches.length>0)t=i.matches;else return null}let r=t,s=i==null?void 0:i.errors;if(s!=null){let f=r.findIndex(p=>p.route.id&&(s==null?void 0:s[p.route.id])!==void 0);Qi(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),r=r.slice(0,Math.min(r.length,f+1))}let a=!1,l=-1;if(n&&i){a=i.renderFallback;for(let f=0;f<r.length;f++){let p=r[f];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(l=f),p.route.id){let{loaderData:m,errors:v}=i,y=p.route.loader&&!m.hasOwnProperty(p.route.id)&&(!v||v[p.route.id]===void 0);if(p.route.lazy||y){n.isStatic&&(a=!0),l>=0?r=r.slice(0,l+1):r=[r[0]];break}}}}let u=n==null?void 0:n.onError,d=i&&u?(f,p)=>{var m,v;u(f,{location:i.location,params:((v=(m=i.matches)==null?void 0:m[0])==null?void 0:v.params)??{},pattern:Cae(i.matches),errorInfo:p})}:void 0;return r.reduceRight((f,p,m)=>{let v,y=!1,b=null,A=null;i&&(v=s&&p.route.id?s[p.route.id]:void 0,b=p.route.errorElement||$ae,a&&(l<0&&m===0?(J9("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),y=!0,A=null):l===m&&(y=!0,A=p.route.hydrateFallbackElement||null)));let w=e.concat(r.slice(0,m+1)),S=()=>{let j;return v?j=b:y?j=A:p.route.Component?j=T.createElement(p.route.Component,null):p.route.element?j=p.route.element:j=f,T.createElement(Hae,{match:p,routeContext:{outlet:f,matches:w,isDataRoute:i!=null},children:j})};return i&&(p.route.ErrorBoundary||p.route.errorElement||m===0)?T.createElement(Z9,{location:i.location,revalidation:i.revalidation,component:b,error:v,children:S(),routeContext:{outlet:null,matches:w,isDataRoute:!0},onError:d}):S()},null)}function gR(t){return`${t} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function Qae(t){let e=T.useContext(Yf);return Qi(e,gR(t)),e}function Yae(t){let e=T.useContext(RS);return Qi(e,gR(t)),e}function Wae(t){let e=T.useContext(xc);return Qi(e,gR(t)),e}function vR(t){let e=Wae(t),n=e.matches[e.matches.length-1];return Qi(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function Uae(){return vR("useRouteId")}function Vae(){var i;let t=T.useContext(pR),e=Yae("useRouteError"),n=vR("useRouteError");return t!==void 0?t:(i=e.errors)==null?void 0:i[n]}function Gae(){let{router:t}=Qae("useNavigate"),e=vR("useNavigate"),n=T.useRef(!1);return X9(()=>{n.current=!0}),T.useCallback(async(r,s={})=>{yl(n.current,G9),n.current&&(typeof r=="number"?await t.navigate(r):await t.navigate(r,{fromRouteId:e,...s}))},[t,e])}var F4={};function J9(t,e,n){!e&&!F4[t]&&(F4[t]=!0,yl(!1,n))}T.memo(Xae);function Xae({routes:t,manifest:e,future:n,state:i,isStatic:r,onError:s}){return K9(t,void 0,{manifest:e,state:i,isStatic:r,onError:s})}function Kae({to:t,replace:e,state:n,relative:i}){Qi(_g(),"<Navigate> may be used only in the context of a <Router> component.");let{static:r}=T.useContext(Oo);yl(!r,"<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}=T.useContext(xc),{pathname:a}=Ia(),l=mR(),u=MS(t,fR(s),a,i==="path"),d=JSON.stringify(u);return T.useEffect(()=>{l(JSON.parse(d),{replace:e,state:n,relative:i})},[l,d,i,e,n]),null}function ph(t){Qi(!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 Zae({basename:t="/",children:e=null,location:n,navigationType:i="POP",navigator:r,static:s=!1,useTransitions:a}){Qi(!_g(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=t.replace(/^\/*/,"/"),u=T.useMemo(()=>({basename:l,navigator:r,static:s,useTransitions:a,future:{}}),[l,r,s,a]);typeof n=="string"&&(n=Cg(n));let{pathname:d="/",search:f="",hash:p="",state:m=null,key:v="default",mask:y}=n,b=T.useMemo(()=>{let A=gu(d,l);return A==null?null:{location:{pathname:A,search:f,hash:p,state:m,key:v,mask:y},navigationType:i}},[l,d,f,p,m,v,i,y]);return yl(b!=null,`<Router basename="${l}"> is not able to match the URL "${d}${f}${p}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:T.createElement(Oo.Provider,{value:u},T.createElement(Wy.Provider,{children:e,value:b}))}function $4({children:t,location:e}){return Pae(RO(t),e)}function RO(t,e=[]){let n=[];return T.Children.forEach(t,(i,r)=>{if(!T.isValidElement(i))return;let s=[...e,r];if(i.type===T.Fragment){n.push.apply(n,RO(i.props.children,s));return}Qi(i.type===ph,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Qi(!i.props.index||!i.props.children,"An index route cannot have child routes.");let a={id:i.props.id||s.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,middleware:i.props.middleware,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(a.children=RO(i.props.children,s)),n.push(a)}),n}var IA="get",BA="application/x-www-form-urlencoded";function DS(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function Jae(t){return DS(t)&&t.tagName.toLowerCase()==="button"}function ele(t){return DS(t)&&t.tagName.toLowerCase()==="form"}function tle(t){return DS(t)&&t.tagName.toLowerCase()==="input"}function nle(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function ile(t,e){return t.button===0&&(!e||e==="_self")&&!nle(t)}var Fb=null;function rle(){if(Fb===null)try{new FormData(document.createElement("form"),0),Fb=!1}catch{Fb=!0}return Fb}var sle=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function bk(t){return t!=null&&!sle.has(t)?(yl(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${BA}"`),null):t}function ole(t,e){let n,i,r,s,a;if(ele(t)){let l=t.getAttribute("action");i=l?gu(l,e):null,n=t.getAttribute("method")||IA,r=bk(t.getAttribute("enctype"))||BA,s=new FormData(t)}else if(Jae(t)||tle(t)&&(t.type==="submit"||t.type==="image")){let l=t.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=t.getAttribute("formaction")||l.getAttribute("action");if(i=u?gu(u,e):null,n=t.getAttribute("formmethod")||l.getAttribute("method")||IA,r=bk(t.getAttribute("formenctype"))||bk(l.getAttribute("enctype"))||BA,s=new FormData(l,t),!rle()){let{name:d,type:f,value:p}=t;if(f==="image"){let m=d?`${d}.`:"";s.append(`${m}x`,"0"),s.append(`${m}y`,"0")}else d&&s.append(d,p)}}else{if(DS(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=IA,i=null,r=BA,a=t}return s&&r==="text/plain"&&(a=s,s=void 0),{action:i,method:n.toLowerCase(),encType:r,formData:s,body:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function yR(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function eq(t,e,n,i){let r=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return n?r.pathname.endsWith("/")?r.pathname=`${r.pathname}_.${i}`:r.pathname=`${r.pathname}.${i}`:r.pathname==="/"?r.pathname=`_root.${i}`:e&&gu(r.pathname,e)==="/"?r.pathname=`${_1(e)}/_root.${i}`:r.pathname=`${_1(r.pathname)}.${i}`,r}async function ale(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 lle(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 cle(t,e,n){let i=await Promise.all(t.map(async r=>{let s=e.routes[r.route.id];if(s){let a=await ale(s,n);return a.links?a.links():[]}return[]}));return fle(i.flat(1).filter(lle).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function z4(t,e,n,i,r,s){let a=(u,d)=>n[d]?u.route.id!==n[d].route.id:!0,l=(u,d)=>{var f;return n[d].pathname!==u.pathname||((f=n[d].route.path)==null?void 0:f.endsWith("*"))&&n[d].params["*"]!==u.params["*"]};return s==="assets"?e.filter((u,d)=>a(u,d)||l(u,d)):s==="data"?e.filter((u,d)=>{var p;let f=i.routes[u.route.id];if(!f||!f.hasLoader)return!1;if(a(u,d)||l(u,d))return!0;if(u.route.shouldRevalidate){let m=u.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:((p=n[0])==null?void 0:p.params)||{},nextUrl:new URL(t,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function ule(t,e,{includeHydrateFallback:n}={}){return hle(t.map(i=>{let r=e.routes[i.route.id];if(!r)return[];let s=[r.module];return r.clientActionModule&&(s=s.concat(r.clientActionModule)),r.clientLoaderModule&&(s=s.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(s=s.concat(r.hydrateFallbackModule)),r.imports&&(s=s.concat(r.imports)),s}).flat(1))}function hle(t){return[...new Set(t)]}function dle(t){let e={},n=Object.keys(t).sort();for(let i of n)e[i]=t[i];return e}function fle(t,e){let n=new Set;return new Set(e),t.reduce((i,r)=>{let s=JSON.stringify(dle(r));return n.has(s)||(n.add(s),i.push({key:s,link:r})),i},[])}function xR(){let t=T.useContext(Yf);return yR(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function ple(){let t=T.useContext(RS);return yR(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var bR=T.createContext(void 0);bR.displayName="FrameworkContext";function NS(){let t=T.useContext(bR);return yR(t,"You must render this element inside a <HydratedRouter> element"),t}function mle(t,e){let n=T.useContext(bR),[i,r]=T.useState(!1),[s,a]=T.useState(!1),{onFocus:l,onBlur:u,onMouseEnter:d,onMouseLeave:f,onTouchStart:p}=e,m=T.useRef(null);T.useEffect(()=>{if(t==="render"&&a(!0),t==="viewport"){let b=w=>{w.forEach(S=>{a(S.isIntersecting)})},A=new IntersectionObserver(b,{threshold:.5});return m.current&&A.observe(m.current),()=>{A.disconnect()}}},[t]),T.useEffect(()=>{if(i){let b=setTimeout(()=>{a(!0)},100);return()=>{clearTimeout(b)}}},[i]);let v=()=>{r(!0)},y=()=>{r(!1),a(!1)};return n?t!=="intent"?[s,m,{}]:[s,m,{onFocus:E0(l,v),onBlur:E0(u,y),onMouseEnter:E0(d,v),onMouseLeave:E0(f,y),onTouchStart:E0(p,v)}]:[!1,m,{}]}function E0(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function gle({page:t,...e}){let n=Oae(),{nonce:i}=NS(),{router:r}=xR(),s=T.useMemo(()=>L9(r.routes,t,r.basename),[r.routes,t,r.basename]);return s?(e.nonce==null&&i&&(e={...e,nonce:i}),n?T.createElement(yle,{page:t,matches:s,...e}):T.createElement(xle,{page:t,matches:s,...e})):null}function vle(t){let{manifest:e,routeModules:n}=NS(),[i,r]=T.useState([]);return T.useEffect(()=>{let s=!1;return cle(t,e,n).then(a=>{s||r(a)}),()=>{s=!0}},[t,e,n]),i}function yle({page:t,matches:e,...n}){let i=Ia(),{future:r}=NS(),{basename:s}=xR(),a=T.useMemo(()=>{if(t===i.pathname+i.search+i.hash)return[];let l=eq(t,s,r.v8_trailingSlashAwareDataRequests,"rsc"),u=!1,d=[];for(let f of e)typeof f.route.shouldRevalidate=="function"?u=!0:d.push(f.route.id);return u&&d.length>0&&l.searchParams.set("_routes",d.join(",")),[l.pathname+l.search]},[s,r.v8_trailingSlashAwareDataRequests,t,i,e]);return T.createElement(T.Fragment,null,a.map(l=>T.createElement("link",{key:l,rel:"prefetch",as:"fetch",href:l,...n})))}function xle({page:t,matches:e,...n}){let i=Ia(),{future:r,manifest:s,routeModules:a}=NS(),{basename:l}=xR(),{loaderData:u,matches:d}=ple(),f=T.useMemo(()=>z4(t,e,d,s,i,"data"),[t,e,d,s,i]),p=T.useMemo(()=>z4(t,e,d,s,i,"assets"),[t,e,d,s,i]),m=T.useMemo(()=>{if(t===i.pathname+i.search+i.hash)return[];let b=new Set,A=!1;if(e.forEach(S=>{var C;let j=s.routes[S.route.id];!j||!j.hasLoader||(!f.some(k=>k.route.id===S.route.id)&&S.route.id in u&&((C=a[S.route.id])!=null&&C.shouldRevalidate)||j.hasClientLoader?A=!0:b.add(S.route.id))}),b.size===0)return[];let w=eq(t,l,r.v8_trailingSlashAwareDataRequests,"data");return A&&b.size>0&&w.searchParams.set("_routes",e.filter(S=>b.has(S.route.id)).map(S=>S.route.id).join(",")),[w.pathname+w.search]},[l,r.v8_trailingSlashAwareDataRequests,u,i,s,f,e,t,a]),v=T.useMemo(()=>ule(p,s),[p,s]),y=vle(p);return T.createElement(T.Fragment,null,m.map(b=>T.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...n})),v.map(b=>T.createElement("link",{key:b,rel:"modulepreload",href:b,...n})),y.map(({key:b,link:A})=>T.createElement("link",{key:b,nonce:n.nonce,...A,crossOrigin:A.crossOrigin??n.crossOrigin})))}function ble(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var Ale=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Ale&&(window.__reactRouterVersion="7.18.1")}catch{}function wle({basename:t,children:e,useTransitions:n,window:i}){let r=T.useRef();r.current==null&&(r.current=tae({window:i,v5Compat:!0}));let s=r.current,[a,l]=T.useState({action:s.action,location:s.location}),u=T.useCallback(d=>{n===!1?l(d):T.startTransition(()=>l(d))},[n]);return T.useLayoutEffect(()=>s.listen(u),[s,u]),T.createElement(Zae,{basename:t,children:e,location:a.location,navigationType:a.action,navigator:s,useTransitions:n})}var AR=T.forwardRef(function({onClick:e,discover:n="render",prefetch:i="none",relative:r,reloadDocument:s,replace:a,mask:l,state:u,target:d,to:f,preventScrollReset:p,viewTransition:m,defaultShouldRevalidate:v,...y},b){let{basename:A,navigator:w,useTransitions:S}=T.useContext(Oo),j=typeof f=="string"&&dR.test(f),C=Q9(f,A);f=C.to;let k=Bae(f,{relative:r}),E=Ia(),M=null;if(l){let q=MS(l,[],E.mask?E.mask.pathname:"/",!0);A!=="/"&&(q.pathname=q.pathname==="/"?A:pl([A,q.pathname])),M=w.createHref(q)}let[R,D,F]=mle(i,y),I=Cle(f,{replace:a,mask:l,state:u,target:d,preventScrollReset:p,relative:r,viewTransition:m,defaultShouldRevalidate:v,useTransitions:S});function Q(q){e&&e(q),q.defaultPrevented||I(q)}let G=!(C.isExternal||s),L=T.createElement("a",{...y,...F,href:(G?M:void 0)||C.absoluteURL||k,onClick:G?Q:e,ref:ble(b,D),target:d,"data-discover":!j&&n==="render"?"true":void 0});return R&&!j?T.createElement(T.Fragment,null,L,T.createElement(gle,{page:k})):L});AR.displayName="Link";var W0=T.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:i="",end:r=!1,style:s,to:a,viewTransition:l,children:u,...d},f){let p=Uy(a,{relative:d.relative}),m=Ia(),v=T.useContext(RS),{navigator:y,basename:b}=T.useContext(Oo),A=v!=null&&Ele(p)&&l===!0,w=y.encodeLocation?y.encodeLocation(p).pathname:p.pathname,S=m.pathname,j=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(S=S.toLowerCase(),j=j?j.toLowerCase():null,w=w.toLowerCase()),j&&b&&(j=gu(j,b)||j);const C=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let k=S===w||!r&&S.startsWith(w)&&S.charAt(C)==="/",E=j!=null&&(j===w||!r&&j.startsWith(w)&&j.charAt(w.length)==="/"),M={isActive:k,isPending:E,isTransitioning:A},R=k?e:void 0,D;typeof i=="function"?D=i(M):D=[i,k?"active":null,E?"pending":null,A?"transitioning":null].filter(Boolean).join(" ");let F=typeof s=="function"?s(M):s;return T.createElement(AR,{...d,"aria-current":R,className:D,ref:f,style:F,to:a,viewTransition:l},typeof u=="function"?u(M):u)});W0.displayName="NavLink";var Sle=T.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:i,replace:r,state:s,method:a=IA,action:l,onSubmit:u,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...v},y)=>{let{useTransitions:b}=T.useContext(Oo),A=Tle(),w=Ole(l,{relative:d}),S=a.toLowerCase()==="get"?"get":"post",j=typeof l=="string"&&dR.test(l),C=k=>{if(u&&u(k),k.defaultPrevented)return;k.preventDefault();let E=k.nativeEvent.submitter,M=(E==null?void 0:E.getAttribute("formmethod"))||a,R=()=>A(E||k.currentTarget,{fetcherKey:e,method:M,navigate:n,replace:r,state:s,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m});b&&n!==!1?T.startTransition(()=>R()):R()};return T.createElement("form",{ref:y,method:S,action:w,onSubmit:i?u:C,...v,"data-discover":!j&&t==="render"?"true":void 0})});Sle.displayName="Form";function jle(t){return`${t} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function tq(t){let e=T.useContext(Yf);return Qi(e,jle(t)),e}function Cle(t,{target:e,replace:n,mask:i,state:r,preventScrollReset:s,relative:a,viewTransition:l,defaultShouldRevalidate:u,useTransitions:d}={}){let f=mR(),p=Ia(),m=Uy(t,{relative:a});return T.useCallback(v=>{if(ile(v,e)){v.preventDefault();let y=n!==void 0?n:Dv(p)===Dv(m),b=()=>f(t,{replace:y,mask:i,state:r,preventScrollReset:s,relative:a,viewTransition:l,defaultShouldRevalidate:u});d?T.startTransition(()=>b()):b()}},[p,f,m,n,i,r,e,t,s,a,l,u,d])}var _le=0,kle=()=>`__${String(++_le)}__`;function Tle(){let{router:t}=tq("useSubmit"),{basename:e}=T.useContext(Oo),n=Uae(),i=t.fetch,r=t.navigate;return T.useCallback(async(s,a={})=>{let{action:l,method:u,encType:d,formData:f,body:p}=ole(s,e);if(a.navigate===!1){let m=a.fetcherKey||kle();await i(m,n,a.action||l,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:f,body:p,formMethod:a.method||u,formEncType:a.encType||d,flushSync:a.flushSync})}else await r(a.action||l,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:f,body:p,formMethod:a.method||u,formEncType:a.encType||d,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[i,r,e,n])}function Ole(t,{relative:e}={}){let{basename:n}=T.useContext(Oo),i=T.useContext(xc);Qi(i,"useFormAction must be used inside a RouteContext");let[r]=i.matches.slice(-1),s={...Uy(t||".",{relative:e})},a=Ia();if(t==null){s.search=a.search;let l=new URLSearchParams(s.search),u=l.getAll("index");if(u.some(f=>f==="")){l.delete("index"),u.filter(p=>p).forEach(p=>l.append("index",p));let f=l.toString();s.search=f?`?${f}`:""}}return(!t||t===".")&&r.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:pl([n,s.pathname])),Dv(s)}function Ele(t,{relative:e}={}){let n=T.useContext(U9);Qi(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=tq("useViewTransitionState"),r=Uy(t,{relative:e});if(!n.isTransitioning)return!1;let s=gu(n.currentLocation.pathname,i)||n.currentLocation.pathname,a=gu(n.nextLocation.pathname,i)||n.nextLocation.pathname;return C1(r.pathname,a)!=null||C1(r.pathname,s)!=null}var Vy=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(){}},ff,Eh,xm,i8,Mle=(i8=class extends Vy{constructor(){super();lt(this,ff);lt(this,Eh);lt(this,xm);Fe(this,xm,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){$(this,Eh)||this.setEventListener($(this,xm))}onUnsubscribe(){var e;this.hasListeners()||((e=$(this,Eh))==null||e.call(this),Fe(this,Eh,void 0))}setEventListener(e){var n;Fe(this,xm,e),(n=$(this,Eh))==null||n.call(this),Fe(this,Eh,e(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(e){$(this,ff)!==e&&(Fe(this,ff,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof $(this,ff)=="boolean"?$(this,ff):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},ff=new WeakMap,Eh=new WeakMap,xm=new WeakMap,i8),wR=new Mle,Rle={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Mh,$E,r8,Dle=(r8=class{constructor(){lt(this,Mh,Rle);lt(this,$E,!1)}setTimeoutProvider(t){Fe(this,Mh,t)}setTimeout(t,e){return $(this,Mh).setTimeout(t,e)}clearTimeout(t){$(this,Mh).clearTimeout(t)}setInterval(t,e){return $(this,Mh).setInterval(t,e)}clearInterval(t){$(this,Mh).clearInterval(t)}},Mh=new WeakMap,$E=new WeakMap,r8),af=new Dle;function Nle(t){setTimeout(t,0)}var Ile=typeof window>"u"||"Deno"in globalThis;function yo(){}function Ble(t,e){return typeof t=="function"?t(e):t}function DO(t){return typeof t=="number"&&t>=0&&t!==1/0}function nq(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Vh(t,e){return typeof t=="function"?t(e):t}function Go(t,e){return typeof t=="function"?t(e):t}function H4(t,e){const{type:n="all",exact:i,fetchStatus:r,predicate:s,queryKey:a,stale:l}=t;if(a){if(i){if(e.queryHash!==SR(a,e.options))return!1}else if(!Wm(e.queryKey,a))return!1}if(n!=="all"){const u=e.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof l=="boolean"&&e.isStale()!==l||r&&r!==e.state.fetchStatus||s&&!s(e))}function q4(t,e){const{exact:n,status:i,predicate:r,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(n){if(Nv(e.options.mutationKey)!==Nv(s))return!1}else if(!Wm(e.options.mutationKey,s))return!1}return!(i&&e.state.status!==i||r&&!r(e))}function SR(t,e){return((e==null?void 0:e.queryKeyHashFn)||Nv)(t)}function Nv(t){return JSON.stringify(t,(e,n)=>IO(n)?Object.keys(n).sort().reduce((i,r)=>(i[r]=n[r],i),{}):n)}function Wm(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(Array.isArray(t)&&Array.isArray(e)){for(let i=0;i<e.length;i++)if(!Wm(t[i],e[i]))return!1;return!0}const n=Object.keys(e);for(const i of n)if(!Wm(t[i],e[i]))return!1;return!0}return!1}var Lle=Object.prototype.hasOwnProperty;function iq(t,e,n=0){if(t===e)return t;if(n>500)return e;const i=Q4(t)&&Q4(e);if(!i&&!(IO(t)&&IO(e)))return e;const s=(i?t:Object.keys(t)).length,a=i?e:Object.keys(e),l=a.length,u=i?new Array(l):{};let d=0;for(let f=0;f<l;f++){const p=i?f:a[f],m=t[p],v=e[p];if(m===v){u[p]=m,(i?f<s:Lle.call(t,p))&&d++;continue}if(m===null||v===null||typeof m!="object"||typeof v!="object"){u[p]=v;continue}const y=iq(m,v,n+1);u[p]=y,y===m&&d++}return s===l&&d===s?t:u}function NO(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 Q4(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function IO(t){if(!Y4(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!Y4(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Y4(t){return Object.prototype.toString.call(t)==="[object Object]"}function Ple(t){return new Promise(e=>{af.setTimeout(e,t)})}function BO(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?iq(t,e):e}function Fle(t,e,n=0){const i=[...t,e];return n&&i.length>n?i.slice(1):i}function $le(t,e,n=0){const i=[e,...t];return n&&i.length>n?i.slice(0,-1):i}var jR=Symbol();function rq(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===jR?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function sq(t,e){return typeof t=="function"?t(...e):!!t}function zle(t,e,n){let i=!1,r;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(r??(r=e()),i||(i=!0,r.aborted?n():r.addEventListener("abort",n,{once:!0})),r)}),t}var Iv=(()=>{let t=()=>Ile;return{isServer(){return t()},setIsServer(e){t=e}}})();function LO(){let t,e;const n=new Promise((r,s)=>{t=r,e=s});n.status="pending",n.catch(()=>{});function i(r){Object.assign(n,r),delete n.resolve,delete n.reject}return n.resolve=r=>{i({status:"fulfilled",value:r}),t(r)},n.reject=r=>{i({status:"rejected",reason:r}),e(r)},n}var Hle=Nle;function qle(){let t=[],e=0,n=l=>{l()},i=l=>{l()},r=Hle;const s=l=>{e?t.push(l):r(()=>{n(l)})},a=()=>{const l=t;t=[],l.length&&r(()=>{i(()=>{l.forEach(u=>{n(u)})})})};return{batch:l=>{let u;e++;try{u=l()}finally{e--,e||a()}return u},batchCalls:l=>(...u)=>{s(()=>{l(...u)})},schedule:s,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{i=l},setScheduler:l=>{r=l}}}var ys=qle(),bm,Rh,Am,s8,Qle=(s8=class extends Vy{constructor(){super();lt(this,bm,!0);lt(this,Rh);lt(this,Am);Fe(this,Am,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e(!0),i=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",i)}}})}onSubscribe(){$(this,Rh)||this.setEventListener($(this,Am))}onUnsubscribe(){var e;this.hasListeners()||((e=$(this,Rh))==null||e.call(this),Fe(this,Rh,void 0))}setEventListener(e){var n;Fe(this,Am,e),(n=$(this,Rh))==null||n.call(this),Fe(this,Rh,e(this.setOnline.bind(this)))}setOnline(e){$(this,bm)!==e&&(Fe(this,bm,e),this.listeners.forEach(i=>{i(e)}))}isOnline(){return $(this,bm)}},bm=new WeakMap,Rh=new WeakMap,Am=new WeakMap,s8),k1=new Qle;function Yle(t){return Math.min(1e3*2**t,3e4)}function oq(t){return(t??"online")==="online"?k1.isOnline():!0}var PO=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function aq(t){let e=!1,n=0,i;const r=LO(),s=()=>r.status!=="pending",a=b=>{var A;if(!s()){const w=new PO(b);m(w),(A=t.onCancel)==null||A.call(t,w)}},l=()=>{e=!0},u=()=>{e=!1},d=()=>wR.isFocused()&&(t.networkMode==="always"||k1.isOnline())&&t.canRun(),f=()=>oq(t.networkMode)&&t.canRun(),p=b=>{s()||(i==null||i(),r.resolve(b))},m=b=>{s()||(i==null||i(),r.reject(b))},v=()=>new Promise(b=>{var A;i=w=>{(s()||d())&&b(w)},(A=t.onPause)==null||A.call(t)}).then(()=>{var b;i=void 0,s()||(b=t.onContinue)==null||b.call(t)}),y=()=>{if(s())return;let b;const A=n===0?t.initialPromise:void 0;try{b=A??t.fn()}catch(w){b=Promise.reject(w)}Promise.resolve(b).then(p).catch(w=>{var E;if(s())return;const S=t.retry??(Iv.isServer()?0:3),j=t.retryDelay??Yle,C=typeof j=="function"?j(n,w):j,k=S===!0||typeof S=="number"&&n<S||typeof S=="function"&&S(n,w);if(e||!k){m(w);return}n++,(E=t.onFail)==null||E.call(t,n,w),Ple(C).then(()=>d()?void 0:v()).then(()=>{e?m(w):y()})})};return{promise:r,status:()=>r.status,cancel:a,continue:()=>(i==null||i(),r),cancelRetry:l,continueRetry:u,canStart:f,start:()=>(f()?y():v().then(y),r)}}var pf,o8,lq=(o8=class{constructor(){lt(this,pf)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),DO(this.gcTime)&&Fe(this,pf,af.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Iv.isServer()?1/0:300*1e3))}clearGcTimeout(){$(this,pf)!==void 0&&(af.clearTimeout($(this,pf)),Fe(this,pf,void 0))}},pf=new WeakMap,o8);function Wle(t){return{onFetch:(e,n)=>{var f,p,m,v,y;const i=e.options,r=(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)||[],a=((y=e.state.data)==null?void 0:y.pageParams)||[];let l={pages:[],pageParams:[]},u=0;const d=async()=>{let b=!1;const A=j=>{zle(j,()=>e.signal,()=>b=!0)},w=rq(e.options,e.fetchOptions),S=async(j,C,k)=>{if(b)return Promise.reject(e.signal.reason);if(C==null&&j.pages.length)return Promise.resolve(j);const M=(()=>{const I={client:e.client,queryKey:e.queryKey,pageParam:C,direction:k?"backward":"forward",meta:e.options.meta};return A(I),I})(),R=await w(M),{maxPages:D}=e.options,F=k?$le:Fle;return{pages:F(j.pages,R,D),pageParams:F(j.pageParams,C,D)}};if(r&&s.length){const j=r==="backward",C=j?Ule:W4,k={pages:s,pageParams:a},E=C(i,k);l=await S(k,E,j)}else{const j=t??s.length;do{const C=u===0?a[0]??i.initialPageParam:W4(i,l);if(u>0&&C==null)break;l=await S(l,C),u++}while(u<j)}return l};e.options.persister?e.fetchFn=()=>{var b,A;return(A=(b=e.options).persister)==null?void 0:A.call(b,d,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=d}}}function W4(t,{pages:e,pageParams:n}){const i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,n[i],n):void 0}function Ule(t,{pages:e,pageParams:n}){var i;return e.length>0?(i=t.getPreviousPageParam)==null?void 0:i.call(t,e[0],e,n[0],n):void 0}var wm,mf,Sm,Aa,gf,Zr,cy,vf,Vo,cq,Zc,a8,Vle=(a8=class extends lq{constructor(e){super();lt(this,Vo);lt(this,wm);lt(this,mf);lt(this,Sm);lt(this,Aa);lt(this,gf);lt(this,Zr);lt(this,cy);lt(this,vf);Fe(this,vf,!1),Fe(this,cy,e.defaultOptions),this.setOptions(e.options),this.observers=[],Fe(this,gf,e.client),Fe(this,Aa,$(this,gf).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Fe(this,mf,V4(this.options)),this.state=e.state??$(this,mf),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return $(this,wm)}get promise(){var e;return(e=$(this,Zr))==null?void 0:e.promise}setOptions(e){if(this.options={...$(this,cy),...e},e!=null&&e._type&&Fe(this,wm,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=V4(this.options);n.data!==void 0&&(this.setState(U4(n.data,n.dataUpdatedAt)),Fe(this,mf,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&$(this,Aa).remove(this)}setData(e,n){const i=BO(this.state.data,e,this.options);return We(this,Vo,Zc).call(this,{data:i,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),i}setState(e){We(this,Vo,Zc).call(this,{type:"setState",state:e})}cancel(e){var i,r;const n=(i=$(this,Zr))==null?void 0:i.promise;return(r=$(this,Zr))==null||r.cancel(e),n?n.then(yo).catch(yo):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return $(this,mf)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Go(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===jR||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Vh(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:!nq(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(i=>i.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=$(this,Zr))==null||n.continue()}onOnline(){var n;const e=this.observers.find(i=>i.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=$(this,Zr))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),$(this,Aa).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||($(this,Zr)&&($(this,vf)||We(this,Vo,cq).call(this)?$(this,Zr).cancel({revert:!0}):$(this,Zr).cancelRetry()),this.scheduleGc()),$(this,Aa).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||We(this,Vo,Zc).call(this,{type:"invalidate"})}async fetch(e,n){var d,f,p,m,v,y,b,A,w,S,j;if(this.state.fetchStatus!=="idle"&&((d=$(this,Zr))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if($(this,Zr))return $(this,Zr).continueRetry(),$(this,Zr).promise}if(e&&this.setOptions(e),!this.options.queryFn){const C=this.observers.find(k=>k.options.queryFn);C&&this.setOptions(C.options)}const i=new AbortController,r=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(Fe(this,vf,!0),i.signal)})},s=()=>{const C=rq(this.options,n),E=(()=>{const M={client:$(this,gf),queryKey:this.queryKey,meta:this.meta};return r(M),M})();return Fe(this,vf,!1),this.options.persister?this.options.persister(C,E,this):C(E)},l=(()=>{const C={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:$(this,gf),state:this.state,fetchFn:s};return r(C),C})(),u=$(this,wm)==="infinite"?Wle(this.options.pages):this.options.behavior;u==null||u.onFetch(l,this),Fe(this,Sm,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=l.fetchOptions)==null?void 0:f.meta))&&We(this,Vo,Zc).call(this,{type:"fetch",meta:(p=l.fetchOptions)==null?void 0:p.meta}),Fe(this,Zr,aq({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:C=>{C instanceof PO&&C.revert&&this.setState({...$(this,Sm),fetchStatus:"idle"}),i.abort()},onFail:(C,k)=>{We(this,Vo,Zc).call(this,{type:"failed",failureCount:C,error:k})},onPause:()=>{We(this,Vo,Zc).call(this,{type:"pause"})},onContinue:()=>{We(this,Vo,Zc).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const C=await $(this,Zr).start();if(C===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(C),(v=(m=$(this,Aa).config).onSuccess)==null||v.call(m,C,this),(b=(y=$(this,Aa).config).onSettled)==null||b.call(y,C,this.state.error,this),C}catch(C){if(C instanceof PO){if(C.silent)return $(this,Zr).promise;if(C.revert){if(this.state.data===void 0)throw C;return this.state.data}}throw We(this,Vo,Zc).call(this,{type:"error",error:C}),(w=(A=$(this,Aa).config).onError)==null||w.call(A,C,this),(j=(S=$(this,Aa).config).onSettled)==null||j.call(S,this.state.data,C,this),C}finally{this.scheduleGc()}}},wm=new WeakMap,mf=new WeakMap,Sm=new WeakMap,Aa=new WeakMap,gf=new WeakMap,Zr=new WeakMap,cy=new WeakMap,vf=new WeakMap,Vo=new WeakSet,cq=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Zc=function(e){const n=i=>{switch(e.type){case"failed":return{...i,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...uq(i.data,this.options),fetchMeta:e.meta??null};case"success":const r={...i,...U4(e.data,e.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Fe(this,Sm,e.manual?r:void 0),r;case"error":const s=e.error;return{...i,error:s,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...e.state}}};this.state=n(this.state),ys.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),$(this,Aa).notify({query:this,type:"updated",action:e})})},a8);function uq(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:oq(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function U4(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function V4(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,i=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var go,On,uy,Qs,yf,jm,iu,Dh,hy,Cm,_m,xf,bf,Nh,km,Jn,U0,FO,$O,zO,HO,qO,QO,YO,dq,l8,hq=(l8=class extends Vy{constructor(e,n){super();lt(this,Jn);lt(this,go);lt(this,On);lt(this,uy);lt(this,Qs);lt(this,yf);lt(this,jm);lt(this,iu);lt(this,Dh);lt(this,hy);lt(this,Cm);lt(this,_m);lt(this,xf);lt(this,bf);lt(this,Nh);lt(this,km,new Set);this.options=n,Fe(this,go,e),Fe(this,Dh,null),Fe(this,iu,LO()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&($(this,On).addObserver(this),G4($(this,On),this.options)?We(this,Jn,U0).call(this):this.updateResult(),We(this,Jn,HO).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return WO($(this,On),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return WO($(this,On),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,We(this,Jn,qO).call(this),We(this,Jn,QO).call(this),$(this,On).removeObserver(this)}setOptions(e){const n=this.options,i=$(this,On);if(this.options=$(this,go).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Go(this.options.enabled,$(this,On))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");We(this,Jn,YO).call(this),$(this,On).setOptions(this.options),n._defaulted&&!NO(this.options,n)&&$(this,go).getQueryCache().notify({type:"observerOptionsUpdated",query:$(this,On),observer:this});const r=this.hasListeners();r&&X4($(this,On),i,this.options,n)&&We(this,Jn,U0).call(this),this.updateResult(),r&&($(this,On)!==i||Go(this.options.enabled,$(this,On))!==Go(n.enabled,$(this,On))||Vh(this.options.staleTime,$(this,On))!==Vh(n.staleTime,$(this,On)))&&We(this,Jn,FO).call(this);const s=We(this,Jn,$O).call(this);r&&($(this,On)!==i||Go(this.options.enabled,$(this,On))!==Go(n.enabled,$(this,On))||s!==$(this,Nh))&&We(this,Jn,zO).call(this,s)}getOptimisticResult(e){const n=$(this,go).getQueryCache().build($(this,go),e),i=this.createResult(n,e);return Xle(this,i)&&(Fe(this,Qs,i),Fe(this,jm,this.options),Fe(this,yf,$(this,On).state)),i}getCurrentResult(){return $(this,Qs)}trackResult(e,n){return new Proxy(e,{get:(i,r)=>(this.trackProp(r),n==null||n(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&$(this,iu).status==="pending"&&$(this,iu).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,r))})}trackProp(e){$(this,km).add(e)}getCurrentQuery(){return $(this,On)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=$(this,go).defaultQueryOptions(e),i=$(this,go).getQueryCache().build($(this,go),n);return i.fetch().then(()=>this.createResult(i,n))}fetch(e){return We(this,Jn,U0).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),$(this,Qs)))}createResult(e,n){var D;const i=$(this,On),r=this.options,s=$(this,Qs),a=$(this,yf),l=$(this,jm),d=e!==i?e.state:$(this,uy),{state:f}=e;let p={...f},m=!1,v;if(n._optimisticResults){const F=this.hasListeners(),I=!F&&G4(e,n),Q=F&&X4(e,i,n,r);(I||Q)&&(p={...p,...uq(f.data,e.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:y,errorUpdatedAt:b,status:A}=p;v=p.data;let w=!1;if(n.placeholderData!==void 0&&v===void 0&&A==="pending"){let F;s!=null&&s.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(F=s.data,w=!0):F=typeof n.placeholderData=="function"?n.placeholderData((D=$(this,_m))==null?void 0:D.state.data,$(this,_m)):n.placeholderData,F!==void 0&&(A="success",v=BO(s==null?void 0:s.data,F,n),m=!0)}if(n.select&&v!==void 0&&!w)if(s&&v===(a==null?void 0:a.data)&&n.select===$(this,hy))v=$(this,Cm);else try{Fe(this,hy,n.select),v=n.select(v),v=BO(s==null?void 0:s.data,v,n),Fe(this,Cm,v),Fe(this,Dh,null)}catch(F){Fe(this,Dh,F)}$(this,Dh)&&(y=$(this,Dh),v=$(this,Cm),b=Date.now(),A="error");const S=p.fetchStatus==="fetching",j=A==="pending",C=A==="error",k=j&&S,E=v!==void 0,R={status:A,fetchStatus:p.fetchStatus,isPending:j,isSuccess:A==="success",isError:C,isInitialLoading:k,isLoading:k,data:v,dataUpdatedAt:p.dataUpdatedAt,error:y,errorUpdatedAt:b,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:p.dataUpdateCount>d.dataUpdateCount||p.errorUpdateCount>d.errorUpdateCount,isFetching:S,isRefetching:S&&!j,isLoadingError:C&&!E,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:C&&E,isStale:CR(e,n),refetch:this.refetch,promise:$(this,iu),isEnabled:Go(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const F=R.data!==void 0,I=R.status==="error"&&!F,Q=q=>{I?q.reject(R.error):F&&q.resolve(R.data)},G=()=>{const q=Fe(this,iu,R.promise=LO());Q(q)},L=$(this,iu);switch(L.status){case"pending":e.queryHash===i.queryHash&&Q(L);break;case"fulfilled":(I||R.data!==L.value)&&G();break;case"rejected":(!I||R.error!==L.reason)&&G();break}}return R}updateResult(){const e=$(this,Qs),n=this.createResult($(this,On),this.options);if(Fe(this,yf,$(this,On).state),Fe(this,jm,this.options),$(this,yf).data!==void 0&&Fe(this,_m,$(this,On)),NO(n,e))return;Fe(this,Qs,n);const i=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,s=typeof r=="function"?r():r;if(s==="all"||!s&&!$(this,km).size)return!0;const a=new Set(s??$(this,km));return this.options.throwOnError&&a.add("error"),Object.keys($(this,Qs)).some(l=>{const u=l;return $(this,Qs)[u]!==e[u]&&a.has(u)})};We(this,Jn,dq).call(this,{listeners:i()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&We(this,Jn,HO).call(this)}},go=new WeakMap,On=new WeakMap,uy=new WeakMap,Qs=new WeakMap,yf=new WeakMap,jm=new WeakMap,iu=new WeakMap,Dh=new WeakMap,hy=new WeakMap,Cm=new WeakMap,_m=new WeakMap,xf=new WeakMap,bf=new WeakMap,Nh=new WeakMap,km=new WeakMap,Jn=new WeakSet,U0=function(e){We(this,Jn,YO).call(this);let n=$(this,On).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(yo)),n},FO=function(){We(this,Jn,qO).call(this);const e=Vh(this.options.staleTime,$(this,On));if(Iv.isServer()||$(this,Qs).isStale||!DO(e))return;const i=nq($(this,Qs).dataUpdatedAt,e)+1;Fe(this,xf,af.setTimeout(()=>{$(this,Qs).isStale||this.updateResult()},i))},$O=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval($(this,On)):this.options.refetchInterval)??!1},zO=function(e){We(this,Jn,QO).call(this),Fe(this,Nh,e),!(Iv.isServer()||Go(this.options.enabled,$(this,On))===!1||!DO($(this,Nh))||$(this,Nh)===0)&&Fe(this,bf,af.setInterval(()=>{(this.options.refetchIntervalInBackground||wR.isFocused())&&We(this,Jn,U0).call(this)},$(this,Nh)))},HO=function(){We(this,Jn,FO).call(this),We(this,Jn,zO).call(this,We(this,Jn,$O).call(this))},qO=function(){$(this,xf)!==void 0&&(af.clearTimeout($(this,xf)),Fe(this,xf,void 0))},QO=function(){$(this,bf)!==void 0&&(af.clearInterval($(this,bf)),Fe(this,bf,void 0))},YO=function(){const e=$(this,go).getQueryCache().build($(this,go),this.options);if(e===$(this,On))return;const n=$(this,On);Fe(this,On,e),Fe(this,uy,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},dq=function(e){ys.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n($(this,Qs))}),$(this,go).getQueryCache().notify({query:$(this,On),type:"observerResultsUpdated"})})},l8);function Gle(t,e){return Go(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&Go(e.retryOnMount,t)===!1)}function G4(t,e){return Gle(t,e)||t.state.data!==void 0&&WO(t,e,e.refetchOnMount)}function WO(t,e,n){if(Go(e.enabled,t)!==!1&&Vh(e.staleTime,t)!=="static"){const i=typeof n=="function"?n(t):n;return i==="always"||i!==!1&&CR(t,e)}return!1}function X4(t,e,n,i){return(t!==e||Go(i.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&CR(t,n)}function CR(t,e){return Go(e.enabled,t)!==!1&&t.isStaleByTime(Vh(e.staleTime,t))}function Xle(t,e){return!NO(t.getCurrentResult(),e)}var dy,Ql,Ns,Af,Yl,mh,c8,Kle=(c8=class extends lq{constructor(e){super();lt(this,Yl);lt(this,dy);lt(this,Ql);lt(this,Ns);lt(this,Af);Fe(this,dy,e.client),this.mutationId=e.mutationId,Fe(this,Ns,e.mutationCache),Fe(this,Ql,[]),this.state=e.state||Zle(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){$(this,Ql).includes(e)||($(this,Ql).push(e),this.clearGcTimeout(),$(this,Ns).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Fe(this,Ql,$(this,Ql).filter(n=>n!==e)),this.scheduleGc(),$(this,Ns).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){$(this,Ql).length||(this.state.status==="pending"?this.scheduleGc():$(this,Ns).remove(this))}continue(){var e;return((e=$(this,Af))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var a,l,u,d,f,p,m,v,y,b,A,w,S,j,C,k,E,M;const n=()=>{We(this,Yl,mh).call(this,{type:"continue"})},i={client:$(this,dy),meta:this.options.meta,mutationKey:this.options.mutationKey};Fe(this,Af,aq({fn:()=>this.options.mutationFn?this.options.mutationFn(e,i):Promise.reject(new Error("No mutationFn found")),onFail:(R,D)=>{We(this,Yl,mh).call(this,{type:"failed",failureCount:R,error:D})},onPause:()=>{We(this,Yl,mh).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>$(this,Ns).canRun(this)}));const r=this.state.status==="pending",s=!$(this,Af).canStart();try{if(r)n();else{We(this,Yl,mh).call(this,{type:"pending",variables:e,isPaused:s}),$(this,Ns).config.onMutate&&await $(this,Ns).config.onMutate(e,this,i);const D=await((l=(a=this.options).onMutate)==null?void 0:l.call(a,e,i));D!==this.state.context&&We(this,Yl,mh).call(this,{type:"pending",context:D,variables:e,isPaused:s})}const R=await $(this,Af).start();return await((d=(u=$(this,Ns).config).onSuccess)==null?void 0:d.call(u,R,e,this.state.context,this,i)),await((p=(f=this.options).onSuccess)==null?void 0:p.call(f,R,e,this.state.context,i)),await((v=(m=$(this,Ns).config).onSettled)==null?void 0:v.call(m,R,null,this.state.variables,this.state.context,this,i)),await((b=(y=this.options).onSettled)==null?void 0:b.call(y,R,null,e,this.state.context,i)),We(this,Yl,mh).call(this,{type:"success",data:R}),R}catch(R){try{await((w=(A=$(this,Ns).config).onError)==null?void 0:w.call(A,R,e,this.state.context,this,i))}catch(D){Promise.reject(D)}try{await((j=(S=this.options).onError)==null?void 0:j.call(S,R,e,this.state.context,i))}catch(D){Promise.reject(D)}try{await((k=(C=$(this,Ns).config).onSettled)==null?void 0:k.call(C,void 0,R,this.state.variables,this.state.context,this,i))}catch(D){Promise.reject(D)}try{await((M=(E=this.options).onSettled)==null?void 0:M.call(E,void 0,R,e,this.state.context,i))}catch(D){Promise.reject(D)}throw We(this,Yl,mh).call(this,{type:"error",error:R}),R}finally{$(this,Ns).runNext(this)}}},dy=new WeakMap,Ql=new WeakMap,Ns=new WeakMap,Af=new WeakMap,Yl=new WeakSet,mh=function(e){const n=i=>{switch(e.type){case"failed":return{...i,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,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{...i,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:e.error,failureCount:i.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),ys.batch(()=>{$(this,Ql).forEach(i=>{i.onMutationUpdate(e)}),$(this,Ns).notify({mutation:this,type:"updated",action:e})})},c8);function Zle(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ru,Wa,fy,u8,Jle=(u8=class extends Vy{constructor(e={}){super();lt(this,ru);lt(this,Wa);lt(this,fy);this.config=e,Fe(this,ru,new Set),Fe(this,Wa,new Map),Fe(this,fy,0)}build(e,n,i){const r=new Kle({client:e,mutationCache:this,mutationId:++qd(this,fy)._,options:e.defaultMutationOptions(n),state:i});return this.add(r),r}add(e){$(this,ru).add(e);const n=$b(e);if(typeof n=="string"){const i=$(this,Wa).get(n);i?i.push(e):$(this,Wa).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if($(this,ru).delete(e)){const n=$b(e);if(typeof n=="string"){const i=$(this,Wa).get(n);if(i)if(i.length>1){const r=i.indexOf(e);r!==-1&&i.splice(r,1)}else i[0]===e&&$(this,Wa).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=$b(e);if(typeof n=="string"){const i=$(this,Wa).get(n),r=i==null?void 0:i.find(s=>s.state.status==="pending");return!r||r===e}else return!0}runNext(e){var i;const n=$b(e);if(typeof n=="string"){const r=(i=$(this,Wa).get(n))==null?void 0:i.find(s=>s!==e&&s.state.isPaused);return(r==null?void 0:r.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ys.batch(()=>{$(this,ru).forEach(e=>{this.notify({type:"removed",mutation:e})}),$(this,ru).clear(),$(this,Wa).clear()})}getAll(){return Array.from($(this,ru))}find(e){const n={exact:!0,...e};return this.getAll().find(i=>q4(n,i))}findAll(e={}){return this.getAll().filter(n=>q4(e,n))}notify(e){ys.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return ys.batch(()=>Promise.all(e.map(n=>n.continue().catch(yo))))}},ru=new WeakMap,Wa=new WeakMap,fy=new WeakMap,u8);function $b(t){var e;return(e=t.options.scope)==null?void 0:e.id}var Wl,h8,ece=(h8=class extends Vy{constructor(e={}){super();lt(this,Wl);this.config=e,Fe(this,Wl,new Map)}build(e,n,i){const r=n.queryKey,s=n.queryHash??SR(r,n);let a=this.get(s);return a||(a=new Vle({client:e,queryKey:r,queryHash:s,options:e.defaultQueryOptions(n),state:i,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){$(this,Wl).has(e.queryHash)||($(this,Wl).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=$(this,Wl).get(e.queryHash);n&&(e.destroy(),n===e&&$(this,Wl).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){ys.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return $(this,Wl).get(e)}getAll(){return[...$(this,Wl).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(i=>H4(n,i))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(i=>H4(e,i)):n}notify(e){ys.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){ys.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ys.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Wl=new WeakMap,h8),ar,Ih,Bh,Tm,Om,Lh,Em,Mm,d8,tce=(d8=class{constructor(t={}){lt(this,ar);lt(this,Ih);lt(this,Bh);lt(this,Tm);lt(this,Om);lt(this,Lh);lt(this,Em);lt(this,Mm);Fe(this,ar,t.queryCache||new ece),Fe(this,Ih,t.mutationCache||new Jle),Fe(this,Bh,t.defaultOptions||{}),Fe(this,Tm,new Map),Fe(this,Om,new Map),Fe(this,Lh,0)}mount(){qd(this,Lh)._++,$(this,Lh)===1&&(Fe(this,Em,wR.subscribe(async t=>{t&&(await this.resumePausedMutations(),$(this,ar).onFocus())})),Fe(this,Mm,k1.subscribe(async t=>{t&&(await this.resumePausedMutations(),$(this,ar).onOnline())})))}unmount(){var t,e;qd(this,Lh)._--,$(this,Lh)===0&&((t=$(this,Em))==null||t.call(this),Fe(this,Em,void 0),(e=$(this,Mm))==null||e.call(this),Fe(this,Mm,void 0))}isFetching(t){return $(this,ar).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return $(this,Ih).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=$(this,ar).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=$(this,ar).build(this,e),i=n.state.data;return i===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Vh(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(t){return $(this,ar).findAll(t).map(({queryKey:e,state:n})=>{const i=n.data;return[e,i]})}setQueryData(t,e,n){const i=this.defaultQueryOptions({queryKey:t}),r=$(this,ar).get(i.queryHash),s=r==null?void 0:r.state.data,a=Ble(e,s);if(a!==void 0)return $(this,ar).build(this,i).setData(a,{...n,manual:!0})}setQueriesData(t,e,n){return ys.batch(()=>$(this,ar).findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=$(this,ar).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=$(this,ar);ys.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=$(this,ar);return ys.batch(()=>(n.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},i=ys.batch(()=>$(this,ar).findAll(t).map(r=>r.cancel(n)));return Promise.all(i).then(yo).catch(yo)}invalidateQueries(t,e={}){return ys.batch(()=>($(this,ar).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},i=ys.batch(()=>$(this,ar).findAll(t).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let s=r.fetch(void 0,n);return n.throwOnError||(s=s.catch(yo)),r.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(i).then(yo)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=$(this,ar).build(this,e);return n.isStaleByTime(Vh(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(yo).catch(yo)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(yo).catch(yo)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return k1.isOnline()?$(this,Ih).resumePausedMutations():Promise.resolve()}getQueryCache(){return $(this,ar)}getMutationCache(){return $(this,Ih)}getDefaultOptions(){return $(this,Bh)}setDefaultOptions(t){Fe(this,Bh,t)}setQueryDefaults(t,e){$(this,Tm).set(Nv(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...$(this,Tm).values()],n={};return e.forEach(i=>{Wm(t,i.queryKey)&&Object.assign(n,i.defaultOptions)}),n}setMutationDefaults(t,e){$(this,Om).set(Nv(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...$(this,Om).values()],n={};return e.forEach(i=>{Wm(t,i.mutationKey)&&Object.assign(n,i.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...$(this,Bh).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=SR(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===jR&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...$(this,Bh).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){$(this,ar).clear(),$(this,Ih).clear()}},ar=new WeakMap,Ih=new WeakMap,Bh=new WeakMap,Tm=new WeakMap,Om=new WeakMap,Lh=new WeakMap,Em=new WeakMap,Mm=new WeakMap,d8),fq=T.createContext(void 0),nce=t=>{const e=T.useContext(fq);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},ice=({client:t,children:e})=>(T.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),o.jsx(fq.Provider,{value:t,children:e})),pq=T.createContext(!1),rce=()=>T.useContext(pq);pq.Provider;function sce(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var oce=T.createContext(sce()),ace=()=>T.useContext(oce),lce=(t,e,n)=>{const i=n!=null&&n.state.error&&typeof t.throwOnError=="function"?sq(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||i)&&(e.isReset()||(t.retryOnMount=!1))},cce=t=>{T.useEffect(()=>{t.clearReset()},[t])},uce=({result:t,errorResetBoundary:e,throwOnError:n,query:i,suspense:r})=>t.isError&&!e.isReset()&&!t.isFetching&&i&&(r&&t.data===void 0||sq(n,[t.error,i])),hce=(t,e)=>e.state.data===void 0,dce=t=>{if(t.suspense){const n=r=>r==="static"?r:Math.max(r??1e3,1e3),i=t.staleTime;t.staleTime=typeof i=="function"?(...r)=>n(i(...r)):n(i),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},fce=(t,e)=>t.isLoading&&t.isFetching&&!e,pce=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,K4=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function mq(t,e,n){var v,y,b,A;const i=rce(),r=ace(),s=nce(),a=s.defaultQueryOptions(t);(y=(v=s.getDefaultOptions().queries)==null?void 0:v._experimental_beforeQuery)==null||y.call(v,a);const l=s.getQueryCache().get(a.queryHash),u=t.subscribed!==!1;a._optimisticResults=i?"isRestoring":u?"optimistic":void 0,dce(a),lce(a,r,l),cce(r);const d=!s.getQueryCache().get(a.queryHash),[f]=T.useState(()=>new e(s,a)),p=f.getOptimisticResult(a),m=!i&&u;if(T.useSyncExternalStore(T.useCallback(w=>{const S=m?f.subscribe(ys.batchCalls(w)):yo;return f.updateResult(),S},[f,m]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),T.useEffect(()=>{f.setOptions(a)},[a,f]),pce(a,p))throw K4(a,f,r);if(uce({result:p,errorResetBoundary:r,throwOnError:a.throwOnError,query:l,suspense:a.suspense}))throw p.error;if((A=(b=s.getDefaultOptions().queries)==null?void 0:b._experimental_afterQuery)==null||A.call(b,a,p),a.experimental_prefetchInRender&&!Iv.isServer()&&fce(p,i)){const w=d?K4(a,f,r):l==null?void 0:l.promise;w==null||w.catch(yo).finally(()=>{f.updateResult()})}return a.notifyOnChangeProps?p:f.trackResult(p)}function mce(t,e){return mq(t,hq)}function gq(t,e){return mq({...t,enabled:!0,suspense:!0,throwOnError:hce,placeholderData:void 0},hq)}var Ak={exports:{}},wk={};/**
 * @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 Z4;function gce(){if(Z4)return wk;Z4=1;var t=gy();function e(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var n=typeof Object.is=="function"?Object.is:e,i=t.useSyncExternalStore,r=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;return wk.useSyncExternalStoreWithSelector=function(u,d,f,p,m){var v=r(null);if(v.current===null){var y={hasValue:!1,value:null};v.current=y}else y=v.current;v=a(function(){function A(k){if(!w){if(w=!0,S=k,k=p(k),m!==void 0&&y.hasValue){var E=y.value;if(m(E,k))return j=E}return j=k}if(E=j,n(S,k))return E;var M=p(k);return m!==void 0&&m(E,M)?(S=k,E):(S=k,j=M)}var w=!1,S,j,C=f===void 0?null:f;return[function(){return A(d())},C===null?void 0:function(){return A(C())}]},[d,f,p,m]);var b=i(u,v[0],v[1]);return s(function(){y.hasValue=!0,y.value=b},[b]),l(b),b},wk}var J4;function vce(){return J4||(J4=1,Ak.exports=gce()),Ak.exports}var yce=vce();function xce(t){t()}function bce(){let t=null,e=null;return{clear(){t=null,e=null},notify(){xce(()=>{let n=t;for(;n;)n.callback(),n=n.next})},get(){const n=[];let i=t;for(;i;)n.push(i),i=i.next;return n},subscribe(n){let i=!0;const r=e={callback:n,next:null,prev:e};return r.prev?r.prev.next=r:t=r,function(){!i||t===null||(i=!1,r.next?r.next.prev=r.prev:e=r.prev,r.prev?r.prev.next=r.next:t=r.next)}}}}var eL={notify(){},get:()=>[]};function Ace(t,e){let n,i=eL,r=0,s=!1;function a(b){f();const A=i.subscribe(b);let w=!1;return()=>{w||(w=!0,A(),p())}}function l(){i.notify()}function u(){y.onStateChange&&y.onStateChange()}function d(){return s}function f(){r++,n||(n=t.subscribe(u),i=bce())}function p(){r--,n&&r===0&&(n(),n=void 0,i.clear(),i=eL)}function m(){s||(s=!0,f())}function v(){s&&(s=!1,p())}const y={addNestedSub:a,notifyNestedSubs:l,handleChangeWrapper:u,isSubscribed:d,trySubscribe:m,tryUnsubscribe:v,getListeners:()=>i};return y}var wce=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Sce=wce(),jce=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Cce=jce(),_ce=()=>Sce||Cce?T.useLayoutEffect:T.useEffect,kce=_ce(),Sk=Symbol.for("react-redux-context"),jk=typeof globalThis<"u"?globalThis:{};function Tce(){if(!T.createContext)return{};const t=jk[Sk]??(jk[Sk]=new Map);let e=t.get(T.createContext);return e||(e=T.createContext(null),t.set(T.createContext,e)),e}var td=Tce();function Oce(t){const{children:e,context:n,serverState:i,store:r}=t,s=T.useMemo(()=>{const u=Ace(r);return{store:r,subscription:u,getServerState:i?()=>i:void 0}},[r,i]),a=T.useMemo(()=>r.getState(),[r]);kce(()=>{const{subscription:u}=s;return u.onStateChange=u.notifyNestedSubs,u.trySubscribe(),a!==r.getState()&&u.notifyNestedSubs(),()=>{u.tryUnsubscribe(),u.onStateChange=void 0}},[s,a]);const l=n||td;return T.createElement(l.Provider,{value:s},e)}var Ece=Oce;function _R(t=td){return function(){return T.useContext(t)}}var vq=_R();function yq(t=td){const e=t===td?vq:_R(t),n=()=>{const{store:i}=e();return i};return Object.assign(n,{withTypes:()=>n}),n}var Mce=yq();function Rce(t=td){const e=t===td?Mce:yq(t),n=()=>e().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var Dce=Rce(),Nce=(t,e)=>t===e;function Ice(t=td){const e=t===td?vq:_R(t),n=(i,r={})=>{const{equalityFn:s=Nce}=typeof r=="function"?{equalityFn:r}:r,a=e(),{store:l,subscription:u,getServerState:d}=a;T.useRef(!0);const f=T.useCallback({[i.name](m){return i(m)}}[i.name],[i]),p=yce.useSyncExternalStoreWithSelector(u.addNestedSub,l.getState,d||l.getState,f,s);return T.useDebugValue(p),p};return Object.assign(n,{withTypes:()=>n}),n}var Bce=Ice();const Tu=Dce.withTypes(),bc=Bce.withTypes();function ps(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 Lce=typeof Symbol=="function"&&Symbol.observable||"@@observable",tL=Lce,Ck=()=>Math.random().toString(36).substring(7).split("").join("."),Pce={INIT:`@@redux/INIT${Ck()}`,REPLACE:`@@redux/REPLACE${Ck()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Ck()}`},T1=Pce;function kR(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 xq(t,e,n){if(typeof t!="function")throw new Error(ps(2));if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(ps(0));if(typeof e=="function"&&typeof n>"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(ps(1));return n(xq)(t,e)}let i=t,r=e,s=new Map,a=s,l=0,u=!1;function d(){a===s&&(a=new Map,s.forEach((A,w)=>{a.set(w,A)}))}function f(){if(u)throw new Error(ps(3));return r}function p(A){if(typeof A!="function")throw new Error(ps(4));if(u)throw new Error(ps(5));let w=!0;d();const S=l++;return a.set(S,A),function(){if(w){if(u)throw new Error(ps(6));w=!1,d(),a.delete(S),s=null}}}function m(A){if(!kR(A))throw new Error(ps(7));if(typeof A.type>"u")throw new Error(ps(8));if(typeof A.type!="string")throw new Error(ps(17));if(u)throw new Error(ps(9));try{u=!0,r=i(r,A)}finally{u=!1}return(s=a).forEach(S=>{S()}),A}function v(A){if(typeof A!="function")throw new Error(ps(10));i=A,m({type:T1.REPLACE})}function y(){const A=p;return{subscribe(w){if(typeof w!="object"||w===null)throw new Error(ps(11));function S(){const C=w;C.next&&C.next(f())}return S(),{unsubscribe:A(S)}},[tL](){return this}}}return m({type:T1.INIT}),{dispatch:m,subscribe:p,getState:f,replaceReducer:v,[tL]:y}}function Fce(t){Object.keys(t).forEach(e=>{const n=t[e];if(typeof n(void 0,{type:T1.INIT})>"u")throw new Error(ps(12));if(typeof n(void 0,{type:T1.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ps(13))})}function $ce(t){const e=Object.keys(t),n={};for(let s=0;s<e.length;s++){const a=e[s];typeof t[a]=="function"&&(n[a]=t[a])}const i=Object.keys(n);let r;try{Fce(n)}catch(s){r=s}return function(a={},l){if(r)throw r;let u=!1;const d={};for(let f=0;f<i.length;f++){const p=i[f],m=n[p],v=a[p],y=m(v,l);if(typeof y>"u")throw l&&l.type,new Error(ps(14));d[p]=y,u=u||y!==v}return u=u||i.length!==Object.keys(a).length,u?d:a}}function O1(...t){return t.length===0?e=>e:t.length===1?t[0]:t.reduce((e,n)=>(...i)=>e(n(...i)))}function zce(...t){return e=>(n,i)=>{const r=e(n,i);let s=()=>{throw new Error(ps(15))};const a={getState:r.getState,dispatch:(u,...d)=>s(u,...d)},l=t.map(u=>u(a));return s=O1(...l)(r.dispatch),{...r,dispatch:s}}}function bq(t){return kR(t)&&"type"in t&&typeof t.type=="string"}var Aq=Symbol.for("immer-nothing"),nL=Symbol.for("immer-draftable"),no=Symbol.for("immer-state");function nl(t,...e){throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var Ko=Object,Um=Ko.getPrototypeOf,E1="constructor",IS="prototype",UO="configurable",M1="enumerable",LA="writable",Bv="value",vu=t=>!!t&&!!t[no];function xl(t){var e;return t?wq(t)||LS(t)||!!t[nL]||!!((e=t[E1])!=null&&e[nL])||PS(t)||FS(t):!1}var Hce=Ko[IS][E1].toString(),iL=new WeakMap;function wq(t){if(!t||!TR(t))return!1;const e=Um(t);if(e===null||e===Ko[IS])return!0;const n=Ko.hasOwnProperty.call(e,E1)&&e[E1];if(n===Object)return!0;if(!Lp(n))return!1;let i=iL.get(n);return i===void 0&&(i=Function.toString.call(n),iL.set(n,i)),i===Hce}function BS(t,e,n=!0){Gy(t)===0?(n?Reflect.ownKeys(t):Ko.keys(t)).forEach(r=>{e(r,t[r],t)}):t.forEach((i,r)=>e(r,i,t))}function Gy(t){const e=t[no];return e?e.type_:LS(t)?1:PS(t)?2:FS(t)?3:0}var rL=(t,e,n=Gy(t))=>n===2?t.has(e):Ko[IS].hasOwnProperty.call(t,e),VO=(t,e,n=Gy(t))=>n===2?t.get(e):t[e],R1=(t,e,n,i=Gy(t))=>{i===2?t.set(e,n):i===3?t.add(n):t[e]=n};function qce(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}var LS=Array.isArray,PS=t=>t instanceof Map,FS=t=>t instanceof Set,TR=t=>typeof t=="object",Lp=t=>typeof t=="function",_k=t=>typeof t=="boolean";function Qce(t){const e=+t;return Number.isInteger(e)&&String(e)===t}var eu=t=>t.copy_||t.base_,OR=t=>t.modified_?t.copy_:t.base_;function GO(t,e){if(PS(t))return new Map(t);if(FS(t))return new Set(t);if(LS(t))return Array[IS].slice.call(t);const n=wq(t);if(e===!0||e==="class_only"&&!n){const i=Ko.getOwnPropertyDescriptors(t);delete i[no];let r=Reflect.ownKeys(i);for(let s=0;s<r.length;s++){const a=r[s],l=i[a];l[LA]===!1&&(l[LA]=!0,l[UO]=!0),(l.get||l.set)&&(i[a]={[UO]:!0,[LA]:!0,[M1]:l[M1],[Bv]:t[a]})}return Ko.create(Um(t),i)}else{const i=Um(t);if(i!==null&&n)return{...t};const r=Ko.create(i);return Ko.assign(r,t)}}function ER(t,e=!1){return $S(t)||vu(t)||!xl(t)||(Gy(t)>1&&Ko.defineProperties(t,{set:zb,add:zb,clear:zb,delete:zb}),Ko.freeze(t),e&&BS(t,(n,i)=>{ER(i,!0)},!1)),t}function Yce(){nl(2)}var zb={[Bv]:Yce};function $S(t){return t===null||!TR(t)?!0:Ko.isFrozen(t)}var D1="MapSet",XO="Patches",sL="ArrayMethods",Sq={};function Lf(t){const e=Sq[t];return e||nl(0,t),e}var oL=t=>!!Sq[t],Lv,jq=()=>Lv,Wce=(t,e)=>({drafts_:[],parent_:t,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:oL(D1)?Lf(D1):void 0,arrayMethodsPlugin_:oL(sL)?Lf(sL):void 0});function aL(t,e){e&&(t.patchPlugin_=Lf(XO),t.patches_=[],t.inversePatches_=[],t.patchListener_=e)}function KO(t){ZO(t),t.drafts_.forEach(Uce),t.drafts_=null}function ZO(t){t===Lv&&(Lv=t.parent_)}var lL=t=>Lv=Wce(Lv,t);function Uce(t){const e=t[no];e.type_===0||e.type_===1?e.revoke_():e.revoked_=!0}function cL(t,e){e.unfinalizedDrafts_=e.drafts_.length;const n=e.drafts_[0];if(t!==void 0&&t!==n){n[no].modified_&&(KO(e),nl(4)),xl(t)&&(t=uL(e,t));const{patchPlugin_:r}=e;r&&r.generateReplacementPatches_(n[no].base_,t,e)}else t=uL(e,n);return Vce(e,t,!0),KO(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),t!==Aq?t:void 0}function uL(t,e){if($S(e))return e;const n=e[no];if(!n)return N1(e,t.handledSet_,t);if(!zS(n,t))return e;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:i}=n;if(i)for(;i.length>0;)i.pop()(t);kq(n,t)}return n.copy_}function Vce(t,e,n=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&ER(e,n)}function Cq(t){t.finalized_=!0,t.scope_.unfinalizedDrafts_--}var zS=(t,e)=>t.scope_===e,Gce=[];function _q(t,e,n,i){const r=eu(t),s=t.type_;if(i!==void 0&&VO(r,i,s)===e){R1(r,i,n,s);return}if(!t.draftLocations_){const l=t.draftLocations_=new Map;BS(r,(u,d)=>{if(vu(d)){const f=l.get(d)||[];f.push(u),l.set(d,f)}})}const a=t.draftLocations_.get(e)??Gce;for(const l of a)R1(r,l,n,s)}function Xce(t,e,n){t.callbacks_.push(function(r){var l;const s=e;if(!s||!zS(s,r))return;(l=r.mapSetPlugin_)==null||l.fixSetContents(s);const a=OR(s);_q(t,s.draft_??s,a,n),kq(s,r)})}function kq(t,e){var i;if(t.modified_&&!t.finalized_&&(t.type_===3||t.type_===1&&t.allIndicesReassigned_||(((i=t.assigned_)==null?void 0:i.size)??0)>0)){const{patchPlugin_:r}=e;if(r){const s=r.getPath(t);s&&r.generatePatches_(t,s,e)}Cq(t)}}function Kce(t,e,n){const{scope_:i}=t;if(vu(n)){const r=n[no];zS(r,i)&&r.callbacks_.push(function(){PA(t);const a=OR(r);_q(t,n,a,e)})}else xl(n)&&t.callbacks_.push(function(){const s=eu(t);t.type_===3?s.has(n)&&N1(n,i.handledSet_,i):VO(s,e,t.type_)===n&&i.drafts_.length>1&&(t.assigned_.get(e)??!1)===!0&&t.copy_&&N1(VO(t.copy_,e,t.type_),i.handledSet_,i)})}function N1(t,e,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||vu(t)||e.has(t)||!xl(t)||$S(t)||(e.add(t),BS(t,(i,r)=>{if(vu(r)){const s=r[no];if(zS(s,n)){const a=OR(s);R1(t,i,a,t.type_),Cq(s)}}else xl(r)&&N1(r,e,n)})),t}function Zce(t,e){const n=LS(t),i={type_:n?1:0,scope_:e?e.scope_:jq(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:e,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let r=i,s=I1;n&&(r=[i],s=Pv);const{revoke:a,proxy:l}=Proxy.revocable(r,s);return i.draft_=l,i.revoke_=a,[l,i]}var I1={get(t,e){if(e===no)return t;let n=t.scope_.arrayMethodsPlugin_;const i=t.type_===1&&typeof e=="string";if(i&&n!=null&&n.isArrayOperationMethod(e))return n.createMethodInterceptor(t,e);const r=eu(t);if(!rL(r,e,t.type_))return Jce(t,r,e);const s=r[e];if(t.finalized_||!xl(s)||i&&t.operationMethod&&(n!=null&&n.isMutatingArrayMethod(t.operationMethod))&&Qce(e))return s;if(s===kk(t.base_,e)){PA(t);const a=t.type_===1?+e:e,l=e2(t.scope_,s,t,a);return t.copy_[a]=l}return s},has(t,e){return e in eu(t)},ownKeys(t){return Reflect.ownKeys(eu(t))},set(t,e,n){const i=Tq(eu(t),e);if(i!=null&&i.set)return i.set.call(t.draft_,n),!0;if(!t.modified_){const r=kk(eu(t),e),s=r==null?void 0:r[no];if(s&&s.base_===n)return t.copy_[e]=n,t.assigned_.set(e,!1),!0;if(qce(n,r)&&(n!==void 0||rL(t.base_,e,t.type_)))return!0;PA(t),JO(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),Kce(t,e,n)),!0},deleteProperty(t,e){return PA(t),kk(t.base_,e)!==void 0||e in t.base_?(t.assigned_.set(e,!1),JO(t)):t.assigned_.delete(e),t.copy_&&delete t.copy_[e],!0},getOwnPropertyDescriptor(t,e){const n=eu(t),i=Reflect.getOwnPropertyDescriptor(n,e);return i&&{[LA]:!0,[UO]:t.type_!==1||e!=="length",[M1]:i[M1],[Bv]:n[e]}},defineProperty(){nl(11)},getPrototypeOf(t){return Um(t.base_)},setPrototypeOf(){nl(12)}},Pv={};for(let t in I1){let e=I1[t];Pv[t]=function(){const n=arguments;return n[0]=n[0][0],e.apply(this,n)}}Pv.deleteProperty=function(t,e){return Pv.set.call(this,t,e,void 0)};Pv.set=function(t,e,n){return I1.set.call(this,t[0],e,n,t[0])};function kk(t,e){const n=t[no];return(n?eu(n):t)[e]}function Jce(t,e,n){var r;const i=Tq(e,n);return i?Bv in i?i[Bv]:(r=i.get)==null?void 0:r.call(t.draft_):void 0}function Tq(t,e){if(!(e in t))return;let n=Um(t);for(;n;){const i=Object.getOwnPropertyDescriptor(n,e);if(i)return i;n=Um(n)}}function JO(t){t.modified_||(t.modified_=!0,t.parent_&&JO(t.parent_))}function PA(t){t.copy_||(t.assigned_=new Map,t.copy_=GO(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var eue=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,n,i)=>{if(Lp(e)&&!Lp(n)){const s=n;n=e;const a=this;return function(u=s,...d){return a.produce(u,f=>n.call(this,f,...d))}}Lp(n)||nl(6),i!==void 0&&!Lp(i)&&nl(7);let r;if(xl(e)){const s=lL(this),a=e2(s,e,void 0);let l=!0;try{r=n(a),l=!1}finally{l?KO(s):ZO(s)}return aL(s,i),cL(r,s)}else if(!e||!TR(e)){if(r=n(e),r===void 0&&(r=e),r===Aq&&(r=void 0),this.autoFreeze_&&ER(r,!0),i){const s=[],a=[];Lf(XO).generateReplacementPatches_(e,r,{patches_:s,inversePatches_:a}),i(s,a)}return r}else nl(1,e)},this.produceWithPatches=(e,n)=>{if(Lp(e))return(a,...l)=>this.produceWithPatches(a,u=>e(u,...l));let i,r;return[this.produce(e,n,(a,l)=>{i=a,r=l}),i,r]},_k(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),_k(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),_k(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){xl(t)||nl(8),vu(t)&&(t=tue(t));const e=lL(this),n=e2(e,t,void 0);return n[no].isManual_=!0,ZO(e),n}finishDraft(t,e){const n=t&&t[no];(!n||!n.isManual_)&&nl(9);const{scope_:i}=n;return aL(i,e),cL(void 0,i)}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 r=e[n];if(r.path.length===0&&r.op==="replace"){t=r.value;break}}n>-1&&(e=e.slice(n+1));const i=Lf(XO).applyPatches_;return vu(t)?i(t,e):this.produce(t,r=>i(r,e))}};function e2(t,e,n,i){const[r,s]=PS(e)?Lf(D1).proxyMap_(e,n):FS(e)?Lf(D1).proxySet_(e,n):Zce(e,n);return((n==null?void 0:n.scope_)??jq()).drafts_.push(r),s.callbacks_=(n==null?void 0:n.callbacks_)??[],s.key_=i,n&&i!==void 0?Xce(n,s,i):s.callbacks_.push(function(u){var f;(f=u.mapSetPlugin_)==null||f.fixSetContents(s);const{patchPlugin_:d}=u;s.modified_&&d&&d.generatePatches_(s,[],u)}),r}function tue(t){return vu(t)||nl(10,t),Oq(t)}function Oq(t){if(!xl(t)||$S(t))return t;const e=t[no];let n,i=!0;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,n=GO(t,e.scope_.immer_.useStrictShallowCopy_),i=e.scope_.immer_.shouldUseStrictIteration()}else n=GO(t,!0);return BS(n,(r,s)=>{R1(n,r,Oq(s))},i),e&&(e.finalized_=!1),n}var nue=new eue,Eq=nue.produce;function Mq(t){return({dispatch:n,getState:i})=>r=>s=>typeof s=="function"?s(n,i,t):r(s)}var iue=Mq(),rue=Mq,sue=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?O1:O1.apply(null,arguments)};function Vm(t,e){function n(...i){if(e){let r=e(...i);if(!r)throw new Error(Jo(0));return{type:t,payload:r.payload,..."meta"in r&&{meta:r.meta},..."error"in r&&{error:r.error}}}return{type:t,payload:i[0]}}return n.toString=()=>`${t}`,n.type=t,n.match=i=>bq(i)&&i.type===t,n}var Rq=class V0 extends Array{constructor(...e){super(...e),Object.setPrototypeOf(this,V0.prototype)}static get[Symbol.species](){return V0}concat(...e){return super.concat.apply(this,e)}prepend(...e){return e.length===1&&Array.isArray(e[0])?new V0(...e[0].concat(this)):new V0(...e.concat(this))}};function hL(t){return xl(t)?Eq(t,()=>{}):t}function Hb(t,e,n){return t.has(e)?t.get(e):t.set(e,n(e)).get(e)}function oue(t){return typeof t=="boolean"}var aue=()=>function(e){const{thunk:n=!0,immutableCheck:i=!0,serializableCheck:r=!0,actionCreatorCheck:s=!0}=e??{};let a=new Rq;return n&&(oue(n)?a.push(iue):a.push(rue(n.extraArgument))),a},lue="RTK_autoBatch",dL=t=>e=>{setTimeout(e,t)},cue=(t,e)=>n=>{let i=!1;const r=()=>{i||(i=!0,cancelAnimationFrame(s),clearTimeout(a),n())},s=t(r),a=setTimeout(r,e)},uue=(t={type:"raf"})=>e=>(...n)=>{const i=e(...n);let r=!0,s=!1,a=!1;const l=new Set,u=t.type==="tick"?queueMicrotask:t.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?cue(window.requestAnimationFrame,100):dL(10):t.type==="callback"?t.queueNotification:dL(t.timeout),d=()=>{a=!1,s&&(s=!1,l.forEach(f=>f()))};return Object.assign({},i,{subscribe(f){const p=()=>r&&f(),m=i.subscribe(p);return l.add(f),()=>{m(),l.delete(f)}},dispatch(f){var p;try{return r=!((p=f==null?void 0:f.meta)!=null&&p[lue]),s=!r,s&&(a||(a=!0,u(d))),i.dispatch(f)}finally{r=!0}}})},hue=t=>function(n){const{autoBatch:i=!0}=n??{};let r=new Rq(t);return i&&r.push(uue(typeof i=="object"?i:void 0)),r};function due(t){const e=aue(),{reducer:n=void 0,middleware:i,devTools:r=!0,preloadedState:s=void 0,enhancers:a=void 0}=t||{};let l;if(typeof n=="function")l=n;else if(kR(n))l=$ce(n);else throw new Error(Jo(1));let u;typeof i=="function"?u=i(e):u=e();let d=O1;r&&(d=sue({trace:!1,...typeof r=="object"&&r}));const f=zce(...u),p=hue(f);let m=typeof a=="function"?a(p):p();const v=d(...m);return xq(l,s,v)}function Dq(t){const e={},n=[];let i;const r={addCase(s,a){const l=typeof s=="string"?s:s.type;if(!l)throw new Error(Jo(28));if(l in e)throw new Error(Jo(29));return e[l]=a,r},addAsyncThunk(s,a){return a.pending&&(e[s.pending.type]=a.pending),a.rejected&&(e[s.rejected.type]=a.rejected),a.fulfilled&&(e[s.fulfilled.type]=a.fulfilled),a.settled&&n.push({matcher:s.settled,reducer:a.settled}),r},addMatcher(s,a){return n.push({matcher:s,reducer:a}),r},addDefaultCase(s){return i=s,r}};return t(r),[e,n,i]}function fue(t){return typeof t=="function"}function pue(t,e){let[n,i,r]=Dq(e),s;if(fue(t))s=()=>hL(t());else{const l=hL(t);s=()=>l}function a(l=s(),u){let d=[n[u.type],...i.filter(({matcher:f})=>f(u)).map(({reducer:f})=>f)];return d.filter(f=>!!f).length===0&&(d=[r]),d.reduce((f,p)=>{if(p)if(vu(f)){const v=p(f,u);return v===void 0?f:v}else{if(xl(f))return Eq(f,m=>p(m,u));{const m=p(f,u);if(m===void 0){if(f===null)return f;throw Error("A case reducer on a non-draftable value must not return undefined")}return m}}return f},l)}return a.getInitialState=s,a}var mue="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",gue=(t=21)=>{let e="",n=t;for(;n--;)e+=mue[Math.random()*64|0];return e},vue=Symbol.for("rtk-slice-createasyncthunk");function yue(t,e){return`${t}/${e}`}function xue({creators:t}={}){var n;const e=(n=t==null?void 0:t.asyncThunk)==null?void 0:n[vue];return function(r){const{name:s,reducerPath:a=s}=r;if(!s)throw new Error(Jo(11));const l=(typeof r.reducers=="function"?r.reducers(Aue()):r.reducers)||{},u=Object.keys(l),d={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(C,k){const E=typeof C=="string"?C:C.type;if(!E)throw new Error(Jo(12));if(E in d.sliceCaseReducersByType)throw new Error(Jo(13));return d.sliceCaseReducersByType[E]=k,f},addMatcher(C,k){return d.sliceMatchers.push({matcher:C,reducer:k}),f},exposeAction(C,k){return d.actionCreators[C]=k,f},exposeCaseReducer(C,k){return d.sliceCaseReducersByName[C]=k,f}};u.forEach(C=>{const k=l[C],E={reducerName:C,type:yue(s,C),createNotation:typeof r.reducers=="function"};Sue(k)?Cue(E,k,f,e):wue(E,k,f)});function p(){const[C={},k=[],E=void 0]=typeof r.extraReducers=="function"?Dq(r.extraReducers):[r.extraReducers],M={...C,...d.sliceCaseReducersByType};return pue(r.initialState,R=>{for(let D in M)R.addCase(D,M[D]);for(let D of d.sliceMatchers)R.addMatcher(D.matcher,D.reducer);for(let D of k)R.addMatcher(D.matcher,D.reducer);E&&R.addDefaultCase(E)})}const m=C=>C,v=new Map,y=new WeakMap;let b;function A(C,k){return b||(b=p()),b(C,k)}function w(){return b||(b=p()),b.getInitialState()}function S(C,k=!1){function E(R){let D=R[C];return typeof D>"u"&&k&&(D=Hb(y,E,w)),D}function M(R=m){const D=Hb(v,k,()=>new WeakMap);return Hb(D,R,()=>{const F={};for(const[I,Q]of Object.entries(r.selectors??{}))F[I]=bue(Q,R,()=>Hb(y,R,w),k);return F})}return{reducerPath:C,getSelectors:M,get selectors(){return M(E)},selectSlice:E}}const j={name:s,reducer:A,actions:d.actionCreators,caseReducers:d.sliceCaseReducersByName,getInitialState:w,...S(a),injectInto(C,{reducerPath:k,...E}={}){const M=k??a;return C.inject({reducerPath:M,reducer:A},E),{...j,...S(M,!0)}}};return j}}function bue(t,e,n,i){function r(s,...a){let l=e(s);return typeof l>"u"&&i&&(l=n()),t(l,...a)}return r.unwrapped=t,r}var HS=xue();function Aue(){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 wue({type:t,reducerName:e,createNotation:n},i,r){let s,a;if("reducer"in i){if(n&&!jue(i))throw new Error(Jo(17));s=i.reducer,a=i.prepare}else s=i;r.addCase(t,s).exposeCaseReducer(e,s).exposeAction(e,a?Vm(t,a):Vm(t))}function Sue(t){return t._reducerDefinitionType==="asyncThunk"}function jue(t){return t._reducerDefinitionType==="reducerWithPrepare"}function Cue({type:t,reducerName:e},n,i,r){if(!r)throw new Error(Jo(18));const{payloadCreator:s,fulfilled:a,pending:l,rejected:u,settled:d,options:f}=n,p=r(t,s,f);i.exposeAction(e,p),a&&i.addCase(p.fulfilled,a),l&&i.addCase(p.pending,l),u&&i.addCase(p.rejected,u),d&&i.addMatcher(p.settled,d),i.exposeCaseReducer(e,{fulfilled:a||qb,pending:l||qb,rejected:u||qb,settled:d||qb})}function qb(){}var _ue="task",Nq="listener",Iq="completed",MR="cancelled",kue=`task-${MR}`,Tue=`task-${Iq}`,t2=`${Nq}-${MR}`,Oue=`${Nq}-${Iq}`,qS=class{constructor(t){Ke(this,"code");Ke(this,"name","TaskAbortError");Ke(this,"message");this.code=t,this.message=`${_ue} ${MR} (reason: ${t})`}},RR=(t,e)=>{if(typeof t!="function")throw new TypeError(Jo(32))},B1=()=>{},Bq=(t,e=B1)=>(t.catch(e),t),Lq=(t,e)=>(t.addEventListener("abort",e,{once:!0}),()=>t.removeEventListener("abort",e)),kf=t=>{if(t.aborted)throw new qS(t.reason)};function Pq(t,e){let n=B1;return new Promise((i,r)=>{const s=()=>r(new qS(t.reason));if(t.aborted){s();return}n=Lq(t,s),e.finally(()=>n()).then(i,r)}).finally(()=>{n=B1})}var Eue=async(t,e)=>{try{return await Promise.resolve(),{status:"ok",value:await t()}}catch(n){return{status:n instanceof qS?"cancelled":"rejected",error:n}}finally{e==null||e()}},L1=t=>e=>Bq(Pq(t,e).then(n=>(kf(t),n))),Fq=t=>{const e=L1(t);return n=>e(new Promise(i=>setTimeout(i,n)))},{assign:nm}=Object,fL={},QS="listenerMiddleware",Mue=(t,e)=>{const n=i=>Lq(t,()=>i.abort(t.reason));return(i,r)=>{RR(i);const s=new AbortController;n(s);const a=Eue(async()=>{kf(t),kf(s.signal);const l=await i({pause:L1(s.signal),delay:Fq(s.signal),signal:s.signal});return kf(s.signal),l},()=>s.abort(Tue));return r!=null&&r.autoJoin&&e.push(a.catch(B1)),{result:L1(t)(a),cancel(){s.abort(kue)}}}},Rue=(t,e)=>{const n=async(i,r)=>{kf(e);let s=()=>{};const l=[new Promise((u,d)=>{let f=t({predicate:i,effect:(p,m)=>{m.unsubscribe(),u([p,m.getState(),m.getOriginalState()])}});s=()=>{f(),d()}})];r!=null&&l.push(new Promise(u=>setTimeout(u,r,null)));try{const u=await Pq(e,Promise.race(l));return kf(e),u}finally{s()}};return((i,r)=>Bq(n(i,r)))},$q=t=>{let{type:e,actionCreator:n,matcher:i,predicate:r,effect:s}=t;if(e)r=Vm(e).match;else if(n)e=n.type,r=n.match;else if(i)r=i;else if(!r)throw new Error(Jo(21));return RR(s),{predicate:r,type:e,effect:s}},zq=nm(t=>{const{type:e,predicate:n,effect:i}=$q(t);return{id:gue(),effect:i,type:e,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Jo(22))}}},{withTypes:()=>zq}),pL=(t,e)=>{const{type:n,effect:i,predicate:r}=$q(e);return Array.from(t.values()).find(s=>(typeof n=="string"?s.type===n:s.predicate===r)&&s.effect===i)},n2=t=>{t.pending.forEach(e=>{e.abort(t2)})},Due=(t,e)=>()=>{for(const n of e.keys())n2(n);t.clear()},mL=(t,e,n)=>{try{t(e,n)}catch(i){setTimeout(()=>{throw i},0)}},Hq=nm(Vm(`${QS}/add`),{withTypes:()=>Hq}),Nue=Vm(`${QS}/removeAll`),qq=nm(Vm(`${QS}/remove`),{withTypes:()=>qq}),Iue=(...t)=>{console.error(`${QS}/error`,...t)},Bue=(t={})=>{const e=new Map,n=new Map,i=v=>{const y=n.get(v)??0;n.set(v,y+1)},r=v=>{const y=n.get(v)??1;y===1?n.delete(v):n.set(v,y-1)},{extra:s,onError:a=Iue}=t;RR(a);const l=v=>(v.unsubscribe=()=>e.delete(v.id),e.set(v.id,v),y=>{v.unsubscribe(),y!=null&&y.cancelActive&&n2(v)}),u=(v=>{const y=pL(e,v)??zq(v);return l(y)});nm(u,{withTypes:()=>u});const d=v=>{const y=pL(e,v);return y&&(y.unsubscribe(),v.cancelActive&&n2(y)),!!y};nm(d,{withTypes:()=>d});const f=async(v,y,b,A)=>{const w=new AbortController,S=Rue(u,w.signal),j=[];try{v.pending.add(w),i(v),await Promise.resolve(v.effect(y,nm({},b,{getOriginalState:A,condition:(C,k)=>S(C,k).then(Boolean),take:S,delay:Fq(w.signal),pause:L1(w.signal),extra:s,signal:w.signal,fork:Mue(w.signal,j),unsubscribe:v.unsubscribe,subscribe:()=>{e.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((C,k,E)=>{C!==w&&(C.abort(t2),E.delete(C))})},cancel:()=>{w.abort(t2),v.pending.delete(w)},throwIfCancelled:()=>{kf(w.signal)}})))}catch(C){C instanceof qS||mL(a,C,{raisedBy:"effect"})}finally{await Promise.all(j),w.abort(Oue),r(v),v.pending.delete(w)}},p=Due(e,n);return{middleware:v=>y=>b=>{if(!bq(b))return y(b);if(Hq.match(b))return u(b.payload);if(Nue.match(b)){p();return}if(qq.match(b))return d(b.payload);let A=v.getState();const w=()=>{if(A===fL)throw new Error(Jo(23));return A};let S;try{if(S=y(b),e.size>0){const j=v.getState(),C=Array.from(e.values());for(const k of C){let E=!1;try{E=k.predicate(b,j,A)}catch(M){E=!1,mL(a,M,{raisedBy:"predicate"})}E&&f(k,b,v,w)}}}finally{A=fL}return S},startListening:u,stopListening:d,clearListeners:p}};function Jo(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 FA={exports:{}},Lue=FA.exports,gL;function Qq(){return gL||(gL=1,(function(t,e){(function(n,i){t.exports=i()})(Lue,(function(){var n=1e3,i=6e4,r=36e5,s="millisecond",a="second",l="minute",u="hour",d="day",f="week",p="month",m="quarter",v="year",y="date",b="Invalid Date",A=/^(\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,S={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(L){var q=["th","st","nd","rd"],N=L%100;return"["+L+(q[(N-20)%10]||q[N]||q[0])+"]"}},j=function(L,q,N){var P=String(L);return!P||P.length>=q?L:""+Array(q+1-P.length).join(N)+L},C={s:j,z:function(L){var q=-L.utcOffset(),N=Math.abs(q),P=Math.floor(N/60),Y=N%60;return(q<=0?"+":"-")+j(P,2,"0")+":"+j(Y,2,"0")},m:function L(q,N){if(q.date()<N.date())return-L(N,q);var P=12*(N.year()-q.year())+(N.month()-q.month()),Y=q.clone().add(P,p),K=N-Y<0,W=q.clone().add(P+(K?-1:1),p);return+(-(P+(N-Y)/(K?Y-W:W-Y))||0)},a:function(L){return L<0?Math.ceil(L)||0:Math.floor(L)},p:function(L){return{M:p,y:v,w:f,d,D:y,h:u,m:l,s:a,ms:s,Q:m}[L]||String(L||"").toLowerCase().replace(/s$/,"")},u:function(L){return L===void 0}},k="en",E={};E[k]=S;var M="$isDayjsObject",R=function(L){return L instanceof Q||!(!L||!L[M])},D=function L(q,N,P){var Y;if(!q)return k;if(typeof q=="string"){var K=q.toLowerCase();E[K]&&(Y=K),N&&(E[K]=N,Y=K);var W=q.split("-");if(!Y&&W.length>1)return L(W[0])}else{var z=q.name;E[z]=q,Y=z}return!P&&Y&&(k=Y),Y||!P&&k},F=function(L,q){if(R(L))return L.clone();var N=typeof q=="object"?q:{};return N.date=L,N.args=arguments,new Q(N)},I=C;I.l=D,I.i=R,I.w=function(L,q){return F(L,{locale:q.$L,utc:q.$u,x:q.$x,$offset:q.$offset})};var Q=(function(){function L(N){this.$L=D(N.locale,null,!0),this.parse(N),this.$x=this.$x||N.x||{},this[M]=!0}var q=L.prototype;return q.parse=function(N){this.$d=(function(P){var Y=P.date,K=P.utc;if(Y===null)return new Date(NaN);if(I.u(Y))return new Date;if(Y instanceof Date)return new Date(Y);if(typeof Y=="string"&&!/Z$/i.test(Y)){var W=Y.match(A);if(W){var z=W[2]-1||0,U=(W[7]||"0").substring(0,3);return K?new Date(Date.UTC(W[1],z,W[3]||1,W[4]||0,W[5]||0,W[6]||0,U)):new Date(W[1],z,W[3]||1,W[4]||0,W[5]||0,W[6]||0,U)}}return new Date(Y)})(N),this.init()},q.init=function(){var N=this.$d;this.$y=N.getFullYear(),this.$M=N.getMonth(),this.$D=N.getDate(),this.$W=N.getDay(),this.$H=N.getHours(),this.$m=N.getMinutes(),this.$s=N.getSeconds(),this.$ms=N.getMilliseconds()},q.$utils=function(){return I},q.isValid=function(){return this.$d.toString()!==b},q.isSame=function(N,P){var Y=F(N);return this.startOf(P)<=Y&&Y<=this.endOf(P)},q.isAfter=function(N,P){return F(N)<this.startOf(P)},q.isBefore=function(N,P){return this.endOf(P)<F(N)},q.$g=function(N,P,Y){return I.u(N)?this[P]:this.set(Y,N)},q.unix=function(){return Math.floor(this.valueOf()/1e3)},q.valueOf=function(){return this.$d.getTime()},q.startOf=function(N,P){var Y=this,K=!!I.u(P)||P,W=I.p(N),z=function(Te,Re){var qe=I.w(Y.$u?Date.UTC(Y.$y,Re,Te):new Date(Y.$y,Re,Te),Y);return K?qe:qe.endOf(d)},U=function(Te,Re){return I.w(Y.toDate()[Te].apply(Y.toDate("s"),(K?[0,0,0,0]:[23,59,59,999]).slice(Re)),Y)},V=this.$W,J=this.$M,ee=this.$D,ce="set"+(this.$u?"UTC":"");switch(W){case v:return K?z(1,0):z(31,11);case p:return K?z(1,J):z(0,J+1);case f:var he=this.$locale().weekStart||0,Oe=(V<he?V+7:V)-he;return z(K?ee-Oe:ee+(6-Oe),J);case d:case y:return U(ce+"Hours",0);case u:return U(ce+"Minutes",1);case l:return U(ce+"Seconds",2);case a:return U(ce+"Milliseconds",3);default:return this.clone()}},q.endOf=function(N){return this.startOf(N,!1)},q.$set=function(N,P){var Y,K=I.p(N),W="set"+(this.$u?"UTC":""),z=(Y={},Y[d]=W+"Date",Y[y]=W+"Date",Y[p]=W+"Month",Y[v]=W+"FullYear",Y[u]=W+"Hours",Y[l]=W+"Minutes",Y[a]=W+"Seconds",Y[s]=W+"Milliseconds",Y)[K],U=K===d?this.$D+(P-this.$W):P;if(K===p||K===v){var V=this.clone().set(y,1);V.$d[z](U),V.init(),this.$d=V.set(y,Math.min(this.$D,V.daysInMonth())).$d}else z&&this.$d[z](U);return this.init(),this},q.set=function(N,P){return this.clone().$set(N,P)},q.get=function(N){return this[I.p(N)]()},q.add=function(N,P){var Y,K=this;N=Number(N);var W=I.p(P),z=function(J){var ee=F(K);return I.w(ee.date(ee.date()+Math.round(J*N)),K)};if(W===p)return this.set(p,this.$M+N);if(W===v)return this.set(v,this.$y+N);if(W===d)return z(1);if(W===f)return z(7);var U=(Y={},Y[l]=i,Y[u]=r,Y[a]=n,Y)[W]||1,V=this.$d.getTime()+N*U;return I.w(V,this)},q.subtract=function(N,P){return this.add(-1*N,P)},q.format=function(N){var P=this,Y=this.$locale();if(!this.isValid())return Y.invalidDate||b;var K=N||"YYYY-MM-DDTHH:mm:ssZ",W=I.z(this),z=this.$H,U=this.$m,V=this.$M,J=Y.weekdays,ee=Y.months,ce=Y.meridiem,he=function(Re,qe,ie,je){return Re&&(Re[qe]||Re(P,K))||ie[qe].slice(0,je)},Oe=function(Re){return I.s(z%12||12,Re,"0")},Te=ce||function(Re,qe,ie){var je=Re<12?"AM":"PM";return ie?je.toLowerCase():je};return K.replace(w,(function(Re,qe){return qe||(function(ie){switch(ie){case"YY":return String(P.$y).slice(-2);case"YYYY":return I.s(P.$y,4,"0");case"M":return V+1;case"MM":return I.s(V+1,2,"0");case"MMM":return he(Y.monthsShort,V,ee,3);case"MMMM":return he(ee,V);case"D":return P.$D;case"DD":return I.s(P.$D,2,"0");case"d":return String(P.$W);case"dd":return he(Y.weekdaysMin,P.$W,J,2);case"ddd":return he(Y.weekdaysShort,P.$W,J,3);case"dddd":return J[P.$W];case"H":return String(z);case"HH":return I.s(z,2,"0");case"h":return Oe(1);case"hh":return Oe(2);case"a":return Te(z,U,!0);case"A":return Te(z,U,!1);case"m":return String(U);case"mm":return I.s(U,2,"0");case"s":return String(P.$s);case"ss":return I.s(P.$s,2,"0");case"SSS":return I.s(P.$ms,3,"0");case"Z":return W}return null})(Re)||W.replace(":","")}))},q.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},q.diff=function(N,P,Y){var K,W=this,z=I.p(P),U=F(N),V=(U.utcOffset()-this.utcOffset())*i,J=this-U,ee=function(){return I.m(W,U)};switch(z){case v:K=ee()/12;break;case p:K=ee();break;case m:K=ee()/3;break;case f:K=(J-V)/6048e5;break;case d:K=(J-V)/864e5;break;case u:K=J/r;break;case l:K=J/i;break;case a:K=J/n;break;default:K=J}return Y?K:I.a(K)},q.daysInMonth=function(){return this.endOf(p).$D},q.$locale=function(){return E[this.$L]},q.locale=function(N,P){if(!N)return this.$L;var Y=this.clone(),K=D(N,P,!0);return K&&(Y.$L=K),Y},q.clone=function(){return I.w(this.$d,this)},q.toDate=function(){return new Date(this.valueOf())},q.toJSON=function(){return this.isValid()?this.toISOString():null},q.toISOString=function(){return this.$d.toISOString()},q.toString=function(){return this.$d.toUTCString()},L})(),G=Q.prototype;return F.prototype=G,[["$ms",s],["$s",a],["$m",l],["$H",u],["$W",d],["$M",p],["$y",v],["$D",y]].forEach((function(L){G[L[1]]=function(q){return this.$g(q,L[0],L[1])}})),F.extend=function(L,q){return L.$i||(L(q,Q,F),L.$i=!0),F},F.locale=D,F.isDayjs=R,F.unix=function(L){return F(1e3*L)},F.en=E[k],F.Ls=E,F.p={},F}))})(FA)),FA.exports}var Pue=Qq();const De=Al(Pue);var $A={exports:{}},Fue=$A.exports,vL;function $ue(){return vL||(vL=1,(function(t,e){(function(n,i){t.exports=i()})(Fue,(function(){var n,i,r=1e3,s=6e4,a=36e5,l=864e5,u=31536e6,d=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:u,months:d,days:l,hours:a,minutes:s,seconds:r,milliseconds:1,weeks:6048e5},v=function(E){return E instanceof C},y=function(E,M,R){return new C(E,R,M.$l)},b=function(E){return i.p(E)+"s"},A=function(E){return E<0},w=function(E){return A(E)?Math.ceil(E):Math.floor(E)},S=function(E){return Math.abs(E)},j=function(E,M){return E?A(E)?{negative:!0,format:""+S(E)+M}:{negative:!1,format:""+E+M}:{negative:!1,format:""}},C=(function(){function E(R,D,F){var I=this;if(this.$d={},this.$l=F,R===void 0&&(this.$ms=0,this.parseFromMilliseconds()),D)return y(R*m[b(D)],this);if(typeof R=="number")return this.$ms=R,this.parseFromMilliseconds(),this;if(typeof R=="object")return Object.keys(R).forEach((function(L){I.$d[b(L)]=R[L]})),this.calMilliseconds(),this;if(typeof R=="string"){var Q=R.match(f);if(Q){var G=Q.slice(2).map((function(L){return L!=null?Number(L):0}));return this.$d.years=G[0],this.$d.months=G[1],this.$d.weeks=G[2],this.$d.days=G[3],this.$d.hours=G[4],this.$d.minutes=G[5],this.$d.seconds=G[6],this.calMilliseconds(),this}}return this}var M=E.prototype;return M.calMilliseconds=function(){var R=this;this.$ms=Object.keys(this.$d).reduce((function(D,F){return D+(R.$d[F]||0)*m[F]}),0)},M.parseFromMilliseconds=function(){var R=this.$ms;this.$d.years=w(R/u),R%=u,this.$d.months=w(R/d),R%=d,this.$d.days=w(R/l),R%=l,this.$d.hours=w(R/a),R%=a,this.$d.minutes=w(R/s),R%=s,this.$d.seconds=w(R/r),R%=r,this.$d.milliseconds=R},M.toISOString=function(){var R=j(this.$d.years,"Y"),D=j(this.$d.months,"M"),F=+this.$d.days||0;this.$d.weeks&&(F+=7*this.$d.weeks);var I=j(F,"D"),Q=j(this.$d.hours,"H"),G=j(this.$d.minutes,"M"),L=this.$d.seconds||0;this.$d.milliseconds&&(L+=this.$d.milliseconds/1e3,L=Math.round(1e3*L)/1e3);var q=j(L,"S"),N=R.negative||D.negative||I.negative||Q.negative||G.negative||q.negative,P=Q.format||G.format||q.format?"T":"",Y=(N?"-":"")+"P"+R.format+D.format+I.format+P+Q.format+G.format+q.format;return Y==="P"||Y==="-P"?"P0D":Y},M.toJSON=function(){return this.toISOString()},M.format=function(R){var D=R||"YYYY-MM-DDTHH:mm:ss",F={Y:this.$d.years,YY:i.s(this.$d.years,2,"0"),YYYY:i.s(this.$d.years,4,"0"),M:this.$d.months,MM:i.s(this.$d.months,2,"0"),D:this.$d.days,DD:i.s(this.$d.days,2,"0"),H:this.$d.hours,HH:i.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:i.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:i.s(this.$d.seconds,2,"0"),SSS:i.s(this.$d.milliseconds,3,"0")};return D.replace(p,(function(I,Q){return Q||String(F[I])}))},M.as=function(R){return this.$ms/m[b(R)]},M.get=function(R){var D=this.$ms,F=b(R);return F==="milliseconds"?D%=1e3:D=F==="weeks"?w(D/m[F]):this.$d[F],D||0},M.add=function(R,D,F){var I;return I=D?R*m[b(D)]:v(R)?R.$ms:y(R,this).$ms,y(this.$ms+I*(F?-1:1),this)},M.subtract=function(R,D){return this.add(R,D,!0)},M.locale=function(R){var D=this.clone();return D.$l=R,D},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")},E})(),k=function(E,M,R){return E.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(E,M,R){n=R,i=R().$utils(),R.duration=function(I,Q){var G=R.locale();return y(I,{$l:G},Q)},R.isDuration=v;var D=M.prototype.add,F=M.prototype.subtract;M.prototype.add=function(I,Q){return v(I)?k(this,I,1):D.bind(this)(I,Q)},M.prototype.subtract=function(I,Q){return v(I)?k(this,I,-1):F.bind(this)(I,Q)}}}))})($A)),$A.exports}var zue=$ue();const Hue=Al(zue);var zA={exports:{}},que=zA.exports,yL;function Que(){return yL||(yL=1,(function(t,e){(function(n,i){t.exports=i()})(que,(function(){var n="minute",i=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(s,a,l){var u=a.prototype;l.utc=function(b){var A={date:b,utc:!0,args:arguments};return new a(A)},u.utc=function(b){var A=l(this.toDate(),{locale:this.$L,utc:!0});return b?A.add(this.utcOffset(),n):A},u.local=function(){return l(this.toDate(),{locale:this.$L,utc:!1})};var d=u.parse;u.parse=function(b){b.utc&&(this.$u=!0),this.$utils().u(b.$offset)||(this.$offset=b.$offset),d.call(this,b)};var f=u.init;u.init=function(){if(this.$u){var b=this.$d;this.$y=b.getUTCFullYear(),this.$M=b.getUTCMonth(),this.$D=b.getUTCDate(),this.$W=b.getUTCDay(),this.$H=b.getUTCHours(),this.$m=b.getUTCMinutes(),this.$s=b.getUTCSeconds(),this.$ms=b.getUTCMilliseconds()}else f.call(this)};var p=u.utcOffset;u.utcOffset=function(b,A){var w=this.$utils().u;if(w(b))return this.$u?0:w(this.$offset)?p.call(this):this.$offset;if(typeof b=="string"&&(b=(function(k){k===void 0&&(k="");var E=k.match(i);if(!E)return null;var M=(""+E[0]).match(r)||["-",0,0],R=M[0],D=60*+M[1]+ +M[2];return D===0?0:R==="+"?D:-D})(b),b===null))return this;var S=Math.abs(b)<=16?60*b:b;if(S===0)return this.utc(A);var j=this.clone();if(A)return j.$offset=S,j.$u=!1,j;var C=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(j=this.local().add(S+C,n)).$offset=S,j.$x.$localOffset=C,j};var m=u.format;u.format=function(b){var A=b||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return m.call(this,A)},u.valueOf=function(){var b=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*b},u.isUTC=function(){return!!this.$u},u.toISOString=function(){return this.toDate().toISOString()},u.toString=function(){return this.toDate().toUTCString()};var v=u.toDate;u.toDate=function(b){return b==="s"&&this.$offset?l(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():v.call(this)};var y=u.diff;u.diff=function(b,A,w){if(b&&this.$u===b.$u)return y.call(this,b,A,w);var S=this.local(),j=l(b).local();return y.call(S,j,A,w)}}}))})(zA)),zA.exports}var Yue=Que();const Yq=Al(Yue);De.extend(Hue);De.extend(Yq);const DR=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 i=0;const r=(s,a)=>{if(n[s]===void 0)return;const l=parseInt(n[s]);i+=l*a};return r(2,1e3*60*60*24*365),r(4,1e3*60*60*24*7),r(6,1e3*60*60*24),r(8,1e3*60*60),r(10,1e3*60),r(12,1e3),r(14,1),i},Wq=(t,e,n)=>{if(t===0)return"0s";const i=t<0?"-":"";let r=Math.abs(t);const s=[];for(const{unit:a,mult:l,exact:u}of[{unit:"y",mult:1e3*60*60*24*365,exact:!0},{unit:"w",mult:1e3*60*60*24*7,exact:!0},{unit:"d",mult:1e3*60*60*24,exact:!1},{unit:"h",mult:1e3*60*60,exact:!1},{unit:"m",mult:1e3*60,exact:!1},{unit:"s",mult:1e3,exact:!1},{unit:"ms",mult:1,exact:!1}]){if(u&&r%l!==0)continue;const d=Math.floor(r/l);if(d>0)if(r-=d*l,n&&a==="s"&&r>0){s.push(`${parseFloat((d+r/1e3).toFixed(3))}s`);break}else s.push(`${d}${a}`);s.length==0&&a=="ms"&&s.push(`${Math.round(r)}ms`)}return i+s.join(e||"")},Gn=t=>Wq(t);function Wue(t){return De.utc(t).valueOf()}const P1=()=>De().valueOf(),im=t=>Wq(t," ",!0),F1=(t,e,n=" ago")=>{const i=Wue(t);return i<0?"never":im(e-i)+n},Tf=(t,e)=>e?De.unix(t).tz(De.tz.guess()).format():De.unix(t).utc().format();function xL(t){return De.utc(t).valueOf()}const Uue=t=>{const e=new URLSearchParams(t),n=[];for(let i=0;e.has(`g${i}.expr`);i++){const r=YS(),s=(a,l)=>{const u=`g${i}.${a}`;e.has(u)&&l(e.get(u))};s("expr",a=>{r.expr=a}),s("show_tree",a=>{r.showTree=a==="1"}),s("tab",a=>{switch(a){case"0":case"graph":r.visualizer.activeTab="graph";break;case"1":case"table":r.visualizer.activeTab="table";break;case"explain":r.visualizer.activeTab="explain";break;default:console.log("Unknown tab",a)}}),s("display_mode",a=>{r.visualizer.displayMode=a}),s("stacked",a=>{r.visualizer.displayMode=a==="1"?Gm.Stacked:Gm.Lines}),s("y_axis_min",a=>{r.visualizer.yAxisMin=a===""?null:parseFloat(a)}),s("show_exemplars",a=>{r.visualizer.showExemplars=a==="1"}),s("range_input",a=>{r.visualizer.range=DR(a)||r.visualizer.range}),s("end_input",a=>{r.visualizer.endTime=xL(a)}),s("step_input",a=>{parseInt(a)>0&&(r.visualizer.resolution={type:"custom",step:parseInt(a)*1e3})}),s("res_type",a=>{switch(a){case"auto":s("res_density",l=>{["low","medium","high"].includes(l)&&(r.visualizer.resolution={type:"auto",density:l})});break;case"fixed":s("res_step",l=>{r.visualizer.resolution={type:"fixed",step:parseFloat(l)*1e3}});break;case"custom":s("res_step",l=>{r.visualizer.resolution={type:"custom",step:parseFloat(l)*1e3}});break;default:console.log("Unknown resolution type",a)}}),s("moment_input",a=>{r.visualizer.endTime=xL(a)}),n.push(r)}return n};function bL(t){return De.utc(t).format("YYYY-MM-DD HH:mm:ss")}const Vue=t=>{const e=new URLSearchParams,n=(i,r,s)=>e.append(`g${i}.${r}`,s);return t.forEach((i,r)=>{switch(n(r,"expr",i.expr),n(r,"show_tree",i.showTree?"1":"0"),n(r,"tab",i.visualizer.activeTab),i.visualizer.endTime!==null&&(n(r,"end_input",bL(i.visualizer.endTime)),n(r,"moment_input",bL(i.visualizer.endTime))),n(r,"range_input",Gn(i.visualizer.range)),i.visualizer.resolution.type){case"auto":n(r,"res_type","auto"),n(r,"res_density",i.visualizer.resolution.density);break;case"fixed":n(r,"res_type","fixed"),n(r,"res_step",(i.visualizer.resolution.step/1e3).toString());break;case"custom":n(r,"res_type","custom"),n(r,"res_step",(i.visualizer.resolution.step/1e3).toString());break}n(r,"display_mode",i.visualizer.displayMode),i.visualizer.yAxisMin!==null&&n(r,"y_axis_min",i.visualizer.yAxisMin.toString()),n(r,"show_exemplars",i.visualizer.showExemplars?"1":"0")}),e},zo=(t,e)=>{const n=localStorage.getItem(t);return n===null?e:JSON.parse(n)},Uq="queryPage.queryHistory";var Gm=(t=>(t.Lines="lines",t.Stacked="stacked",t.Heatmap="heatmap",t))(Gm||{});const HA=(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}},YS=()=>({id:Pm(),expr:"",showTree:!1,showMetricsExplorer:!1,visualizer:{activeTab:"table",endTime:null,range:3600*1e3,resolution:{type:"auto",density:"medium"},displayMode:"lines",showExemplars:!1,yAxisMin:null}}),Gue={panels:[YS()],queryHistory:zo(Uq,[])},Op=t=>{const e="?"+Vue(t).toString();window.history.pushState({},"",e)},Vq=HS({name:"queryPage",initialState:Gue,reducers:{setPanels:(t,{payload:e})=>{t.panels=e},addPanel:t=>{t.panels.push(YS()),Op(t.panels)},duplicatePanel:(t,{payload:e})=>{const n={...t.panels[e.idx],id:Pm(),expr:e.expr};t.panels.splice(e.idx+1,0,n),Op(t.panels)},removePanel:(t,{payload:e})=>{t.panels.splice(e,1),Op(t.panels)},setExpr:(t,{payload:e})=>{t.panels[e.idx].expr=e.expr,Op(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,Op(t.panels)},setVisualizer:(t,{payload:e})=>{t.panels[e.idx].visualizer=e.visualizer,Op(t.panels)}}}),{setPanels:AL,addPanel:Xue,removePanel:Kue,duplicatePanel:Zue,setExpr:Jue,addQueryToHistory:Gq,setShowTree:Tk,setVisualizer:gh}=Vq.actions,ehe=Vq.reducer;function the({direction:t,levelIndex:e,rowIndex:n,cellIndex:i,size:r}){switch(t){case"up":return e===0&&n===0?null:n===0?{levelIndex:e-1,rowIndex:i<=r[e-1][r[e-1].length-1]-1?r[e-1].length-1:r[e-1].length-2,cellIndex:i}:{levelIndex:e,rowIndex:n-1,cellIndex:i};case"down":return n===r[e].length-1?{levelIndex:e+1,rowIndex:0,cellIndex:i}:n===r[e].length-2&&i>=r[e][r[e].length-1]?{levelIndex:e+1,rowIndex:0,cellIndex:i}:{levelIndex:e,rowIndex:n+1,cellIndex:i};case"left":return e===0&&n===0&&i===0?null:n===0&&i===0?{levelIndex:e-1,rowIndex:r[e-1].length-1,cellIndex:r[e-1][r[e-1].length-1]-1}:i===0?{levelIndex:e,rowIndex:n-1,cellIndex:r[e][n-1]-1}:{levelIndex:e,rowIndex:n,cellIndex:i-1};case"right":return n===r[e].length-1&&i===r[e][n]-1?{levelIndex:e+1,rowIndex:0,cellIndex:0}:i===r[e][n]-1?{levelIndex:e,rowIndex:n+1,cellIndex:0}:{levelIndex:e,rowIndex:n,cellIndex:i+1};default:return{levelIndex:e,rowIndex:n,cellIndex:i}}}function Xq({controlsRef:t,direction:e,levelIndex:n,rowIndex:i,cellIndex:r,size:s}){var u,d,f;const a=the({direction:e,size:s,rowIndex:i,cellIndex:r,levelIndex:n});if(!a)return;const l=(f=(d=(u=t.current)==null?void 0:u[a.levelIndex])==null?void 0:d[a.rowIndex])==null?void 0:f[a.cellIndex];l&&(l.disabled||l.getAttribute("data-hidden")||l.getAttribute("data-outside")?Xq({controlsRef:t,direction:e,levelIndex:a.levelIndex,cellIndex:a.cellIndex,rowIndex:a.rowIndex,size:s}):l.focus())}function nhe(t){switch(t){case"ArrowDown":return"down";case"ArrowUp":return"up";case"ArrowRight":return"right";case"ArrowLeft":return"left";default:return null}}function ihe(t){var e;return(e=t.current)==null?void 0:e.map(n=>n.map(i=>i.length))}function NR({controlsRef:t,levelIndex:e,rowIndex:n,cellIndex:i,event:r}){const s=nhe(r.key);s&&(r.preventDefault(),Xq({controlsRef:t,direction:s,levelIndex:e,rowIndex:n,cellIndex:i,size:ihe(t)}))}function Ep(t,e){let n=t?De(t):De();if(e==="")return n.format("YYYY-MM-DD HH:mm:ss");const[i,r,s=0]=e.split(":").map(Number);return n=n.set("hour",i),n=n.set("minute",r),n=n.set("second",s),n=n.set("millisecond",0),n.format("YYYY-MM-DD HH:mm:ss")}function Ls(t){return t==null||t===""?t:De(t).format("YYYY-MM-DD")}function Wp(t){return t==null||t===""?t:De(t).format("YYYY-MM-DD HH:mm:ss")}function rhe({minDate:t,maxDate:e}){const n=De();return!t&&!e?Ls(n):t&&De(n).isBefore(t)?Ls(t):e&&De(n).isAfter(e)?Ls(e):Ls(n)}function rm(t,e,n){return!t&&!e?Wp(n):t&&De(n).isBefore(t)?Wp(t):e&&De(n).isAfter(e)?Wp(e):Wp(n)}const she={locale:"en",firstDayOfWeek:1,weekendDays:[0,6],labelSeparator:"–",consistentWeeks:!1},ohe=T.createContext(she);function Ou(){const t=T.use(ohe),e=T.useCallback(s=>s||t.locale,[t.locale]),n=T.useCallback(s=>typeof s=="number"?s:t.firstDayOfWeek,[t.firstDayOfWeek]),i=T.useCallback(s=>Array.isArray(s)?s:t.weekendDays,[t.weekendDays]),r=T.useCallback(s=>typeof s=="string"?s:t.labelSeparator,[t.labelSeparator]);return{...t,getLocale:e,getFirstDayOfWeek:n,getWeekendDays:i,getLabelSeparator:r}}function ahe({value:t,type:e,withTime:n}){const i=n?Wp:Ls;if(e==="range"&&Array.isArray(t)){const r=i(t[0]),s=i(t[1]);return r?s?`${r} – ${s}`:`${r} –`:""}return e==="multiple"&&Array.isArray(t)?t.filter(Boolean).join(", "):!Array.isArray(t)&&t?i(t):""}function Kq({value:t,type:e,name:n,form:i,withTime:r=!1}){return o.jsx("input",{type:"hidden",value:ahe({value:t,type:e,withTime:r}),name:n,form:i})}Kq.displayName="@mantine/dates/HiddenDatesInput";function bs(t){return t<10?`0${t}`:`${t}`}function $1(t){const[e=null,n=null,i=null]=t.split(":").map(Number);return{hours:e,minutes:n,seconds:i}}function lhe(t,e){return`${t.getHours()}:${t.getMinutes()}${e?`:${t.getSeconds()}`:""}`}function che({value:t,format:e,amPmLabels:n,withSeconds:i}){const r=$1(typeof t=="string"?t:lhe(t,i));if(r.hours===null||r.minutes===null)return null;if(e==="24h")return`${bs(r.hours)}:${bs(r.minutes)}${i?`:${bs(r.seconds||0)}`:""}`;const s=r.hours>=12;return`${r.hours%12===0?12:r.hours%12}:${bs(r.minutes)}${i?`:${bs(r.seconds||0)}`:""} ${s?n.pm:n.am}`}function Zq({value:t,format:e="24h",amPmLabels:n={am:"AM",pm:"PM"},withSeconds:i=!1}){return o.jsx(o.Fragment,{children:che({value:t,format:e,amPmLabels:n,withSeconds:i})})}Zq.displayName="@mantine/dates/TimeValue";const uhe=t=>Number(t.toFixed(0)[0]);function qA({value:t,min:e,max:n,onChange:i,focusable:r,step:s,onNextInput:a,onPreviousInput:l,onFocus:u,readOnly:d,allowTemporaryZero:f=!1,placeholder:p="--",disableAutoAdvance:m=!1,...v}){const y=Number.isFinite(n),b=y?uhe(n):1/0,A=y?n+1-s:n,w=j=>{if(d)return;const C=j.replace(/\D/g,"");if(C!==""){let k=0;for(let M=0;M<C.length;M+=1){const R=C.charCodeAt(M)-48,D=k*10+R;k=D>n?R:D}const E=f&&k===0&&e>0?0:Yh(k,e,n);i(E),!m&&(E>b||j.startsWith("00"))&&(a==null||a())}},S=j=>{if(!d){if(j.key==="0"||j.key==="Num0"){const{selectionStart:C,selectionEnd:k,value:E}=j.currentTarget,M=E.length>0&&C===0&&k===E.length;t===0&&!M&&(j.preventDefault(),a==null||a())}j.key==="Home"&&(j.preventDefault(),i(e)),j.key==="End"&&y&&(j.preventDefault(),i(n)),(j.key==="Backspace"||j.key==="Delete")&&(j.preventDefault(),t!==null?i(null):l==null||l()),j.key==="ArrowRight"&&(j.preventDefault(),a==null||a()),j.key==="ArrowLeft"&&(j.preventDefault(),l==null||l()),j.key==="ArrowUp"&&(j.preventDefault(),i(t===null?e:Yh(t+s,e,A))),j.key==="ArrowDown"&&(j.preventDefault(),i(t===null?y?A:e:Yh(t-s,e,A)))}};return o.jsx("input",{type:"text",role:"spinbutton","aria-valuemin":e,"aria-valuemax":y?n:void 0,"aria-valuenow":t===null?0:t,"data-empty":t===null||void 0,inputMode:"numeric",placeholder:p,value:t===null?"":bs(t),onChange:j=>w(j.currentTarget.value),onKeyDown:S,onFocus:j=>{j.currentTarget.select(),u==null||u(j)},onClick:j=>{j.stopPropagation(),j.currentTarget.select()},onMouseDown:j=>j.stopPropagation(),...v})}qA.displayName="@mantine/dates/SpinInput";const[hhe,Wf]=rs("TimeInput component was not found in the component tree");function Jq({labels:t,value:e,onChange:n,className:i,style:r,onPreviousInput:s,readOnly:a,onMouseDown:l,onTouchStart:u,inputType:d,...f}){const p=Wf(),m=v=>{a||(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(d==="input"){const v=e||"--",y=v.length+1;return o.jsx("input",{...p.getStyles("field",{className:i,style:r}),value:v,size:y,onChange:b=>!a&&n(b.target.value||null),onClick:(b=>b.stopPropagation()),onKeyDown:m,onMouseDown:b=>{b.stopPropagation(),l==null||l(b)},"data-am-pm":!0,...f})}return o.jsxs("select",{...p.getStyles("field",{className:i,style:r}),value:e||"",onChange:v=>!a&&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:[o.jsx("option",{value:"",children:"--"}),o.jsx("option",{value:t.am,children:t.am}),o.jsx("option",{value:t.pm,children:t.pm})]})}Jq.displayName="@mantine/dates/AmPmInput";function IR({value:t,active:e,onSelect:n}){const i=Wf();return o.jsx(Fi,{mod:{active:e},onClick:()=>n(t),onMouseDown:r=>r.preventDefault(),"data-value":t,tabIndex:-1,...i.getStyles("control"),children:typeof t=="number"?bs(t):t})}IR.displayName="@mantine/dates/TimeControl";function e7({labels:t,value:e,onSelect:n}){const i=Wf(),r=[t.am,t.pm].map(s=>o.jsx(IR,{value:s,active:e===s,onSelect:n},s));return o.jsx("div",{...i.getStyles("controlsList"),children:r})}e7.displayName="@mantine/dates/AmPmControlsList";function dhe(t,e){if(!t||!e)return!1;const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return n.top>=i.top&&n.bottom<=i.bottom&&n.left>=i.left&&n.right<=i.right}function fhe(t,e,n){const i=[];for(let r=t;r<=e;r+=n)i.push(r);return i}function QA({min:t,max:e,step:n,value:i,onSelect:r,reversed:s}){const a=Wf(),l=T.useRef(null),u=fhe(t,e,n),d=(s?u.reverse():u).map(f=>o.jsx(IR,{value:f,active:i===f,onSelect:r},f));return T.useEffect(()=>{i!==null&&requestAnimationFrame(()=>{var m;const p=(m=l.current)==null?void 0:m.querySelector(`[data-value="${i}"]`);dhe(p,l.current)||p==null||p.scrollIntoView({block:"nearest"})})},[i]),o.jsx(Co,{h:a.maxDropdownContentHeight,type:"never",viewportRef:l,...a.getStyles("scrollarea"),...a.scrollAreaProps,children:o.jsx("div",{...a.getStyles("controlsList"),children:d})})}QA.displayName="@mantine/dates/TimeControlsList";function t7({time:t,compare:e,withSeconds:n}){const i=$1(t),r=$1(e);return n?i.hours===r.hours&&i.minutes===r.minutes&&i.seconds===r.seconds:i.hours===r.hours&&i.minutes===r.minutes}function BR({value:t,active:e,onChange:n,format:i,amPmLabels:r,withSeconds:s}){const a=Wf();return o.jsx(Fi,{mod:{active:e},onClick:()=>n(t),...a.getStyles("presetControl"),children:o.jsx(Zq,{withSeconds:s,value:t,format:i,amPmLabels:r})})}BR.displayName="@mantine/dates/TimePresetControl";function n7({value:t,data:e,onChange:n,format:i,amPmLabels:r,withSeconds:s}){const a=Wf(),l=e.values.map(u=>o.jsx(BR,{value:u,format:i,amPmLabels:r,withSeconds:s,active:t7({time:u,compare:t,withSeconds:s}),onChange:n},u));return o.jsxs("div",{...a.getStyles("presetsGroup"),children:[o.jsx("div",{...a.getStyles("presetsGroupLabel"),children:e.label}),o.jsx(OS,{cols:s?2:3,spacing:4,children:l})]})}n7.displayName="@mantine/dates/TimePresetGroup";function i7({presets:t,format:e,amPmLabels:n,withSeconds:i,value:r,onChange:s}){const a=Wf();if(t.length===0)return null;if(typeof t[0]=="string"){const u=t.map(d=>o.jsx(BR,{value:d,format:e,amPmLabels:n,withSeconds:i,active:t7({time:d,compare:r,withSeconds:i}),onChange:s},d));return o.jsx(Co.Autosize,{mah:a.maxDropdownContentHeight,type:"never",...a.getStyles("scrollarea"),...a.scrollAreaProps,children:o.jsx("div",{...a.getStyles("presetsRoot"),children:o.jsx(OS,{cols:i?2:3,spacing:4,children:u})})})}const l=t.map((u,d)=>o.jsx(n7,{data:u,value:r,format:e,amPmLabels:n,withSeconds:i,onChange:s},d));return o.jsx(Co.Autosize,{mah:a.maxDropdownContentHeight,type:"never",...a.getStyles("scrollarea"),...a.scrollAreaProps,children:o.jsx("div",{...a.getStyles("presetsRoot"),children:l})})}i7.displayName="@mantine/dates/TimePresets";function Ok(t){const[e=0,n=0,i=0]=t.split(":").map(Number);return e*3600+n*60+i}function phe(t){const e=Math.floor(t/3600),n=Math.floor(t%3600/60),i=t%60;return{timeString:`${bs(e)}:${bs(n)}:${bs(i)}`,hours:e,minutes:n,seconds:i}}function r7(t,e,n,i=!0){const r=Ok(t);let s=e?Ok(e):-1/0,a=n?Ok(n):1/0;i||(s=Math.ceil(s/60)*60,a=Math.floor(a/60)*60);const l=phe(Math.max(s,Math.min(r,a)));return i?l:{...l,timeString:l.timeString.split(":").slice(0,2).join(":")}}function mhe({hours:t,minutes:e,seconds:n,amPmLabels:i}){if(t===null)return{hours:null,minutes:null,seconds:null,amPm:null};const r=t>=12?i.pm:i.am;return{hours:t%12===0?12:t%12,minutes:typeof e=="number"?e:null,seconds:typeof n=="number"?n:null,amPm:r}}function G0({time:t,format:e,amPmLabels:n}){if(t==="")return{hours:null,minutes:null,seconds:null,amPm:null};const{hours:i,minutes:r,seconds:s}=$1(t),a={hours:i,minutes:r,seconds:s};return e==="12h"?mhe({...a,amPmLabels:n}):{...a,amPm:null}}function ghe({hours:t,minutes:e,seconds:n,amPm:i,amPmLabels:r,withSeconds:s}){let a=t;return i===r.pm&&t!==12?a+=12:i===r.am&&t===12&&(a=0),`${bs(a)}:${bs(e)}${s?`:${bs(n||0)}`:""}`}function Pp({hours:t,minutes:e,seconds:n,format:i,withSeconds:r,amPm:s,amPmLabels:a}){return t===null||e===null?{valid:!1,value:""}:r&&n===null?{valid:!1,value:""}:i==="24h"?{valid:!0,value:`${bs(t)}:${bs(e)}${r?`:${bs(n)}`:""}`}:s===null?{valid:!1,value:""}:{valid:!0,value:ghe({hours:t,minutes:e,seconds:n,amPm:s,amPmLabels:a,withSeconds:r})}}function vhe({value:t,defaultValue:e,onChange:n,format:i,amPmLabels:r,withSeconds:s=!1,min:a,max:l,clearable:u,readOnly:d,disabled:f,pasteSplit:p,type:m}){const v=G0({time:t||e||"",amPmLabels:r,format:i}),y=Pp({hours:v.hours,minutes:v.minutes,seconds:v.seconds,format:i,withSeconds:s,amPm:v.amPm,amPmLabels:r}),b=T.useRef(!0),A=T.useRef(!y.valid),[w,S]=T.useState(v.hours),[j,C]=T.useState(v.minutes),[k,E]=T.useState(v.seconds),[M,R]=T.useState(v.amPm),D=u&&!d&&!f&&(w!==null||j!==null||k!==null||M!==null),F=T.useRef(null),I=T.useRef(null),Q=T.useRef(null),G=T.useRef(null),L=J=>{var ee,ce,he,Oe;J==="hours"&&((ee=F.current)==null||ee.focus()),J==="minutes"&&((ce=I.current)==null||ce.focus()),J==="seconds"&&((he=Q.current)==null||he.focus()),J==="amPm"&&((Oe=G.current)==null||Oe.focus())},q=(J,ee)=>{const ce=Pp({hours:J==="hours"?ee:w,minutes:J==="minutes"?ee:j,seconds:J==="seconds"?ee:k,amPm:J==="amPm"?ee:M,format:i,withSeconds:s,amPmLabels:r});ce.valid?(b.current=!1,A.current=!1,J==="hours"&&S(ee),J==="minutes"&&C(ee),J==="seconds"&&E(ee),J==="amPm"&&R(ee),n==null||n(ce.value)):(b.current=!1,A.current||(n==null||n(""),A.current=!0))},N=J=>{b.current=!1;const ee=G0({time:J,amPmLabels:r,format:i});S(ee.hours),C(ee.minutes),E(ee.seconds),R(ee.amPm);const ce=Pp({...ee,format:i,withSeconds:s,amPmLabels:r});A.current=!ce.valid,n==null||n(J)},P=J=>{let ee=J;i==="12h"&&typeof J=="number"&&J>12&&(ee=(J-1)%12+1),S(ee),q("hours",ee),L("hours")},Y=J=>{C(J),q("minutes",J),L("minutes")},K=J=>{E(J),q("seconds",J),L("seconds")},W=J=>{R(J),q("amPm",J),L("amPm")},z=()=>{b.current=!1,S(null),C(null),E(null),R(null),n==null||n(""),A.current=!0,L("hours")},U=J=>{J.preventDefault();const ee=J.clipboardData.getData("text"),ce=(p||G0)({time:ee,format:i,amPmLabels:r}),he=Pp({...ce,format:i,withSeconds:s,amPmLabels:r});if(he.valid){b.current=!1;const Oe=m==="duration"?void 0:"23:59:59",Te=r7(he.value,a||"00:00:00",l||Oe,s);n==null||n(Te.timeString),S(ce.hours),C(ce.minutes),E(ce.seconds),R(ce.amPm)}},V=Pp({hours:w,minutes:j,seconds:k,format:i,withSeconds:s,amPm:M,amPmLabels:r});return wu(()=>{if(t===""){b.current=!1,S(null),C(null),E(null),R(null),b.current=!0;return}if(b.current&&typeof t=="string"){const J=G0({time:t||"",amPmLabels:r,format:i});S(J.hours),C(J.minutes),E(J.seconds),R(J.amPm)}b.current=!0},[t]),{refs:{hours:F,minutes:I,seconds:Q,amPm:G},values:{hours:w,minutes:j,seconds:k,amPm:M},setHours:P,setMinutes:Y,setSeconds:K,setAmPm:W,focus:L,clear:z,onPaste:U,setTimeString:N,isClearable:D,hiddenInputValue:V.value}}var s7={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 yhe={type:"time",hoursStep:1,minutesStep:1,secondsStep:1,format:"24h",amPmLabels:{am:"AM",pm:"PM"},pasteSplit:G0,maxDropdownContentHeight:200,hoursPlaceholder:"--",minutesPlaceholder:"--",secondsPlaceholder:"--",minHoursDigits:2},o7=(t,{size:e})=>({dropdown:{"--control-font-size":Ai(e)}}),xhe=1/0,sm=Pe(t=>{const e=we(["Input","InputWrapper","TimePicker"],yhe,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,onClick:u,type:d,format:f,value:p,defaultValue:m,onChange:v,hoursStep:y,minutesStep:b,secondsStep:A,withSeconds:w,hoursInputLabel:S,minutesInputLabel:j,secondsInputLabel:C,amPmInputLabel:k,amPmLabels:E,clearable:M,clearSectionMode:R,onMouseDown:D,onFocusCapture:F,onBlurCapture:I,min:Q,max:G,popoverProps:L,withDropdown:q,rightSection:N,onFocus:P,onBlur:Y,clearButtonProps:K,hoursInputProps:W,minutesInputProps:z,secondsInputProps:U,amPmSelectProps:V,readOnly:J,disabled:ee,size:ce,name:he,form:Oe,hiddenInputProps:Te,labelProps:Re,pasteSplit:qe,hoursRef:ie,minutesRef:je,secondsRef:se,amPmRef:be,presets:Be,closeDropdownOnPresetSelect:Ce,maxDropdownContentHeight:Ve,scrollAreaProps:st,attributes:Ye,reverseTimeControlsList:Ge,hoursPlaceholder:dt,minutesPlaceholder:nt,secondsPlaceholder:Ee,minHoursDigits:Qe,...Xe}=e,Ze=d==="duration",vt=Ze?"24h":f,pn=Ze&&dt==="--"?"-".repeat(Qe):dt,{resolvedClassNames:mn,resolvedStyles:un}=na({classNames:n,styles:s,props:e}),Qt=gt({name:"TimePicker",classes:s7,props:e,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:Ye,vars:l,varsResolver:o7}),ct=vhe({value:p,defaultValue:m,onChange:v,format:vt,amPmLabels:E,withSeconds:w,min:Q,max:G,clearable:M,disabled:ee,readOnly:J,pasteSplit:qe,type:d}),zt=Dn(ct.refs.hours,ie),on=Dn(ct.refs.minutes,je),Lt=Dn(ct.refs.seconds,se),It=Dn(ct.refs.amPm,be),$t=zr(),dn=T.useRef(!1),[ji,tn]=T.useState(!1),an=ve=>{dn.current||(dn.current=!0,P==null||P(ve))},gn=ve=>{var pe;ct.setTimeString(ve),Ce&&(tn(!1),(pe=L==null?void 0:L.onChange)==null||pe.call(L,!1))},re=ve=>{if(!ve.currentTarget.contains(ve.relatedTarget)){const pe=ct.values,Ne=Pp({...pe,format:vt,amPmLabels:E,withSeconds:!!w});if(Ne.valid&&(Q||G)){const Ut=r7(Ne.value,Q,G,!!w);Ut.timeString!==Ne.value&&ct.setTimeString(Ut.timeString)}dn.current=!1,Y==null||Y(ve)}};return o.jsx(hhe,{value:{getStyles:Qt,scrollAreaProps:st,maxDropdownContentHeight:Ve},children:o.jsxs(En,{opened:ji,transitionProps:{duration:0},position:"bottom-start",withRoles:!1,disabled:ee||J||!q||Ze,...L,children:[o.jsx(En.Target,{children:o.jsxs(Fs,{component:"div",size:ce,disabled:ee,onClick:ve=>{u==null||u(ve),ct.focus("hours"),ee||tn(!0)},onMouseDown:ve=>{ve.preventDefault(),D==null||D(ve)},onFocusCapture:ve=>{tn(!0),F==null||F(ve)},onBlurCapture:ve=>{tn(!1),I==null||I(ve)},rightSection:N,__clearSection:o.jsx(Sl,{...K,size:ce,onClick:ve=>{var pe;ct.clear(),(pe=K==null?void 0:K.onClick)==null||pe.call(K,ve)},onMouseDown:ve=>{var pe;ve.preventDefault(),(pe=K==null?void 0:K.onMouseDown)==null||pe.call(K,ve)}}),__clearable:ct.isClearable,__clearSectionMode:R,labelProps:{htmlFor:$t,...Re},style:r,className:i,classNames:mn,styles:un,attributes:Ye,__staticSelector:"TimePicker",...Xe,children:[o.jsx("div",{...Qt("fieldsRoot"),dir:"ltr",children:o.jsxs("div",{...Qt("fieldsGroup"),onBlur:re,children:[o.jsx(qA,{id:$t,...W,...Qt("field",{className:W==null?void 0:W.className,style:Ze?{width:`calc(${Math.max(Qe,bs(ct.values.hours??0).length)}ch + 0.3em)`,...W==null?void 0:W.style}:W==null?void 0:W.style}),value:ct.values.hours,onChange:ct.setHours,onNextInput:()=>ct.focus("minutes"),min:vt==="12h"?1:0,max:Ze?xhe:vt==="12h"?12:23,allowTemporaryZero:vt==="12h",disableAutoAdvance:Ze,focusable:!0,step:y,ref:zt,"aria-label":S,readOnly:J,disabled:ee,onPaste:ct.onPaste,onFocus:ve=>{var pe;an(ve),(pe=W==null?void 0:W.onFocus)==null||pe.call(W,ve)},onBlur:ve=>{var Ne;const pe=ve.currentTarget.value;vt==="12h"&&(pe?parseInt(pe,10):null)===0&&ct.setHours(12),(Ne=W==null?void 0:W.onBlur)==null||Ne.call(W,ve)},placeholder:pn}),o.jsx("span",{children:":"}),o.jsx(qA,{...z,...Qt("field",{className:z==null?void 0:z.className,style:z==null?void 0:z.style}),value:ct.values.minutes,onChange:ct.setMinutes,min:0,max:59,focusable:!0,step:b,ref:on,onPreviousInput:()=>ct.focus("hours"),onNextInput:()=>w?ct.focus("seconds"):ct.focus("amPm"),"aria-label":j,tabIndex:-1,readOnly:J,disabled:ee,onPaste:ct.onPaste,onFocus:ve=>{var pe;an(ve),(pe=z==null?void 0:z.onFocus)==null||pe.call(z,ve)},placeholder:nt}),w&&o.jsxs(o.Fragment,{children:[o.jsx("span",{children:":"}),o.jsx(qA,{...U,...Qt("field",{className:U==null?void 0:U.className,style:U==null?void 0:U.style}),value:ct.values.seconds,onChange:ct.setSeconds,min:0,max:59,focusable:!0,step:A,ref:Lt,onPreviousInput:()=>ct.focus("minutes"),onNextInput:()=>ct.focus("amPm"),"aria-label":C,tabIndex:-1,readOnly:J,disabled:ee,onPaste:ct.onPaste,onFocus:ve=>{var pe;an(ve),(pe=U==null?void 0:U.onFocus)==null||pe.call(U,ve)},placeholder:Ee})]}),vt==="12h"&&!Ze&&o.jsx(Jq,{...V,inputType:q?"input":"select",labels:E,value:ct.values.amPm,onChange:ct.setAmPm,ref:It,"aria-label":k,onPreviousInput:()=>w?ct.focus("seconds"):ct.focus("minutes"),readOnly:J,disabled:ee,tabIndex:-1,onPaste:ct.onPaste,onFocus:ve=>{var pe;an(ve),(pe=V==null?void 0:V.onFocus)==null||pe.call(V,ve)}})]})}),o.jsx("input",{type:"hidden",name:he,form:Oe,value:ct.hiddenInputValue,...Te})]})}),o.jsx(En.Dropdown,{...Qt("dropdown"),onMouseDown:ve=>ve.preventDefault(),children:Be?o.jsx(i7,{value:ct.hiddenInputValue,onChange:gn,format:vt,presets:Be,amPmLabels:E,withSeconds:w||!1}):o.jsxs("div",{...Qt("controlsListGroup"),children:[o.jsx(QA,{min:vt==="12h"?1:0,max:vt==="12h"?12:23,step:y,value:ct.values.hours,onSelect:ct.setHours,reversed:Ge}),o.jsx(QA,{min:0,max:59,step:b,value:ct.values.minutes,onSelect:ct.setMinutes,reversed:Ge}),w&&o.jsx(QA,{min:0,max:59,step:A,value:ct.values.seconds,onSelect:ct.setSeconds,reversed:Ge}),vt==="12h"&&o.jsx(e7,{labels:E,value:ct.values.amPm,onSelect:ct.setAmPm})]})})]})})});sm.displayName="@mantine/dates/TimePicker";sm.classes=s7;sm.varsResolver=o7;var a7={day:"m_396ce5cb"};const l7=(t,{size:e})=>({day:{"--day-size":Zt(e,"day-size")}}),WS=Pe(t=>{const e=we("Day",null,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,date:u,disabled:d,__staticSelector:f,weekend:p,outside:m,selected:v,renderDay:y,inRange:b,firstInRange:A,lastInRange:w,hidden:S,static:j,highlightToday:C,fullWidth:k,attributes:E,...M}=e;return o.jsx(Fi,{...gt({name:f||"Day",classes:a7,props:e,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:E,vars:l,varsResolver:l7,rootSelector:"day"})("day",{style:S?{display:"none"}:void 0}),component:j?"div":"button",disabled:d,"data-today":De(u).isSame(new Date,"day")||void 0,"data-hidden":S||void 0,"data-highlight-today":C||void 0,"data-disabled":d||void 0,"data-weekend":!d&&!m&&p||void 0,"data-outside":!d&&m||void 0,"data-selected":!d&&v||void 0,"data-in-range":b&&!d||void 0,"data-first-in-range":A&&!d||void 0,"data-last-in-range":w&&!d||void 0,"data-static":j||void 0,"data-full-width":k||void 0,unstyled:a,...M,children:(y==null?void 0:y(u))||De(u).date()})});WS.classes=a7;WS.varsResolver=l7;WS.displayName="@mantine/dates/Day";function bhe({locale:t,format:e="dd",firstDayOfWeek:n=1}){const i=De().day(n),r=[];for(let s=0;s<7;s+=1)typeof e=="string"?r.push(De(i).add(s,"days").locale(t).format(e)):r.push(e(De(i).add(s,"days").format("YYYY-MM-DD")));return r}var c7={weekday:"m_18a3eca"};const u7=(t,{size:e})=>({weekdaysRow:{"--wr-fz":Ai(e),"--wr-spacing":ns(e)}}),US=Pe(t=>{const e=we("WeekdaysRow",null,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,locale:u,firstDayOfWeek:d,weekdayFormat:f,cellComponent:p="th",__staticSelector:m,withWeekNumbers:v,attributes:y,...b}=e,A=gt({name:m||"WeekdaysRow",classes:c7,props:e,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:y,vars:l,varsResolver:u7,rootSelector:"weekdaysRow"}),w=Ou(),S=bhe({locale:w.getLocale(u),format:f,firstDayOfWeek:w.getFirstDayOfWeek(d)}).map((j,C)=>o.jsx(p,{...A("weekday"),children:j},C));return o.jsxs(xe,{component:"tr",...A("weekdaysRow"),...b,children:[v&&o.jsx(p,{...A("weekday"),children:"#"}),S]})});US.classes=c7;US.varsResolver=u7;US.displayName="@mantine/dates/WeekdaysRow";function Ahe(t,e=1){let n=De(t);if(!n.isValid())return n;const i=e===0?6:e-1;for(;n.day()!==i;)n=n.add(1,"day");return n.format("YYYY-MM-DD")}function whe(t,e=1){let n=De(t);for(;n.day()!==e;)n=n.subtract(1,"day");return n.format("YYYY-MM-DD")}function She({month:t,firstDayOfWeek:e=1,consistentWeeks:n}){const i=De(De(t).subtract(De(t).date()-1,"day").format("YYYY-M-D")),r=i.format("YYYY-MM-DD"),s=Ahe(i.add(+i.daysInMonth()-1,"day").format("YYYY-MM-DD"),e),a=[];let l=De(whe(r,e));for(;De(l).isBefore(s,"day");){const u=[];for(let d=0;d<7;d+=1)u.push(l.format("YYYY-MM-DD")),l=l.add(1,"day");a.push(u)}if(n&&a.length<6){const u=a[a.length-1],d=u[u.length-1];let f=De(d).add(1,"day");for(;a.length<6;){const p=[];for(let m=0;m<7;m+=1)p.push(f.format("YYYY-MM-DD")),f=f.add(1,"day");a.push(p)}}return a}function LR(t,e){return De(t).format("YYYY-MM")===De(e).format("YYYY-MM")}function h7(t,e){return e?De(t).isAfter(De(e).subtract(1,"day"),"day"):!0}function d7(t,e){return e?De(t).isBefore(De(e).add(1,"day"),"day"):!0}function jhe({dates:t,minDate:e,maxDate:n,getDayProps:i,excludeDate:r,hideOutsideDates:s,month:a}){const l=t.flat().filter(f=>{var p;return d7(f,n)&&h7(f,e)&&!(r!=null&&r(f))&&!((p=i==null?void 0:i(f))!=null&&p.disabled)&&(!s||LR(f,a))}),u=l.find(f=>{var p;return(p=i==null?void 0:i(f))==null?void 0:p.selected});if(u)return u;const d=l.find(f=>De().isSame(f,"date"));return d||l[0]}var YA={exports:{}},Che=YA.exports,wL;function _he(){return wL||(wL=1,(function(t,e){(function(n,i){t.exports=i()})(Che,(function(){var n="day";return function(i,r,s){var a=function(d){return d.add(4-d.isoWeekday(),n)},l=r.prototype;l.isoWeekYear=function(){return a(this).year()},l.isoWeek=function(d){if(!this.$utils().u(d))return this.add(7*(d-this.isoWeek()),n);var f,p,m,v,y=a(this),b=(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(b,"week")+1},l.isoWeekday=function(d){return this.$utils().u(d)?this.day()||7:this.day(this.day()%7?d:d-7)};var u=l.startOf;l.startOf=function(d,f){var p=this.$utils(),m=!!p.u(f)||f;return p.p(d)==="isoweek"?m?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):u.bind(this)(d,f)}}}))})(YA)),YA.exports}var khe=_he();const The=Al(khe);De.extend(The);function Ohe(t){return De(t.find(e=>De(e).day()===1)).isoWeek()}var f7={month:"m_cc9820d3",monthCell:"m_8f457cd5",weekNumber:"m_6cff9dea"};const Ehe={withCellSpacing:!0},p7=(t,{size:e})=>({weekNumber:{"--wn-fz":Ai(e),"--wn-size":Zt(e,"wn-size")}}),Xy=Pe(t=>{const e=we("Month",Ehe,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,__staticSelector:u,locale:d,firstDayOfWeek:f,weekdayFormat:p,month:m,weekendDays:v,getDayProps:y,excludeDate:b,minDate:A,maxDate:w,renderDay:S,hideOutsideDates:j,hideWeekdays:C,getDayAriaLabel:k,static:E,__getDayRef:M,__onDayKeyDown:R,__onDayClick:D,__onDayMouseEnter:F,__preventFocus:I,__stopPropagation:Q,withCellSpacing:G,size:L,highlightToday:q,withWeekNumbers:N,fullWidth:P,attributes:Y,...K}=e,W=gt({name:u||"Month",classes:f7,props:e,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:Y,vars:l,varsResolver:p7,rootSelector:"month"}),z=Ou(),U=She({month:m,firstDayOfWeek:z.getFirstDayOfWeek(f),consistentWeeks:z.consistentWeeks}),V=jhe({dates:U,minDate:Ls(A),maxDate:Ls(w),getDayProps:y,excludeDate:b,hideOutsideDates:j,month:m}),{resolvedClassNames:J,resolvedStyles:ee}=na({classNames:n,styles:s,props:e}),ce=U.map((he,Oe)=>{const Te=he.map((Re,qe)=>{const ie=!LR(Re,m),je=(k==null?void 0:k(Re))||De(Re).locale(d||z.locale).format("D MMMM YYYY"),se=y==null?void 0:y(Re),be=De(Re).isSame(V,"date");return o.jsx("td",{...W("monthCell"),"data-with-spacing":G||void 0,children:o.jsx(WS,{__staticSelector:u||"Month",classNames:J,styles:ee,attributes:Y,unstyled:a,"data-mantine-stop-propagation":Q||void 0,highlightToday:q,renderDay:S,date:Re,size:L,weekend:z.getWeekendDays(v).includes(De(Re).get("day")),outside:ie,hidden:j?ie:!1,"aria-label":je,static:E,fullWidth:P,disabled:(b==null?void 0:b(Re))||!d7(Re,Ls(w))||!h7(Re,Ls(A)),ref:Be=>{Be&&(M==null||M(Oe,qe,Be))},...se,onKeyDown:Be=>{var Ce;(Ce=se==null?void 0:se.onKeyDown)==null||Ce.call(se,Be),R==null||R(Be,{rowIndex:Oe,cellIndex:qe,date:Re})},onMouseEnter:Be=>{var Ce;(Ce=se==null?void 0:se.onMouseEnter)==null||Ce.call(se,Be),F==null||F(Be,Re)},onClick:Be=>{var Ce;(Ce=se==null?void 0:se.onClick)==null||Ce.call(se,Be),D==null||D(Be,Re)},onMouseDown:Be=>{var Ce;(Ce=se==null?void 0:se.onMouseDown)==null||Ce.call(se,Be),I&&Be.preventDefault()},tabIndex:I||!be?-1:0})},Re.toString())});return o.jsxs("tr",{...W("monthRow"),children:[N&&o.jsx("td",{...W("weekNumber"),children:Ohe(he)}),Te]},Oe)});return o.jsxs(xe,{component:"table",...W("month"),size:L,"data-full-width":P||void 0,...K,children:[!C&&o.jsx("thead",{...W("monthThead"),children:o.jsx(US,{__staticSelector:u||"Month",locale:d,firstDayOfWeek:f,weekdayFormat:p,withWeekNumbers:N,size:L,classNames:J,styles:ee,unstyled:a,attributes:Y})}),o.jsx("tbody",{...W("monthTbody"),children:ce})]})});Xy.classes=f7;Xy.varsResolver=p7;Xy.displayName="@mantine/dates/Month";var m7={pickerControl:"m_dc6a3c71"};const g7=(t,{size:e})=>({pickerControl:{"--dpc-fz":Ai(e),"--dpc-size":Zt(e,"dpc-size")}}),Ky=Pe(t=>{const e=we("PickerControl",null,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,firstInRange:u,lastInRange:d,inRange:f,__staticSelector:p,selected:m,disabled:v,fullWidth:y,attributes:b,...A}=e;return o.jsx(Fi,{...gt({name:p||"PickerControl",classes:m7,props:e,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:b,vars:l,varsResolver:g7,rootSelector:"pickerControl"})("pickerControl"),unstyled:a,"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":u&&!v||void 0,"data-last-in-range":d&&!v||void 0,disabled:v,...A})});Ky.classes=m7;Ky.varsResolver=g7;Ky.displayName="@mantine/dates/PickerControl";function v7({year:t,minDate:e,maxDate:n}){return!e&&!n?!1:!!(e&&De(t).isBefore(e,"year")||n&&De(t).isAfter(n,"year"))}function Mhe({years:t,minDate:e,maxDate:n,getYearControlProps:i}){const r=t.flat().filter(l=>{var u;return!v7({year:l,minDate:e,maxDate:n})&&!((u=i==null?void 0:i(l))!=null&&u.disabled)}),s=r.find(l=>{var u;return(u=i==null?void 0:i(l))==null?void 0:u.selected});if(s)return s;const a=r.find(l=>De().isSame(l,"year"));return a||r[0]}function y7(t){const e=De(t).year(),n=e-e%10;let i=0;const r=[[],[],[],[]];for(let s=0;s<4;s+=1){const a=s===3?1:3;for(let l=0;l<a;l+=1)r[s].push(De(new Date(n+i,0)).format("YYYY-MM-DD")),i+=1}return r}var x7={yearsList:"m_9206547b",yearsListCell:"m_c5a19c7d"};const Rhe={yearsListFormat:"YYYY",withCellSpacing:!0},VS=Pe(t=>{const e=we("YearsList",Rhe,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,decade:u,yearsListFormat:d,locale:f,minDate:p,maxDate:m,getYearControlProps:v,__staticSelector:y,__getControlRef:b,__onControlKeyDown:A,__onControlClick:w,__onControlMouseEnter:S,__preventFocus:j,__stopPropagation:C,withCellSpacing:k,fullWidth:E,size:M,attributes:R,...D}=e,F=gt({name:y||"YearsList",classes:x7,props:e,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:R,vars:l,rootSelector:"yearsList"}),I=Ou(),Q=y7(u),G=Mhe({years:Q,minDate:p,maxDate:m,getYearControlProps:v}),L=Q.map((q,N)=>{const P=q.map((Y,K)=>{const W=v==null?void 0:v(Y),z=De(Y).isSame(G,"year");return o.jsx("td",{...F("yearsListCell"),"data-with-spacing":k||void 0,children:o.jsx(Ky,{...F("yearsListControl"),size:M,unstyled:a,fullWidth:E,"data-mantine-stop-propagation":C||void 0,disabled:v7({year:Y,minDate:p,maxDate:m}),ref:U=>{U&&(b==null||b(N,K,U))},...W,onKeyDown:U=>{var V;(V=W==null?void 0:W.onKeyDown)==null||V.call(W,U),A==null||A(U,{rowIndex:N,cellIndex:K,date:Y})},onClick:U=>{var V;(V=W==null?void 0:W.onClick)==null||V.call(W,U),w==null||w(U,Y)},onMouseEnter:U=>{var V;(V=W==null?void 0:W.onMouseEnter)==null||V.call(W,U),S==null||S(U,Y)},onMouseDown:U=>{var V;(V=W==null?void 0:W.onMouseDown)==null||V.call(W,U),j&&U.preventDefault()},tabIndex:j||!z?-1:0,children:(W==null?void 0:W.children)??De(Y).locale(I.getLocale(f)).format(d)})},K)});return o.jsx("tr",{...F("yearsListRow"),children:P},N)});return o.jsx(xe,{component:"table",size:M,...F("yearsList"),"data-full-width":E||void 0,...D,children:o.jsx("tbody",{children:L})})});VS.classes=x7;VS.displayName="@mantine/dates/YearsList";function b7({month:t,minDate:e,maxDate:n}){return!e&&!n?!1:!!(e&&De(t).isBefore(e,"month")||n&&De(t).isAfter(n,"month"))}function Dhe({months:t,minDate:e,maxDate:n,getMonthControlProps:i}){const r=t.flat().filter(l=>{var u;return!b7({month:l,minDate:e,maxDate:n})&&!((u=i==null?void 0:i(l))!=null&&u.disabled)}),s=r.find(l=>{var u;return(u=i==null?void 0:i(l))==null?void 0:u.selected});if(s)return s;const a=r.find(l=>De().isSame(l,"month"));return a||r[0]}function Nhe(t){const e=De(t).startOf("year").toDate(),n=[[],[],[],[]];let i=0;for(let r=0;r<4;r+=1)for(let s=0;s<3;s+=1)n[r].push(De(e).add(i,"months").format("YYYY-MM-DD")),i+=1;return n}var A7={monthsList:"m_2a6c32d",monthsListCell:"m_fe27622f"};const Ihe={monthsListFormat:"MMM",withCellSpacing:!0},GS=Pe(t=>{const e=we("MonthsList",Ihe,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,__staticSelector:u,year:d,monthsListFormat:f,locale:p,minDate:m,maxDate:v,getMonthControlProps:y,__getControlRef:b,__onControlKeyDown:A,__onControlClick:w,__onControlMouseEnter:S,__preventFocus:j,__stopPropagation:C,withCellSpacing:k,fullWidth:E,size:M,attributes:R,...D}=e,F=gt({name:u||"MonthsList",classes:A7,props:e,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:R,vars:l,rootSelector:"monthsList"}),I=Ou(),Q=Nhe(d),G=Dhe({months:Q,minDate:Ls(m),maxDate:Ls(v),getMonthControlProps:y}),L=Q.map((q,N)=>{const P=q.map((Y,K)=>{const W=y==null?void 0:y(Y),z=De(Y).isSame(G,"month");return o.jsx("td",{...F("monthsListCell"),"data-with-spacing":k||void 0,children:o.jsx(Ky,{...F("monthsListControl"),size:M,unstyled:a,fullWidth:E,__staticSelector:u||"MonthsList","data-mantine-stop-propagation":C||void 0,disabled:b7({month:Y,minDate:Ls(m),maxDate:Ls(v)}),ref:U=>{U&&(b==null||b(N,K,U))},...W,onKeyDown:U=>{var V;(V=W==null?void 0:W.onKeyDown)==null||V.call(W,U),A==null||A(U,{rowIndex:N,cellIndex:K,date:Y})},onClick:U=>{var V;(V=W==null?void 0:W.onClick)==null||V.call(W,U),w==null||w(U,Y)},onMouseEnter:U=>{var V;(V=W==null?void 0:W.onMouseEnter)==null||V.call(W,U),S==null||S(U,Y)},onMouseDown:U=>{var V;(V=W==null?void 0:W.onMouseDown)==null||V.call(W,U),j&&U.preventDefault()},tabIndex:j||!z?-1:0,children:(W==null?void 0:W.children)??De(Y).locale(I.getLocale(p)).format(f)})},K)});return o.jsx("tr",{...F("monthsListRow"),children:P},N)});return o.jsx(xe,{component:"table",size:M,...F("monthsList"),"data-full-width":E||void 0,...D,children:o.jsx("tbody",{children:L})})});GS.classes=A7;GS.displayName="@mantine/dates/MonthsList";var w7={calendarHeader:"m_730a79ed",calendarHeaderLevel:"m_f6645d97",calendarHeaderControl:"m_2351eeb0",calendarHeaderSelect:"m_e214b549",calendarHeaderControlIcon:"m_367dc749"};const Bhe={hasNextLevel:!0,withNext:!0,withPrevious:!0,headerControlsOrder:["previous","level","next"]},S7=(t,{size:e})=>({calendarHeader:{"--dch-control-size":Zt(e,"dch-control-size"),"--dch-fz":Ai(e)}}),Eu=Pe(t=>{const e=we("CalendarHeader",Bhe,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,nextIcon:u,previousIcon:d,nextLabel:f,previousLabel:p,onNext:m,onPrevious:v,onLevelClick:y,label:b,nextDisabled:A,previousDisabled:w,hasNextLevel:S,levelControlAriaLabel:j,withNext:C,withPrevious:k,headerControlsOrder:E,fullWidth:M,withNativeLevelSelect:R,yearsSelectRange:D,__staticSelector:F,__preventFocus:I,__stopPropagation:Q,__calendarLevel:G,__date:L,__locale:q,__onDateChange:N,__minDate:P,__maxDate:Y,__disableNativeLevelSelect:K,attributes:W,...z}=e,U=gt({name:F||"CalendarHeader",classes:w7,props:e,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:W,vars:l,varsResolver:S7,rootSelector:"calendarHeader"}),V=I?be=>be.preventDefault():void 0,J=k&&T.createElement(Fi,{...U("calendarHeaderControl"),key:"previous","data-direction":"previous","aria-label":p,onClick:v,unstyled:a,onMouseDown:V,disabled:w,"data-disabled":w||void 0,tabIndex:I||w?-1:0,"data-mantine-stop-propagation":Q||void 0},d||o.jsx(zm,{...U("calendarHeaderControlIcon"),"data-direction":"previous",size:"45%"})),ee=new Date().getFullYear(),ce=L?De(L).year():ee,he=(D==null?void 0:D[0])??(P?De(P).year():ee-100),Oe=(D==null?void 0:D[1])??(Y?De(Y).year():ee+50),Te=Math.min(he,Oe,ce),Re=Math.max(he,Oe,ce),qe=be=>{let Be=be;return P&&Be.isBefore(De(P),"day")&&(Be=De(P)),Y&&Be.isAfter(De(Y),"day")&&(Be=De(Y)),Be.format("YYYY-MM-DD")},ie=(R&&L&&N&&G!=="decade"?T.createElement("div",{...U("calendarHeaderLevel"),key:"level","data-static":!0,"data-native-level-select":!0},G==="month"&&o.jsx("select",{...U("calendarHeaderSelect"),"data-select":"month",disabled:K,value:De(L).month(),onChange:be=>{N(qe(De(L).month(parseInt(be.currentTarget.value,10))))},onMouseDown:V,"aria-label":j,children:Array.from({length:12},(be,Be)=>o.jsx("option",{value:Be,children:De().locale(q||"en").month(Be).format("MMMM")},Be))}),o.jsx("select",{...U("calendarHeaderSelect"),"data-select":"year",disabled:K,value:De(L).year(),onChange:be=>{N(qe(De(L).year(parseInt(be.currentTarget.value,10))))},onMouseDown:V,"aria-label":j,children:Array.from({length:Re-Te+1},(be,Be)=>{const Ce=Te+Be;return o.jsx("option",{value:Ce,children:Ce},Ce)})})):null)||T.createElement(Fi,{component:S?"button":"div",...U("calendarHeaderLevel"),key:"level",onClick:S?y:void 0,unstyled:a,onMouseDown:S?V:void 0,disabled:!S,"data-static":!S||void 0,"aria-label":j,tabIndex:I||!S?-1:0,"data-mantine-stop-propagation":Q||void 0},b),je=C&&T.createElement(Fi,{...U("calendarHeaderControl"),key:"next","data-direction":"next","aria-label":f,onClick:m,unstyled:a,onMouseDown:V,disabled:A,"data-disabled":A||void 0,tabIndex:I||A?-1:0,"data-mantine-stop-propagation":Q||void 0},u||o.jsx(zm,{...U("calendarHeaderControlIcon"),"data-direction":"next",size:"45%"})),se=E.map(be=>be==="previous"?J:be==="level"?ie:be==="next"?je:null);return o.jsx(xe,{...U("calendarHeader"),"data-full-width":M||void 0,...z,children:se})});Eu.classes=w7;Eu.varsResolver=S7;Eu.displayName="@mantine/dates/CalendarHeader";function Lhe(t){const e=y7(t);return[e[0][0],e[3][0]]}const Phe={decadeLabelFormat:"YYYY"},XS=Pe(t=>{const{decade:e,locale:n,minDate:i,maxDate:r,yearsListFormat:s,getYearControlProps:a,__getControlRef:l,__onControlKeyDown:u,__onControlClick:d,__onControlMouseEnter:f,withCellSpacing:p,__preventFocus:m,nextIcon:v,previousIcon:y,nextLabel:b,previousLabel:A,onNext:w,onPrevious:S,nextDisabled:j,previousDisabled:C,levelControlAriaLabel:k,withNext:E,withPrevious:M,headerControlsOrder:R,decadeLabelFormat:D,classNames:F,styles:I,unstyled:Q,__staticSelector:G,__stopPropagation:L,size:q,fullWidth:N,attributes:P,...Y}=we("DecadeLevel",Phe,t),K=Ou(),[W,z]=Lhe(e),U={__staticSelector:G||"DecadeLevel",classNames:F,styles:I,unstyled:Q,size:q,attributes:P},V=typeof j=="boolean"?j:r?!De(z).endOf("year").isBefore(r):!1,J=typeof C=="boolean"?C:i?!De(W).startOf("year").isAfter(i):!1,ee=(ce,he)=>De(ce).locale(n||K.locale).format(he);return o.jsxs(xe,{"data-decade-level":!0,size:q,...Y,children:[o.jsx(Eu,{label:typeof D=="function"?D(W,z):`${ee(W,D)} – ${ee(z,D)}`,__preventFocus:m,__stopPropagation:L,nextIcon:v,previousIcon:y,nextLabel:b,previousLabel:A,onNext:w,onPrevious:S,nextDisabled:V,previousDisabled:J,hasNextLevel:!1,levelControlAriaLabel:k,withNext:E,withPrevious:M,headerControlsOrder:R,fullWidth:N,...U}),o.jsx(VS,{decade:e,locale:n,minDate:i,maxDate:r,yearsListFormat:s,getYearControlProps:a,__getControlRef:l,__onControlKeyDown:u,__onControlClick:d,__onControlMouseEnter:f,__preventFocus:m,__stopPropagation:L,withCellSpacing:p,fullWidth:N,...U})]})});XS.classes={...VS.classes,...Eu.classes};XS.displayName="@mantine/dates/DecadeLevel";const Fhe={yearLabelFormat:"YYYY"},KS=Pe(t=>{const{year:e,locale:n,minDate:i,maxDate:r,monthsListFormat:s,getMonthControlProps:a,__getControlRef:l,__onControlKeyDown:u,__onControlClick:d,__onControlMouseEnter:f,withCellSpacing:p,__preventFocus:m,nextIcon:v,previousIcon:y,nextLabel:b,previousLabel:A,onNext:w,onPrevious:S,onLevelClick:j,nextDisabled:C,previousDisabled:k,hasNextLevel:E,levelControlAriaLabel:M,withNext:R,withPrevious:D,headerControlsOrder:F,withNativeLevelSelect:I,yearsSelectRange:Q,yearLabelFormat:G,__staticSelector:L,__stopPropagation:q,__onDateChange:N,__disableNativeLevelSelect:P,size:Y,classNames:K,styles:W,unstyled:z,fullWidth:U,attributes:V,...J}=we("YearLevel",Fhe,t),ee=Ou(),ce={__staticSelector:L||"YearLevel",classNames:K,styles:W,unstyled:z,size:Y,attributes:V},he=typeof C=="boolean"?C:r?!De(e).endOf("year").isBefore(r):!1,Oe=typeof k=="boolean"?k:i?!De(e).startOf("year").isAfter(i):!1;return o.jsxs(xe,{"data-year-level":!0,size:Y,...J,children:[o.jsx(Eu,{label:typeof G=="function"?G(e):De(e).locale(n||ee.locale).format(G),__preventFocus:m,__stopPropagation:q,__calendarLevel:"year",__date:e,__locale:n||ee.locale,__onDateChange:N,__disableNativeLevelSelect:P,__minDate:i,__maxDate:r,nextIcon:v,previousIcon:y,nextLabel:b,previousLabel:A,onNext:w,onPrevious:S,onLevelClick:j,nextDisabled:he,previousDisabled:Oe,hasNextLevel:E,levelControlAriaLabel:M,withNext:R,withPrevious:D,headerControlsOrder:F,withNativeLevelSelect:I,yearsSelectRange:Q,fullWidth:U,...ce}),o.jsx(GS,{year:e,locale:n,minDate:i,maxDate:r,monthsListFormat:s,getMonthControlProps:a,__getControlRef:l,__onControlKeyDown:u,__onControlClick:d,__onControlMouseEnter:f,__preventFocus:m,__stopPropagation:q,withCellSpacing:p,fullWidth:U,...ce})]})});KS.classes={...Eu.classes,...GS.classes};KS.displayName="@mantine/dates/YearLevel";const $he={monthLabelFormat:"MMMM YYYY"},ZS=Pe(t=>{const{month:e,locale:n,firstDayOfWeek:i,weekdayFormat:r,weekendDays:s,getDayProps:a,excludeDate:l,minDate:u,maxDate:d,renderDay:f,hideOutsideDates:p,hideWeekdays:m,getDayAriaLabel:v,__getDayRef:y,__onDayKeyDown:b,__onDayClick:A,__onDayMouseEnter:w,withCellSpacing:S,highlightToday:j,withWeekNumbers:C,__preventFocus:k,__stopPropagation:E,nextIcon:M,previousIcon:R,nextLabel:D,previousLabel:F,onNext:I,onPrevious:Q,onLevelClick:G,nextDisabled:L,previousDisabled:q,hasNextLevel:N,levelControlAriaLabel:P,withNext:Y,withPrevious:K,headerControlsOrder:W,withNativeLevelSelect:z,yearsSelectRange:U,monthLabelFormat:V,classNames:J,styles:ee,unstyled:ce,__staticSelector:he,__onDateChange:Oe,__disableNativeLevelSelect:Te,size:Re,static:qe,fullWidth:ie,attributes:je,...se}=we("MonthLevel",$he,t),be=Ou(),Be={__staticSelector:he||"MonthLevel",classNames:J,styles:ee,unstyled:ce,size:Re,attributes:je},Ce=typeof L=="boolean"?L:d?!De(e).endOf("month").isBefore(d):!1,Ve=typeof q=="boolean"?q:u?!De(e).startOf("month").isAfter(u):!1;return o.jsxs(xe,{"data-month-level":!0,size:Re,...se,children:[o.jsx(Eu,{label:typeof V=="function"?V(e):De(e).locale(n||be.locale).format(V),__preventFocus:k,__stopPropagation:E,__calendarLevel:"month",__date:e,__locale:n||be.locale,__onDateChange:Oe,__disableNativeLevelSelect:Te,__minDate:u,__maxDate:d,nextIcon:M,previousIcon:R,nextLabel:D,previousLabel:F,onNext:I,onPrevious:Q,onLevelClick:G,nextDisabled:Ce,previousDisabled:Ve,hasNextLevel:N,levelControlAriaLabel:P,withNext:Y,withPrevious:K,headerControlsOrder:W,withNativeLevelSelect:z,yearsSelectRange:U,fullWidth:ie,...Be}),o.jsx(Xy,{month:e,locale:n,firstDayOfWeek:i,weekdayFormat:r,weekendDays:s,getDayProps:a,excludeDate:l,minDate:u,maxDate:d,renderDay:f,hideOutsideDates:p,hideWeekdays:m,getDayAriaLabel:v,__getDayRef:y,__onDayKeyDown:b,__onDayClick:A,__onDayMouseEnter:w,__preventFocus:k,__stopPropagation:E,static:qe,withCellSpacing:S,highlightToday:j,withWeekNumbers:C,fullWidth:ie,...Be})]})});ZS.classes={...Xy.classes,...Eu.classes};ZS.displayName="@mantine/dates/MonthLevel";var j7={levelsGroup:"m_30b26e33"};const xd=Pe(t=>{const e=we("LevelsGroup",null,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,__staticSelector:u,fullWidth:d,attributes:f,...p}=e;return o.jsx(xe,{...gt({name:u||"LevelsGroup",classes:j7,props:e,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:f,vars:l,rootSelector:"levelsGroup"})("levelsGroup"),"data-full-width":d||void 0,...p})});xd.classes=j7;xd.displayName="@mantine/dates/LevelsGroup";const zhe={numberOfColumns:1},JS=Pe(t=>{const{decade:e,locale:n,minDate:i,maxDate:r,yearsListFormat:s,getYearControlProps:a,__onControlClick:l,__onControlMouseEnter:u,withCellSpacing:d,__preventFocus:f,nextIcon:p,previousIcon:m,nextLabel:v,previousLabel:y,onNext:b,onPrevious:A,nextDisabled:w,previousDisabled:S,headerControlsOrder:j,classNames:C,styles:k,unstyled:E,__staticSelector:M,__stopPropagation:R,numberOfColumns:D,levelControlAriaLabel:F,decadeLabelFormat:I,size:Q,fullWidth:G,vars:L,attributes:q,...N}=we("DecadeLevelGroup",zhe,t),P=T.useRef([]),Y=Array(D).fill(0).map((K,W)=>{const z=De(e).add(W*10,"years").format("YYYY-MM-DD");return o.jsx(XS,{size:Q,yearsListFormat:s,decade:z,withNext:W===D-1,withPrevious:W===0,decadeLabelFormat:I,__onControlClick:l,__onControlMouseEnter:u,__onControlKeyDown:(U,V)=>NR({levelIndex:W,rowIndex:V.rowIndex,cellIndex:V.cellIndex,event:U,controlsRef:P}),__getControlRef:(U,V,J)=>{Array.isArray(P.current[W])||(P.current[W]=[]),Array.isArray(P.current[W][U])||(P.current[W][U]=[]),P.current[W][U][V]=J},levelControlAriaLabel:typeof F=="function"?F(z):F,locale:n,minDate:i,maxDate:r,__preventFocus:f,__stopPropagation:R,nextIcon:p,previousIcon:m,nextLabel:v,previousLabel:y,onNext:b,onPrevious:A,nextDisabled:w,previousDisabled:S,getYearControlProps:a,__staticSelector:M||"DecadeLevelGroup",classNames:C,styles:k,unstyled:E,withCellSpacing:d,headerControlsOrder:j,fullWidth:G,attributes:q},W)});return o.jsx(xd,{classNames:C,styles:k,__staticSelector:M||"DecadeLevelGroup",size:Q,unstyled:E,fullWidth:G,attributes:q,...N,children:Y})});JS.classes={...xd.classes,...XS.classes};JS.displayName="@mantine/dates/DecadeLevelGroup";const Hhe={numberOfColumns:1},ej=Pe(t=>{const{year:e,locale:n,minDate:i,maxDate:r,monthsListFormat:s,getMonthControlProps:a,__onControlClick:l,__onControlMouseEnter:u,withCellSpacing:d,__preventFocus:f,nextIcon:p,previousIcon:m,nextLabel:v,previousLabel:y,onNext:b,onPrevious:A,onLevelClick:w,nextDisabled:S,previousDisabled:j,hasNextLevel:C,headerControlsOrder:k,withNativeLevelSelect:E,yearsSelectRange:M,classNames:R,styles:D,unstyled:F,__staticSelector:I,__stopPropagation:Q,__onDateChange:G,__disableNativeLevelSelect:L,numberOfColumns:q,levelControlAriaLabel:N,yearLabelFormat:P,size:Y,fullWidth:K,vars:W,attributes:z,...U}=we("YearLevelGroup",Hhe,t),V=T.useRef([]),J=Array(q).fill(0).map((ee,ce)=>{const he=De(e).add(ce,"years").format("YYYY-MM-DD");return o.jsx(KS,{size:Y,monthsListFormat:s,year:he,withNext:ce===q-1,withPrevious:ce===0,yearLabelFormat:P,__stopPropagation:Q,__onControlClick:l,__onControlMouseEnter:u,__onControlKeyDown:(Oe,Te)=>NR({levelIndex:ce,rowIndex:Te.rowIndex,cellIndex:Te.cellIndex,event:Oe,controlsRef:V}),__getControlRef:(Oe,Te,Re)=>{Array.isArray(V.current[ce])||(V.current[ce]=[]),Array.isArray(V.current[ce][Oe])||(V.current[ce][Oe]=[]),V.current[ce][Oe][Te]=Re},levelControlAriaLabel:typeof N=="function"?N(he):N,locale:n,minDate:i,maxDate:r,__preventFocus:f,nextIcon:p,previousIcon:m,nextLabel:v,previousLabel:y,onNext:b,onPrevious:A,onLevelClick:w,nextDisabled:S,previousDisabled:j,hasNextLevel:C,withNativeLevelSelect:E,yearsSelectRange:M,__onDateChange:G,__disableNativeLevelSelect:L,getMonthControlProps:a,classNames:R,styles:D,unstyled:F,__staticSelector:I||"YearLevelGroup",withCellSpacing:d,headerControlsOrder:k,fullWidth:K,attributes:z},ce)});return o.jsx(xd,{classNames:R,styles:D,__staticSelector:I||"YearLevelGroup",size:Y,unstyled:F,fullWidth:K,attributes:z,...U,children:J})});ej.classes={...KS.classes,...xd.classes};ej.displayName="@mantine/dates/YearLevelGroup";const qhe={numberOfColumns:1},tj=Pe(t=>{const{month:e,locale:n,firstDayOfWeek:i,weekdayFormat:r,weekendDays:s,getDayProps:a,excludeDate:l,minDate:u,maxDate:d,renderDay:f,hideOutsideDates:p,hideWeekdays:m,getDayAriaLabel:v,__onDayClick:y,__onDayMouseEnter:b,withCellSpacing:A,highlightToday:w,withWeekNumbers:S,__preventFocus:j,nextIcon:C,previousIcon:k,nextLabel:E,previousLabel:M,onNext:R,onPrevious:D,onLevelClick:F,nextDisabled:I,previousDisabled:Q,hasNextLevel:G,headerControlsOrder:L,withNativeLevelSelect:q,yearsSelectRange:N,classNames:P,styles:Y,unstyled:K,numberOfColumns:W,levelControlAriaLabel:z,monthLabelFormat:U,__staticSelector:V,__stopPropagation:J,__onDateChange:ee,__disableNativeLevelSelect:ce,size:he,static:Oe,fullWidth:Te,vars:Re,attributes:qe,...ie}=we("MonthLevelGroup",qhe,t),je=T.useRef([]),se=Array(W).fill(0).map((be,Be)=>{const Ce=De(e).add(Be,"months").format("YYYY-MM-DD");return o.jsx(ZS,{month:Ce,withNext:Be===W-1,withPrevious:Be===0,monthLabelFormat:U,__stopPropagation:J,__onDayClick:y,__onDayMouseEnter:b,__onDayKeyDown:(Ve,st)=>NR({levelIndex:Be,rowIndex:st.rowIndex,cellIndex:st.cellIndex,event:Ve,controlsRef:je}),__getDayRef:(Ve,st,Ye)=>{Array.isArray(je.current[Be])||(je.current[Be]=[]),Array.isArray(je.current[Be][Ve])||(je.current[Be][Ve]=[]),je.current[Be][Ve][st]=Ye},levelControlAriaLabel:typeof z=="function"?z(Ce):z,locale:n,firstDayOfWeek:i,weekdayFormat:r,weekendDays:s,getDayProps:a,excludeDate:l,minDate:u,maxDate:d,renderDay:f,hideOutsideDates:p,hideWeekdays:m,getDayAriaLabel:v,__preventFocus:j,nextIcon:C,previousIcon:k,nextLabel:E,previousLabel:M,onNext:R,onPrevious:D,onLevelClick:F,nextDisabled:I,previousDisabled:Q,hasNextLevel:G,withNativeLevelSelect:q,yearsSelectRange:N,__onDateChange:ee,__disableNativeLevelSelect:ce,classNames:P,styles:Y,unstyled:K,__staticSelector:V||"MonthLevelGroup",size:he,static:Oe,withCellSpacing:A,highlightToday:w,withWeekNumbers:S,headerControlsOrder:L,fullWidth:Te,attributes:qe},Be)});return o.jsx(xd,{classNames:P,styles:Y,__staticSelector:V||"MonthLevelGroup",size:he,fullWidth:Te,attributes:qe,...ie,children:se})});tj.classes={...xd.classes,...ZS.classes};tj.displayName="@mantine/dates/MonthLevelGroup";var C7={input:"m_6fa5e2aa"};const nj=Pe(t=>{const{inputProps:e,wrapperProps:n,placeholder:i,classNames:r,styles:s,unstyled:a,popoverProps:l,modalProps:u,dropdownType:d,children:f,formattedValue:p,dropdownHandlers:m,dropdownOpened:v,onClick:y,clearable:b,clearSectionMode:A,onClear:w,clearButtonProps:S,rightSection:j,shouldClear:C,readOnly:k,disabled:E,value:M,name:R,form:D,type:F,onDropdownClose:I,withTime:Q,...G}=bz("PickerInputBase",{size:"sm"},t),L=o.jsx(wi.ClearButton,{onClick:w,unstyled:a,...S}),q=()=>{F==="range"&&Array.isArray(M)&&M[0]&&!M[1]&&w(),m.close()};return o.jsxs(o.Fragment,{children:[d==="modal"&&!k&&o.jsx(ra,{opened:v,onClose:q,withCloseButton:!1,size:"auto","data-dates-modal":!0,unstyled:a,...u,children:f}),o.jsx(wi.Wrapper,{...n,children:o.jsxs(En,{position:"bottom-start",opened:v,trapFocus:!0,returnFocus:!1,unstyled:a,onClose:I,...l,disabled:(l==null?void 0:l.disabled)||d==="modal"||k,onChange:N=>{var P;N||((P=l==null?void 0:l.onClose)==null||P.call(l),q())},children:[o.jsx(En.Target,{children:o.jsx(wi,{"data-dates-input":!0,"data-read-only":k||void 0,disabled:E,component:"button",type:"button",multiline:!0,onClick:N=>{y==null||y(N),m.toggle()},__clearSection:L,__clearable:b&&C&&!k&&!E,__clearSectionMode:A,rightSection:j,...e,classNames:{...r,input:Yi(C7.input,r==null?void 0:r.input)},...G,children:p||o.jsx(wi.Placeholder,{error:e.error,unstyled:a,classNames:r,styles:s,__staticSelector:e.__staticSelector,children:i})})}),o.jsx(En.Dropdown,{"data-dates-dropdown":!0,children:f})]})}),o.jsx(Kq,{value:M,name:R,form:D,type:F,withTime:Q})]})});nj.classes=C7;nj.displayName="@mantine/dates/PickerInputBase";const SL=t=>t==="range"?[null,null]:t==="multiple"?[]:null,jL=(t,e)=>{const n=e?Wp:Ls;return Array.isArray(t)?t.map(n):n(t)};function ij({type:t,value:e,defaultValue:n,onChange:i,withTime:r=!1}){const s=T.useRef(t),[a,l,u]=hr({value:jL(e,r),defaultValue:jL(n,r),finalValue:SL(t),onChange:i});let d=a;return s.current!==t&&(s.current=t,e===void 0&&(d=n!==void 0?n:SL(t),l(d))),[d,l,u]}function Ek(t,e){return t?t==="month"?0:t==="year"?1:2:e||0}function Qhe(t){return t===0?"month":t===1?"year":"decade"}function M0(t,e,n){return Qhe(Yh(Ek(t,0),Ek(e,0),Ek(n,2)))}const Yhe={maxLevel:"decade",minLevel:"month",__updateDateOnYearSelect:!0,__updateDateOnMonthSelect:!0,enableKeyboardNavigation:!0},rj=Pe(t=>{const e=we("Calendar",Yhe,t),{vars:n,maxLevel:i,minLevel:r,defaultLevel:s,level:a,onLevelChange:l,date:u,defaultDate:d,onDateChange:f,numberOfColumns:p,columnsToScroll:m,ariaLabels:v,nextLabel:y,previousLabel:b,onYearSelect:A,onMonthSelect:w,onYearMouseEnter:S,onMonthMouseEnter:j,headerControlsOrder:C,__updateDateOnYearSelect:k,__updateDateOnMonthSelect:E,__setDateRef:M,__setLevelRef:R,firstDayOfWeek:D,weekdayFormat:F,weekendDays:I,getDayProps:Q,excludeDate:G,renderDay:L,hideOutsideDates:q,hideWeekdays:N,getDayAriaLabel:P,monthLabelFormat:Y,nextIcon:K,previousIcon:W,__onDayClick:z,__onDayMouseEnter:U,withCellSpacing:V,highlightToday:J,withWeekNumbers:ee,monthsListFormat:ce,getMonthControlProps:he,yearLabelFormat:Oe,yearsListFormat:Te,getYearControlProps:Re,decadeLabelFormat:qe,classNames:ie,styles:je,unstyled:se,minDate:be,maxDate:Be,locale:Ce,__staticSelector:Ve,size:st,__preventFocus:Ye,__stopPropagation:Ge,onNextDecade:dt,onPreviousDecade:nt,onNextYear:Ee,onPreviousYear:Qe,onNextMonth:Xe,onPreviousMonth:Ze,static:vt,enableKeyboardNavigation:pn,withNativeLevelSelect:mn,yearsSelectRange:un,fullWidth:Qt,attributes:ct,ref:zt,...on}=e,{resolvedClassNames:Lt,resolvedStyles:It}=na({classNames:ie,styles:je,props:e}),[$t,dn]=hr({value:a?M0(a,r,i):void 0,defaultValue:s?M0(s,r,i):void 0,finalValue:M0(void 0,r,i),onChange:l}),[ji,tn,an]=ij({type:"default",value:Ls(u),defaultValue:Ls(d),onChange:f}),gn=an&&!f;T.useImperativeHandle(M,()=>Ct=>{tn(Ct)}),T.useImperativeHandle(R,()=>Ct=>{dn(Ct)});const re={__staticSelector:Ve||"Calendar",styles:It,classNames:Lt,unstyled:se,size:st,attributes:ct},ve=m||p||1,pe=T.useRef(null);if(pe.current===null){const Ct=new Date;pe.current=be&&De(Ct).isAfter(be)?be:De(Ct).format("YYYY-MM-DD")}const Ne=ji||pe.current,Ut=()=>{const Ct=De(Ne).add(ve,"month").format("YYYY-MM-DD");Xe==null||Xe(Ct),tn(Ct)},Kt=()=>{const Ct=De(Ne).subtract(ve,"month").format("YYYY-MM-DD");Ze==null||Ze(Ct),tn(Ct)},it=()=>{const Ct=De(Ne).add(ve,"year").format("YYYY-MM-DD");Ee==null||Ee(Ct),tn(Ct)},rt=()=>{const Ct=De(Ne).subtract(ve,"year").format("YYYY-MM-DD");Qe==null||Qe(Ct),tn(Ct)},ht=()=>{const Ct=De(Ne).add(10*ve,"year").format("YYYY-MM-DD");dt==null||dt(Ct),tn(Ct)},Et=()=>{const Ct=De(Ne).subtract(10*ve,"year").format("YYYY-MM-DD");nt==null||nt(Ct),tn(Ct)},Tt=T.useRef(null);return T.useEffect(()=>{if(!pn||vt)return;const Ct=vn=>{var li;if(!((li=Tt.current)!=null&&li.contains(document.activeElement)))return;const gi=vn.ctrlKey||vn.metaKey,er=vn.shiftKey;switch(vn.key){case"ArrowUp":gi&&er?(vn.preventDefault(),Et()):gi&&(vn.preventDefault(),rt());break;case"ArrowDown":gi&&er?(vn.preventDefault(),ht()):gi&&(vn.preventDefault(),it());break;case"y":case"Y":$t==="month"&&(vn.preventDefault(),dn("year"));break}};return document.addEventListener("keydown",Ct),()=>{document.removeEventListener("keydown",Ct)}},[pn,vt,$t,it,rt,ht,Et]),o.jsxs(xe,{ref:Dn(Tt,zt),size:st,"data-calendar":!0,"data-full-width":Qt||void 0,...on,children:[$t==="month"&&o.jsx(tj,{month:Ne,minDate:be,maxDate:Be,firstDayOfWeek:D,weekdayFormat:F,weekendDays:I,getDayProps:Q,excludeDate:G,renderDay:L,hideOutsideDates:q,hideWeekdays:N,getDayAriaLabel:P,onNext:Ut,onPrevious:Kt,hasNextLevel:i!=="month",onLevelClick:()=>dn("year"),numberOfColumns:p,locale:Ce,levelControlAriaLabel:v==null?void 0:v.monthLevelControl,nextLabel:(v==null?void 0:v.nextMonth)??y,nextIcon:K,previousLabel:(v==null?void 0:v.previousMonth)??b,previousIcon:W,monthLabelFormat:Y,__onDayClick:z,__onDayMouseEnter:U,__onDateChange:tn,__disableNativeLevelSelect:gn,__preventFocus:Ye,__stopPropagation:Ge,static:vt,withCellSpacing:V,highlightToday:J,withWeekNumbers:ee,withNativeLevelSelect:mn,yearsSelectRange:un,headerControlsOrder:C,fullWidth:Qt,...re}),$t==="year"&&o.jsx(ej,{year:Ne,numberOfColumns:p,minDate:be,maxDate:Be,monthsListFormat:ce,getMonthControlProps:he,locale:Ce,onNext:it,onPrevious:rt,hasNextLevel:i!=="month"&&i!=="year",onLevelClick:()=>dn("decade"),levelControlAriaLabel:v==null?void 0:v.yearLevelControl,nextLabel:(v==null?void 0:v.nextYear)??y,nextIcon:K,previousLabel:(v==null?void 0:v.previousYear)??b,previousIcon:W,yearLabelFormat:Oe,__onControlMouseEnter:j,__onControlClick:(Ct,vn)=>{E&&tn(vn),dn(M0("month",r,i)),w==null||w(vn)},__onDateChange:tn,__disableNativeLevelSelect:gn,__preventFocus:Ye,__stopPropagation:Ge,withCellSpacing:V,withNativeLevelSelect:mn,yearsSelectRange:un,headerControlsOrder:C,fullWidth:Qt,...re}),$t==="decade"&&o.jsx(JS,{decade:Ne,minDate:be,maxDate:Be,yearsListFormat:Te,getYearControlProps:Re,locale:Ce,onNext:ht,onPrevious:Et,numberOfColumns:p,nextLabel:(v==null?void 0:v.nextDecade)??y,nextIcon:K,previousLabel:(v==null?void 0:v.previousDecade)??b,previousIcon:W,decadeLabelFormat:qe,__onControlMouseEnter:S,__onControlClick:(Ct,vn)=>{k&&tn(vn),dn(M0("year",r,i)),A==null||A(vn)},__preventFocus:Ye,__stopPropagation:Ge,withCellSpacing:V,headerControlsOrder:C,fullWidth:Qt,...re})]})});rj.classes={...JS.classes,...ej.classes,...tj.classes};rj.displayName="@mantine/dates/Calendar";function PR(t){const{maxLevel:e,minLevel:n,defaultLevel:i,level:r,onLevelChange:s,nextIcon:a,previousIcon:l,date:u,defaultDate:d,onDateChange:f,numberOfColumns:p,columnsToScroll:m,ariaLabels:v,nextLabel:y,previousLabel:b,onYearSelect:A,onMonthSelect:w,onYearMouseEnter:S,onMonthMouseEnter:j,onNextMonth:C,onPreviousMonth:k,onNextYear:E,onPreviousYear:M,onNextDecade:R,onPreviousDecade:D,withCellSpacing:F,highlightToday:I,withNativeLevelSelect:Q,yearsSelectRange:G,__updateDateOnYearSelect:L,__updateDateOnMonthSelect:q,__setDateRef:N,__setLevelRef:P,withWeekNumbers:Y,headerControlsOrder:K,firstDayOfWeek:W,weekdayFormat:z,weekendDays:U,getDayProps:V,excludeDate:J,renderDay:ee,hideOutsideDates:ce,hideWeekdays:he,getDayAriaLabel:Oe,monthLabelFormat:Te,monthsListFormat:Re,getMonthControlProps:qe,yearLabelFormat:ie,yearsListFormat:je,getYearControlProps:se,decadeLabelFormat:be,allowSingleDateInRange:Be,allowDeselect:Ce,minDate:Ve,maxDate:st,locale:Ye,...Ge}=t;return{calendarProps:{maxLevel:e,minLevel:n,defaultLevel:i,level:r,onLevelChange:s,nextIcon:a,previousIcon:l,date:u,defaultDate:d,onDateChange:f,numberOfColumns:p,columnsToScroll:m,ariaLabels:v,nextLabel:y,previousLabel:b,onYearSelect:A,onMonthSelect:w,onYearMouseEnter:S,onMonthMouseEnter:j,onNextMonth:C,onPreviousMonth:k,onNextYear:E,onPreviousYear:M,onNextDecade:R,onPreviousDecade:D,withCellSpacing:F,highlightToday:I,withNativeLevelSelect:Q,yearsSelectRange:G,__updateDateOnYearSelect:L,__updateDateOnMonthSelect:q,__setDateRef:N,withWeekNumbers:Y,headerControlsOrder:K,firstDayOfWeek:W,weekdayFormat:z,weekendDays:U,getDayProps:V,excludeDate:J,renderDay:ee,hideOutsideDates:ce,hideWeekdays:he,getDayAriaLabel:Oe,monthLabelFormat:Te,monthsListFormat:Re,getMonthControlProps:qe,yearLabelFormat:ie,yearsListFormat:je,getYearControlProps:se,decadeLabelFormat:be,allowSingleDateInRange:Be,allowDeselect:Ce,minDate:Ve,maxDate:st,locale:Ye},others:Ge}}function CL(t,e){const n=[...e].sort((i,r)=>De(i).isAfter(De(r))?1:-1);return De(n[0]).startOf("day").subtract(1,"ms").isBefore(t)&&De(n[1]).endOf("day").add(1,"ms").isAfter(t)}function Whe({type:t,level:e,value:n,defaultValue:i,onChange:r,allowSingleDateInRange:s,allowDeselect:a,onMouseLeave:l}){const[u,d]=ij({type:t,value:n,defaultValue:i,onChange:r}),[f,p]=T.useState(t==="range"&&u[0]&&!u[1]?u[0]:null),[m,v]=T.useState(null),y=k=>{if(t==="range"){if(f&&!u[1]){if(De(k).isSame(f,e)&&!s){p(null),v(null),d([null,null]);return}const E=[k,f];E.sort((M,R)=>De(M).isAfter(De(R))?1:-1),d(E),v(null),p(null);return}if(u[0]&&!u[1]&&De(k).isSame(u[0],e)&&!s){p(null),v(null),d([null,null]);return}d([k,null]),v(null),p(k);return}if(t==="multiple"){u.some(E=>De(E).isSame(k,e))?d(u.filter(E=>!De(E).isSame(k,e))):d([...u,k]);return}u&&a&&De(k).isSame(u,e)?d(null):d(k)},b=k=>f&&m?CL(k,[m,f]):u[0]&&u[1]?CL(k,u):!1,A=t==="range"?k=>{l==null||l(k),v(null)}:l,w=k=>u[0]&&De(k).isSame(u[0],e)?!(m&&De(m).isBefore(u[0])):!1,S=k=>u[1]?De(k).isSame(u[1],e):!u[0]||!m?!1:De(m).isBefore(u[0])&&De(k).isSame(u[0],e),j=k=>{if(t==="range")return{selected:u.some(M=>M&&De(M).isSame(k,e)),inRange:b(k),firstInRange:w(k),lastInRange:S(k),"data-autofocus":!!u[0]&&De(u[0]).isSame(k,e)||void 0};if(t==="multiple")return{selected:u.some(M=>M&&De(M).isSame(k,e)),"data-autofocus":!!u[0]&&De(u[0]).isSame(k,e)||void 0};const E=De(u).isSame(k,e);return{selected:E,"data-autofocus":E||void 0}},C=t==="range"&&f?v:()=>{};return T.useEffect(()=>{if(t==="range")if(u[0]&&!u[1])p(u[0]);else{const k=u[0]==null&&u[1]==null,E=u[0]!=null&&u[1]!=null;(k||E)&&(p(null),v(null))}},[u]),{onDateChange:y,onRootMouseLeave:A,onHoveredDateChange:C,getControlProps:j,_value:u,setValue:d}}var Uhe={datePickerRoot:"m_765a40cf",presetsList:"m_d6a681e1",presetButton:"m_acd30b22"};const _7=(t,{size:e})=>({datePickerRoot:{"--preset-font-size":Ai(e)}}),Vhe={type:"default",defaultLevel:"month",numberOfColumns:1,size:"sm"},Zy=Pe(t=>{const e=we("DatePicker",Vhe,t),{allowDeselect:n,allowSingleDateInRange:i,value:r,defaultValue:s,onChange:a,onMouseLeave:l,classNames:u,styles:d,__staticSelector:f,__onDayClick:p,__onDayMouseEnter:m,__onPresetSelect:v,__stopPropagation:y,presets:b,className:A,style:w,unstyled:S,size:j,vars:C,attributes:k,fullWidth:E,...M}=e,{calendarProps:R,others:D}=PR(M),F=T.useRef(null),I=T.useRef(null),Q=gt({name:f||"DatePicker",classes:Uhe,props:e,className:A,style:w,classNames:u,styles:d,unstyled:S,attributes:k,rootSelector:b?"datePickerRoot":void 0,varsResolver:_7,vars:C}),{onDateChange:G,onRootMouseLeave:L,onHoveredDateChange:q,getControlProps:N,_value:P,setValue:Y}=Whe({type:D.type,level:"day",allowDeselect:n,allowSingleDateInRange:i,value:r,defaultValue:s,onChange:a,onMouseLeave:l}),{resolvedClassNames:K,resolvedStyles:W}=na({classNames:u,styles:d,props:e}),z=o.jsx(rj,{classNames:K,styles:W,__staticSelector:f||"DatePicker",onMouseLeave:L,size:j,fullWidth:E,...R,...b?{}:D,__stopPropagation:y,__setDateRef:F,__setLevelRef:I,minLevel:R.minLevel||"month",__onDayMouseEnter:(J,ee)=>{q(ee),m==null||m(J,ee)},__onDayClick:(J,ee)=>{G(ee),p==null||p(J,ee)},getDayProps:J=>{var ee;return{...N(J),...(ee=R.getDayProps)==null?void 0:ee.call(R,J)}},getMonthControlProps:J=>{var ee;return{selected:typeof P=="string"?LR(J,P):!1,...(ee=R.getMonthControlProps)==null?void 0:ee.call(R,J)}},getYearControlProps:J=>{var ee;return{selected:typeof P=="string"?De(J).isSame(P,"year"):!1,...(ee=R.getYearControlProps)==null?void 0:ee.call(R,J)}},hideOutsideDates:R.hideOutsideDates??R.numberOfColumns!==1,attributes:k,...b?{}:{className:A,style:w}});if(!b)return z;const U=J=>{var ce,he;const ee=Array.isArray(J)?J[0]:J;ee!==void 0&&((ce=F.current)==null||ce.call(F,ee),(he=I.current)==null||he.call(I,"month"),v?v(J):Y(J))},V=b.map((J,ee)=>o.jsx(Fi,{...Q("presetButton"),onClick:()=>U(J.value),onMouseDown:ce=>ce.preventDefault(),"data-mantine-stop-propagation":y||void 0,children:J.label},ee));return o.jsxs(xe,{...Q("datePickerRoot"),size:j,...D,children:[o.jsx("div",{...Q("presetsList"),children:V}),z]})});Zy.classes=rj.classes;Zy.varsResolver=_7;Zy.displayName="@mantine/dates/DatePicker";function Mk({minDate:t,value:e}){const n=t?De(t).format("HH:mm:ss"):null;return e&&t&&e===t?n??void 0:void 0}function Rk({maxDate:t,value:e}){const n=t?De(t).format("HH:mm:ss"):null;return e&&t&&e===t?n??void 0:void 0}var k7={timeWrapper:"m_43bf4edb",timeInput:"m_49f1412",rangeInfo:"m_d6d672a0",rangeTimeWrapper:"m_80eb36d4",rangeTimeInput:"m_5566a64b"};const Ghe={type:"default",size:"sm"},sj=md(t=>{const e=we("InlineDateTimePicker",Ghe,t),{value:n,defaultValue:i,onChange:r,valueFormat:s,locale:a,classNames:l,styles:u,unstyled:d,timePickerProps:f,endTimePickerProps:p,submitButtonProps:m,withSeconds:v,level:y,defaultLevel:b,size:A,variant:w,vars:S,minDate:j,maxDate:C,defaultDate:k,defaultTimeValue:E,presets:M,attributes:R,onSubmit:D,labelSeparator:F,type:I,className:Q,style:G,__stopPropagation:L,__staticSelector:q,__onEnter:N,__onPresetSelect:P,fullWidth:Y,...K}=e,W=q||"InlineDateTimePicker",z=gt({name:W,classes:k7,props:e,classNames:l,styles:u,unstyled:d,attributes:R,vars:S}),{resolvedClassNames:U,resolvedStyles:V}=na({classNames:l,styles:u,props:e}),J=Ou(),ee=s||(v?"DD/MM/YYYY HH:mm:ss":"DD/MM/YYYY HH:mm"),ce=J.getLabelSeparator(F),he=I==="range",Oe=T.useRef(null),Te=Dn(Oe,f==null?void 0:f.hoursRef),Re=Dn(T.useRef(null),p==null?void 0:p.hoursRef),{calendarProps:{allowSingleDateInRange:qe,...ie},others:je}=PR(K),[se,be]=ij({type:I,value:n,defaultValue:i,onChange:r,withTime:!0}),Be=It=>It?De(It).format(v?"HH:mm:ss":"HH:mm"):"",Ce=()=>E||(he?Array.isArray(se)?Be(se[0]):"":Be(se)),Ve=()=>E||(he&&Array.isArray(se)?Be(se[1]):""),[st,Ye]=T.useState(Ce),[Ge,dt]=T.useState(Ve),[nt,Ee]=T.useState(y||b||"month"),Qe=he?(Array.isArray(se)?se[0]:null)||k:se||k,Xe=It=>{var $t;It&&be(Ep(rm(j,C,It),st||E||"")),($t=Oe.current)==null||$t.focus()},Ze=It=>{var an;const[$t,dn]=It,ji=$t?Ep(rm(j,C,$t),st||E||""):null,tn=dn?Ep(rm(j,C,dn),Ge||E||""):null;be([ji,tn]),$t&&dn&&((an=Oe.current)==null||an.focus())},vt=It=>{he?Ze(It):Xe(It)},pn=It=>{var $t;if(($t=f==null?void 0:f.onChange)==null||$t.call(f,It),Ye(It),It)if(he&&Array.isArray(se)){if(se[0]){const dn=Ep(se[0],It);be([dn,se[1]])}}else be(Ep(se,It))},mn=It=>{var $t;if(($t=p==null?void 0:p.onChange)==null||$t.call(p,It),dt(It),It&&he&&Array.isArray(se)&&se[1]){const dn=Ep(se[1],It);be([se[0],dn])}},un=It=>{It.key==="Enter"&&(It.preventDefault(),N==null||N())},Qt=()=>{if(!he||!Array.isArray(se))return"";const It=ji=>ji?typeof ee=="function"?ee(ji):De(ji).locale(J.getLocale(a)).format(ee):"",$t=It(se[0]),dn=It(se[1]);return $t&&dn?`${$t} ${ce} ${dn}`:$t?`${$t} ${ce} ...`:""};wu(()=>{he&&Array.isArray(se)?(Ye(Be(se[0])),dt(Be(se[1]))):Ye(Be(se))},[se]);const ct=Mk(he?{minDate:j,value:Array.isArray(se)?se[0]:null}:{minDate:j,value:se}),zt=Rk(he?{maxDate:C,value:Array.isArray(se)?se[0]:null}:{maxDate:C,value:se}),on=he?Mk({minDate:j,value:Array.isArray(se)?se[1]:null}):void 0,Lt=he?Rk({maxDate:C,value:Array.isArray(se)?se[1]:null}):void 0;return o.jsxs(xe,{...z("root",{className:Q,style:G}),...je,ref:e.ref,children:[o.jsx(Zy,{fullWidth:Y??!0,...ie,maxDate:C,minDate:j,size:A,variant:w,type:I,value:se,defaultDate:Qe||rhe({maxDate:C,minDate:j}),onChange:vt,locale:a,classNames:U,styles:V,unstyled:d,__staticSelector:W,__stopPropagation:L,level:y,defaultLevel:b,onLevelChange:It=>{var $t;Ee(It),($t=ie.onLevelChange)==null||$t.call(ie,It)},presets:M,allowSingleDateInRange:qe,__onPresetSelect:P,attributes:R}),nt==="month"&&!he&&o.jsxs("div",{...z("timeWrapper"),children:[o.jsx(sm,{value:st,withSeconds:v,unstyled:d,min:ct,max:zt,...f,...z("timeInput",{className:f==null?void 0:f.className,style:f==null?void 0:f.style}),onChange:pn,onKeyDown:un,size:A,"data-mantine-stop-propagation":L||void 0,hoursRef:Te}),o.jsx(mi,{variant:"default",size:`input-${A||"sm"}`,...z("submitButton",{className:m==null?void 0:m.className,style:m==null?void 0:m.style}),unstyled:d,"data-mantine-stop-propagation":L||void 0,children:o.jsx(Hm,{size:"30%"}),...m,onClick:It=>{var $t;($t=m==null?void 0:m.onClick)==null||$t.call(m,It),D==null||D()}})]}),nt==="month"&&he&&o.jsxs(o.Fragment,{children:[o.jsx(ft,{...z("rangeInfo"),children:Qt()}),o.jsxs("div",{...z("rangeTimeWrapper"),children:[o.jsx(sm,{value:st,withSeconds:v,unstyled:d,min:ct,max:zt,...f,...z("rangeTimeInput",{className:f==null?void 0:f.className,style:f==null?void 0:f.style}),onChange:pn,onKeyDown:un,size:A,"data-mantine-stop-propagation":L||void 0,hoursRef:Te}),o.jsx(sm,{value:Ge,withSeconds:v,unstyled:d,min:on,max:Lt,...p,...z("rangeTimeInput",{className:p==null?void 0:p.className,style:p==null?void 0:p.style}),onChange:mn,onKeyDown:un,size:A,"data-mantine-stop-propagation":L||void 0,hoursRef:Re}),o.jsx(mi,{variant:"default",size:`input-${A||"sm"}`,...z("submitButton",{className:m==null?void 0:m.className,style:m==null?void 0:m.style}),unstyled:d,"data-mantine-stop-propagation":L||void 0,children:o.jsx(Hm,{size:"30%"}),...m,onClick:It=>{var $t;($t=m==null?void 0:m.onClick)==null||$t.call(m,It),D==null||D()}})]})]})]})});sj.classes={...k7,...Zy.classes};sj.displayName="@mantine/dates/InlineDateTimePicker";var T7={timeWrapper:"m_208d2562",timeInput:"m_62ee059",rangeInfo:"m_d8663ee7",rangeTimeWrapper:"m_afb15cad",rangeTimeInput:"m_8afe6e64"};const Xhe={type:"default",dropdownType:"popover",size:"sm"},Fv=md(t=>{const e=we(["Input","InputWrapper","DateTimePicker"],Xhe,t),{value:n,defaultValue:i,onChange:r,valueFormat:s,locale:a,classNames:l,styles:u,unstyled:d,timePickerProps:f,endTimePickerProps:p,submitButtonProps:m,withSeconds:v,level:y,defaultLevel:b,size:A,variant:w,dropdownType:S,vars:j,minDate:C,maxDate:k,defaultDate:E,defaultTimeValue:M,presets:R,attributes:D,onDropdownClose:F,type:I,labelSeparator:Q,allowSingleDateInRange:G,...L}=e,q=I==="range";gt({name:"DateTimePicker",classes:T7,props:e,classNames:l,styles:u,unstyled:d,attributes:D,vars:j});const{resolvedClassNames:N,resolvedStyles:P}=na({classNames:l,styles:u,props:e}),Y=v||(f==null?void 0:f.withSeconds),K=s||(Y?"DD/MM/YYYY HH:mm:ss":"DD/MM/YYYY HH:mm"),{calendarProps:{allowSingleDateInRange:W,...z},others:U}=PR(L),V=Ou(),J=V.getLabelSeparator(Q),[ee,ce]=ij({type:I,value:n,defaultValue:i,onChange:r,withTime:!0}),[he,Oe]=Dw(!1),[Te,Re]=T.useState(0),qe=Ge=>Ge?typeof K=="function"?K(Ge):De(Ge).locale(V.getLocale(a)).format(K):"",je=(()=>{if(q&&Array.isArray(ee)){const Ge=qe(ee[0]),dt=qe(ee[1]);return Ge&&dt?`${Ge} ${J} ${dt}`:Ge?`${Ge} ${J} ...`:""}return qe(ee)})();wu(()=>{he&&Re(Ge=>Ge+1)},[he]);const se=S==="popover",be=()=>{q&&Array.isArray(ee)&&ee[0]&&!ee[1]&&ce([null,null])},Be=()=>{if(be(),q&&Array.isArray(ee)){const Ge=ee[0]?rm(C,k,ee[0]):null,dt=ee[1]?rm(C,k,ee[1]):null;(ee[0]&&ee[0]!==Ge||ee[1]&&ee[1]!==dt)&&ce([Ge,dt])}else if(ee){const Ge=rm(C,k,ee);ee!==Ge&&ce(Ge)}F==null||F()},Ce=()=>{Be(),Oe.close()},Ve=()=>{ce(q?[null,null]:null)},st=q?Array.isArray(ee)&&!!ee[0]:!!ee,Ye=Ge=>{ce(Ge)};return o.jsx(nj,{formattedValue:je,dropdownOpened:L.disabled?!1:he,dropdownHandlers:Oe,classNames:N,styles:P,unstyled:d,onClear:Ve,shouldClear:st,value:ee,size:A,variant:w,dropdownType:S,...U,type:I,__staticSelector:"DateTimePicker",onDropdownClose:Be,withTime:!0,attributes:D,children:o.jsx(sj,{...z,fullWidth:!1,type:I,value:ee,onChange:ce,maxDate:k,minDate:C,size:A,variant:w,locale:a,classNames:N,styles:P,unstyled:d,level:y,defaultLevel:b,defaultDate:E,defaultTimeValue:M,presets:R,allowSingleDateInRange:G,timePickerProps:f,endTimePickerProps:p,submitButtonProps:m,withSeconds:v,valueFormat:s,labelSeparator:Q,attributes:D,onSubmit:Ce,__stopPropagation:se,__staticSelector:"DateTimePicker",__onEnter:Ce,__onPresetSelect:Ye},Te)})});Fv.classes={...T7,...nj.classes,...sj.classes};Fv.displayName="@mantine/dates/DateTimePicker";const Khe="settings.useLocalTime",Zhe="settings.enableQueryHistory",Jhe="settings.enableAutocomplete",ede="settings.enableSyntaxHighlighting",tde="settings.enableLinter",nde="settings.showAnnotations",ide="settings.showQueryWarnings",rde="settings.showQueryInfoNotices",sde="settings.ruleGroupsPerPage",ode="settings.alertGroupsPerPage",ade=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(i=>t.endsWith(i));return t.slice(0,t.length-(n||"").length)},lde={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:ade(window.location.pathname),useLocalTime:zo(Khe,!1),enableQueryHistory:zo(Zhe,!1),enableAutocomplete:zo(Jhe,!0),enableSyntaxHighlighting:zo(ede,!0),enableLinter:zo(tde,!0),showAnnotations:zo(nde,!1),showQueryWarnings:zo(ide,!0),showQueryInfoNotices:zo(rde,!0),ruleGroupsPerPage:zo(sde,10),alertGroupsPerPage:zo(ode,10)},O7=HS({name:"settings",initialState:lde,reducers:{updateSettings:(t,{payload:e})=>{Object.assign(t,e)}}}),{updateSettings:ba}=O7.actions,xr=()=>bc(t=>t.settings),cde=O7.reducer,_L={width:"0.9rem",height:"0.9rem"},E7=({time:t,range:e,description:n,onChangeTime:i})=>{const r=()=>t!==null?t:Date.now().valueOf(),{useLocalTime:s}=xr(),a=s?De(t).format():De(t).subtract(De().utcOffset(),"minutes").format();return o.jsx(pt,{gap:5,children:o.jsx(Fv,{title:"End time",w:230,valueFormat:"YYYY-MM-DD HH:mm:ss",withSeconds:!0,value:t!==null?a:void 0,onChange:l=>i(l?s?new Date(l).getTime():De.utc(l).valueOf():null),"aria-label":n,placeholder:n,onClick:()=>{t===null&&i(r())},leftSection:o.jsx(mi,{size:"lg",color:"gray",variant:"transparent",title:"Decrease time","aria-label":"Decrease time",onClick:()=>i(r()-e/2),children:o.jsx(Tse,{style:_L})}),styles:{section:{width:"unset"}},rightSection:o.jsxs(o.Fragment,{children:[t&&o.jsx(Sl,{variant:"transparent",color:"gray",onMouseDown:l=>l.preventDefault(),tabIndex:-1,onClick:()=>{i(null)},size:"xs"}),o.jsx(mi,{size:"lg",color:"gray",variant:"transparent",title:"Increase time","aria-label":"Increase time",onClick:()=>i(r()+e/2),children:o.jsx(k9,{style:_L})})]})})})},kL={width:"0.9rem",height:"0.9rem"},TL=[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),ude=({range:t,onChangeRange:e})=>{const[n,i]=T.useState(Gn(t));T.useEffect(()=>{i(Gn(t))},[t]);const r=l=>{const u=DR(l);u===null?i(Gn(t)):e(u)},s=()=>{for(const l of TL)if(t<l){i(Gn(l)),e(l);return}},a=()=>{for(const l of TL.slice().reverse())if(t>l){i(Gn(l)),e(l);return}};return o.jsx(pt,{gap:5,children:o.jsx(yc,{title:"Range",value:n,onChange:l=>i(l.currentTarget.value),onBlur:()=>r(n),onKeyDown:l=>l.key==="Enter"&&r(n),"aria-label":"Range",style:{width:`calc(44px + ${n.length+3}ch)`},leftSection:o.jsx(mi,{size:"lg",variant:"transparent",color:"gray","aria-label":"Decrease range",onClick:a,children:o.jsx(aoe,{style:kL})}),rightSection:o.jsx(mi,{size:"lg",variant:"transparent",color:"gray","aria-label":"Increase range",onClick:s,children:o.jsx(R9,{style:kL})}),leftSectionPointerEvents:"all",rightSectionPointerEvents:"all"})})},M7=1024;let hde=0,Dk=class{constructor(e,n){this.from=e,this.to=n}};class xn{constructor(e={}){this.id=hde++,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=_o.match(e)),n=>{let i=e(n);return i===void 0?null:[this,i]}}}xn.closedBy=new xn({deserialize:t=>t.split(" ")});xn.openedBy=new xn({deserialize:t=>t.split(" ")});xn.group=new xn({deserialize:t=>t.split(" ")});xn.isolate=new xn({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});xn.contextHash=new xn({perNode:!0});xn.lookAhead=new xn({perNode:!0});xn.mounted=new xn({perNode:!0});class uv{constructor(e,n,i,r=!1){this.tree=e,this.overlay=n,this.parser=i,this.bracketed=r}static get(e){return e&&e.props&&e.props[xn.mounted.id]}}const dde=Object.create(null);class _o{constructor(e,n,i,r=0){this.name=e,this.props=n,this.id=i,this.flags=r}static define(e){let n=e.props&&e.props.length?Object.create(null):dde,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new _o(e.name||"",n,e.id,i);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),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 r}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(xn.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let i in e)for(let r of i.split(" "))n[r]=e[i];return i=>{for(let r=i.prop(xn.group),s=-1;s<(r?r.length:0);s++){let a=n[s<0?i.name:r[s]];if(a)return a}}}}_o.none=new _o("",Object.create(null),0,8);class FR{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 i of this.types){let r=null;for(let s of e){let a=s(i);if(a){r||(r=Object.assign({},i.props));let l=a[1],u=a[0];u.combine&&u.id in r&&(l=u.combine(r[u.id],l)),r[u.id]=l}}n.push(r?new _o(i.name,r,i.id,i.flags):i)}return new FR(n)}}const Qb=new WeakMap,OL=new WeakMap;var lr;(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"})(lr||(lr={}));class yr{constructor(e,n,i,r,s){if(this.type=e,this.children=n,this.positions=i,this.length=r,this.props=null,s&&s.length){this.props=Object.create(null);for(let[a,l]of s)this.props[typeof a=="number"?a:a.id]=l}}toString(){let e=uv.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let i of this.children){let r=i.toString();r&&(n&&(n+=","),n+=r)}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 r2(this.topNode,e)}cursorAt(e,n=0,i=0){let r=Qb.get(this)||this.topNode,s=new r2(r);return s.moveTo(e,n),Qb.set(this,s._tree),s}get topNode(){return new id(this,0,0,null)}resolve(e,n=0){let i=$v(Qb.get(this)||this.topNode,e,n,!1);return Qb.set(this,i),i}resolveInner(e,n=0){let i=$v(OL.get(this)||this.topNode,e,n,!0);return OL.set(this,i),i}resolveStack(e,n=0){return mde(this,e,n)}iterate(e){let{enter:n,leave:i,from:r=0,to:s=this.length}=e,a=e.mode||0,l=(a&lr.IncludeAnonymous)>0;for(let u=this.cursor(a|lr.IncludeAnonymous);;){let d=!1;if(u.from<=s&&u.to>=r&&(!l&&u.type.isAnonymous||n(u)!==!1)){if(u.firstChild())continue;d=!0}for(;d&&i&&(l||!u.type.isAnonymous)&&i(u),!u.nextSibling();){if(!u.parent())return;d=!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:HR(_o.none,this.children,this.positions,0,this.children.length,0,this.length,(n,i,r)=>new yr(this.type,n,i,r,this.propValues),e.makeTree||((n,i,r)=>new yr(_o.none,n,i,r)))}static build(e){return gde(e)}}yr.empty=new yr(_o.none,[],[],0);class $R{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 $R(this.buffer,this.index)}}class nd{constructor(e,n,i){this.buffer=e,this.length=n,this.set=i}get type(){return _o.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],i=this.buffer[e+3],r=this.set.types[n],s=r.name;if(/\W/.test(s)&&!r.isError&&(s=JSON.stringify(s)),e+=4,i==e)return s;let a=[];for(;e<i;)a.push(this.childString(e)),e=this.buffer[e+3];return s+"("+a.join(",")+")"}findChild(e,n,i,r,s){let{buffer:a}=this,l=-1;for(let u=e;u!=n&&!(R7(s,r,a[u+1],a[u+2])&&(l=u,i>0));u=a[u+3]);return l}slice(e,n,i){let r=this.buffer,s=new Uint16Array(n-e),a=0;for(let l=e,u=0;l<n;){s[u++]=r[l++],s[u++]=r[l++]-i;let d=s[u++]=r[l++]-i;s[u++]=r[l++]-e,a=Math.max(a,d)}return new nd(s,a,this.set)}}function R7(t,e,n,i){switch(t){case-2:return n<e;case-1:return i>=e&&n<e;case 0:return n<e&&i>e;case 1:return n<=e&&i>e;case 2:return i>e;case 4:return!0}}function $v(t,e,n,i){for(var r;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let a=!i&&t instanceof id&&t.index<0?null:t.parent;if(!a)return t;t=a}let s=i?0:lr.IgnoreOverlays;if(i)for(let a=t,l=a.parent;l;a=l,l=a.parent)a instanceof id&&a.index<0&&((r=l.enter(e,n,s))===null||r===void 0?void 0:r.from)!=a.from&&(t=l);for(;;){let a=t.enter(e,n,s);if(!a)return t;t=a}}class D7{cursor(e=0){return new r2(this,e)}getChild(e,n=null,i=null){let r=EL(this,e,n,i);return r.length?r[0]:null}getChildren(e,n=null,i=null){return EL(this,e,n,i)}resolve(e,n=0){return $v(this,e,n,!1)}resolveInner(e,n=0){return $v(this,e,n,!0)}matchContext(e){return i2(this.parent,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),i=this;for(;n;){let r=n.lastChild;if(!r||r.to!=n.to)break;r.type.isError&&r.from==r.to?(i=n,n=r.prevSibling):n=r}return i}get node(){return this}get next(){return this.parent}}let id=class WA extends D7{constructor(e,n,i,r){super(),this._tree=e,this.from=n,this.index=i,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,i,r,s=0){for(let a=this;;){for(let{children:l,positions:u}=a._tree,d=n>0?l.length:-1;e!=d;e+=n){let f=l[e],p=u[e]+a.from,m;if(!(!(s&lr.EnterBracketed&&f instanceof yr&&(m=uv.get(f))&&!m.overlay&&m.bracketed&&i>=p&&i<=p+f.length)&&!R7(r,i,p,p+f.length))){if(f instanceof nd){if(s&lr.ExcludeBuffers)continue;let v=f.findChild(0,f.buffer.length,n,i-p,r);if(v>-1)return new $h(new fde(a,f,e,p),null,v)}else if(s&lr.IncludeAnonymous||!f.type.isAnonymous||zR(f)){let v;if(!(s&lr.IgnoreMounts)&&(v=uv.get(f))&&!v.overlay)return new WA(v.tree,p,e,a);let y=new WA(f,p,e,a);return s&lr.IncludeAnonymous||!y.type.isAnonymous?y:y.nextChild(n<0?f.children.length-1:0,n,i,r,s)}}}if(s&lr.IncludeAnonymous||!a.type.isAnonymous||(a.index>=0?e=a.index+n:e=n<0?-1:a._parent._tree.children.length,a=a._parent,!a))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,i=0){let r;if(!(i&lr.IgnoreOverlays)&&(r=uv.get(this._tree))&&r.overlay){let s=e-this.from,a=i&lr.EnterBracketed&&r.bracketed;for(let{from:l,to:u}of r.overlay)if((n>0||a?l<=s:l<s)&&(n<0||a?u>=s:u>s))return new WA(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,i)}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 EL(t,e,n,i){let r=t.cursor(),s=[];if(!r.firstChild())return s;if(n!=null){for(let a=!1;!a;)if(a=r.type.is(n),!r.nextSibling())return s}for(;;){if(i!=null&&r.type.is(i))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return i==null?s:[]}}function i2(t,e,n=e.length-1){for(let i=t;n>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[n]&&e[n]!=i.name)return!1;n--}}return!0}class fde{constructor(e,n,i,r){this.parent=e,this.buffer=n,this.index=i,this.start=r}}class $h extends D7{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,i){super(),this.context=e,this._parent=n,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,n,i){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,n-this.context.start,i);return s<0?null:new $h(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,i=0){if(i&lr.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return s<0?null:new $h(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 $h(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 $h(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:i}=this.context,r=this.index+4,s=i.buffer[this.index+3];if(s>r){let a=i.buffer[this.index+1];e.push(i.slice(r,s,a)),n.push(0)}return new yr(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function N7(t){if(!t.length)return null;let e=0,n=t[0];for(let s=1;s<t.length;s++){let a=t[s];(a.from>n.from||a.to<n.to)&&(n=a,e=s)}let i=n instanceof id&&n.index<0?null:n.parent,r=t.slice();return i?r[e]=i:r.splice(e,1),new pde(r,n)}class pde{constructor(e,n){this.heads=e,this.node=n}get next(){return N7(this.heads)}}function mde(t,e,n){let i=t.resolveInner(e,n),r=null;for(let s=i instanceof id?i:i.context.parent;s;s=s.parent)if(s.index<0){let a=s.parent;(r||(r=[i])).push(a.resolve(e,n)),s=a}else{let a=uv.get(s.tree);if(a&&a.overlay&&a.overlay[0].from<=e&&a.overlay[a.overlay.length-1].to>=e){let l=new id(a.tree,a.overlay[0].from+s.from,-1,s);(r||(r=[i])).push($v(l,e,n,!1))}}return r?N7(r):i}class r2{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&~lr.EnterBracketed,e instanceof id)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.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:i,buffer:r}=this.buffer;return this.type=n||r.set.types[r.buffer[e]],this.from=i+r.buffer[e+1],this.to=i+r.buffer[e+2],!0}yield(e){return e?e instanceof id?(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,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,i,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],e,n-this.buffer.start,i);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,i=this.mode){return this.buffer?i&lr.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&lr.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&lr.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,i=this.stack.length-1;if(e<0){let r=i<0?0:this.stack[i]+4;if(this.index!=r)return this.yieldBuf(n.findChild(r,this.index,-1,0,4))}else{let r=n.buffer[this.index+3];if(r<(i<0?n.buffer.length:n.buffer[this.stack[i]+3]))return this.yieldBuf(r)}return i<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,i,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(r.buffer.buffer[s+3]<this.index)return!1;({index:n,parent:i}=r)}else({index:n,_parent:i}=this._tree);for(;i;{index:n,_parent:i}=i)if(n>-1)for(let s=n+e,a=e<0?-1:i._tree.children.length;s!=a;s+=e){let l=i._tree.children[s];if(this.mode&lr.IncludeAnonymous||l instanceof nd||!l.type.isAnonymous||zR(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,i=0;if(e&&e.context==this.buffer)e:for(let r=this.index,s=this.stack.length;s>=0;){for(let a=e;a;a=a._parent)if(a.index==r){if(r==this.index)return a;n=a,i=s+1;break e}r=this.stack[--s]}for(let r=i;r<this.stack.length;r++)n=new $h(this.buffer,n,this.stack[r]);return this.bufferNode=new $h(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let i=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){i++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&n&&n(this),r=this.type.isAnonymous,!i)return;if(this.nextSibling())break;this.parent(),i--,r=!0}}}matchContext(e){if(!this.buffer)return i2(this.node.parent,e);let{buffer:n}=this.buffer,{types:i}=n.set;for(let r=e.length-1,s=this.stack.length-1;r>=0;s--){if(s<0)return i2(this._tree,e,r);let a=i[n.buffer[this.stack[s]]];if(!a.isAnonymous){if(e[r]&&e[r]!=a.name)return!1;r--}}return!0}}function zR(t){return t.children.some(e=>e instanceof nd||!e.type.isAnonymous||zR(e))}function gde(t){var e;let{buffer:n,nodeSet:i,maxBufferLength:r=M7,reused:s=[],minRepeatType:a=i.types.length}=t,l=Array.isArray(n)?new $R(n,n.length):n,u=i.types,d=0,f=0;function p(k,E,M,R,D,F){let{id:I,start:Q,end:G,size:L}=l,q=f,N=d;if(L<0)if(l.next(),L==-1){let z=s[I];M.push(z),R.push(Q-k);return}else if(L==-3){d=I;return}else if(L==-4){f=I;return}else throw new RangeError(`Unrecognized record size: ${L}`);let P=u[I],Y,K,W=Q-k;if(G-Q<=r&&(K=A(l.pos-E,D))){let z=new Uint16Array(K.size-K.skip),U=l.pos-K.size,V=z.length;for(;l.pos>U;)V=w(K.start,z,V);Y=new nd(z,G-K.start,i),W=K.start-k}else{let z=l.pos-L;l.next();let U=[],V=[],J=I>=a?I:-1,ee=0,ce=G;for(;l.pos>z;)J>=0&&l.id==J&&l.size>=0?(l.end<=ce-r&&(y(U,V,Q,ee,l.end,ce,J,q,N),ee=U.length,ce=l.end),l.next()):F>2500?m(Q,z,U,V):p(Q,z,U,V,J,F+1);if(J>=0&&ee>0&&ee<U.length&&y(U,V,Q,ee,Q,ce,J,q,N),U.reverse(),V.reverse(),J>-1&&ee>0){let he=v(P,N);Y=HR(P,U,V,0,U.length,0,G-Q,he,he)}else Y=b(P,U,V,G-Q,q-G,N)}M.push(Y),R.push(W)}function m(k,E,M,R){let D=[],F=0,I=-1;for(;l.pos>E;){let{id:Q,start:G,end:L,size:q}=l;if(q>4)l.next();else{if(I>-1&&G<I)break;I<0&&(I=L-r),D.push(Q,G,L),F++,l.next()}}if(F){let Q=new Uint16Array(F*4),G=D[D.length-2];for(let L=D.length-3,q=0;L>=0;L-=3)Q[q++]=D[L],Q[q++]=D[L+1]-G,Q[q++]=D[L+2]-G,Q[q++]=q;M.push(new nd(Q,D[2]-G,i)),R.push(G-k)}}function v(k,E){return(M,R,D)=>{let F=0,I=M.length-1,Q,G;if(I>=0&&(Q=M[I])instanceof yr){if(!I&&Q.type==k&&Q.length==D)return Q;(G=Q.prop(xn.lookAhead))&&(F=R[I]+Q.length+G)}return b(k,M,R,D,F,E)}}function y(k,E,M,R,D,F,I,Q,G){let L=[],q=[];for(;k.length>R;)L.push(k.pop()),q.push(E.pop()+M-D);k.push(b(i.types[I],L,q,F-D,Q-F,G)),E.push(D-M)}function b(k,E,M,R,D,F,I){if(F){let Q=[xn.contextHash,F];I=I?[Q].concat(I):[Q]}if(D>25){let Q=[xn.lookAhead,D];I=I?[Q].concat(I):[Q]}return new yr(k,E,M,R,I)}function A(k,E){let M=l.fork(),R=0,D=0,F=0,I=M.end-r,Q={size:0,start:0,skip:0};e:for(let G=M.pos-k;M.pos>G;){let L=M.size;if(M.id==E&&L>=0){Q.size=R,Q.start=D,Q.skip=F,F+=4,R+=4,M.next();continue}let q=M.pos-L;if(L<0||q<G||M.start<I)break;let N=M.id>=a?4:0,P=M.start;for(M.next();M.pos>q;){if(M.size<0)if(M.size==-3||M.size==-4)N+=4;else break e;else M.id>=a&&(N+=4);M.next()}D=P,R+=L,F+=N}return(E<0||R==k)&&(Q.size=R,Q.start=D,Q.skip=F),Q.size>4?Q:void 0}function w(k,E,M){let{id:R,start:D,end:F,size:I}=l;if(l.next(),I>=0&&R<a){let Q=M;if(I>4){let G=l.pos-(I-4);for(;l.pos>G;)M=w(k,E,M)}E[--M]=Q,E[--M]=F-k,E[--M]=D-k,E[--M]=R}else I==-3?d=R:I==-4&&(f=R);return M}let S=[],j=[];for(;l.pos>0;)p(t.start||0,t.bufferStart||0,S,j,-1,0);let C=(e=t.length)!==null&&e!==void 0?e:S.length?j[0]+S[0].length:0;return new yr(u[t.topID],S.reverse(),j.reverse(),C)}const ML=new WeakMap;function UA(t,e){if(!t.isAnonymous||e instanceof nd||e.type!=t)return 1;let n=ML.get(e);if(n==null){n=1;for(let i of e.children){if(i.type!=t||!(i instanceof yr)){n=1;break}n+=UA(t,i)}ML.set(e,n)}return n}function HR(t,e,n,i,r,s,a,l,u){let d=0;for(let y=i;y<r;y++)d+=UA(t,e[y]);let f=Math.ceil(d*1.5/8),p=[],m=[];function v(y,b,A,w,S){for(let j=A;j<w;){let C=j,k=b[j],E=UA(t,y[j]);for(j++;j<w;j++){let M=UA(t,y[j]);if(E+M>=f)break;E+=M}if(j==C+1){if(E>f){let M=y[C];v(M.children,M.positions,0,M.children.length,b[C]+S);continue}p.push(y[C])}else{let M=b[j-1]+y[j-1].length-k;p.push(HR(t,y,b,C,j,k,M,null,u))}m.push(k+S-s)}}return v(e,n,i,r,0),(l||u)(p,m,a)}class Of{constructor(e,n,i,r,s=!1,a=!1){this.from=e,this.to=n,this.tree=i,this.offset=r,this.open=(s?1:0)|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],i=!1){let r=[new Of(0,e.length,e,0,!1,i)];for(let s of n)s.to>e.length&&r.push(s);return r}static applyChanges(e,n,i=128){if(!n.length)return e;let r=[],s=1,a=e.length?e[0]:null;for(let l=0,u=0,d=0;;l++){let f=l<n.length?n[l]:null,p=f?f.fromA:1e9;if(p-u>=i)for(;a&&a.from<p;){let m=a;if(u>=m.from||p<=m.to||d){let v=Math.max(m.from,u)-d,y=Math.min(m.to,p)-d;m=v>=y?null:new Of(v,y,m.tree,m.offset+d,l>0,!!f)}if(m&&r.push(m),a.to>p)break;a=s<e.length?e[s++]:null}if(!f)break;u=f.toA,d=f.toA-f.toB}return r}}let I7=class{startParse(e,n,i){return typeof e=="string"&&(e=new vde(e)),i=i?i.length?i.map(r=>new Dk(r.from,r.to)):[new Dk(0,0)]:[new Dk(0,e.length)],this.createParse(e,n||[],i)}parse(e,n,i){let r=this.startParse(e,n,i);for(;;){let s=r.advance();if(s)return s}}};class vde{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 xn({perNode:!0});var RL={};class z1{constructor(e,n,i,r,s,a,l,u,d,f=0,p){this.p=e,this.stack=n,this.state=i,this.reducePos=r,this.pos=s,this.score=a,this.buffer=l,this.bufferBase=u,this.curContext=d,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,i=0){let r=e.parser.context;return new z1(e,[],n,i,i,0,[],0,r?new DL(r,r.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 i=e>>19,r=e&65535,{parser:s}=this.p,a=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),l=s.dynamicPrecedence(r);if(l&&(this.score+=l),i==0){r<s.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(s.getGoto(this.state,r,!0),this.reducePos),r<s.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,a?8:4,!0),this.reduceContext(r,this.reducePos);return}let u=this.stack.length-(i-1)*3-(e&262144?6:0),d=u?this.stack[u-2]:this.p.ranges[0].from;r<s.minRepeatTerm&&d==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let f=this.reducePos-d;f>=2e3&&!(!((n=this.p.parser.nodeSet.types[r])===null||n===void 0)&&n.isAnonymous)&&(d==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=f):this.p.lastBigReductionSize<f&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=d,this.p.lastBigReductionSize=f));let p=u?this.stack[u-1]:0,m=this.bufferBase+this.buffer.length-p;if(r<s.minRepeatTerm||e&131072){let v=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,d,v,m+4,!0)}if(e&262144)this.state=this.stack[u];else{let v=this.stack[u-3];this.state=s.getGoto(v,r,!0)}for(;this.stack.length>u;)this.stack.pop();this.reduceContext(r,d)}storeNode(e,n,i,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let a=this.buffer.length;if(a>0&&this.buffer[a-4]==0&&this.buffer[a-1]>-1){if(n==i)return;if(this.buffer[a-2]>=n){this.buffer[a-2]=i;return}}}if(!s||this.pos==i)this.buffer.push(e,n,i,r);else{let a=this.buffer.length;if(a>0&&(this.buffer[a-4]!=0||this.buffer[a-1]<0)){let l=!1;for(let u=a;u>0&&this.buffer[u-2]>i;u-=4)if(this.buffer[u-1]>=0){l=!0;break}if(l)for(;a>0&&this.buffer[a-2]>i;)this.buffer[a]=this.buffer[a-4],this.buffer[a+1]=this.buffer[a-3],this.buffer[a+2]=this.buffer[a-2],this.buffer[a+3]=this.buffer[a-1],a-=4,r>4&&(r-=4)}this.buffer[a]=e,this.buffer[a+1]=n,this.buffer[a+2]=i,this.buffer[a+3]=r}}shift(e,n,i,r){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let s=e,{parser:a}=this.p;this.pos=r;let l=a.stateFlag(s,1);!l&&(r>i||n<=a.maxNode)&&(this.reducePos=r),this.pushState(s,l?i:Math.min(i,this.reducePos)),this.shiftContext(n,i),n<=a.maxNode&&this.buffer.push(n,i,r,4)}else this.pos=r,this.shiftContext(n,i),n<=this.p.parser.maxNode&&this.buffer.push(n,i,r,4)}apply(e,n,i,r){e&65536?this.reduce(e):this.shift(e,n,i,r)}useNode(e,n){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(n,r),this.buffer.push(i,r,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 i=e.buffer.slice(n),r=e.bufferBase+n;for(;e&&r==e.bufferBase;)e=e.parent;return new z1(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,i?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new yde(this);;){let i=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(i==0)return!1;if((i&65536)==0)return!0;n.reduce(i)}}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 r=[];for(let s=0,a;s<n.length;s+=2)(a=n[s+1])!=this.state&&this.p.parser.hasAction(a,e)&&r.push(n[s],a);if(this.stack.length<120)for(let s=0;r.length<8&&s<n.length;s+=2){let a=n[s+1];r.some((l,u)=>u&1&&l==a)||r.push(n[s],a)}n=r}let i=[];for(let r=0;r<n.length&&i.length<4;r+=2){let s=n[r+1];if(s==this.state)continue;let a=this.split();a.pushState(s,this.pos),a.storeNode(0,a.pos,a.pos,4,!0),a.shiftContext(n[r],this.pos),a.reducePos=this.pos,a.score-=200,i.push(a)}return i}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 i=n>>19,r=n&65535,s=this.stack.length-i*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let a=this.findForcedReduction();if(a==null)return!1;n=a}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=[],i=(r,s)=>{if(!n.includes(r))return n.push(r),e.allActions(r,a=>{if(!(a&393216))if(a&65536){let l=(a>>19)-s;if(l>1){let u=a&65535,d=this.stack.length-l*3;if(d>=0&&e.getGoto(this.stack[d],u,!1)>=0)return l<<19|65536|u}}else{let l=i(a,s+1);if(l!=null)return l}})};return i(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 DL(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 DL{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class yde{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,i=e>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=r}}class H1{constructor(e,n,i){this.stack=e,this.pos=n,this.index=i,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new H1(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 H1(this.stack,this.pos,this.index)}}function Yb(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let i=0,r=0;i<t.length;){let s=0;for(;;){let a=t.charCodeAt(i++),l=!1;if(a==126){s=65535;break}a>=92&&a--,a>=34&&a--;let u=a-32;if(u>=46&&(u-=46,l=!0),s+=u,l)break;s*=46}n?n[r++]=s:n=new e(s)}return n}class VA{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const NL=new VA;class xde{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=NL,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 i=this.range,r=this.rangeIndex,s=this.pos+e;for(;s<i.from;){if(!r)return null;let a=this.ranges[--r];s-=i.from-a.to,i=a}for(;n<0?s>i.to:s>=i.to;){if(r==this.ranges.length-1)return null;let a=this.ranges[++r];s+=a.from-i.to,i=a}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,i,r;if(n>=0&&n<this.chunk.length)i=this.pos+e,r=this.chunk.charCodeAt(n);else{let s=this.resolveOffset(e,1);if(s==null)return-1;if(i=s,i>=this.chunk2Pos&&i<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(i-this.chunk2Pos);else{let a=this.rangeIndex,l=this.range;for(;l.to<=i;)l=this.ranges[++a];this.chunk2=this.input.chunk(this.chunk2Pos=i),i+this.chunk2.length>l.to&&(this.chunk2=this.chunk2.slice(0,l.to-i)),r=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),r}acceptToken(e,n=0){let i=n?this.resolveOffset(n,-1):this.pos;if(i==null||i<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=i}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=NL,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 i="";for(let r of this.ranges){if(r.from>=n)break;r.to>e&&(i+=this.input.read(Math.max(r.from,e),Math.min(r.to,n)))}return i}}class om{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:i}=n.p;bde(this.data,e,n,this.id,i.data,i.tokenPrecTable)}}om.prototype.contextual=om.prototype.fallback=om.prototype.extend=!1;om.prototype.fallback=om.prototype.extend=!1;function bde(t,e,n,i,r,s){let a=0,l=1<<i,{dialect:u}=n.p.parser;e:for(;(l&t[a])!=0;){let d=t[a+1];for(let v=a+3;v<d;v+=2)if((t[v+1]&l)>0){let y=t[v];if(u.allows(y)&&(e.token.value==-1||e.token.value==y||Ade(y,e.token.value,r,s))){e.acceptToken(y);break}}let f=e.next,p=0,m=t[a+2];if(e.next<0&&m>p&&t[d+m*3-3]==65535){a=t[d+m*3-1];continue e}for(;p<m;){let v=p+m>>1,y=d+v+(v<<1),b=t[y],A=t[y+1]||65536;if(f<b)m=v;else if(f>=A)p=v+1;else{a=t[y+2],e.advance();continue e}}break}}function IL(t,e,n){for(let i=e,r;(r=t[i])!=65535;i++)if(r==n)return i-e;return-1}function Ade(t,e,n,i){let r=IL(n,i,e);return r<0||IL(n,i,t)<r}const Po=typeof process<"u"&&RL&&/\bparse\b/.test(RL.LOG);let Nk=null;function BL(t,e,n){let i=t.cursor(lr.IncludeAnonymous);for(i.moveTo(e);;)if(!(n<0?i.childBefore(e):i.childAfter(e)))for(;;){if((n<0?i.to<e:i.from>e)&&!i.type.isError)return n<0?Math.max(0,Math.min(i.to-1,e-25)):Math.min(t.length,Math.max(i.from+1,e+25));if(n<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return n<0?0:t.length}}class wde{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?BL(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?BL(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 i=this.trees[n],r=this.index[n];if(r==i.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=i.children[r],a=this.start[n]+i.positions[r];if(a>e)return this.nextStart=a,null;if(s instanceof yr){if(a==e){if(a<this.safeFrom)return null;let l=a+s.length;if(l<=this.safeTo){let u=s.prop(xn.lookAhead);if(!u||l+u<this.fragment.to)return s}}this.index[n]++,a+s.length>=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(a),this.index.push(0))}else this.index[n]++,this.nextStart=a+s.length}}}class Sde{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(i=>new VA)}getActions(e){let n=0,i=null,{parser:r}=e.p,{tokenizers:s}=r,a=r.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,u=0;for(let d=0;d<s.length;d++){if((1<<d&a)==0)continue;let f=s[d],p=this.tokens[d];if(!(i&&!f.fallback)&&((f.contextual||p.start!=e.pos||p.mask!=a||p.context!=l)&&(this.updateCachedToken(p,f,e),p.mask=a,p.context=l),p.lookAhead>p.end+25&&(u=Math.max(p.lookAhead,u)),p.value!=0)){let m=n;if(p.extended>-1&&(n=this.addActions(e,p.extended,p.end,n)),n=this.addActions(e,p.value,p.end,n),!f.extend&&(i=p,n>m))break}}for(;this.actions.length>n;)this.actions.pop();return u&&e.setLookAhead(u),!i&&e.pos==this.stream.end&&(i=new VA,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,n=this.addActions(e,i.value,i.end,n)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new VA,{pos:i,p:r}=e;return n.start=i,n.end=Math.min(i+1,r.stream.end),n.value=i==r.stream.end?r.parser.eofTerm:0,n}updateCachedToken(e,n,i){let r=this.stream.clipPos(i.pos);if(n.token(this.stream.reset(r,e),i),e.value>-1){let{parser:s}=i.p;for(let a=0;a<s.specialized.length;a++)if(s.specialized[a]==e.value){let l=s.specializers[a](this.stream.read(e.start,e.end),i);if(l>=0&&i.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(r+1)}putAction(e,n,i,r){for(let s=0;s<r;s+=3)if(this.actions[s]==e)return r;return this.actions[r++]=e,this.actions[r++]=n,this.actions[r++]=i,r}addActions(e,n,i,r){let{state:s}=e,{parser:a}=e.p,{data:l}=a;for(let u=0;u<2;u++)for(let d=a.stateSlot(s,u?2:1);;d+=3){if(l[d]==65535)if(l[d+1]==1)d=tu(l,d+2);else{r==0&&l[d+1]==2&&(r=this.putAction(tu(l,d+2),n,i,r));break}l[d]==n&&(r=this.putAction(tu(l,d+1),n,i,r))}return r}}class jde{constructor(e,n,i,r){this.parser=e,this.input=n,this.ranges=r,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 xde(n,r),this.tokens=new Sde(e,this.stream),this.topTerm=e.top[1];let{from:s}=r[0];this.stacks=[z1.start(this,e.top[0],s)],this.fragments=i.length&&this.stream.end-s>e.bufferLength*4?new wde(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,i=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[a]=e;for(;a.forceReduce()&&a.stack.length&&a.stack[a.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let l=e[a];for(;;){if(this.tokens.mainToken=null,l.pos>n)i.push(l);else{if(this.advanceStack(l,i,e))continue;{r||(r=[],s=[]),r.push(l);let u=this.tokens.getMainToken(l);s.push(u.value,u.end)}}break}}if(!i.length){let a=r&&_de(r);if(a)return Po&&console.log("Finish with "+this.stackID(a)),this.stackToTree(a);if(this.parser.strict)throw Po&&r&&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&&r){let a=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,i);if(a)return Po&&console.log("Force-finish "+this.stackID(a)),this.stackToTree(a.forceAll())}if(this.recovering){let a=this.recovering==1?1:this.recovering*3;if(i.length>a)for(i.sort((l,u)=>u.score-l.score);i.length>a;)i.pop();i.some(l=>l.reducePos>n)&&this.recovering--}else if(i.length>1){e:for(let a=0;a<i.length-1;a++){let l=i[a];for(let u=a+1;u<i.length;u++){let d=i[u];if(l.sameState(d)||l.buffer.length>500&&d.buffer.length>500)if((l.score-d.score||l.buffer.length-d.buffer.length)>0)i.splice(u--,1);else{i.splice(a--,1);continue e}}}i.length>12&&(i.sort((a,l)=>l.score-a.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let a=1;a<i.length;a++)i[a].pos<this.minStackPos&&(this.minStackPos=i[a].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,i){let r=e.pos,{parser:s}=this,a=Po?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let d=e.curContext&&e.curContext.tracker.strict,f=d?e.curContext.hash:0;for(let p=this.fragments.nodeAt(r);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&&(!d||(p.prop(xn.contextHash)||0)==f))return e.useNode(p,m),Po&&console.log(a+this.stackID(e)+` (via reuse of ${s.getName(p.type.id)})`),!0;if(!(p instanceof yr)||p.children.length==0||p.positions[0]>0)break;let v=p.children[0];if(v instanceof yr&&p.positions[0]==0)p=v;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),Po&&console.log(a+this.stackID(e)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let u=this.tokens.getActions(e);for(let d=0;d<u.length;){let f=u[d++],p=u[d++],m=u[d++],v=d==u.length||!i,y=v?e:e.split(),b=this.tokens.mainToken;if(y.apply(f,p,b?b.start:y.pos,m),Po&&console.log(a+this.stackID(y)+` (via ${(f&65536)==0?"shift":`reduce of ${s.getName(f&65535)}`} for ${s.getName(p)} @ ${r}${y==e?"":", split"})`),v)return!0;y.pos>r?n.push(y):i.push(y)}return!1}advanceFully(e,n){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return LL(e,n),!0}}runRecovery(e,n,i){let r=null,s=!1;for(let a=0;a<e.length;a++){let l=e[a],u=n[a<<1],d=n[(a<<1)+1],f=Po?this.stackID(l)+" -> ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),Po&&console.log(f+this.stackID(l)+" (restarted)"),this.advanceFully(l,i))))continue;let p=l.split(),m=f;for(let v=0;v<10&&p.forceReduce()&&(Po&&console.log(m+this.stackID(p)+" (via force-reduce)"),!this.advanceFully(p,i));v++)Po&&(m=this.stackID(p)+" -> ");for(let v of l.recoverByInsert(u))Po&&console.log(f+this.stackID(v)+" (via recover-insert)"),this.advanceFully(v,i);this.stream.end>l.pos?(d==l.pos&&(d++,u=0),l.recoverByDelete(u,d),Po&&console.log(f+this.stackID(l)+` (via recover-delete ${this.parser.getName(u)})`),LL(l,i)):(!r||r.score<p.score)&&(r=p)}return r}stackToTree(e){return e.close(),yr.build({buffer:H1.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=(Nk||(Nk=new WeakMap)).get(e);return n||Nk.set(e,n=String.fromCodePoint(this.nextStackID++)),n+e}}function LL(t,e){for(let n=0;n<e.length;n++){let i=e[n];if(i.pos==t.pos&&i.sameState(t)){e[n].score<t.score&&(e[n]=t);return}}e.push(t)}class Cde{constructor(e,n,i){this.source=e,this.flags=n,this.disabled=i}allows(e){return!this.disabled||this.disabled[e]==0}}class q1 extends I7{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 i=Object.keys(e.topRules).map(l=>e.topRules[l][1]),r=[];for(let l=0;l<n.length;l++)r.push([]);function s(l,u,d){r[l].push([u,u.deserialize(String(d))])}if(e.nodeProps)for(let l of e.nodeProps){let u=l[0];typeof u=="string"&&(u=xn[u]);for(let d=1;d<l.length;){let f=l[d++];if(f>=0)s(f,u,l[d++]);else{let p=l[d+-f];for(let m=-f;m>0;m--)s(l[d++],u,p);d++}}}this.nodeSet=new FR(n.map((l,u)=>_o.define({name:u>=this.minRepeatTerm?void 0:l,id:u,props:r[u],top:i.indexOf(u)>-1,error:u==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(u)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=M7;let a=Yb(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(PL),this.states=Yb(e.states,Uint32Array),this.data=Yb(e.stateData),this.goto=Yb(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(l=>typeof l=="number"?new om(a,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,i){let r=new jde(this,e,n,i);for(let s of this.wrappers)r=s(r,e,n,i);return r}getGoto(e,n,i=!1){let r=this.goto;if(n>=r[0])return-1;for(let s=r[n+1];;){let a=r[s++],l=a&1,u=r[s++];if(l&&i)return u;for(let d=s+(a>>1);s<d;s++)if(r[s]==e)return u;if(l)return-1}}hasAction(e,n){let i=this.data;for(let r=0;r<2;r++)for(let s=this.stateSlot(e,r?2:1),a;;s+=3){if((a=i[s])==65535)if(i[s+1]==1)a=i[s=tu(i,s+2)];else{if(i[s+1]==2)return tu(i,s+2);break}if(a==n||a==0)return tu(i,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,i=>i==n?!0:null)}allActions(e,n){let i=this.stateSlot(e,4),r=i?n(i):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=tu(this.data,s+2);else break;r=n(tu(this.data,s+1))}return r}nextStates(e){let n=[];for(let i=this.stateSlot(e,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=tu(this.data,i+2);else break;if((this.data[i+2]&1)==0){let r=this.data[i+1];n.some((s,a)=>a&1&&s==r)||n.push(this.data[i],r)}}return n}configure(e){let n=Object.assign(Object.create(q1.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let i=this.topRules[e.top];if(!i)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=i}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(i=>{let r=e.tokenizers.find(s=>s.from==i);return r?r.to:i})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((i,r)=>{let s=e.specializers.find(l=>l.from==i.external);if(!s)return i;let a=Object.assign(Object.assign({},i),{external:s.to});return n.specializers[r]=PL(a),a})),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),i=n.map(()=>!1);if(e)for(let s of e.split(" ")){let a=n.indexOf(s);a>=0&&(i[a]=!0)}let r=null;for(let s=0;s<n.length;s++)if(!i[s])for(let a=this.dialects[n[s]],l;(l=this.data[a++])!=65535;)(r||(r=new Uint8Array(this.maxTerm+1)))[l]=1;return new Cde(e,i,r)}static deserialize(e){return new q1(e)}}function tu(t,e){return t[e]|t[e+1]<<16}function _de(t){let e=null;for(let n of t){let i=n.p.stoppedAt;(n.pos==n.p.stream.end||i!=null&&n.pos>i)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.score<n.score)&&(e=n)}return e}function PL(t){if(t.external){let e=t.extend?1:0;return(n,i)=>t.external(n,i)<<1|e}return t.get}let kde=0,nu=class s2{constructor(e,n,i,r){this.name=e,this.set=n,this.base=i,this.modified=r,this.id=kde++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let i=typeof e=="string"?e:"?";if(e instanceof s2&&(n=e),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let r=new s2(i,[],null,[]);if(r.set.push(r),n)for(let s of n.set)r.set.push(s);return r}static defineModifier(e){let n=new Q1(e);return i=>i.modified.indexOf(n)>-1?i:Q1.get(i.base||i,i.modified.concat(n).sort((r,s)=>r.id-s.id))}},Tde=0;class Q1{constructor(e){this.name=e,this.instances=[],this.id=Tde++}static get(e,n){if(!n.length)return e;let i=n[0].instances.find(l=>l.base==e&&Ode(n,l.modified));if(i)return i;let r=[],s=new nu(e.name,r,e,n);for(let l of n)l.instances.push(s);let a=Ede(n);for(let l of e.set)if(!l.modified.length)for(let u of a)r.push(Q1.get(l,u));return s}}function Ode(t,e){return t.length==e.length&&t.every((n,i)=>n==e[i])}function Ede(t){let e=[[]];for(let n=0;n<t.length;n++)for(let i=0,r=e.length;i<r;i++)e.push(e[i].concat(t[n]));return e.sort((n,i)=>i.length-n.length)}function B7(t){let e=Object.create(null);for(let n in t){let i=t[n];Array.isArray(i)||(i=[i]);for(let r of n.split(" "))if(r){let s=[],a=2,l=r;for(let p=0;;){if(l=="..."&&p>0&&p+3==r.length){a=1;break}let m=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!m)throw new RangeError("Invalid path: "+r);if(s.push(m[0]=="*"?"":m[0][0]=='"'?JSON.parse(m[0]):m[0]),p+=m[0].length,p==r.length)break;let v=r[p++];if(p==r.length&&v=="!"){a=0;break}if(v!="/")throw new RangeError("Invalid path: "+r);l=r.slice(p)}let u=s.length-1,d=s[u];if(!d)throw new RangeError("Invalid path: "+r);let f=new zv(i,a,u>0?s.slice(0,u):null);e[d]=f.sort(e[d])}}return L7.add(e)}const L7=new xn({combine(t,e){let n,i,r;for(;t||e;){if(!t||e&&t.depth>=e.depth?(r=e,e=e.next):(r=t,t=t.next),n&&n.mode==r.mode&&!r.context&&!n.context)continue;let s=new zv(r.tags,r.mode,r.context);n?n.next=s:i=s,n=s}return i}});class zv{constructor(e,n,i,r){this.tags=e,this.mode=n,this.context=i,this.next=r}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}}zv.empty=new zv([],2,null);function P7(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 a of s.tag)n[a.id]=s.class;let{scope:i,all:r=null}=e||{};return{style:s=>{let a=r;for(let l of s)for(let u of l.set){let d=n[u.id];if(d){a=a?a+" "+d:d;break}}return a},scope:i}}function Mde(t,e){let n=null;for(let i of t){let r=i.style(e);r&&(n=n?n+" "+r:r)}return n}function Rde(t,e,n,i=0,r=t.length){let s=new Dde(i,Array.isArray(e)?e:[e],n);s.highlightRange(t.cursor(),i,r,"",s.highlighters),s.flush(r)}class Dde{constructor(e,n,i){this.at=e,this.highlighters=n,this.span=i,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,i,r,s){let{type:a,from:l,to:u}=e;if(l>=i||u<=n)return;a.isTop&&(s=this.highlighters.filter(v=>!v.scope||v.scope(a)));let d=r,f=Nde(e)||zv.empty,p=Mde(s,f.tags);if(p&&(d&&(d+=" "),d+=p,f.mode==1&&(r+=(r?" ":"")+p)),this.startSpan(Math.max(n,l),d),f.opaque)return;let m=e.tree&&e.tree.prop(xn.mounted);if(m&&m.overlay){let v=e.node.enter(m.overlay[0].from+l,1),y=this.highlighters.filter(A=>!A.scope||A.scope(m.tree.type)),b=e.firstChild();for(let A=0,w=l;;A++){let S=A<m.overlay.length?m.overlay[A]:null,j=S?S.from+l:u,C=Math.max(n,w),k=Math.min(i,j);if(C<k&&b)for(;e.from<k&&(this.highlightRange(e,C,k,r,s),this.startSpan(Math.min(k,e.to),d),!(e.to>=j||!e.nextSibling())););if(!S||j>i)break;w=S.to+l,w>n&&(this.highlightRange(v.cursor(),Math.max(n,S.from+l),Math.min(i,w),"",y),this.startSpan(Math.min(i,w),d))}b&&e.parent()}else if(e.firstChild()){m&&(r="");do if(!(e.to<=n)){if(e.from>=i)break;this.highlightRange(e,n,i,r,s),this.startSpan(Math.min(i,e.to),d)}while(e.nextSibling());e.parent()}}}function Nde(t){let e=t.type.prop(L7);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const mt=nu.define,Wb=mt(),wh=mt(),FL=mt(wh),$L=mt(wh),Sh=mt(),Ub=mt(Sh),Ik=mt(Sh),Hl=mt(),Wd=mt(Hl),Pl=mt(),Fl=mt(),o2=mt(),R0=mt(o2),Vb=mt(),ye={comment:Wb,lineComment:mt(Wb),blockComment:mt(Wb),docComment:mt(Wb),name:wh,variableName:mt(wh),typeName:FL,tagName:mt(FL),propertyName:$L,attributeName:mt($L),className:mt(wh),labelName:mt(wh),namespace:mt(wh),macroName:mt(wh),literal:Sh,string:Ub,docString:mt(Ub),character:mt(Ub),attributeValue:mt(Ub),number:Ik,integer:mt(Ik),float:mt(Ik),bool:mt(Sh),regexp:mt(Sh),escape:mt(Sh),color:mt(Sh),url:mt(Sh),keyword:Pl,self:mt(Pl),null:mt(Pl),atom:mt(Pl),unit:mt(Pl),modifier:mt(Pl),operatorKeyword:mt(Pl),controlKeyword:mt(Pl),definitionKeyword:mt(Pl),moduleKeyword:mt(Pl),operator:Fl,derefOperator:mt(Fl),arithmeticOperator:mt(Fl),logicOperator:mt(Fl),bitwiseOperator:mt(Fl),compareOperator:mt(Fl),updateOperator:mt(Fl),definitionOperator:mt(Fl),typeOperator:mt(Fl),controlOperator:mt(Fl),punctuation:o2,separator:mt(o2),bracket:R0,angleBracket:mt(R0),squareBracket:mt(R0),paren:mt(R0),brace:mt(R0),content:Hl,heading:Wd,heading1:mt(Wd),heading2:mt(Wd),heading3:mt(Wd),heading4:mt(Wd),heading5:mt(Wd),heading6:mt(Wd),contentSeparator:mt(Hl),list:mt(Hl),quote:mt(Hl),emphasis:mt(Hl),strong:mt(Hl),link:mt(Hl),monospace:mt(Hl),strikethrough:mt(Hl),inserted:mt(),deleted:mt(),changed:mt(),invalid:mt(),meta:Vb,documentMeta:mt(Vb),annotation:mt(Vb),processingInstruction:mt(Vb),definition:nu.defineModifier("definition"),constant:nu.defineModifier("constant"),function:nu.defineModifier("function"),standard:nu.defineModifier("standard"),local:nu.defineModifier("local"),special:nu.defineModifier("special")};for(let t in ye){let e=ye[t];e instanceof nu&&(e.name=t)}P7([{tag:ye.link,class:"tok-link"},{tag:ye.heading,class:"tok-heading"},{tag:ye.emphasis,class:"tok-emphasis"},{tag:ye.strong,class:"tok-strong"},{tag:ye.keyword,class:"tok-keyword"},{tag:ye.atom,class:"tok-atom"},{tag:ye.bool,class:"tok-bool"},{tag:ye.url,class:"tok-url"},{tag:ye.labelName,class:"tok-labelName"},{tag:ye.inserted,class:"tok-inserted"},{tag:ye.deleted,class:"tok-deleted"},{tag:ye.literal,class:"tok-literal"},{tag:ye.string,class:"tok-string"},{tag:ye.number,class:"tok-number"},{tag:[ye.regexp,ye.escape,ye.special(ye.string)],class:"tok-string2"},{tag:ye.variableName,class:"tok-variableName"},{tag:ye.local(ye.variableName),class:"tok-variableName tok-local"},{tag:ye.definition(ye.variableName),class:"tok-variableName tok-definition"},{tag:ye.special(ye.variableName),class:"tok-variableName2"},{tag:ye.definition(ye.propertyName),class:"tok-propertyName tok-definition"},{tag:ye.typeName,class:"tok-typeName"},{tag:ye.namespace,class:"tok-namespace"},{tag:ye.className,class:"tok-className"},{tag:ye.macroName,class:"tok-macroName"},{tag:ye.propertyName,class:"tok-propertyName"},{tag:ye.operator,class:"tok-operator"},{tag:ye.comment,class:"tok-comment"},{tag:ye.meta,class:"tok-meta"},{tag:ye.invalid,class:"tok-invalid"},{tag:ye.punctuation,class:"tok-punctuation"}]);const Ide=188,Bde=189,Lde=1,Pde=2,Fde=3,$de=4,zde=5,Hde=6,qde=7,Qde=8,Yde=9,Wde=10,Ude=11,Vde=12,Gde=13,Xde=14,Kde=15,Zde=16,Jde=17,efe=18,tfe=19,nfe=20,ife=21,rfe=22,sfe=23,ofe=24,afe=25,lfe=26,zL=27,HL=28,qL=29,QL=30,cfe=31,ufe=32,hfe=33,dfe=34,ffe=35,pfe={inf:Ide,nan:Bde,bool:Lde,ignoring:Pde,on:Fde,group_left:$de,group_right:zde,offset:Hde},YL=(t,e)=>pfe[t.toLowerCase()]||-1,mfe={avg:Qde,atan2:qde,bottomk:Yde,count:Wde,count_values:Ude,group:Vde,max:Gde,min:Xde,quantile:Kde,limitk:Zde,limit_ratio:Jde,stddev:efe,stdvar:tfe,sum:nfe,topk:ife,by:rfe,without:sfe,and:ofe,or:afe,unless:lfe,smoothed:cfe,anchored:ufe,fill:hfe,fill_left:dfe,fill_right:ffe},WL=(t,e)=>{if(t==="start"&&e.canShift(zL))return zL;if(t==="end"&&e.canShift(HL))return HL;if(t.toLowerCase()==="start"&&e.canShift(qL))return qL;if(t.toLowerCase()==="end"&&e.canShift(QL))return QL;const n=mfe[t.toLowerCase()];return n!==void 0&&e.canShift(n)?n:-1},gfe=B7({LineComment:ye.comment,LabelName:ye.labelName,StringLiteral:ye.string,NumberDurationLiteral:ye.number,NumberDurationLiteralInDurationContext:ye.number,Identifier:ye.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":ye.function(ye.variableName),"Avg Bottomk Count Count_values Group LimitK LimitRatio Max Min Quantile Stddev Stdvar Sum Topk":ye.operatorKeyword,"AtModifierPreprocessors By Without Bool On Ignoring GroupLeft GroupRight Offset Smoothed Anchored":ye.modifier,"DurationExpr/DurationStep DurationExpr/DurationRange DurationExpr/DurationMinOf DurationExpr/DurationMaxOf OffsetDurationExpr/DurationStep OffsetDurationExpr/DurationRange OffsetDurationExpr/DurationMinOf OffsetDurationExpr/DurationMaxOf":ye.function(ye.variableName),"And Unless Or":ye.logicOperator,"Sub Add Mul Mod Div Atan2 Eql Neq Lte Lss Gte Gtr EqlRegex EqlSingle NeqRegex Pow At":ye.operator,UnaryOp:ye.arithmeticOperator,"( )":ye.paren,"[ ]":ye.squareBracket,"{ }":ye.brace,"⚠":ye.invalid}),vfe={__proto__:null,absent_over_time:401,absent:403,abs:405,acos:407,acosh:409,asin:411,asinh:413,atan:415,atanh:417,avg_over_time:419,ceil:421,changes:423,clamp:425,clamp_max:427,clamp_min:429,cos:431,cosh:433,count_over_time:435,days_in_month:437,day_of_month:439,day_of_week:441,day_of_year:443,deg:445,delta:447,deriv:449,exp:451,first_over_time:453,floor:455,histogram_count:457,histogram_fraction:459,histogram_quantile:461,histogram_quantiles:463,histogram_stddev:465,histogram_stdvar:467,histogram_sum:469,histogram_avg:471,double_exponential_smoothing:473,hour:475,idelta:477,increase:479,info:481,irate:483,label_replace:485,label_join:487,last_over_time:489,ln:491,log10:493,log2:495,mad_over_time:497,max_over_time:499,min_over_time:501,ts_of_first_over_time:503,ts_of_max_over_time:505,ts_of_min_over_time:507,ts_of_last_over_time:509,minute:511,month:513,pi:515,predict_linear:517,present_over_time:519,quantile_over_time:521,rad:523,rate:525,resets:527,round:529,scalar:531,sgn:533,sin:535,sinh:537,sort:539,sort_desc:541,sort_by_label:543,sort_by_label_desc:545,start_timestamp:547,range:549,step:551,sqrt:553,stddev_over_time:555,stdvar_over_time:557,sum_over_time:559,tan:561,tanh:563,timestamp:565,time:567,vector:569,year:571,min_of:575,max_of:577},yfe=q1.deserialize({version:14,states:"BnOYQPOOO(gQPOOOOQO'#DT'#DTO(lQPO'#DSOOQO'#Db'#DbO(wQPO'#FqQ0_QQOOOOQO'#Ds'#DsO(rQPO'#DrOYQPO'#F{OYQPO'#F}O1xQSO'#GPO2TQQO'#GOOOQO'#GO'#GOOOQO'#Gd'#GdOOQO'#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'#FmOOQO'#Fn'#FnQOQPOOO3zQPO'#DUO4PQPO'#DZO(rQPO,59nO4WQQO,59nOOQO,59|,59|O6QQPO,59vO6QQPO,59vO6QQPO,59vO6QQPO,59vO6QQPO,59vO=qQPO,5<ZO>cQPO,5<cOOQO,5<e,5<eOOQO,5<f,5<fO?fQPO,5<rOOQO,5:^,5:^O?pQQO,5<gO?wQQO,5<iOOQO'#DX'#DXOAkQPO'#GQOAyQPO,5<kOOQO,5<k,5<kOBVQPO,5<kOOQO,5<j,5<jOB_QSO'#DVOOQO,59p,59pOOQO,59u,59uOBjQQO,59uOOQO1G/Y1G/YOOQO'#D^'#D^O3zQPO'#D_OBtQPO'#DaOByQPO'#DcOCOQPO'#DdOOQO'#D`'#D`OJbQPO'#D`OJiQPO'#D`OOQO'#Gh'#GhOJpQPO'#GhO!$WQPO'#GhOYQPO1G/bOYQPO1G/bOYQPO1G/bOYQPO1G/bOYQPO1G/bOOQO'#Fq'#FqOOQO'#Fv'#FvO!$bQSO1G1uO=qQPO'#FpOOQO'#Fr'#FrOOQO'#Fs'#FsOOQO'#Ft'#FtOOQO'#Fu'#FuO!$|QPO'#FpO!%RQPO'#FpO=qQPO'#FpOOQO'#Fp'#FpO>cQPO'#FxOOQO1G1}1G1}O!%WQPO'#FxO!%]QPO'#FxO=qQPO'#FxOOQO'#Fx'#FxO!%bQPO'#DbOOQO'#GY'#GYOOQO1G2^1G2^O!%mQPO1G2^OOQO1G2R1G2ROOQO'#GR'#GRO!%rQPO,5<lO!%wQPO,5<qO!%|QSO1G2VO!&XQPO1G2VOOQO1G2V1G2VOOQO,59q,59qO!&aQPO,59qOYQPO'#G]O!&iQPO1G/aOOQO1G/a1G/aO!&qQPO,59yO?TQPO,59{O?TQPO,59}O?TQPO,5:OOOQO,59z,59zOOQO,5=S,5=SO!._QPO,5=SO!7]QQO7+$|O!7mQQO7+$|O!9XQQO7+$|O!9uQQO7+$|O!;jQQO7+$|O=qQPO,5<[O=qQPO,5<[OOQO7+'a7+'aO!<ZQPO7+'nO!<vQSO,5<[O!=QQPO,5<[O=qQPO,5<[O!=kQQO,5<[OOQO,5<d,5<dO!=rQPO,5<dO=qQPO,5<dO!=wQQO,5<dO!>OQPO7+'xOOQO1G2W1G2WOOQO1G2]1G2]O!>TQPO,5<xOOQO,5<x,5<xOOQO7+'q7+'qO!>iQSO7+'qOOQO-E:[-E:[O!>tQSO1G/]O!?PQPO1G/]OOQO1G/]1G/]O!?XQQO,5<wOOQO-E:Z-E:ZOOQO7+${7+${O!?cQPO1G/eO!FyQPO1G/gO!GOQPO1G/iO!GTQPO1G/jOOQO1G2n1G2nO!GnQSO1G1vO!GxQSO1G1vO!HdQQO<<KYOOQO<<KY<<KYOOQO1G1v1G1vO!HkQQO1G1vO!HrQQO,5<[OOQO1G2O1G2OO!IPQQO1G2OOOQO<<Kd<<KdOOQO<<K]<<K]P!IWQSO'#G^OOQO,5<v,5<vOOQO7+$w7+$wO!I`QSO7+$wOOQO-E:Y-E:YOOQO7+%P7+%POOQO7+%R7+%ROOQO7+%T7+%TOOQO7+%U7+%UOOQOAN@tAN@tO=qQPO7+'bO!IkQQO1G1vO!IxQQO1G1vO=qQPO7+'jOOQO<<Hc<<HcP!JgQSO'#G[O!JoQQO<<J|O!JvQQO<<KUOOQOAN@hAN@hOOQOAN@pAN@pO=qQPO'#FpO=qQPO,5<[O=qQPO,5<[",stateData:"!J}~O%VOStOS~OWQOXQOYQOZQO[QO]QO^QO_QO`QOaQObQOcQOdQOeQOkVOlVO|^O!i[O%SSO%TSO%XXO%]TO%^TO%_SO%`_O%a`O%baO%cbO%dcO%edO%feO%gfO%hgO%ihO%jiO%kjO%lkO%mlO%nmO%onO%poO%qpO%rqO%srO%tsO%utO%vuO%wvO%xwO%yxO%zyO%{zO%|{O%}|O&O}O&P!OO&Q!PO&R!QO&S!RO&T!SO&U!TO&V!UO&W!VO&X!WO&Y!XO&Z!YO&[!ZO&]![O&^!]O&_!^O&`!_O&a!`O&b!aO&c!bO&d!cO&e!dO&f!eO&g!fO&h!gO&i!hO&j!iO&k!jO&l!kO&m!lO&n!mO&o!nO&p!oO&q!pO&r!qO&s!rO&t!sO&u!tO&v!uO&w!vO&x!wO&y!xO&z!yO&{!zO&|!{O&}!|O'O!}O'P#OO'Q#PO'R#QO'S#RO'T#SO'U#TO'V#UO'W#VO'X#WO'_ZO~O!i#XO~Of#YOg#YO%X#ZO~O%S#^O%T#^O%_#^OW$eXX$eXY$eXZ$eX[$eX]$eX^$eX_$eX`$eXa$eXb$eXc$eXd$eXe$eXk$eXl$eX|$eX!i$eX%S$eX%T$eX%X$eX%]$eX%^$eX%_$eX%`$eX%a$eX%b$eX%c$eX%d$eX%e$eX%f$eX%g$eX%h$eX%i$eX%j$eX%k$eX%l$eX%m$eX%n$eX%o$eX%p$eX%q$eX%r$eX%s$eX%t$eX%u$eX%v$eX%w$eX%x$eX%y$eX%z$eX%{$eX%|$eX%}$eX&O$eX&P$eX&Q$eX&R$eX&S$eX&T$eX&U$eX&V$eX&W$eX&X$eX&Y$eX&Z$eX&[$eX&]$eX&^$eX&_$eX&`$eX&a$eX&b$eX&c$eX&d$eX&e$eX&f$eX&g$eX&h$eX&i$eX&j$eX&k$eX&l$eX&m$eX&n$eX&o$eX&p$eX&q$eX&r$eX&s$eX&t$eX&u$eX&v$eX&w$eX&x$eX&y$eX&z$eX&{$eX&|$eX&}$eX'O$eX'P$eX'Q$eX'R$eX'S$eX'T$eX'U$eX'V$eX'W$eX'X$eX'_$eX~OU#eOV#_Oh#bOi#cOj#bOo#gOp#fO!P#_O!X#_O!Y#_O!Z#_O![#`O!]#`O!^#aO!_#aO!`#aO!a#aO!b#aO!c#aO!d#aO!e#aO${#hO'Y#dO~Oz#mO|#lO'`#oO~O'_ZOU$rXV$rXh$rXi$rXj$rXo$rXp$rX!P$rX!X$rX!Y$rX!Z$rX![$rX!]$rX!^$rX!_$rX!`$rX!a$rX!b$rX!c$rX!d$rX!e$rX${$rX%R$rX'Y$rX%Z$rX%Y$rX~O%X#rO~O%Z#tO~PYOf#YOg#YOUvaVvahvaivajvaovapva!Pva!Xva!Yva!Zva![va!]va!^va!_va!`va!ava!bva!cva!dva!eva${va%Rva'Yva%Zva%Yva~OP#wOQ#xOR#xOq#yOr#zOs#{OW%[PX%[PY%[PZ%[P[%[P]%[P^%[P_%[P`%[Pa%[Pb%[Pc%[Pd%[Pe%[Pk%[Pl%[P|%[P!i%[P%S%[P%T%[P%X%[P%]%[P%^%[P%_%[P%`%[P%a%[P%b%[P%c%[P%d%[P%e%[P%f%[P%g%[P%h%[P%i%[P%j%[P%k%[P%l%[P%m%[P%n%[P%o%[P%p%[P%q%[P%r%[P%s%[P%t%[P%u%[P%v%[P%w%[P%x%[P%y%[P%z%[P%{%[P%|%[P%}%[P&O%[P&P%[P&Q%[P&R%[P&S%[P&T%[P&U%[P&V%[P&W%[P&X%[P&Y%[P&Z%[P&[%[P&]%[P&^%[P&_%[P&`%[P&a%[P&b%[P&c%[P&d%[P&e%[P&f%[P&g%[P&h%[P&i%[P&j%[P&k%[P&l%[P&m%[P&n%[P&o%[P&p%[P&q%[P&r%[P&s%[P&t%[P&u%[P&v%[P&w%[P&x%[P&y%[P&z%[P&{%[P&|%[P&}%[P'O%[P'P%[P'Q%[P'R%[P'S%[P'T%[P'U%[P'V%[P'W%[P'X%[P'_%[P~O%S$YO%T$YO%X$cO%]$XO%^$XO%_$YO&|$^O&}$]O'Z$_O'[$`O~O%S$YO%T$YO%X$iO%]$XO%^$XO%_$YO&|$^O&}$]O'Z$_O'[$`O~O%SSO%TSO%]$kO%^$kO%_SO~Om$lOn$lO~P?TO%Z$oO~P0_O!P#_OU$qaV$qah$qai$qaj$qao$qap$qa!X$qa!Y$qa!Z$qa![$qa!]$qa!^$qa!_$qa!`$qa!a$qa!b$qa!c$qa!d$qa!e$qa${$qa%R$qa'Y$qa%Z$qa%Y$qa~O!e$pO$v$pO$w$pO$x$pO~O!e$pO$v$pO$w$pO$x$pO%Y$sO'`$uO~Oz$wO|#lO%Z$vO~O%Y$xO%Z$zO~P0_O%X$|O~O%X$}O~O%X%OO~OW!SXX!SXY!SXZ!SX[!SX]!SX^!SX_!SX`!SXa!SXb!SXc!SXd!SXe!SXk!SXl!SX|!SX!i!SX%S!SX%T!SX%X!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'Q!SX'R!SX'S!SX'T!SX'U!SX'V!SX'W!SX'X!SX'_!SX~Os#{O~PCTOr#zO~PCTOq#yOr#zOs#{OW%[XX%[XY%[XZ%[X[%[X]%[X^%[X_%[X`%[Xa%[Xb%[Xc%[Xd%[Xe%[Xk%[Xl%[X|%[X!i%[X%S%[X%T%[X%X%[X%]%[X%^%[X%_%[X%`%[X%a%[X%b%[X%c%[X%d%[X%e%[X%f%[X%g%[X%h%[X%i%[X%j%[X%k%[X%l%[X%m%[X%n%[X%o%[X%p%[X%q%[X%r%[X%s%[X%t%[X%u%[X%v%[X%w%[X%x%[X%y%[X%z%[X%{%[X%|%[X%}%[X&O%[X&P%[X&Q%[X&R%[X&S%[X&T%[X&U%[X&V%[X&W%[X&X%[X&Y%[X&Z%[X&[%[X&]%[X&^%[X&_%[X&`%[X&a%[X&b%[X&c%[X&d%[X&e%[X&f%[X&g%[X&h%[X&i%[X&j%[X&k%[X&l%[X&m%[X&n%[X&o%[X&p%[X&q%[X&r%[X&s%[X&t%[X&u%[X&v%[X&w%[X&x%[X&y%[X&z%[X&{%[X&|%[X&}%[X'O%[X'P%[X'Q%[X'R%[X'S%[X'T%[X'U%[X'V%[X'W%[X'X%[X'_%[X~OQ#xOR#xO~PJpO!P%XO!X%XO!Y%XO!Z%XO![%YO!]%YO']%ZO'^%[O~O%X%^O~O%X%_O~O%X%bO~O%X%cO~O%S#^O%T#^O%_#^O~O%X%eO~O|%fO~O|%gO~Oz#mO|#lO'`%jO~O%Y%kO'`%jO~O%Y%mO%Z%oO~O%Y$xO%Z%rO~OS%sOT%sOW!RaX!RaY!RaZ!Ra[!Ra]!Ra^!Ra_!Ra`!Raa!Rab!Rac!Rad!Rae!Rak!Ral!Raq!Rar!Ras!Ra|!Ra!i!Ra%S!Ra%T!Ra%X!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'Q!Ra'R!Ra'S!Ra'T!Ra'U!Ra'V!Ra'W!Ra'X!Ra'_!Ra~Oq#yOr#zOs#{OW%[aX%[aY%[aZ%[a[%[a]%[a^%[a_%[a`%[aa%[ab%[ac%[ad%[ae%[ak%[al%[a|%[a!i%[a%S%[a%T%[a%X%[a%]%[a%^%[a%_%[a%`%[a%a%[a%b%[a%c%[a%d%[a%e%[a%f%[a%g%[a%h%[a%i%[a%j%[a%k%[a%l%[a%m%[a%n%[a%o%[a%p%[a%q%[a%r%[a%s%[a%t%[a%u%[a%v%[a%w%[a%x%[a%y%[a%z%[a%{%[a%|%[a%}%[a&O%[a&P%[a&Q%[a&R%[a&S%[a&T%[a&U%[a&V%[a&W%[a&X%[a&Y%[a&Z%[a&[%[a&]%[a&^%[a&_%[a&`%[a&a%[a&b%[a&c%[a&d%[a&e%[a&f%[a&g%[a&h%[a&i%[a&j%[a&k%[a&l%[a&m%[a&n%[a&o%[a&p%[a&q%[a&r%[a&s%[a&t%[a&u%[a&v%[a&w%[a&x%[a&y%[a&z%[a&{%[a&|%[a&}%[a'O%[a'P%[a'Q%[a'R%[a'S%[a'T%[a'U%[a'V%[a'W%[a'X%[a'_%[a~O!P#_OU!Oqh!Oqi!Oqj!Oqo!Oqp!Oq![!Oq!]!Oq!^!Oq!_!Oq!`!Oq!a!Oq!b!Oq!c!Oq!d!Oq!e!Oq${!Oq%R!Oq'Y!Oq%Z!Oq%Y!Oq~OV!Oq!X!Oq!Y!Oq!Z!Oq~P!5uOV#_O!X#_O!Y#_O!Z#_O~P!5uOV#_O!P#_O!X#_O!Y#_O!Z#_O![#`O!]#`OU!Oqh!Oqi!Oqj!Oqo!Oqp!Oq${!Oq%R!Oq'Y!Oq%Z!Oq%Y!Oq~O!^!Oq!_!Oq!`!Oq!a!Oq!b!Oq!c!Oq!d!Oq!e!Oq~P!7}O!^#aO!_#aO!`#aO!a#aO!b#aO!c#aO!d#aO!e#aO~P!7}OV#_Oh#bOj#bO!P#_O!X#_O!Y#_O!Z#_O![#`O!]#`O!^#aO!_#aO!`#aO!a#aO!b#aO!c#aO!d#aO!e#aO~OU!Oqi!Oqo!Oqp!Oq${!Oq%R!Oq'Y!Oq%Z!Oq%Y!Oq~P!:cO']%{O~P=qO!X$da!Y$da!Z$da![$da!]$da']$da~O!P%XO'^$da~P!<bO%Z%|O~O!P&jO!X&jO!Y&jO!Z&jO![&kO!]&kO~O%Z%|O~P!=VO%Z&PO~O%Z&PO~P!=VO%Z&RO~O!e$pO$v$pO$w$pO$x$pO%Y%Qa'`%Qa~Oz#mO|#lO'`&SO~Oz&UO|#lO%Z&VO~O%Y&WO%Z&VO~O%Y%Pa%Z%Pa~P0_O%X#rOW!RiX!RiY!RiZ!Ri[!Ri]!Ri^!Ri_!Ri`!Ria!Rib!Ric!Rid!Rie!Rik!Ril!Riq!Rir!Ris!Ri|!Ri!i!Ri%S!Ri%T!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'Q!Ri'R!Ri'S!Ri'T!Ri'U!Ri'V!Ri'W!Ri'X!Ri'_!Ri~O%Z&ZO~O%Z&[O~O%Z&]O~O!X$di!Y$di!Z$di![$di!]$di']$di~O!P%XO'^$di~P!GYO!P%XO!X%XO!Y%XO!Z%XO![$di!]$di']$di'^$di~O']&^O~P!=VO%Y&_O~P!=VO!P&jO%Z$da%Y$da~P!<bO%Y&bO~P!=VOz#mO|#lO~Oz&UO|#lO%Z&cO~O!P&jO%Z$di%Y$di~P!GYO!P&jO!X&jO!Y&jO!Z&jO![$di!]$di%Z$di']$di%Y$di~Oz&UO|#lO~O%Z&gO~P!=VO%Z&hO~P!=VO",goto:".b%]PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP%^%j%v%|P&VP&g%^P&p&w'R'a'k(T(bPPPPPPPPPPPPP%^(o({P({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({({%^)X*T*w*w+]+]+q%^,V%^%^%^%^%^%^,],l,tPPP,l%^P,{P-O-U-[PPPPP-cPPP.Re^OXY#Z$S$T$U$V$W$xeROXY#Z$S$T$U$V$W$xQ#[RR#v#]Q#s#YQ${#xR&Y%sQ#nZQ$w#rU%h$s%k&TV&U%m&W&dQ#]RQ#iWR#v#[Z$R#_#`#a#b#cY$Q#_#`#a#b#cR%R$RY$P#_#`#a#b#cS%Q$Q$RR%w%Ra#|#_#`#a#b#c$Q$R%Rd^OXY#Z$S$T$U$V$W$xQ$m#hQ%t$|Q%u$}R%v%O`#}#_#`#a#b#c$Q$R%RR%P$O`$O#_#`#a#b#c$Q$R%RR%P#}eWOXY#Z$S$T$U$V$W$xeVOXY#Z$S$T$U$V$W$xQ$Z#dQ%]$[Q%`$cQ%d$iQ%x%XQ%y%YQ%z%[Q%}%_Q&O&iQ&Q%cQ&`&jQ&a&kQ&e&_R&f&bdYOXY#Z$S$T$U$V$W$xW$[#d$[%X%YS$e#e$ee&i$c$i%[%_%c&_&b&i&j&kl$a#d$[$c$i%X%Y%[%_%c&_&b&i&j&kT$g#e$el$b#d$[$c$i%X%Y%[%_%c&_&b&i&j&kT$h#e$el$d#d$[$c$i%X%Y%[%_%c&_&b&i&j&kT$j#e$eQ$f#eR%a$ed]OXY#Z$S$T$U$V$W$xR#q[Q#pZV%i$s%k&TQ$q#mT$r#n%hR$n#hQ%n$wR&X%nQ$y#uR%q$yS$t#n#pR%l$tQUOQ#jXQ#kYQ#u#ZQ%S$SQ%T$TQ%U$UQ%V$VQ%W$WR%p$xQ$S#_Q$T#`Q$U#aQ$V#bR$W#c",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 StartTimestamp Range Step Sqrt StddevOverTime StdvarOverTime SumOverTime Tan Tanh Timestamp Time Vector Year MatrixSelector DurationExpr UnaryOp DurationStep DurationRange DurationMinOf DurationMaxOf NumberDurationLiteralInDurationContext OffsetExpr OffsetDurationExpr AnchoredExpr SmoothedExpr ParenExpr SubqueryExpr UnaryExpr VectorSelector LabelMatchers UnquotedLabelMatcher MatchOp EqlSingle EqlRegex NeqRegex QuotedLabelMatcher StepInvariantExpr At AtModifierPreprocessors MetricName",maxTerm:292,nodeProps:[["group",-14,38,44,46,52,68,157,165,167,168,169,170,171,172,180,"Expr"]],propSources:[gfe],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%V~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$x~~$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%X~~)VO%Z~~)[O!X~V)cO%^P![U~)hO%Y~V)oO%]P!]U~)rP!Q![)u~)zS%_~!Q![)u!g!h*W#R#S)o#X#Y*W~*ZR{|*d}!O*d!Q![*j~*gP!Q![*j~*oQ%_~!Q![*j#R#S*d~*zO!Y~~+P[%_~!O!P)o!Q![+u!g!h*W#R#S,m#W#X-X#X#Y*W#[#]-p#a#b.U#g#h.x#k#l/Z#l#m0d#m#n/u~+zZ%_~!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%_~!O!P)o!Q![,s!g!h*W#R#S,m#X#Y*W~-^P%_~!Q![-a~-dS!Q![-a#[#]-p#a#b.U#g#h.x~-uP%_~!Q![-x~-{R!Q![-x#a#b.U#g#h.x~.ZQ%_~!Q![.a#g#h.s~.dR!Q![.a#a#b.m#g#h.x~.pP#g#h.s~.xO%_~~.}P%_~!Q![/Q~/TQ!Q![/Q#a#b.m~/`P%_~!Q![/c~/fT!Q![/c#W#X-X#[#]-p#a#b.U#g#h.x~/zP%_~!Q![/}~0QU!Q![/}#W#X-X#[#]-p#a#b.U#g#h.x#k#l/Z~0gR!Q![0p!c!i0p#T#Z0p~0uR%_~!Q![0p!c!i0p#T#Z0pV1VT'^S!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$vP!_!`2l#r#s2qQ2qO!^Q~2vO$w~~2{Q!`~!P!Q3R!_!`3W~3WO!b~~3]O!_~~3bO${~V3iT!iRzS!Q![3b![!]1f!c!}3b#R#S3b#T#o3b~3}O'Y~~4SO']~~4XO!P~~4[TO#S4X#S#T%c#T;'S4X;'S;=`4k<%lO4X~4nP;=`<%l4X~4vO'_~~4{O'`~",tokenizers:[0,1,2],topRules:{PromQL:[0,37],MetricName:[1,183]},specialized:[{term:71,get:(t,e)=>YL(t)<<1,external:YL},{term:71,get:(t,e)=>WL(t,e)<<1|1,external:WL,extend:!0},{term:71,get:t=>vfe[t]||-1}],tokenPrec:0}),xfe=3,bfe=4,Afe=5,F7=9,$7=11,wfe=15,z7=16,H7=17,q7=21,qR=24,QR=25,YR=26,Sfe=27,jfe=28,Cfe=37,Hv=38,_fe=39,kfe=40,am=41,qv=42,Qv=43,Xm=44,hu=45,lm=46,Tfe=47,Q7=48,Ofe=49,Efe=50,Mfe=51,oj=52,Rfe=53,Dfe=54,Nfe=55,Ife=56,Bfe=57,Lfe=58,Pfe=59,a2=60,l2=61,c2=62,Y7=63,W7=64,u2=65,h2=66,Yv=67,d2=68,Ffe=70,Y1=71,$fe=72,zfe=73,Hfe=74,qfe=75,Qfe=76,Yfe=77,Wfe=78,Ufe=79,Vfe=80,Gfe=81,U7=82,Xfe=83,Kfe=84,Zfe=85,Jfe=86,epe=87,tpe=88,npe=89,ipe=90,rpe=91,spe=92,ope=93,f2=94,ape=95,lpe=96,cpe=97,upe=98,hpe=99,dpe=100,fpe=101,ppe=102,mpe=103,gpe=104,vpe=105,ype=106,xpe=107,bpe=108,Ape=109,p2=110,wpe=111,Spe=112,jpe=113,Cpe=114,_pe=115,kpe=116,Tpe=117,Ope=118,Epe=119,Mpe=120,Rpe=121,Dpe=122,Npe=123,Ipe=124,Bpe=125,Lpe=126,Ppe=127,Fpe=128,$pe=129,zpe=130,Hpe=131,qpe=132,m2=133,V7=134,Qpe=135,Ype=136,Wpe=137,Upe=138,Vpe=139,Gpe=140,Xpe=141,Kpe=142,Zpe=143,Jpe=144,eme=145,tme=146,nme=147,ime=148,rme=149,sme=150,ome=151,ame=152,lme=153,cme=154,ume=155,hme=156,Gl=157,hv=158,dme=161,G7=164,au=165,fme=166,X7=167,K7=168,Z7=169,il=170,J7=171,Jy=172,cm=173,zh=174,W1=175,ex=176,eQ=177,tQ=178,Ef=179,WR=180;var oe;(function(t){t.none="none",t.vector="vector",t.scalar="scalar",t.matrix="matrix",t.string="string"})(oe||(oe={}));const pme={[zfe]:{name:"abs",argTypes:[oe.vector],variadic:0,returnType:oe.vector},[$fe]:{name:"absent",argTypes:[oe.vector],variadic:0,returnType:oe.vector},[Ffe]:{name:"absent_over_time",argTypes:[oe.matrix],variadic:0,returnType:oe.vector},[Hfe]:{name:"acos",argTypes:[oe.vector],variadic:0,returnType:oe.vector},[qfe]:{name:"acosh",argTypes:[oe.vector],variadic:0,returnType:oe.vector},[Qfe]:{name:"asin",argTypes:[oe.vector],variadic:0,returnType:oe.vector},[Yfe]:{name:"asinh",argTypes:[oe.vector],variadic:0,returnType:oe.vector},[Wfe]:{name:"atan",argTypes:[oe.vector],variadic:0,returnType:oe.vector},[Ufe]:{name:"atanh",argTypes:[oe.vector],variadic:0,returnType:oe.vector},[Vfe]:{name:"avg_over_time",argTypes:[oe.matrix],variadic:0,returnType:oe.vector},[Gfe]:{name:"ceil",argTypes:[oe.vector],variadic:0,returnType:oe.vector},[U7]:{name:"changes",argTypes:[oe.matrix],variadic:0,returnType:oe.vector},[Xfe]:{name:"clamp",argTypes:[oe.vector,oe.scalar,oe.scalar],variadic:0,returnType:oe.vector},[Kfe]:{name:"clamp_max",argTypes:[oe.vector,oe.scalar],variadic:0,returnType:oe.vector},[Zfe]:{name:"clamp_min",argTypes:[oe.vector,oe.scalar],variadic:0,returnType:oe.vector},[Jfe]:{name:"cos",argTypes:[oe.vector],variadic:0,returnType:oe.vector},[epe]:{name:"Cosh",argTypes:[oe.vector],variadic:0,returnType:oe.vector},[tpe]:{name:"count_over_time",argTypes:[oe.matrix],variadic:0,returnType:oe.vector},[npe]:{name:"days_in_month",argTypes:[oe.vector],variadic:1,returnType:oe.vector},[ipe]:{name:"day_of_month",argTypes:[oe.vector],variadic:1,returnType:oe.vector},[rpe]:{name:"day_of_week",argTypes:[oe.vector],variadic:1,returnType:oe.vector},[spe]:{name:"day_of_year",argTypes:[oe.vector],variadic:1,returnType:oe.vector},[ope]:{name:"deg",argTypes:[oe.vector],variadic:0,returnType:oe.vector},[f2]:{name:"delta",argTypes:[oe.matrix],variadic:0,returnType:oe.vector},[ape]:{name:"deriv",argTypes:[oe.matrix],variadic:0,returnType:oe.vector},[jfe]:{name:"end",argTypes:[],variadic:0,returnType:oe.scalar},[lpe]:{name:"exp",argTypes:[oe.vector],variadic:0,returnType:oe.vector},[cpe]:{name:"first_over_time",argTypes:[oe.matrix],variadic:0,returnType:oe.vector},[upe]:{name:"floor",argTypes:[oe.vector],variadic:0,returnType:oe.vector},[ype]:{name:"histogram_avg",argTypes:[oe.vector],variadic:0,returnType:oe.vector},[hpe]:{name:"histogram_count",argTypes:[oe.vector],variadic:0,returnType:oe.vector},[dpe]:{name:"histogram_fraction",argTypes:[oe.scalar,oe.scalar,oe.vector],variadic:0,returnType:oe.vector},[fpe]:{name:"histogram_quantile",argTypes:[oe.scalar,oe.vector],variadic:0,returnType:oe.vector},[ppe]:{name:"histogram_quantiles",argTypes:[oe.vector,oe.string,oe.scalar,oe.scalar],variadic:10,returnType:oe.vector},[mpe]:{name:"histogram_stddev",argTypes:[oe.vector],variadic:0,returnType:oe.vector},[gpe]:{name:"histogram_stdvar",argTypes:[oe.vector],variadic:0,returnType:oe.vector},[vpe]:{name:"histogram_sum",argTypes:[oe.vector],variadic:0,returnType:oe.vector},[xpe]:{name:"double_exponential_smoothing",argTypes:[oe.matrix,oe.scalar,oe.scalar],variadic:0,returnType:oe.vector},[bpe]:{name:"hour",argTypes:[oe.vector],variadic:1,returnType:oe.vector},[Ape]:{name:"idelta",argTypes:[oe.matrix],variadic:0,returnType:oe.vector},[p2]:{name:"increase",argTypes:[oe.matrix],variadic:0,returnType:oe.vector},[wpe]:{name:"info",argTypes:[oe.vector,oe.vector],variadic:1,returnType:oe.vector},[Spe]:{name:"irate",argTypes:[oe.matrix],variadic:0,returnType:oe.vector},[jpe]:{name:"label_replace",argTypes:[oe.vector,oe.string,oe.string,oe.string,oe.string],variadic:0,returnType:oe.vector},[Cpe]:{name:"label_join",argTypes:[oe.vector,oe.string,oe.string,oe.string],variadic:-1,returnType:oe.vector},[_pe]:{name:"last_over_time",argTypes:[oe.matrix],variadic:0,returnType:oe.vector},[kpe]:{name:"ln",argTypes:[oe.vector],variadic:0,returnType:oe.vector},[Tpe]:{name:"log10",argTypes:[oe.vector],variadic:0,returnType:oe.vector},[Ope]:{name:"log2",argTypes:[oe.vector],variadic:0,returnType:oe.vector},[Epe]:{name:"mad_over_time",argTypes:[oe.matrix],variadic:0,returnType:oe.vector},[Mpe]:{name:"max_over_time",argTypes:[oe.matrix],variadic:0,returnType:oe.vector},[Rpe]:{name:"min_over_time",argTypes:[oe.matrix],variadic:0,returnType:oe.vector},[Dpe]:{name:"ts_of_first_over_time",argTypes:[oe.matrix],variadic:0,returnType:oe.vector},[Npe]:{name:"ts_of_max_over_time",argTypes:[oe.matrix],variadic:0,returnType:oe.vector},[Ipe]:{name:"ts_of_min_over_time",argTypes:[oe.matrix],variadic:0,returnType:oe.vector},[Bpe]:{name:"ts_of_last_over_time",argTypes:[oe.matrix],variadic:0,returnType:oe.vector},[Lpe]:{name:"minute",argTypes:[oe.vector],variadic:1,returnType:oe.vector},[Ppe]:{name:"month",argTypes:[oe.vector],variadic:1,returnType:oe.vector},[Fpe]:{name:"pi",argTypes:[],variadic:0,returnType:oe.vector},[$pe]:{name:"predict_linear",argTypes:[oe.matrix,oe.scalar],variadic:0,returnType:oe.vector},[zpe]:{name:"present_over_time",argTypes:[oe.matrix],variadic:0,returnType:oe.vector},[Hpe]:{name:"quantile_over_time",argTypes:[oe.scalar,oe.matrix],variadic:0,returnType:oe.vector},[qpe]:{name:"rad",argTypes:[oe.vector],variadic:0,returnType:oe.vector},[eme]:{name:"range",argTypes:[],variadic:0,returnType:oe.scalar},[m2]:{name:"rate",argTypes:[oe.matrix],variadic:0,returnType:oe.vector},[V7]:{name:"resets",argTypes:[oe.matrix],variadic:0,returnType:oe.vector},[Qpe]:{name:"round",argTypes:[oe.vector,oe.scalar],variadic:1,returnType:oe.vector},[Ype]:{name:"scalar",argTypes:[oe.vector],variadic:0,returnType:oe.scalar},[Wpe]:{name:"sgn",argTypes:[oe.vector],variadic:0,returnType:oe.vector},[Upe]:{name:"sin",argTypes:[oe.vector],variadic:0,returnType:oe.vector},[Vpe]:{name:"Sinh",argTypes:[oe.vector],variadic:0,returnType:oe.vector},[Gpe]:{name:"sort",argTypes:[oe.vector],variadic:0,returnType:oe.vector},[Xpe]:{name:"sort_desc",argTypes:[oe.vector],variadic:0,returnType:oe.vector},[Kpe]:{name:"sort_by_label",argTypes:[oe.vector,oe.string],variadic:-1,returnType:oe.vector},[Zpe]:{name:"sort_by_label_desc",argTypes:[oe.vector,oe.string],variadic:-1,returnType:oe.vector},[nme]:{name:"sqrt",argTypes:[oe.vector],variadic:0,returnType:oe.vector},[Sfe]:{name:"start",argTypes:[],variadic:0,returnType:oe.scalar},[Jpe]:{name:"start_timestamp",argTypes:[oe.vector],variadic:0,returnType:oe.vector},[tme]:{name:"step",argTypes:[],variadic:0,returnType:oe.scalar},[ime]:{name:"stddev_over_time",argTypes:[oe.matrix],variadic:0,returnType:oe.vector},[rme]:{name:"stdvar_over_time",argTypes:[oe.matrix],variadic:0,returnType:oe.vector},[sme]:{name:"sum_over_time",argTypes:[oe.matrix],variadic:0,returnType:oe.vector},[ome]:{name:"tan",argTypes:[oe.vector],variadic:0,returnType:oe.vector},[ame]:{name:"tanh",argTypes:[oe.vector],variadic:0,returnType:oe.vector},[cme]:{name:"time",argTypes:[],variadic:0,returnType:oe.scalar},[lme]:{name:"timestamp",argTypes:[oe.vector],variadic:0,returnType:oe.vector},[ume]:{name:"vector",argTypes:[oe.scalar],variadic:0,returnType:oe.vector},[hme]:{name:"year",argTypes:[oe.vector],variadic:1,returnType:oe.vector}};function nQ(t){return pme[t]}class iQ{constructor(e,n,i){this.type=e,this.name=n,this.value=i}matchesEmpty(){switch(this.type){case ex:return this.value==="";case Yv:return this.value!=="";default:return!1}}}var Xl;(function(t){t.CardOneToOne="one-to-one",t.CardManyToOne="many-to-one",t.CardOneToMany="one-to-many",t.CardManyToMany="many-to-many"})(Xl||(Xl={}));function mme(t,e){const n=new iQ(0,"",""),i=t.cursor();switch(i.type.id){case Ef:if(!i.next())return n;do switch(i.type.id){case Qv:n.name=e.sliceDoc(i.from,i.to).slice(1,-1);break;case W1:{const r=i.node.firstChild;r&&(n.type=r.type.id);break}case Xm:n.value=e.sliceDoc(i.from,i.to).slice(1,-1);break}while(i.nextSibling());break;case zh:if(!i.next())return n;do switch(i.type.id){case qv:n.name=e.sliceDoc(i.from,i.to);break;case W1:{const r=i.node.firstChild;r&&(n.type=r.type.id);break}case Xm:n.value=e.sliceDoc(i.from,i.to).slice(1,-1);break}while(i.nextSibling());break;case Qv:n.name="__name__",n.value=e.sliceDoc(i.from,i.to).slice(1,-1),n.type=ex;break}return n}function rQ(t,e){const n=[];return t.forEach(i=>{n.push(mme(i,e))}),n}function Bk(t,e,n){if(!e||e.length===0)return t;let i="";for(const r of e){if(r.name===n||r.value==="")continue;let s="";switch(r.type){case ex:s="=";break;case Yv:s="!=";break;case tQ:s="!~";break;case eQ:s="=~";break;default:s="="}const a=`${r.name}${s}"${r.value}"`;i===""?i=a:i=`${i},${a}`}return`${t}{${i}}`}function UR(t,e){for(;;){if(!t||t.type.id===e)return t;t=t.parent}return null}function lf(t,...e){const n=t.cursor();if(!n.next())return!1;let i=!1;do i=e.some(r=>n.type.id===r||n.type.name===r);while(!i&&n.nextSibling());return i}function U1(t,...e){const n=t.cursor();if(!n.next())return!1;let i=0;do n.type.is(e[i])&&i++;while(i<e.length&&n.nextSibling());return i>=e.length}function ql(t){var e;if(!t)return oe.none;switch(t.type.id){case Hv:return oe.vector;case Jy:return oe.vector;case au:return ql(t.firstChild);case Xm:return oe.string;case oj:return oe.scalar;case Gl:return oe.matrix;case il:return oe.matrix;case K7:return ql(t.firstChild);case X7:return ql(t.firstChild);case Z7:return ql(t.getChild("Expr"));case J7:return ql(t.getChild("Expr"));case lm:{const n=ql(t.firstChild),i=ql(t.lastChild);return n===oe.scalar&&i===oe.scalar?oe.scalar:oe.vector}case d2:{const n=(e=t.firstChild)===null||e===void 0?void 0:e.firstChild;return n?nQ(n.type.id).returnType:oe.none}case WR:return ql(t.getChild("Expr"));default:return oe.none}}let g2=[],sQ=[];(()=>{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?sQ:g2).push(n=n+t[e])})();function gme(t){if(t<768)return!1;for(let e=0,n=g2.length;;){let i=e+n>>1;if(t<g2[i])n=i;else if(t>=sQ[i])e=i+1;else return!0;if(e==n)return!1}}function UL(t){return t>=127462&&t<=127487}const VL=8205;function vme(t,e,n=!0,i=!0){return(n?oQ:yme)(t,e,i)}function oQ(t,e,n){if(e==t.length)return e;e&&aQ(t.charCodeAt(e))&&lQ(t.charCodeAt(e-1))&&e--;let i=Lk(t,e);for(e+=GL(i);e<t.length;){let r=Lk(t,e);if(i==VL||r==VL||n&&gme(r))e+=GL(r),i=r;else if(UL(r)){let s=0,a=e-2;for(;a>=0&&UL(Lk(t,a));)s++,a-=2;if(s%2==0)break;e+=2}else break}return e}function yme(t,e,n){for(;e>1;){let i=oQ(t,e-2,n);if(i<e)return i;e--}return 0}function Lk(t,e){let n=t.charCodeAt(e);if(!lQ(n)||e+1==t.length)return n;let i=t.charCodeAt(e+1);return aQ(i)?(n-55296<<10)+(i-56320)+65536:n}function aQ(t){return t>=56320&&t<57344}function lQ(t){return t>=55296&&t<56320}function GL(t){return t<65536?1:2}let zn=class cQ{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,i){[e,n]=Km(this,e,n);let r=[];return this.decompose(0,e,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(n,this.length,r,1),Kl.from(r,this.length-(n-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=Km(this,e,n);let i=[];return this.decompose(e,n,i,0),Kl.from(i,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),i=this.length-this.scanIdentical(e,-1),r=new dv(this),s=new dv(e);for(let a=n,l=n;;){if(r.next(a),s.next(a),a=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=i)return!0}}iter(e=1){return new dv(this,e)}iterRange(e,n=this.length){return new uQ(this,e,n)}iterLines(e,n){let i;if(e==null)i=this.iter();else{n==null&&(n=this.lines+1);let r=this.line(e).from;i=this.iterRange(r,Math.max(r,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new hQ(i)}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]?cQ.empty:e.length<=32?new vr(e):Kl.from(vr.split(e,[]))}};class vr extends zn{constructor(e,n=xme(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,i,r){for(let s=0;;s++){let a=this.text[s],l=r+a.length;if((n?i:l)>=e)return new bme(r,l,i,a);r=l+1,i++}}decompose(e,n,i,r){let s=e<=0&&n>=this.length?this:new vr(XL(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(r&1){let a=i.pop(),l=GA(s.text,a.text.slice(),0,s.length);if(l.length<=32)i.push(new vr(l,a.length+s.length));else{let u=l.length>>1;i.push(new vr(l.slice(0,u)),new vr(l.slice(u)))}}else i.push(s)}replace(e,n,i){if(!(i instanceof vr))return super.replace(e,n,i);[e,n]=Km(this,e,n);let r=GA(this.text,GA(i.text,XL(this.text,0,e)),n),s=this.length+i.length-(n-e);return r.length<=32?new vr(r,s):Kl.from(vr.split(r,[]),s)}sliceString(e,n=this.length,i=`
`){[e,n]=Km(this,e,n);let r="";for(let s=0,a=0;s<=n&&a<this.text.length;a++){let l=this.text[a],u=s+l.length;s>e&&a&&(r+=i),e<u&&n>s&&(r+=l.slice(Math.max(0,e-s),n-s)),s=u+1}return r}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let i=[],r=-1;for(let s of e)i.push(s),r+=s.length+1,i.length==32&&(n.push(new vr(i,r)),i=[],r=-1);return r>-1&&n.push(new vr(i,r)),n}}class Kl extends zn{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,n,i,r){for(let s=0;;s++){let a=this.children[s],l=r+a.length,u=i+a.lines-1;if((n?u:l)>=e)return a.lineInner(e,n,i,r);r=l+1,i=u+1}}decompose(e,n,i,r){for(let s=0,a=0;a<=n&&s<this.children.length;s++){let l=this.children[s],u=a+l.length;if(e<=u&&n>=a){let d=r&((a<=e?1:0)|(u>=n?2:0));a>=e&&u<=n&&!d?i.push(l):l.decompose(e-a,n-a,i,d)}a=u+1}}replace(e,n,i){if([e,n]=Km(this,e,n),i.lines<this.lines)for(let r=0,s=0;r<this.children.length;r++){let a=this.children[r],l=s+a.length;if(e>=s&&n<=l){let u=a.replace(e-s,n-s,i),d=this.lines-a.lines+u.lines;if(u.lines<d>>4&&u.lines>d>>6){let f=this.children.slice();return f[r]=u,new Kl(f,this.length-(n-e)+i.length)}return super.replace(s,l,u)}s=l+1}return super.replace(e,n,i)}sliceString(e,n=this.length,i=`
`){[e,n]=Km(this,e,n);let r="";for(let s=0,a=0;s<this.children.length&&a<=n;s++){let l=this.children[s],u=a+l.length;a>e&&s&&(r+=i),e<u&&n>a&&(r+=l.sliceString(e-a,n-a,i)),a=u+1}return r}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof Kl))return 0;let i=0,[r,s,a,l]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=n,s+=n){if(r==a||s==l)return i;let u=this.children[r],d=e.children[s];if(u!=d)return i+u.scanIdentical(d,n);i+=u.length+1}}static from(e,n=e.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let v of e)i+=v.lines;if(i<32){let v=[];for(let y of e)y.flatten(v);return new vr(v,n)}let r=Math.max(32,i>>5),s=r<<1,a=r>>1,l=[],u=0,d=-1,f=[];function p(v){let y;if(v.lines>s&&v instanceof Kl)for(let b of v.children)p(b);else v.lines>a&&(u>a||!u)?(m(),l.push(v)):v instanceof vr&&u&&(y=f[f.length-1])instanceof vr&&v.lines+y.lines<=32?(u+=v.lines,d+=v.length+1,f[f.length-1]=new vr(y.text.concat(v.text),y.length+1+v.length)):(u+v.lines>r&&m(),u+=v.lines,d+=v.length+1,f.push(v))}function m(){u!=0&&(l.push(f.length==1?f[0]:Kl.from(f,d)),d=-1,u=f.length=0)}for(let v of e)p(v);return m(),l.length==1?l[0]:new Kl(l,n)}}zn.empty=new vr([""],0);function xme(t){let e=-1;for(let n of t)e+=n.length+1;return e}function GA(t,e,n=0,i=1e9){for(let r=0,s=0,a=!0;s<t.length&&r<=i;s++){let l=t[s],u=r+l.length;u>=n&&(u>i&&(l=l.slice(0,i-r)),r<n&&(l=l.slice(n-r)),a?(e[e.length-1]+=l,a=!1):e.push(l)),r=u+1}return e}function XL(t,e,n){return GA(t,[""],e,n)}class dv{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 vr?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],s=this.offsets[i],a=s>>1,l=r instanceof vr?r.text.length:r.children.length;if(a==(n>0?l:0)){if(i==0)return this.done=!0,this.value="",this;n>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(n>0?0:1)){if(this.offsets[i]+=n,e==0)return this.lineBreak=!0,this.value=`
`,this;e--}else if(r instanceof vr){let u=r.text[a+(n<0?-1:0)];if(this.offsets[i]+=n,u.length>Math.max(0,e))return this.value=e==0?u:n>0?u.slice(e):u.slice(0,u.length-e),this;e-=u.length}else{let u=r.children[a+(n<0?-1:0)];e>u.length?(e-=u.length,this.offsets[i]+=n):(n<0&&this.offsets[i]--,this.nodes.push(u),this.offsets.push(n>0?1:(u instanceof vr?u.text.length:u.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class uQ{constructor(e,n,i){this.value="",this.done=!1,this.cursor=new dv(e,n>i?-1:1),this.pos=n>i?e.length:0,this.from=Math.min(n,i),this.to=Math.max(n,i)}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 i=n<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*n,this.value=r.length<=i?r:n<0?r.slice(r.length-i):r.slice(0,i),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 hQ{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:i,value:r}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(zn.prototype[Symbol.iterator]=function(){return this.iter()},dv.prototype[Symbol.iterator]=uQ.prototype[Symbol.iterator]=hQ.prototype[Symbol.iterator]=function(){return this});class bme{constructor(e,n,i,r){this.from=e,this.to=n,this.number=i,this.text=r}get length(){return this.to-this.from}}function Km(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function is(t,e,n=!0,i=!0){return vme(t,e,n,i)}function Ame(t){return t>=56320&&t<57344}function wme(t){return t>=55296&&t<56320}function bo(t,e){let n=t.charCodeAt(e);if(!wme(n)||e+1==t.length)return n;let i=t.charCodeAt(e+1);return Ame(i)?(n-55296<<10)+(i-56320)+65536:n}function VR(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function Zl(t){return t<65536?1:2}const v2=/\r\n?|\n/;var As=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(As||(As={}));class lc{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 i=this.sections[n+1];e+=i<0?this.sections[n]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,i=0,r=0;n<this.sections.length;){let s=this.sections[n++],a=this.sections[n++];a<0?(e(i,r,s),r+=s):r+=a,i+=s}}iterChangedRanges(e,n=!1){y2(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let i=this.sections[n++],r=this.sections[n++];r<0?e.push(i,r):e.push(r,i)}return new lc(e)}composeDesc(e){return this.empty?e:e.empty?this:dQ(this,e)}mapDesc(e,n=!1){return e.empty?this:x2(this,e,n)}mapPos(e,n=-1,i=As.Simple){let r=0,s=0;for(let a=0;a<this.sections.length;){let l=this.sections[a++],u=this.sections[a++],d=r+l;if(u<0){if(d>e)return s+(e-r);s+=l}else{if(i!=As.Simple&&d>=e&&(i==As.TrackDel&&r<e&&d>e||i==As.TrackBefore&&r<e||i==As.TrackAfter&&d>e))return null;if(d>e||d==e&&n<0&&!l)return e==r||n<0?s:s+u;s+=u}r=d}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,n=e){for(let i=0,r=0;i<this.sections.length&&r<=n;){let s=this.sections[i++],a=this.sections[i++],l=r+s;if(a>=0&&r<=n&&l>=e)return r<e&&l>n?"cover":!0;r=l}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let i=this.sections[n++],r=this.sections[n++];e+=(e?" ":"")+i+(r>=0?":"+r:"")}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 lc(e)}static create(e){return new lc(e)}}class Br extends lc{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 y2(this,(n,i,r,s,a)=>e=e.replace(r,r+(i-n),a),!1),e}mapDesc(e,n=!1){return x2(this,e,n,!0)}invert(e){let n=this.sections.slice(),i=[];for(let r=0,s=0;r<n.length;r+=2){let a=n[r],l=n[r+1];if(l>=0){n[r]=l,n[r+1]=a;let u=r>>1;for(;i.length<u;)i.push(zn.empty);i.push(a?e.slice(s,s+a):zn.empty)}s+=a}return new Br(n,i)}compose(e){return this.empty?e:e.empty?this:dQ(this,e,!0)}map(e,n=!1){return e.empty?this:x2(this,e,n,!0)}iterChanges(e,n=!1){y2(this,e,n)}get desc(){return lc.create(this.sections)}filter(e){let n=[],i=[],r=[],s=new Wv(this);e:for(let a=0,l=0;;){let u=a==e.length?1e9:e[a++];for(;l<u||l==u&&s.len==0;){if(s.done)break e;let f=Math.min(s.len,u-l);Bs(r,f,-1);let p=s.ins==-1?-1:s.off==0?s.ins:0;Bs(n,f,p),p>0&&Hh(i,n,s.text),s.forward(f),l+=f}let d=e[a++];for(;l<d;){if(s.done)break e;let f=Math.min(s.len,d-l);Bs(n,f,-1),Bs(r,f,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(f),l+=f}}return{changes:new Br(n,i),filtered:lc.create(r)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let i=this.sections[n],r=this.sections[n+1];r<0?e.push(i):r==0?e.push([i]):e.push([i].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,i){let r=[],s=[],a=0,l=null;function u(f=!1){if(!f&&!r.length)return;a<n&&Bs(r,n-a,-1);let p=new Br(r,s);l=l?l.compose(p.map(l)):p,r=[],s=[],a=0}function d(f){if(Array.isArray(f))for(let p of f)d(p);else if(f instanceof Br){if(f.length!=n)throw new RangeError(`Mismatched change set length (got ${f.length}, expected ${n})`);u(),l=l?l.compose(f.map(l)):f}else{let{from:p,to:m=p,insert:v}=f;if(p>m||p<0||m>n)throw new RangeError(`Invalid change range ${p} to ${m} (in doc of length ${n})`);let y=v?typeof v=="string"?zn.of(v.split(i||v2)):v:zn.empty,b=y.length;if(p==m&&b==0)return;p<a&&u(),p>a&&Bs(r,p-a,-1),Bs(r,m-p,b),Hh(s,r,y),a=m}}return d(e),u(!l),l}static empty(e){return new Br(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],i=[];for(let r=0;r<e.length;r++){let s=e[r];if(typeof s=="number")n.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((a,l)=>l&&typeof a!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;i.length<r;)i.push(zn.empty);i[r]=zn.of(s.slice(1)),n.push(s[0],i[r].length)}}}return new Br(n,i)}static createSet(e,n){return new Br(e,n)}}function Bs(t,e,n,i=!1){if(e==0&&n<=0)return;let r=t.length-2;r>=0&&n<=0&&n==t[r+1]?t[r]+=e:r>=0&&e==0&&t[r]==0?t[r+1]+=n:i?(t[r]+=e,t[r+1]+=n):t.push(e,n)}function Hh(t,e,n){if(n.length==0)return;let i=e.length-2>>1;if(i<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<i;)t.push(zn.empty);t.push(n)}}function y2(t,e,n){let i=t.inserted;for(let r=0,s=0,a=0;a<t.sections.length;){let l=t.sections[a++],u=t.sections[a++];if(u<0)r+=l,s+=l;else{let d=r,f=s,p=zn.empty;for(;d+=l,f+=u,u&&i&&(p=p.append(i[a-2>>1])),!(n||a==t.sections.length||t.sections[a+1]<0);)l=t.sections[a++],u=t.sections[a++];e(r,d,s,f,p),r=d,s=f}}}function x2(t,e,n,i=!1){let r=[],s=i?[]:null,a=new Wv(t),l=new Wv(e);for(let u=-1;;){if(a.done&&l.len||l.done&&a.len)throw new Error("Mismatched change set lengths");if(a.ins==-1&&l.ins==-1){let d=Math.min(a.len,l.len);Bs(r,d,-1),a.forward(d),l.forward(d)}else if(l.ins>=0&&(a.ins<0||u==a.i||a.off==0&&(l.len<a.len||l.len==a.len&&!n))){let d=l.len;for(Bs(r,l.ins,-1);d;){let f=Math.min(a.len,d);a.ins>=0&&u<a.i&&a.len<=f&&(Bs(r,0,a.ins),s&&Hh(s,r,a.text),u=a.i),a.forward(f),d-=f}l.next()}else if(a.ins>=0){let d=0,f=a.len;for(;f;)if(l.ins==-1){let p=Math.min(f,l.len);d+=p,f-=p,l.forward(p)}else if(l.ins==0&&l.len<f)f-=l.len,l.next();else break;Bs(r,d,u<a.i?a.ins:0),s&&u<a.i&&Hh(s,r,a.text),u=a.i,a.forward(a.len-f)}else{if(a.done&&l.done)return s?Br.createSet(r,s):lc.create(r);throw new Error("Mismatched change set lengths")}}}function dQ(t,e,n=!1){let i=[],r=n?[]:null,s=new Wv(t),a=new Wv(e);for(let l=!1;;){if(s.done&&a.done)return r?Br.createSet(i,r):lc.create(i);if(s.ins==0)Bs(i,s.len,0,l),s.next();else if(a.len==0&&!a.done)Bs(i,0,a.ins,l),r&&Hh(r,i,a.text),a.next();else{if(s.done||a.done)throw new Error("Mismatched change set lengths");{let u=Math.min(s.len2,a.len),d=i.length;if(s.ins==-1){let f=a.ins==-1?-1:a.off?0:a.ins;Bs(i,u,f,l),r&&f&&Hh(r,i,a.text)}else a.ins==-1?(Bs(i,s.off?0:s.len,u,l),r&&Hh(r,i,s.textBit(u))):(Bs(i,s.off?0:s.len,a.off?0:a.ins,l),r&&!a.off&&Hh(r,i,a.text));l=(s.ins>u||a.ins>=0&&a.len>u)&&(l||i.length>d),s.forward2(u),a.forward(u)}}}}class Wv{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?zn.empty:e[n]}textBit(e){let{inserted:n}=this.set,i=this.i-2>>1;return i>=n.length&&!e?zn.empty:n[i].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 Th{constructor(e,n,i,r){this.from=e,this.to=n,this.flags=i,this.goalColumn=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 undirectional(){return(this.flags&64)>0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}map(e,n=-1){let i,r;return this.empty?i=r=e.mapPos(this.from,n):(i=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new Th(i,r,this.flags,this.goalColumn)}extend(e,n=e,i=0){if(e<=this.anchor&&n>=this.anchor)return Le.range(e,n,void 0,void 0,i);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return Le.range(this.anchor,r,void 0,void 0,i)}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 Le.range(e.anchor,e.head)}static create(e,n,i,r){return new Th(e,n,i,r)}}class Le{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:Le.create(this.ranges.map(i=>i.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(e.ranges[i],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new Le([this.main],0)}addRange(e,n=!0){return Le.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let i=this.ranges.slice();return i[n]=e,Le.create(i,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 Le(e.ranges.map(n=>Th.fromJSON(n)),e.main)}static single(e,n=e){return new Le([Le.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 i=0,r=0;r<e.length;r++){let s=e[r];if(s.empty?s.from<=i:s.from<i)return Le.normalized(e.slice(),n);i=s.to}return new Le(e,n)}static cursor(e,n=0,i,r){return Th.create(e,e,(n==0?0:n<0?8:16)|(i==null?7:Math.min(6,i)),r)}static range(e,n,i,r,s){let a=r==null?7:Math.min(6,r);return!s&&e!=n&&(s=n<e?1:-1),s&&(a|=s<0?8:16),n<e?Th.create(n,e,a|32,i):Th.create(e,n,a,i)}static undirectionalRange(e,n){return Th.create(e,n,64,void 0)}static normalized(e,n=0){let i=e[n];e.sort((r,s)=>r.from-s.from),n=e.indexOf(i);for(let r=1;r<e.length;r++){let s=e[r],a=e[r-1];if(s.empty?s.from<=a.to:s.from<a.to){let l=a.from,u=Math.max(s.to,a.to);r<=n&&n--,e.splice(--r,2,s.anchor>s.head?Le.range(u,l):Le.range(l,u))}}return new Le(e,n)}}function fQ(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let GR=0;class bt{constructor(e,n,i,r,s){this.combine=e,this.compareInput=n,this.compare=i,this.isStatic=r,this.id=GR++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new bt(e.combine||(n=>n),e.compareInput||((n,i)=>n===i),e.compare||(e.combine?(n,i)=>n===i:XR),!!e.static,e.enables)}of(e){return new XA([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new XA(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new XA(e,this,2,n)}from(e,n){return n||(n=i=>i),this.compute([e],i=>n(i.field(e)))}}function XR(t,e){return t==e||t.length==e.length&&t.every((n,i)=>n===e[i])}class XA{constructor(e,n,i,r){this.dependencies=e,this.facet=n,this.type=i,this.value=r,this.id=GR++}dynamicSlot(e){var n;let i=this.value,r=this.facet.compareInput,s=this.id,a=e[s]>>1,l=this.type==2,u=!1,d=!1,f=[];for(let p of this.dependencies)p=="doc"?u=!0:p=="selection"?d=!0:(((n=e[p.id])!==null&&n!==void 0?n:1)&1)==0&&f.push(e[p.id]);return{create(p){return p.values[a]=i(p),1},update(p,m){if(u&&m.docChanged||d&&(m.docChanged||m.selection)||b2(p,f)){let v=i(p);if(l?!KL(v,p.values[a],r):!r(v,p.values[a]))return p.values[a]=v,1}return 0},reconfigure:(p,m)=>{let v,y=m.config.address[s];if(y!=null){let b=G1(m,y);if(this.dependencies.every(A=>A instanceof bt?m.facet(A)===p.facet(A):A instanceof Ss?m.field(A,!1)==p.field(A,!1):!0)||(l?KL(v=i(p),b,r):r(v=i(p),b)))return p.values[a]=b,0}else v=i(p);return p.values[a]=v,1}}}get extension(){return this}}function KL(t,e,n){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(!n(t[i],e[i]))return!1;return!0}function b2(t,e){let n=!1;for(let i of e)fv(t,i)&1&&(n=!0);return n}function Sme(t,e,n){let i=n.map(u=>t[u.id]),r=n.map(u=>u.type),s=i.filter(u=>!(u&1)),a=t[e.id]>>1;function l(u){let d=[];for(let f=0;f<i.length;f++){let p=G1(u,i[f]);if(r[f]==2)for(let m of p)d.push(m);else d.push(p)}return e.combine(d)}return{create(u){for(let d of i)fv(u,d);return u.values[a]=l(u),1},update(u,d){if(!b2(u,s))return 0;let f=l(u);return e.compare(f,u.values[a])?0:(u.values[a]=f,1)},reconfigure(u,d){let f=b2(u,i),p=d.config.facets[e.id],m=d.facet(e);if(p&&!f&&XR(n,p))return u.values[a]=m,0;let v=l(u);return e.compare(v,m)?(u.values[a]=m,0):(u.values[a]=v,1)}}}const Gb=bt.define({static:!0});class Ss{constructor(e,n,i,r,s){this.id=e,this.createF=n,this.updateF=i,this.compareF=r,this.spec=s,this.provides=void 0}static define(e){let n=new Ss(GR++,e.create,e.update,e.compare||((i,r)=>i===r),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(Gb).find(i=>i.field==this);return((n==null?void 0:n.create)||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:i=>(i.values[n]=this.create(i),1),update:(i,r)=>{let s=i.values[n],a=this.updateF(s,r);return this.compareF(s,a)?0:(i.values[n]=a,1)},reconfigure:(i,r)=>{let s=i.facet(Gb),a=r.facet(Gb),l;return(l=s.find(u=>u.field==this))&&l!=a.find(u=>u.field==this)?(i.values[n]=l.create(i),1):r.config.address[this.id]!=null?(i.values[n]=r.field(this),0):(i.values[n]=this.create(i),1)}}}init(e){return[this,Gb.of({field:this,create:e})]}get extension(){return this}}const tf={lowest:4,low:3,default:2,high:1,highest:0};function D0(t){return e=>new pQ(e,t)}const Mu={highest:D0(tf.highest),high:D0(tf.high),default:D0(tf.default),low:D0(tf.low),lowest:D0(tf.lowest)};class pQ{constructor(e,n){this.inner=e,this.prec=n}get extension(){return this}}class aj{of(e){return new A2(this,e)}reconfigure(e){return aj.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class A2{constructor(e,n){this.compartment=e,this.inner=n}get extension(){return this}}class V1{constructor(e,n,i,r,s,a){for(this.base=e,this.compartments=n,this.dynamicSlots=i,this.address=r,this.staticValues=s,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<i.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,i){let r=[],s=Object.create(null),a=new Map;for(let m of jme(e,n,a))m instanceof Ss?r.push(m):(s[m.facet.id]||(s[m.facet.id]=[])).push(m);let l=Object.create(null),u=[],d=[];for(let m of r)l[m.id]=d.length<<1,d.push(v=>m.slot(v));let f=i==null?void 0:i.config.facets;for(let m in s){let v=s[m],y=v[0].facet,b=f&&f[m]||[];if(v.every(A=>A.type==0))if(l[y.id]=u.length<<1|1,XR(b,v))u.push(i.facet(y));else{let A=y.combine(v.map(w=>w.value));u.push(i&&y.compare(A,i.facet(y))?i.facet(y):A)}else{for(let A of v)A.type==0?(l[A.id]=u.length<<1|1,u.push(A.value)):(l[A.id]=d.length<<1,d.push(w=>A.dynamicSlot(w)));l[y.id]=d.length<<1,d.push(A=>Sme(A,y,v))}}let p=d.map(m=>m(l));return new V1(e,a,p,l,u,s)}}function jme(t,e,n){let i=[[],[],[],[],[]],r=new Map;function s(a,l){let u=r.get(a);if(u!=null){if(u<=l)return;let d=i[u].indexOf(a);d>-1&&i[u].splice(d,1),a instanceof A2&&n.delete(a.compartment)}if(r.set(a,l),Array.isArray(a))for(let d of a)s(d,l);else if(a instanceof A2){if(n.has(a.compartment))throw new RangeError("Duplicate use of compartment in extensions");let d=e.get(a.compartment)||a.inner;n.set(a.compartment,d),s(d,l)}else if(a instanceof pQ)s(a.inner,a.prec);else if(a instanceof Ss)i[l].push(a),a.provides&&s(a.provides,l);else if(a instanceof XA)i[l].push(a),a.facet.extensions&&s(a.facet.extensions,tf.default);else{let d=a.extension;if(!d)throw new Error(`Unrecognized extension value in extension set (${a}).`);if(d==a)throw new Error(`Unrecognized extension value in extension set (${a}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(d,l)}}return s(t,tf.default),i.reduce((a,l)=>a.concat(l))}function fv(t,e){if(e&1)return 2;let n=e>>1,i=t.status[n];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;t.status[n]=4;let r=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|r}function G1(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const mQ=bt.define(),w2=bt.define({combine:t=>t.some(e=>e),static:!0}),gQ=bt.define({combine:t=>t.length?t[0]:void 0,static:!0}),vQ=bt.define(),yQ=bt.define(),xQ=bt.define(),bQ=bt.define({combine:t=>t.length?t[0]:!1});class Ac{constructor(e,n){this.type=e,this.value=n}static define(){return new Cme}}class Cme{of(e){return new Ac(this,e)}}class _me{constructor(e){this.map=e}of(e){return new Xt(this,e)}}class Xt{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 Xt(this.type,n)}is(e){return this.type==e}static define(e={}){return new _me(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let i=[];for(let r of e){let s=r.map(n);s&&i.push(s)}return i}}Xt.reconfigure=Xt.define();Xt.appendConfig=Xt.define();class Mr{constructor(e,n,i,r,s,a){this.startState=e,this.changes=n,this.selection=i,this.effects=r,this.annotations=s,this.scrollIntoView=a,this._doc=null,this._state=null,i&&fQ(i,n.newLength),s.some(l=>l.type==Mr.time)||(this.annotations=s.concat(Mr.time.of(Date.now())))}static create(e,n,i,r,s,a){return new Mr(e,n,i,r,s,a)}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(Mr.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}Mr.time=Ac.define();Mr.userEvent=Ac.define();Mr.addToHistory=Ac.define();Mr.remote=Ac.define();function kme(t,e){let n=[];for(let i=0,r=0;;){let s,a;if(i<t.length&&(r==e.length||e[r]>=t[i]))s=t[i++],a=t[i++];else if(r<e.length)s=e[r++],a=e[r++];else return n;!n.length||n[n.length-1]<s?n.push(s,a):n[n.length-1]<a&&(n[n.length-1]=a)}}function AQ(t,e,n){var i;let r,s,a;return n?(r=e.changes,s=Br.empty(e.changes.length),a=t.changes.compose(e.changes)):(r=e.changes.map(t.changes),s=t.changes.mapDesc(e.changes,!0),a=t.changes.compose(r)),{changes:a,selection:e.selection?e.selection.map(s):(i=t.selection)===null||i===void 0?void 0:i.map(r),effects:Xt.mapEffects(t.effects,r).concat(Xt.mapEffects(e.effects,s)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function S2(t,e,n){let i=e.selection,r=um(e.annotations);return e.userEvent&&(r=r.concat(Mr.userEvent.of(e.userEvent))),{changes:e.changes instanceof Br?e.changes:Br.of(e.changes||[],n,t.facet(gQ)),selection:i&&(i instanceof Le?i:Le.single(i.anchor,i.head)),effects:um(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}function wQ(t,e,n){let i=S2(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 a=!!e[s].sequential;i=AQ(i,S2(t,e[s],a?i.changes.newLength:t.doc.length),a)}let r=Mr.create(t,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return Ome(n?Tme(r):r)}function Tme(t){let e=t.startState,n=!0;for(let r of e.facet(vQ)){let s=r(t);if(s===!1){n=!1;break}Array.isArray(s)&&(n=n===!0?s:kme(n,s))}if(n!==!0){let r,s;if(n===!1)s=t.changes.invertedDesc,r=Br.empty(e.doc.length);else{let a=t.changes.filter(n);r=a.changes,s=a.filtered.mapDesc(a.changes).invertedDesc}t=Mr.create(e,r,t.selection&&t.selection.map(s),Xt.mapEffects(t.effects,s),t.annotations,t.scrollIntoView)}let i=e.facet(yQ);for(let r=i.length-1;r>=0;r--){let s=i[r](t);s instanceof Mr?t=s:Array.isArray(s)&&s.length==1&&s[0]instanceof Mr?t=s[0]:t=wQ(e,um(s),!1)}return t}function Ome(t){let e=t.startState,n=e.facet(xQ),i=t;for(let r=n.length-1;r>=0;r--){let s=n[r](t);s&&Object.keys(s).length&&(i=AQ(i,S2(e,s,t.changes.newLength),!0))}return i==t?t:Mr.create(e,t.changes,t.selection,i.effects,i.annotations,i.scrollIntoView)}const Eme=[];function um(t){return t==null?Eme:Array.isArray(t)?t:[t]}var qi=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(qi||(qi={}));const Mme=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let j2;try{j2=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Rme(t){if(j2)return j2.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||Mme.test(n)))return!0}return!1}function Dme(t){return e=>{if(!/\S/.test(e))return qi.Space;if(Rme(e))return qi.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return qi.Word;return qi.Other}}class kn{constructor(e,n,i,r,s,a){this.config=e,this.doc=n,this.selection=i,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,a&&(a._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)fv(this,l<<1);this.computeSlot=null}field(e,n=!0){let i=this.config.address[e.id];if(i==null){if(n)throw new RangeError("Field is not present in this state");return}return fv(this,i),G1(this,i)}update(...e){return wQ(this,e,!0)}applyTransaction(e){let n=this.config,{base:i,compartments:r}=n;for(let l of e.effects)l.is(aj.reconfigure)?(n&&(r=new Map,n.compartments.forEach((u,d)=>r.set(d,u)),n=null),r.set(l.value.compartment,l.value.extension)):l.is(Xt.reconfigure)?(n=null,i=l.value):l.is(Xt.appendConfig)&&(n=null,i=um(i).concat(l.value));let s;n?s=e.startState.values.slice():(n=V1.resolve(i,r,this),s=new kn(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(u,d)=>d.reconfigure(u,this),null).values);let a=e.startState.facet(w2)?e.newSelection:e.newSelection.asSingle();new kn(n,e.newDoc,a,s,(l,u)=>u.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:Le.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,i=e(n.ranges[0]),r=this.changes(i.changes),s=[i.range],a=um(i.effects);for(let l=1;l<n.ranges.length;l++){let u=e(n.ranges[l]),d=this.changes(u.changes),f=d.map(r);for(let m=0;m<l;m++)s[m]=s[m].map(f);let p=r.mapDesc(d,!0);s.push(u.range.map(p)),r=r.compose(f),a=Xt.mapEffects(a,f).concat(Xt.mapEffects(um(u.effects),p))}return{changes:r,selection:Le.create(s,n.mainIndex),effects:a}}changes(e=[]){return e instanceof Br?e:Br.of(e,this.doc.length,this.facet(kn.lineSeparator))}toText(e){return zn.of(e.split(this.facet(kn.lineSeparator)||v2))}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:(fv(this,n),G1(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let r=e[i];r instanceof Ss&&this.config.address[r.id]!=null&&(n[i]=r.spec.toJSON(this.field(e[i]),this))}return n}static fromJSON(e,n={},i){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(i){for(let s in i)if(Object.prototype.hasOwnProperty.call(e,s)){let a=i[s],l=e[s];r.push(a.init(u=>a.spec.fromJSON(l,u)))}}return kn.create({doc:e.doc,selection:Le.fromJSON(e.selection),extensions:n.extensions?r.concat([n.extensions]):r})}static create(e={}){let n=V1.resolve(e.extensions||[],new Map),i=e.doc instanceof zn?e.doc:zn.of((e.doc||"").split(n.staticFacet(kn.lineSeparator)||v2)),r=e.selection?e.selection instanceof Le?e.selection:Le.single(e.selection.anchor,e.selection.head):Le.single(0);return fQ(r,i.length),n.staticFacet(w2)||(r=r.asSingle()),new kn(n,i,r,n.dynamicSlots.map(()=>null),(s,a)=>a.create(s),null)}get tabSize(){return this.facet(kn.tabSize)}get lineBreak(){return this.facet(kn.lineSeparator)||`
`}get readOnly(){return this.facet(bQ)}phrase(e,...n){for(let i of this.facet(kn.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(i,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>n.length?i:n[s-1]})),e}languageDataAt(e,n,i=-1){let r=[];for(let s of this.facet(mQ))for(let a of s(this,n,i))Object.prototype.hasOwnProperty.call(a,e)&&r.push(a[e]);return r}charCategorizer(e){let n=this.languageDataAt("wordChars",e);return Dme(n.length?n[0]:"")}wordAt(e){let{text:n,from:i,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),a=e-i,l=e-i;for(;a>0;){let u=is(n,a,!1);if(s(n.slice(u,a))!=qi.Word)break;a=u}for(;l<r;){let u=is(n,l);if(s(n.slice(l,u))!=qi.Word)break;l=u}return a==l?null:Le.range(a+i,l+i)}}kn.allowMultipleSelections=w2;kn.tabSize=bt.define({combine:t=>t.length?t[0]:4});kn.lineSeparator=gQ;kn.readOnly=bQ;kn.phrases=bt.define({compare(t,e){let n=Object.keys(t),i=Object.keys(e);return n.length==i.length&&n.every(r=>t[r]==e[r])}});kn.languageData=mQ;kn.changeFilter=vQ;kn.transactionFilter=yQ;kn.transactionExtender=xQ;aj.reconfigure=Xt.define();function wc(t,e,n={}){let i={};for(let r of t)for(let s of Object.keys(r)){let a=r[s],l=i[s];if(l===void 0)i[s]=a;else if(!(l===a||a===void 0))if(Object.hasOwnProperty.call(n,s))i[s]=n[s](l,a);else throw new Error("Config merge conflict for field "+s)}for(let r in e)i[r]===void 0&&(i[r]=e[r]);return i}class rd{eq(e){return this==e}range(e,n=e){return Uv.create(e,n,this)}}rd.prototype.startSide=rd.prototype.endSide=0;rd.prototype.point=!1;rd.prototype.mapMode=As.TrackDel;function KR(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}class Uv{constructor(e,n,i){this.from=e,this.to=n,this.value=i}static create(e,n,i){return new Uv(e,n,i)}}function C2(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class ZR{constructor(e,n,i,r){this.from=e,this.to=n,this.value=i,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,n,i,r=0){let s=i?this.to:this.from;for(let a=r,l=s.length;;){if(a==l)return a;let u=a+l>>1,d=s[u]-e||(i?this.value[u].endSide:this.value[u].startSide)-n;if(u==a)return d>=0?a:l;d>=0?l=u:a=u+1}}between(e,n,i,r){for(let s=this.findIndex(n,-1e9,!0),a=this.findIndex(i,1e9,!1,s);s<a;s++)if(r(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,n){let i=[],r=[],s=[],a=-1,l=-1;for(let u=0;u<this.value.length;u++){let d=this.value[u],f=this.from[u]+e,p=this.to[u]+e,m,v;if(f==p){let y=n.mapPos(f,d.startSide,d.mapMode);if(y==null||(m=v=y,d.startSide!=d.endSide&&(v=n.mapPos(f,d.endSide),v<m)))continue}else if(m=n.mapPos(f,d.startSide),v=n.mapPos(p,d.endSide),m>v||m==v&&d.startSide>0&&d.endSide<=0)continue;(v-m||d.endSide-d.startSide)<0||(a<0&&(a=m),d.point&&(l=Math.max(l,v-m)),i.push(d),r.push(m-a),s.push(v-a))}return{mapped:i.length?new ZR(r,s,i,l):null,pos:a}}}class Sn{constructor(e,n,i,r){this.chunkPos=e,this.chunk=n,this.nextLayer=i,this.maxPoint=r}static create(e,n,i,r){return new Sn(e,n,i,r)}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:i=!1,filterFrom:r=0,filterTo:s=this.length}=e,a=e.filter;if(n.length==0&&!a)return this;if(i&&(n=n.slice().sort(C2)),this.isEmpty)return n.length?Sn.of(n):this;let l=new SQ(this,null,-1).goto(0),u=0,d=[],f=new yu;for(;l.value||u<n.length;)if(u<n.length&&(l.from-n[u].from||l.startSide-n[u].value.startSide)>=0){let p=n[u++];f.addInner(p.from,p.to,p.value)||d.push(p)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(u==n.length||this.chunkEnd(l.chunkIndex)<n[u].from)&&(!a||r>this.chunkEnd(l.chunkIndex)||s<this.chunkPos[l.chunkIndex])&&f.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!a||r>l.to||s<l.from||a(l.from,l.to,l.value))&&(f.addInner(l.from,l.to,l.value)||d.push(Uv.create(l.from,l.to,l.value))),l.next());return f.finishInner(this.nextLayer.isEmpty&&!d.length?Sn.empty:this.nextLayer.update({add:d,filter:a,filterFrom:r,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],i=[],r=-1;for(let a=0;a<this.chunk.length;a++){let l=this.chunkPos[a],u=this.chunk[a],d=e.touchesRange(l,l+u.length);if(d===!1)r=Math.max(r,u.maxPoint),n.push(u),i.push(e.mapPos(l));else if(d===!0){let{mapped:f,pos:p}=u.map(l,e);f&&(r=Math.max(r,f.maxPoint),n.push(f),i.push(p))}}let s=this.nextLayer.map(e);return n.length==0?s:new Sn(i,n,s||Sn.empty,r)}between(e,n,i){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let s=this.chunkPos[r],a=this.chunk[r];if(n>=s&&e<=s+a.length&&a.between(s,e-s,n-s,i)===!1)return}this.nextLayer.between(e,n,i)}}iter(e=0){return Vv.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return Vv.from(e).goto(n)}static compare(e,n,i,r,s=-1){let a=e.filter(p=>p.maxPoint>0||!p.isEmpty&&p.maxPoint>=s),l=n.filter(p=>p.maxPoint>0||!p.isEmpty&&p.maxPoint>=s),u=ZL(a,l,i),d=new N0(a,u,s),f=new N0(l,u,s);i.iterGaps((p,m,v)=>JL(d,p,f,m,v,r)),i.empty&&i.length==0&&JL(d,0,f,0,0,r)}static eq(e,n,i=0,r){r==null&&(r=999999999);let s=e.filter(f=>!f.isEmpty&&n.indexOf(f)<0),a=n.filter(f=>!f.isEmpty&&e.indexOf(f)<0);if(s.length!=a.length)return!1;if(!s.length)return!0;let l=ZL(s,a),u=new N0(s,l,0).goto(i),d=new N0(a,l,0).goto(i);for(;;){if(u.to!=d.to||!_2(u.active,d.active)||u.point&&(!d.point||!KR(u.point,d.point)))return!1;if(u.to>r)return!0;u.next(),d.next()}}static spans(e,n,i,r,s=-1){let a=new N0(e,null,s).goto(n),l=n,u=a.openStart;for(;;){let d=Math.min(a.to,i);if(a.point){let f=a.activeForPoint(a.to),p=a.pointFrom<n?f.length+1:a.point.startSide<0?f.length:Math.min(f.length,u);r.point(l,d,a.point,f,p,a.pointRank),u=Math.min(a.openEnd(d),f.length)}else d>l&&(r.span(l,d,a.active,u),u=a.openEnd(d));if(a.to>i)return u+(a.point&&a.to>i?1:0);l=a.to,a.next()}}static of(e,n=!1){let i=new yu;for(let r of e instanceof Uv?[e]:n?Nme(e):e)i.add(r.from,r.to,r.value);return i.finish()}static join(e){if(!e.length)return Sn.empty;let n=e[e.length-1];for(let i=e.length-2;i>=0;i--)for(let r=e[i];r!=Sn.empty;r=r.nextLayer)n=new Sn(r.chunkPos,r.chunk,n,Math.max(r.maxPoint,n.maxPoint));return n}}Sn.empty=new Sn([],[],null,-1);function Nme(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let i=t[n];if(C2(e,i)>0)return t.slice().sort(C2);e=i}return t}Sn.empty.nextLayer=Sn.empty;class yu{finishChunk(e){this.chunks.push(new ZR(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,i){this.addInner(e,n,i)||(this.nextLayer||(this.nextLayer=new yu)).add(e,n,i)}addInner(e,n,i){let r=e-this.lastTo||i.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<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=i,this.lastFrom=e,this.lastTo=n,this.value.push(i),i.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 i=n.value.length-1;return this.last=n.value[i],this.lastFrom=n.from[i]+e,this.lastTo=n.to[i]+e,!0}finish(){return this.finishInner(Sn.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=Sn.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function ZL(t,e,n){let i=new Map;for(let s of t)for(let a=0;a<s.chunk.length;a++)s.chunk[a].maxPoint<=0&&i.set(s.chunk[a],s.chunkPos[a]);let r=new Set;for(let s of e)for(let a=0;a<s.chunk.length;a++){let l=i.get(s.chunk[a]);l!=null&&(n?n.mapPos(l):l)==s.chunkPos[a]&&!(n!=null&&n.touchesRange(l,l+s.chunk[a].length))&&r.add(s.chunk[a])}return r}class SQ{constructor(e,n,i,r=0){this.layer=e,this.skip=n,this.minPoint=i,this.rank=r}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,i){for(;this.chunkIndex<this.layer.chunk.length;){let r=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(r)||this.layer.chunkEnd(this.chunkIndex)<e||r.maxPoint<this.minPoint))break;this.chunkIndex++,i=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!i||this.rangeIndex<r)&&this.setRangeIndex(r)}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],i=e+n.from[this.rangeIndex];if(this.from=i,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 Vv{constructor(e){this.heap=e}static from(e,n=null,i=-1){let r=[];for(let s=0;s<e.length;s++)for(let a=e[s];!a.isEmpty;a=a.nextLayer)a.maxPoint>=i&&r.push(new SQ(a,n,i,s));return r.length==1?r[0]:new Vv(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let i of this.heap)i.goto(e,n);for(let i=this.heap.length>>1;i>=0;i--)Pk(this.heap,i);return this.next(),this}forward(e,n){for(let i of this.heap)i.forward(e,n);for(let i=this.heap.length>>1;i>=0;i--)Pk(this.heap,i);(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(),Pk(this.heap,0)}}}function Pk(t,e){for(let n=t[e];;){let i=(e<<1)+1;if(i>=t.length)break;let r=t[i];if(i+1<t.length&&r.compare(t[i+1])>=0&&(r=t[i+1],i++),n.compare(r)<0)break;t[i]=n,t[e]=r,e=i}}class N0{constructor(e,n,i){this.minPoint=i,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=Vv.from(e,n,i)}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){Xb(this.active,e),Xb(this.activeTo,e),Xb(this.activeRank,e),this.minActive=eP(this.active,this.activeTo)}addActive(e){let n=0,{value:i,to:r,rank:s}=this.cursor;for(;n<this.activeRank.length&&(s-this.activeRank[n]||r-this.activeTo[n])>0;)n++;Kb(this.active,n,i),Kb(this.activeTo,n,r),Kb(this.activeRank,n,s),e&&Kb(e,n,this.cursor.from),this.minActive=eP(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&Xb(i,r)}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(i),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(i){this.openStart=0;for(let r=i.length-1;r>=0&&i[r]<e;r--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let n=[];for(let i=this.active.length-1;i>=0&&!(this.activeRank[i]<this.pointRank);i--)(this.activeTo[i]>e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&n.push(this.active[i]);return n.reverse()}openEnd(e){let n=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)n++;return n}}function JL(t,e,n,i,r,s){t.goto(e),n.goto(i);let a=i+r,l=i,u=i-e,d=!!s.boundChange;for(let f=!1;;){let p=t.to+u-n.to,m=p||t.endSide-n.endSide,v=m<0?t.to+u:n.to,y=Math.min(v,a);if(t.point||n.point?(t.point&&n.point&&KR(t.point,n.point)&&_2(t.activeForPoint(t.to),n.activeForPoint(n.to))||s.comparePoint(l,y,t.point,n.point),f=!1):(f&&s.boundChange(l),y>l&&!_2(t.active,n.active)&&s.compareRange(l,y,t.active,n.active),d&&y<a&&(p||t.openEnd(v)!=n.openEnd(v))&&(f=!0)),v>a)break;l=v,m<=0&&t.next(),m>=0&&n.next()}}function _2(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!KR(t[n],e[n]))return!1;return!0}function Xb(t,e){for(let n=e,i=t.length-1;n<i;n++)t[n]=t[n+1];t.pop()}function Kb(t,e,n){for(let i=t.length-1;i>=e;i--)t[i+1]=t[i];t[e]=n}function eP(t,e){let n=-1,i=1e9;for(let r=0;r<e.length;r++)(e[r]-i||t[r].endSide-t[n].endSide)<0&&(n=r,i=e[r]);return n}function kg(t,e,n=t.length){let i=0;for(let r=0;r<n&&r<t.length;)t.charCodeAt(r)==9?(i+=e-i%e,r++):(i++,r=is(t,r));return i}function k2(t,e,n,i){for(let r=0,s=0;;){if(s>=e)return r;if(r==t.length)break;s+=t.charCodeAt(r)==9?n-s%n:1,r=is(t,r)}return i===!0?-1:t.length}const T2="ͼ",tP=typeof Symbol>"u"?"__"+T2:Symbol.for(T2),O2=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),nP=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class sd{constructor(e,n){this.rules=[];let{finish:i}=n||{};function r(a){return/^@/.test(a)?[a]:a.split(/,\s*/)}function s(a,l,u,d){let f=[],p=/^@(\w+)\b/.exec(a[0]),m=p&&p[1]=="keyframes";if(p&&l==null)return u.push(a[0]+";");for(let v in l){let y=l[v];if(/&/.test(v))s(v.split(/,\s*/).map(b=>a.map(A=>b.replace(/&/,A))).reduce((b,A)=>b.concat(A)),y,u);else if(y&&typeof y=="object"){if(!p)throw new RangeError("The value of a property ("+v+") should be a primitive value.");s(r(v),y,f,m)}else y!=null&&f.push(v.replace(/_.*/,"").replace(/[A-Z]/g,b=>"-"+b.toLowerCase())+": "+y+";")}(f.length||m)&&u.push((i&&!p&&!d?a.map(i):a).join(", ")+" {"+f.join(" ")+"}")}for(let a in e)s(r(a),e[a],this.rules)}getRules(){return this.rules.join(`
`)}static newName(){let e=nP[tP]||1;return nP[tP]=e+1,T2+e.toString(36)}static mount(e,n,i){let r=e[O2],s=i&&i.nonce;r?s&&r.setNonce(s):r=new Ime(e,s),r.mount(Array.isArray(n)?n:[n],e)}}let iP=new Map;class Ime{constructor(e,n){let i=e.ownerDocument||e,r=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let s=iP.get(i);if(s)return e[O2]=s;this.sheet=new r.CSSStyleSheet,iP.set(i,this)}else this.styleTag=i.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[O2]=this}mount(e,n){let i=this.sheet,r=0,s=0;for(let a=0;a<e.length;a++){let l=e[a],u=this.modules.indexOf(l);if(u<s&&u>-1&&(this.modules.splice(u,1),s--,u=-1),u==-1){if(this.modules.splice(s++,0,l),i)for(let d=0;d<l.rules.length;d++)i.insertRule(l.rules[d],r++)}else{for(;s<u;)r+=this.modules[s++].rules.length;r+=l.rules.length,s++}}if(i)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let a="";for(let u=0;u<this.modules.length;u++)a+=this.modules[u].getRules()+`
`;this.styleTag.textContent=a;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 od={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:"'"},Gv={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Bme=typeof navigator<"u"&&/Mac/.test(navigator.platform),Lme=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var xs=0;xs<10;xs++)od[48+xs]=od[96+xs]=String(xs);for(var xs=1;xs<=24;xs++)od[xs+111]="F"+xs;for(var xs=65;xs<=90;xs++)od[xs]=String.fromCharCode(xs+32),Gv[xs]=String.fromCharCode(xs);for(var Fk in od)Gv.hasOwnProperty(Fk)||(Gv[Fk]=od[Fk]);function Pme(t){var e=Bme&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Lme&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Gv:od)[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 fi(){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 i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var r=n[i];typeof r=="string"?t.setAttribute(i,r):r!=null&&(t[i]=r)}e++}for(;e<arguments.length;e++)jQ(t,arguments[e]);return t}function jQ(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++)jQ(t,e[n]);else throw new RangeError("Unsupported child node: "+e)}let Gs=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},E2=typeof document<"u"?document:{documentElement:{style:{}}};const M2=/Edge\/(\d+)/.exec(Gs.userAgent),CQ=/MSIE \d/.test(Gs.userAgent),R2=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Gs.userAgent),lj=!!(CQ||R2||M2),rP=!lj&&/gecko\/(\d+)/i.test(Gs.userAgent),$k=!lj&&/Chrome\/(\d+)/.exec(Gs.userAgent),sP="webkitFontSmoothing"in E2.documentElement.style,D2=!lj&&/Apple Computer/.test(Gs.vendor),oP=D2&&(/Mobile\/\w+/.test(Gs.userAgent)||Gs.maxTouchPoints>2);var xt={mac:oP||/Mac/.test(Gs.platform),windows:/Win/.test(Gs.platform),linux:/Linux|X11/.test(Gs.platform),ie:lj,ie_version:CQ?E2.documentMode||6:R2?+R2[1]:M2?+M2[1]:0,gecko:rP,gecko_version:rP?+(/Firefox\/(\d+)/.exec(Gs.userAgent)||[0,0])[1]:0,chrome:!!$k,chrome_version:$k?+$k[1]:0,ios:oP,android:/Android\b/.test(Gs.userAgent),webkit:sP,webkit_version:sP?+(/\bAppleWebKit\/(\d+)/.exec(Gs.userAgent)||[0,0])[1]:0,safari:D2,safari_version:D2?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Gs.userAgent)||[0,0])[1]:0,tabSize:E2.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function JR(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 X1=Object.create(null);function eD(t,e,n){if(t==e)return!0;t||(t=X1),e||(e=X1);let i=Object.keys(t),r=Object.keys(e);if(i.length-0!=r.length-0)return!1;for(let s of i)if(s!=n&&(r.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 i=t.attributes[n].name;e[i]==null&&t.removeAttribute(i)}for(let n in e){let i=e[n];n=="style"?t.style.cssText=i:t.getAttribute(n)!=i&&t.setAttribute(n,i)}}function aP(t,e,n){let i=!1;if(e)for(let r in e)n&&r in n||(i=!0,r=="style"?t.style.cssText="":t.removeAttribute(r));if(n)for(let r in n)e&&e[r]==n[r]||(i=!0,r=="style"?t.style.cssText=n[r]:t.setAttribute(r,n[r]));return i}function $me(t){let e=Object.create(null);for(let n=0;n<t.attributes.length;n++){let i=t.attributes[n];e[i.name]=i.value}return e}class Cl{eq(e){return!1}updateDOM(e,n,i){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,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var ws=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(ws||(ws={}));class Bt extends rd{constructor(e,n,i,r){super(),this.startSide=e,this.endSide=n,this.widget=i,this.spec=r}get heightRelevant(){return!1}static mark(e){return new tx(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),i=!!e.block;return n+=i&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new Pf(e,n,n,i,e.widget||null,!1)}static replace(e){let n=!!e.block,i,r;if(e.isBlockGap)i=-5e8,r=4e8;else{let{start:s,end:a}=_Q(e,n);i=(s?n?-3e8:-1:5e8)-1,r=(a?n?2e8:1:-6e8)+1}return new Pf(e,i,r,n,e.widget||null,!0)}static line(e){return new nx(e)}static set(e,n=!1){return Sn.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Bt.none=Sn.empty;class tx extends Bt{constructor(e){let{start:n,end:i}=_Q(e);super(n?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?JR(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||X1}eq(e){return this==e||e instanceof tx&&this.tagName==e.tagName&&eD(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)}}tx.prototype.point=!1;class nx extends Bt{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof nx&&this.spec.class==e.spec.class&&eD(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)}}nx.prototype.mapMode=As.TrackBefore;nx.prototype.point=!0;class Pf extends Bt{constructor(e,n,i,r,s,a){super(n,i,s,e),this.block=r,this.isReplace=a,this.mapMode=r?n<=0?As.TrackBefore:As.TrackAfter:As.TrackDel}get type(){return this.startSide!=this.endSide?ws.WidgetRange:this.startSide<=0?ws.WidgetBefore:ws.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Pf&&zme(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)}}Pf.prototype.point=!0;function _Q(t,e=!1){let{inclusiveStart:n,inclusiveEnd:i}=t;return n==null&&(n=t.inclusive),i==null&&(i=t.inclusive),{start:n??e,end:i??e}}function zme(t,e){return t==e||!!(t&&e&&t.compare(e))}function hm(t,e,n,i=0){let r=n.length-1;r>=0&&n[r]+i>=t?n[r]=Math.max(n[r],e):n.push(t,e)}class Xv extends rd{constructor(e,n,i){super(),this.tagName=e,this.attributes=n,this.rank=i}eq(e){return e==this||e instanceof Xv&&this.tagName==e.tagName&&eD(this.attributes,e.attributes)}static create(e){return new Xv(e.tagName,e.attributes||X1,e.rank==null?50:Math.max(0,Math.min(e.rank,100)))}static set(e,n=!1){return Sn.of(e,n)}}Xv.prototype.startSide=Xv.prototype.endSide=-1;function Kv(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function N2(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function pv(t,e){if(!e.anchorNode)return!1;try{return N2(t,e.anchorNode)}catch{return!1}}function mv(t){return t.nodeType==3?Jv(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function gv(t,e,n,i){return n?lP(t,e,n,i,-1)||lP(t,e,n,i,1):!1}function ad(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function K1(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function lP(t,e,n,i,r){for(;;){if(t==n&&e==i)return!0;if(e==(r<0?0:xu(t))){if(t.nodeName=="DIV")return!1;let s=t.parentNode;if(!s||s.nodeType!=1)return!1;e=ad(t)+(r<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(r<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=r<0?xu(t):0}else return!1}}function xu(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Zv(t,e){let{left:n,right:i}=t;if(n==i)return t;let r=e?n:i;return{left:r,right:r,top:t.top,bottom:t.bottom}}function Hme(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 kQ(t,e){let n=e.width/t.offsetWidth,i=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-t.offsetHeight)<1)&&(i=1),{scaleX:n,scaleY:i}}function qme(t,e,n,i,r,s,a,l){let u=t.ownerDocument,d=u.defaultView||window;for(let f=t,p=!1;f&&!p;)if(f.nodeType==1){let m,v=f==u.body,y=1,b=1;if(v)m=Hme(d);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 S=f.getBoundingClientRect();({scaleX:y,scaleY:b}=kQ(f,S)),m={left:S.left,right:S.left+f.clientWidth*y,top:S.top,bottom:S.top+f.clientHeight*b}}let A=0,w=0;if(r=="nearest")e.top<m.top+a?(w=e.top-(m.top+a),n>0&&e.bottom>m.bottom+w&&(w=e.bottom-m.bottom+a)):e.bottom>m.bottom-a&&(w=e.bottom-m.bottom+a,n<0&&e.top-w<m.top&&(w=e.top-(m.top+a)));else{let S=e.bottom-e.top,j=m.bottom-m.top;w=(r=="center"&&S<=j?e.top+S/2-j/2:r=="start"||r=="center"&&n<0?e.top-a:e.bottom-j+a)-m.top}if(i=="nearest"?e.left<m.left+s?(A=e.left-(m.left+s),n>0&&e.right>m.right+A&&(A=e.right-m.right+s)):e.right>m.right-s&&(A=e.right-m.right+s,n<0&&e.left<m.left+A&&(A=e.left-(m.left+s))):A=(i=="center"?e.left+(e.right-e.left)/2-(m.right-m.left)/2:i=="start"==l?e.left-s:e.right-(m.right-m.left)+s)-m.left,A||w)if(v)d.scrollBy(A,w);else{let S=0,j=0;if(w){let C=f.scrollTop;f.scrollTop+=w/b,j=(f.scrollTop-C)*b}if(A){let C=f.scrollLeft;f.scrollLeft+=A/y,S=(f.scrollLeft-C)*y}e={left:e.left-S,top:e.top-j,right:e.right-S,bottom:e.bottom-j},S&&Math.abs(S-A)<1&&(i="nearest"),j&&Math.abs(j-w)<1&&(r="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 TQ(t,e=!0){let n=t.ownerDocument,i=null,r=null;for(let s=t.parentNode;s&&!(s==n.body||(!e||i)&&r);)if(s.nodeType==1)!r&&s.scrollHeight>s.clientHeight&&(r=s),e&&!i&&s.scrollWidth>s.clientWidth&&(i=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:i,y:r}}class Qme{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:i}=e;this.set(n,Math.min(e.anchorOffset,n?xu(n):0),i,Math.min(e.focusOffset,i?xu(i):0))}set(e,n,i,r){this.anchorNode=e,this.anchorOffset=n,this.focusNode=i,this.focusOffset=r}}let Ud=null;xt.safari&&xt.safari_version>=26&&(Ud=!1);function OQ(t){if(t.setActive)return t.setActive();if(Ud)return t.focus(Ud);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(Ud==null?{get preventScroll(){return Ud={preventScroll:!0},!0}}:void 0),!Ud){Ud=!1;for(let n=0;n<e.length;){let i=e[n++],r=e[n++],s=e[n++];i.scrollTop!=r&&(i.scrollTop=r),i.scrollLeft!=s&&(i.scrollLeft=s)}}}let cP;function Jv(t,e,n=e){let i=cP||(cP=document.createRange());return i.setEnd(t,n),i.setStart(t,e),i}function dm(t,e,n,i){let r={key:e,code:e,keyCode:n,which:n,cancelable:!0};i&&({altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,metaKey:r.metaKey}=i);let s=new KeyboardEvent("keydown",r);s.synthetic=!0,t.dispatchEvent(s);let a=new KeyboardEvent("keyup",r);return a.synthetic=!0,t.dispatchEvent(a),s.defaultPrevented||a.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 Wme(t,e){let n=e.focusNode,i=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=i)return!1;for(i=Math.min(i,xu(n));;)if(i){if(n.nodeType!=1)return!1;let r=n.childNodes[i-1];r.contentEditable=="false"?i--:(n=r,i=xu(n))}else{if(n==t)return!0;i=ad(n),n=n.parentNode}}function EQ(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 MQ(t,e){for(let n=t,i=e;;){if(n.nodeType==3&&i>0)return{node:n,offset:i};if(n.nodeType==1&&i>0){if(n.contentEditable=="false")return null;n=n.childNodes[i-1],i=xu(n)}else if(n.parentNode&&!K1(n))i=ad(n),n=n.parentNode;else return null}}function RQ(t,e){for(let n=t,i=e;;){if(n.nodeType==3&&i<n.nodeValue.length)return{node:n,offset:i};if(n.nodeType==1&&i<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[i],i=0}else if(n.parentNode&&!K1(n))i=ad(n)+1,n=n.parentNode;else return null}}class hl{constructor(e,n,i=!0){this.node=e,this.offset=n,this.precise=i}static before(e,n){return new hl(e.parentNode,ad(e),n)}static after(e,n){return new hl(e.parentNode,ad(e)+1,n)}}var Si=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(Si||(Si={}));const Ff=Si.LTR,tD=Si.RTL;function DQ(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const Ume=DQ("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),Vme=DQ("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),I2=Object.create(null),$l=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);I2[e]=n,I2[n]=-e}function NQ(t){return t<=247?Ume[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?Vme[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const Gme=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class nc{get dir(){return this.level%2?tD:Ff}constructor(e,n,i){this.from=e,this.to=n,this.level=i}side(e,n){return this.dir==n==e?this.to:this.from}forward(e,n){return e==(this.dir==n)}static find(e,n,i,r){let s=-1;for(let a=0;a<e.length;a++){let l=e[a];if(l.from<=n&&l.to>=n){if(l.level==i)return a;(s<0||(r!=0?r<0?l.from<n:l.to>n:e[s].level>l.level))&&(s=a)}}if(s<0)throw new RangeError("Index out of range");return s}}function IQ(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let i=t[n],r=e[n];if(i.from!=r.from||i.to!=r.to||i.direction!=r.direction||!IQ(i.inner,r.inner))return!1}return!0}const yi=[];function Xme(t,e,n,i,r){for(let s=0;s<=i.length;s++){let a=s?i[s-1].to:e,l=s<i.length?i[s].from:n,u=s?256:r;for(let d=a,f=u,p=u;d<l;d++){let m=NQ(t.charCodeAt(d));m==512?m=f:m==8&&p==4&&(m=16),yi[d]=m==4?2:m,m&7&&(p=m),f=m}for(let d=a,f=u,p=u;d<l;d++){let m=yi[d];if(m==128)d<l-1&&f==yi[d+1]&&f&24?m=yi[d]=f:yi[d]=256;else if(m==64){let v=d+1;for(;v<l&&yi[v]==64;)v++;let y=d&&f==8||v<n&&yi[v]==8?p==1?1:8:256;for(let b=d;b<v;b++)yi[b]=y;d=v-1}else m==8&&p==1&&(yi[d]=1);f=m,m&7&&(p=m)}}}function Kme(t,e,n,i,r){let s=r==1?2:1;for(let a=0,l=0,u=0;a<=i.length;a++){let d=a?i[a-1].to:e,f=a<i.length?i[a].from:n;for(let p=d,m,v,y;p<f;p++)if(v=I2[m=t.charCodeAt(p)])if(v<0){for(let b=l-3;b>=0;b-=3)if($l[b+1]==-v){let A=$l[b+2],w=A&2?r:A&4?A&1?s:r:0;w&&(yi[p]=yi[$l[b]]=w),l=b;break}}else{if($l.length==189)break;$l[l++]=p,$l[l++]=m,$l[l++]=u}else if((y=yi[p])==2||y==1){let b=y==r;u=b?0:1;for(let A=l-3;A>=0;A-=3){let w=$l[A+2];if(w&2)break;if(b)$l[A+2]|=2;else{if(w&4)break;$l[A+2]|=4}}}}}function Zme(t,e,n,i){for(let r=0,s=i;r<=n.length;r++){let a=r?n[r-1].to:t,l=r<n.length?n[r].from:e;for(let u=a;u<l;){let d=yi[u];if(d==256){let f=u+1;for(;;)if(f==l){if(r==n.length)break;f=n[r++].to,l=r<n.length?n[r].from:e}else if(yi[f]==256)f++;else break;let p=s==1,m=(f<e?yi[f]:i)==1,v=p==m?p?1:2:i;for(let y=f,b=r,A=b?n[b-1].to:t;y>u;)y==A&&(y=n[--b].from,A=b?n[b-1].to:t),yi[--y]=v;u=f}else s=d,u++}}}function B2(t,e,n,i,r,s,a){let l=i%2?2:1;if(i%2==r%2)for(let u=e,d=0;u<n;){let f=!0,p=!1;if(d==s.length||u<s[d].from){let b=yi[u];b!=l&&(f=!1,p=b==16)}let m=!f&&l==1?[]:null,v=f?i:i+1,y=u;e:for(;;)if(d<s.length&&y==s[d].from){if(p)break e;let b=s[d];if(!f)for(let A=b.to,w=d+1;;){if(A==n)break e;if(w<s.length&&s[w].from==A)A=s[w++].to;else{if(yi[A]==l)break e;break}}if(d++,m)m.push(b);else{b.from>u&&a.push(new nc(u,b.from,v));let A=b.direction==Ff!=!(v%2);L2(t,A?i+1:i,r,b.inner,b.from,b.to,a),u=b.to}y=b.to}else{if(y==n||(f?yi[y]!=l:yi[y]==l))break;y++}m?B2(t,u,y,i+1,r,m,a):u<y&&a.push(new nc(u,y,v)),u=y}else for(let u=n,d=s.length;u>e;){let f=!0,p=!1;if(!d||u>s[d-1].to){let b=yi[u-1];b!=l&&(f=!1,p=b==16)}let m=!f&&l==1?[]:null,v=f?i:i+1,y=u;e:for(;;)if(d&&y==s[d-1].to){if(p)break e;let b=s[--d];if(!f)for(let A=b.from,w=d;;){if(A==e)break e;if(w&&s[w-1].to==A)A=s[--w].from;else{if(yi[A-1]==l)break e;break}}if(m)m.push(b);else{b.to<u&&a.push(new nc(b.to,u,v));let A=b.direction==Ff!=!(v%2);L2(t,A?i+1:i,r,b.inner,b.from,b.to,a),u=b.from}y=b.from}else{if(y==e||(f?yi[y-1]!=l:yi[y-1]==l))break;y--}m?B2(t,y,u,i+1,r,m,a):y<u&&a.push(new nc(y,u,v)),u=y}}function L2(t,e,n,i,r,s,a){let l=e%2?2:1;Xme(t,r,s,i,l),Kme(t,r,s,i,l),Zme(r,s,i,l),B2(t,r,s,e,n,i,a)}function Jme(t,e,n){if(!t)return[new nc(0,0,e==tD?1:0)];if(e==Ff&&!n.length&&!Gme.test(t))return BQ(t.length);if(n.length)for(;t.length>yi.length;)yi[yi.length]=256;let i=[],r=e==Ff?0:1;return L2(t,r,r,n,0,t.length,i),i}function BQ(t){return[new nc(0,t,0)]}let LQ="";function ege(t,e,n,i,r){var s;let a=i.head-t.from,l=nc.find(e,a,(s=i.bidiLevel)!==null&&s!==void 0?s:-1,i.assoc),u=e[l],d=u.side(r,n);if(a==d){let m=l+=r?1:-1;if(m<0||m>=e.length)return null;u=e[l=m],a=u.side(!r,n),d=u.side(r,n)}let f=is(t.text,a,u.forward(r,n));(f<u.from||f>u.to)&&(f=d),LQ=t.text.slice(Math.min(a,f),Math.max(a,f));let p=l==(r?e.length-1:0)?null:e[l+(r?1:-1)];return p&&f==d&&p.level+(r?0:1)<u.level?Le.cursor(p.side(!r,n)+t.from,p.forward(r,n)?1:-1,p.level):Le.cursor(f+t.from,u.forward(r,n)?-1:1,u.level)}function tge(t,e,n){for(let i=e;i<n;i++){let r=NQ(t.charCodeAt(i));if(r==1)return Ff;if(r==2||r==4)return tD}return Ff}const PQ=bt.define(),FQ=bt.define(),$Q=bt.define(),zQ=bt.define(),P2=bt.define(),HQ=bt.define(),qQ=bt.define(),nD=bt.define(),iD=bt.define(),QQ=bt.define({combine:t=>t.some(e=>e)}),YQ=bt.define({combine:t=>t.some(e=>e)}),WQ=bt.define();class fm{constructor(e,n,i,r,s,a=!1){this.range=e,this.y=n,this.x=i,this.yMargin=r,this.xMargin=s,this.isSnapshot=a}map(e){return e.empty?this:new fm(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 fm(Le.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Zb=Xt.define({map:(t,e)=>t.map(e)}),UQ=Xt.define();function Ks(t,e,n){let i=t.facet(zQ);i.length?i[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}const ou=bt.define({combine:t=>t.length?t[0]:!0});let nge=0;const Up=bt.define({combine(t){return t.filter((e,n)=>{for(let i=0;i<n;i++)if(t[i].plugin==e.plugin)return!1;return!0})}});class Ji{constructor(e,n,i,r,s){this.id=e,this.create=n,this.domEventHandlers=i,this.domEventObservers=r,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(Up.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(Up.of({plugin:this,arg:e}))}static define(e,n){const{eventHandlers:i,eventObservers:r,provide:s,decorations:a}=n||{};return new Ji(nge++,e,i,r,l=>{let u=[];return a&&u.push(cj.of(d=>{let f=d.plugin(l);return f?a(f):Bt.none})),s&&u.push(s(l)),u})}static fromClass(e,n){return Ji.define((i,r)=>new e(i,r),n)}}class zk{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(i){if(Ks(n.state,i,"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){Ks(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(i){Ks(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const VQ=bt.define(),rD=bt.define(),cj=bt.define(),GQ=bt.define(),sD=bt.define(),ix=bt.define(),XQ=bt.define();function uP(t,e){let n=t.state.facet(XQ);if(!n.length)return n;let i=n.map(s=>s instanceof Function?s(t):s),r=[];return Sn.spans(i,e.from,e.to,{point(){},span(s,a,l,u){let d=s-e.from,f=a-e.from,p=r;for(let m=l.length-1;m>=0;m--,u--){let v=l[m].spec.bidiIsolate,y;if(v==null&&(v=tge(e.text,d,f)),u>0&&p.length&&(y=p[p.length-1]).to==d&&y.direction==v)y.to=f,p=y.inner;else{let b={from:d,to:f,direction:v,inner:[]};p.push(b),p=b.inner}}}}),r}const KQ=bt.define();function oD(t){let e=0,n=0,i=0,r=0;for(let s of t.state.facet(KQ)){let a=s(t);a&&(a.left!=null&&(e=Math.max(e,a.left)),a.right!=null&&(n=Math.max(n,a.right)),a.top!=null&&(i=Math.max(i,a.top)),a.bottom!=null&&(r=Math.max(r,a.bottom)))}return{left:e,right:n,top:i,bottom:r}}const X0=bt.define();class Ca{constructor(e,n,i,r){this.fromA=e,this.toA=n,this.fromB=i,this.toB=r}join(e){return new Ca(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,i=this;for(;n>0;n--){let r=e[n-1];if(!(r.fromA>i.toA)){if(r.toA<i.fromA)break;i=i.join(r),e.splice(n-1,1)}}return e.splice(n,0,i),e}static extendWithRanges(e,n){if(n.length==0)return e;let i=[];for(let r=0,s=0,a=0;;){let l=r<e.length?e[r].fromB:1e9,u=s<n.length?n[s]:1e9,d=Math.min(l,u);if(d==1e9)break;let f=d+a,p=d,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=r;y<e.length&&e[y].fromB<=p;y++)a=e[y].toA-e[y].toB;m=Math.max(m,v+a)}else if(r<e.length&&e[r].fromB<=p){let v=e[r++];p=Math.max(p,v.toB),m=Math.max(m,v.toA),a=v.toA-v.toB}else break;i.push(new Ca(f,m,d,p))}return i}}class Z1{constructor(e,n,i){this.view=e,this.state=n,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=Br.empty(this.startState.doc.length);for(let s of i)this.changes=this.changes.compose(s.changes);let r=[];this.changes.iterChangedRanges((s,a,l,u)=>r.push(new Ca(s,a,l,u))),this.changedRanges=r}static create(e,n,i){return new Z1(e,n,i)}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 ige=[];class ur{constructor(e,n,i=0){this.dom=e,this.length=n,this.flags=i,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return ige}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 i=n;for(let r of this.children){if(r==e)return i;i+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,n,i){return null}domPosFor(e,n){let i=ad(this.dom),r=this.length?e>0:n>0;return new hl(this.parent.dom,i+(r?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 hj)return e;return null}static get(e){return e.cmTile}}class uj extends ur{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,i=null,r,s=(e==null?void 0:e.node)==n?e:null,a=0;for(let l of this.children){if(l.sync(e),a+=l.length+l.breakAfter,r=i?i.nextSibling:n.firstChild,s&&r!=l.dom&&(s.written=!0),l.dom.parentNode==n)for(;r&&r!=l.dom;)r=hP(r);else n.insertBefore(l.dom,r);i=l.dom}for(r=i?i.nextSibling:n.firstChild,s&&r&&(s.written=!0);r;)r=hP(r);this.length=a}}function hP(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class hj extends uj{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=ur.get(e);if(n&&this.owns(n))return n;e=e.parentNode}}blockTiles(e){for(let n=[],i=this,r=0,s=0;;)if(r==i.children.length){if(!n.length)return;i=i.parent,i.breakAfter&&s++,r=n.pop()}else{let a=i.children[r++];if(a instanceof du)n.push(r),i=a,r=0;else{let l=s+a.length,u=e(a,s);if(u!==void 0)return u;s=l+a.breakAfter}}}resolveBlock(e,n){let i,r=-1,s,a=-1;if(this.blockTiles((l,u)=>{let d=u+l.length;if(e>=u&&e<=d){if(l.isWidget()&&n>=-1&&n<=1){if(l.flags&32)return!0;l.flags&16&&(i=void 0)}(u<e||e==d&&(n<-1?l.length:l.covers(1)))&&(!i||!l.isWidget()&&i.isWidget())&&(i=l,r=e-u),(d>e||e==u&&(n>1?l.length:l.covers(-1)))&&(!s||!l.isWidget()&&s.isWidget())&&(s=l,a=e-u)}}),!i&&!s)throw new Error("No tile at position "+e);return i&&n<0||!s?{tile:i,offset:r}:{tile:s,offset:a}}}class du extends uj{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 i=new du(n||document.createElement(e.tagName),e);return n||(i.flags|=4),i}}class Zm extends uj{constructor(e,n){super(e),this.attrs=n}isLine(){return!0}static start(e,n,i){let r=new Zm(n||document.createElement("div"),e);return(!n||!i)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(e,n,i){let r=null,s=-1,a=null,l=-1;function u(f,p){for(let m=0,v=0;m<f.children.length&&v<=p;m++){let y=f.children[m],b=v+y.length;b>=p&&(y.isComposite()?u(y,p-v):(!a||a.isHidden&&(n>0&&!(a.flags&32)||i&&sge(a,y)))&&(b>p||y.flags&32)?(a=y,l=p-v):(v<p||y.flags&16&&!y.isHidden)&&(r=y,s=p-v)),v=b}}u(this,e);let d=(n<0?r:a)||r||a;return d?{tile:d,offset:d==r?s:l}:null}coordsIn(e,n,i){let r=this.resolveInline(e,n,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),n,i):rge(this)}domIn(e,n){let i=this.resolveInline(e,n);if(i){let{tile:r,offset:s}=i;if(this.dom.contains(r.dom))return r.isText()?new hl(r.dom,Math.min(r.dom.nodeValue.length,s)):r.domPosFor(s,r.flags&16?1:r.flags&32?-1:n);let a=i.tile.parent,l=!1;for(let u of a.children){if(l)return new hl(u.dom,0);u==i.tile&&(l=!0)}}return new hl(this.dom,0)}}function rge(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=mv(e);return n[n.length-1]||null}function sge(t,e){let n=t.coordsIn(0,1),i=e.coordsIn(0,1);return n&&i&&i.top<n.bottom}class So extends uj{constructor(e,n){super(e),this.mark=n}get domAttrs(){return this.mark.attrs}static of(e,n){let i=new So(n||document.createElement(e.tagName),e);return n||(i.flags|=4),i}}class cf extends ur{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,i){let r=this.dom.nodeValue.length;e>r&&(e=r);let s=e,a=e,l=0;e==0&&n<0||e==r&&n>=0?xt.chrome||xt.gecko||(e?(s--,l=1):a<r&&(a++,l=-1)):n<0?s--:a<r&&a++;let u=Jv(this.dom,s,a).getClientRects();if(!u.length)return null;let d=u[(l?l<0:n>=0)?0:u.length-1];return xt.safari&&!l&&d.width==0&&(d=Array.prototype.find.call(u,f=>f.width)||d),i==null?d:Zv(d,(l?l>0:n<0)==i)}static of(e,n){let i=new cf(n||document.createTextNode(e),e);return n||(i.flags|=2),i}}class $f extends ur{constructor(e,n,i,r){super(e,n,r),this.widget=i}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,i){let r=this.widget.coordsAt(this.dom,e,n);if(r)return r;if(i)return Zv(this.dom.getBoundingClientRect(),this.length?e==0:n<=0);{let s=this.dom.getClientRects(),a=null;if(!s.length)return null;let l=this.flags&16?!0:this.flags&32?!1:e>0;for(let u=l?s.length-1:0;a=s[u],!(e>0?u==0:u==s.length-1||a.top<a.bottom);u+=l?-1:1);return Zv(a,!l)}}get overrideDOMText(){if(!this.length)return zn.empty;let{root:e}=this;if(!e)return zn.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,i,r,s){return s||(s=e.toDOM(n),e.editable||(s.contentEditable="false")),new $f(s,i,e,r)}}class J1 extends ur{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 zn.empty}coordsIn(e,n,i){let r=this.dom.getBoundingClientRect();return i==null?r:Zv(r,n>0==i)}}class oge{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,n,i){let{tile:r,index:s,beforeBreak:a,parents:l}=this;for(;e||n>0;)if(r.isComposite())if(a){if(!e)break;i&&i.break(),e--,a=!1}else if(s==r.children.length){if(!e&&!l.length)break;i&&i.leave(r),a=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++}else{let u=r.children[s],d=u.breakAfter;(n>0?u.length<=e:u.length<e)&&(!i||i.skip(u,0,u.length)!==!1||!u.isComposite)?(a=!!d,s++,e-=u.length):(l.push({tile:r,index:s}),r=u,s=0,i&&u.isComposite()&&i.enter(u))}else if(s==r.length)a=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++;else if(e){let u=Math.min(e,r.length-s);i&&i.skip(r,s,s+u),e-=u,s+=u}else break;return this.tile=r,this.index=s,this.beforeBreak=a,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class age{constructor(e,n,i,r){this.from=e,this.to=n,this.wrapper=i,this.rank=r}}class lge{constructor(e,n,i){this.cache=e,this.root=n,this.blockWrappers=i,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,n,i,r){var s;this.flushBuffer();let a=this.ensureMarks(n,i),l=a.lastChild;if(l&&l.isText()&&!(l.flags&8)&&l.length+e.length<512){this.cache.reused.set(l,2);let u=a.children[a.children.length-1]=new cf(l.dom,l.text+e);u.parent=a}else a.append(r||cf.of(e,(s=this.cache.find(cf))===null||s===void 0?void 0:s.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,n){let i=this.curLine;i.dom!=n.line.dom&&(i.setDOM(this.cache.reused.has(n.line)?Hk(n.line.dom):n.line.dom),this.cache.reused.set(n.line,2));let r=i;for(let l=n.marks.length-1;l>=0;l--){let u=n.marks[l],d=r.lastChild;if(d instanceof So&&d.mark.eq(u.mark))d.dom!=u.dom&&d.setDOM(Hk(u.dom)),r=d;else{if(this.cache.reused.get(u)){let p=ur.get(u.dom);p&&p.setDOM(Hk(u.dom))}let f=So.of(u.mark,u.dom);r.append(f),r=f}this.cache.reused.set(u,2)}let s=ur.get(e.text);s&&this.cache.reused.set(s,2);let a=new cf(e.text,e.text.nodeValue);a.flags|=8,this.pos=e.range.toB,r.append(a)}addInlineWidget(e,n,i){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let s=this.ensureMarks(n,i);!r&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,n,i){this.flushBuffer(),this.ensureMarks(n,i).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 i;e||(e=ZQ);let r=Zm.start(e,n||((i=this.cache.find(Zm))===null||i===void 0?void 0:i.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=r)}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 i;let r=this.curLine;for(let s=e.length-1;s>=0;s--){let a=e[s],l;if(n>0&&(l=r.lastChild)&&l instanceof So&&l.mark.eq(a))r=l,n--;else{let u=So.of(a,(i=this.cache.find(So,d=>d.mark.eq(a)))===null||i===void 0?void 0:i.dom);r.append(u),r=u,n=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!dP(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(xt.ios&&dP(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(qk,0,32)||new $f(qk.toDOM(),0,qk,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,i=new age(e.from,e.to,e.value,n),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-i.rank||this.wrappers[r-1].to-i.to)<0;)r--;this.wrappers.splice(r,0,i)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let n=this.root;for(let i of this.wrappers){let r=n.lastChild;if(i.from<this.pos&&r instanceof du&&r.wrapper.eq(i.wrapper))n=r;else{let s=du.of(i.wrapper,(e=this.cache.find(du,a=>a.wrapper.eq(i.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),i=this.cache.find(J1,void 0,1);return i&&(i.flags=n),i||new J1(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class cge{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:r,lineBreak:s,done:a}=this.cursor.next(this.skipCount);if(this.skipCount=0,a)throw new Error("Ran out of text content when drawing inline views");this.text=r;let l=this.textOff=Math.min(e,r.length);return s?null:r.slice(0,l)}let n=Math.min(this.text.length,this.textOff+e),i=this.text.slice(this.textOff,n);return this.textOff=n,i}}const ew=[$f,Zm,cf,So,J1,du,hj];for(let t=0;t<ew.length;t++)ew[t].bucket=t;class uge{constructor(e){this.view=e,this.buckets=ew.map(()=>[]),this.index=ew.map(()=>0),this.reused=new Map}add(e){let n=e.constructor.bucket,i=this.buckets[n];i.length<6?i.push(e):i[this.index[n]=(this.index[n]+1)%6]=e}find(e,n,i=2){let r=e.bucket,s=this.buckets[r],a=this.index[r];for(let l=0;l<s.length;l++){let u=(l+a)%s.length,d=s[u];if((!n||n(d))&&!this.reused.has(d))return s.splice(u,1),u<a&&this.index[r]--,this.reused.set(d,i),d}return null}findWidget(e,n,i){let r=this.buckets[0];if(r.length)for(let s=0,a=0;;s++){if(s==r.length){if(a)return null;a=1,s=0}let l=r[s];if(!this.reused.has(l)&&(a==0?l.widget.compare(e):l.widget.constructor==e.constructor&&e.updateDOM(l.dom,this.view,l.widget)))return r.splice(s,1),s<this.index[0]&&this.index[0]--,l.widget==e&&l.length==n&&(l.flags&497)==i?(this.reused.set(l,1),l):(this.reused.set(l,2),new $f(l.dom,n,e,l.flags&-498|i))}}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 hge{constructor(e,n,i,r,s){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=s,this.openWidget=!1,this.openMarks=0,this.cache=new uge(e),this.text=new cge(e.state.doc),this.builder=new lge(this.cache,new hj(e,e.contentDOM),Sn.iter(i)),this.cache.reused.set(n,2),this.old=new oge(n),this.reuseWalker={skip:(a,l,u)=>{if(this.cache.add(a),a.isComposite())return!1},enter:a=>this.cache.add(a),leave:()=>{},break:()=>{}}}run(e,n){let i=n&&this.getCompositionContext(n.text);for(let r=0,s=0,a=0;;){let l=a<e.length?e[a++]:null,u=l?l.fromA:this.old.root.length;if(u>r){let d=u-r;this.preserve(d,!a,!l),r=u,s+=d}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,i),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,r=l.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,n,i){let r=pge(this.old),s=this.openMarks;this.old.advance(e,i?1:-1,{skip:(a,l,u)=>{if(a.isWidget())if(this.openWidget)this.builder.continueWidget(u-l);else{let d=u>0||l<a.length?$f.of(a.widget,this.view,u-l,a.flags&496,this.cache.maybeReuse(a)):this.cache.reuse(a);d.flags&256?(d.flags&=-2,this.builder.addBlockWidget(d)):(this.builder.ensureLine(null),this.builder.addInlineWidget(d,r,s),s=r.length)}else if(a.isText())this.builder.ensureLine(null),!l&&u==a.length&&!this.cache.reused.has(a)?this.builder.addText(a.text,r,s,this.cache.reuse(a)):(this.cache.add(a),this.builder.addText(a.text.slice(l,u),r,s)),s=r.length;else if(a.isLine())a.flags&=-2,this.cache.reused.set(a,1),this.builder.addLine(a);else if(a instanceof J1)this.cache.add(a);else if(a instanceof So)this.builder.ensureLine(null),this.builder.addMark(a,r,s),this.cache.reused.set(a,1),s=r.length;else return!1;this.openWidget=!1},enter:a=>{a.isLine()?this.builder.addLineStart(a.attrs,this.cache.maybeReuse(a)):(this.cache.add(a),a instanceof So&&r.unshift(a.mark)),this.openWidget=!1},leave:a=>{a.isLine()?r.length&&(r.length=s=0):a instanceof So&&(r.shift(),s=Math.min(s,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,n){let i=null,r=this.builder,s=-1,a=Sn.spans(this.decorations,e,n,{point:(l,u,d,f,p,m)=>{if(d instanceof Pf){if(this.disallowBlockEffectsFor[m]){if(d.block)throw new RangeError("Block decorations may not be specified via plugins");if(u>this.view.state.doc.lineAt(l).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=f.length,p>f.length)r.continueWidget(u-l);else{let v=d.widget||(d.block?Jm.block:Jm.inline),y=dge(d),b=this.cache.findWidget(v,u-l,y)||$f.of(v,this.view,u-l,y);d.block?(d.startSide>0&&r.addLineStartIfNotCovered(i),r.addBlockWidget(b)):(r.ensureLine(i),r.addInlineWidget(b,f,p))}i=null}else i=fge(i,d);u>l&&this.text.skip(u-l)},span:(l,u,d,f)=>{for(let p=l;p<u;){let m=this.text.next(Math.min(512,u-p));m==null?(r.addLineStartIfNotCovered(i),r.addBreak(),p++):(r.ensureLine(i),r.addText(m,d,p==l?f:d.length),p+=m.length),i=null}s=d.length}});s>-1&&(this.openWidget=a>s),this.openWidget||r.addLineStartIfNotCovered(i),this.openMarks=a}forward(e,n,i=1){n-e<=10?this.old.advance(n-e,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-e-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(e){let n=[],i=null;for(let r=e.parentNode;;r=r.parentNode){let s=ur.get(r);if(r==this.view.contentDOM)break;s instanceof So?n.push(s):s!=null&&s.isLine()?i=s:s instanceof du||(r.nodeName=="DIV"&&!i&&r!=this.view.contentDOM?i=new Zm(r,ZQ):i||n.push(So.of(new tx({tagName:r.nodeName.toLowerCase(),attributes:$me(r)}),r)))}return{line:i,marks:n}}}function dP(t,e){let n=i=>{for(let r of i.children)if((e?r.isText():r.length)||n(r))return!0;return!1};return n(t)}function dge(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 ZQ={class:"cm-line"};function fge(t,e){let n=e.spec.attributes,i=e.spec.class;return!n&&!i||(t||(t={class:"cm-line"}),n&&JR(n,t),i&&(t.class+=" "+i)),t}function pge(t){let e=[];for(let n=t.parents.length;n>1;n--){let i=n==t.parents.length?t.tile:t.parents[n].tile;i instanceof So&&e.push(i.mark)}return e}function Hk(t){let e=ur.get(t);return e&&e.setDOM(t.cloneNode()),t}class Jm extends Cl{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}}Jm.inline=new Jm("span");Jm.block=new Jm("div");const qk=new class extends Cl{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class fP{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Bt.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 hj(e,e.contentDOM),this.updateInner([new Ca(0,0,0,e.state.doc.length)],null)}update(e){var n;let i=e.changedRanges;this.minWidth>0&&i.length&&(i.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 r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?r=this.domChanged.newSel.head:!Sge(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let s=r>-1?gge(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:f,to:p}=this.hasComposition;i=new Ca(f,p,e.changes.mapPos(f,-1),e.changes.mapPos(p,1)).addToSet(i.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(xt.ie||xt.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let a=this.decorations,l=this.blockWrappers;this.updateDeco();let u=xge(a,this.decorations,e.changes);u.length&&(i=Ca.extendWithRanges(i,u));let d=Age(l,this.blockWrappers,e.changes);return d.length&&(i=Ca.extendWithRanges(i,d)),s&&!i.some(f=>f.fromA<=s.range.fromA&&f.toA>=s.range.toA)&&(i=s.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(n||e.length){let a=this.tile,l=new hge(this.view,a,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&ur.get(n.text)&&l.cache.reused.set(ur.get(n.text),2),this.tile=l.run(e,n),F2(a,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=xt.chrome||xt.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||i.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];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 Qk&&r.push(s.dom);i.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let i of n.effects)i.is(UQ)&&(this.editContextFormatting=i.value)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:i}=this.tile,r=this.view.root.activeElement,s=r==i,a=!s&&!(this.view.state.facet(ou)||i.tabIndex>-1)&&pv(i,this.view.observer.selectionRange)&&!(r&&i.contains(r));if(!(s||n||a))return;let l=this.forceSelection;this.forceSelection=!1;let u=this.view.state.selection.main,d,f;if(u.empty?f=d=this.inlineDOMNearPos(u.anchor,u.assoc||1):(f=this.inlineDOMNearPos(u.head,u.head==u.from?1:-1),d=this.inlineDOMNearPos(u.anchor,u.anchor==u.from?1:-1)),xt.gecko&&u.empty&&!this.hasComposition&&mge(d)){let m=document.createTextNode("");this.view.observer.ignore(()=>d.node.insertBefore(m,d.node.childNodes[d.offset]||null)),d=f=new hl(m,0),l=!0}let p=this.view.observer.selectionRange;(l||!p.focusNode||(!gv(d.node,d.offset,p.anchorNode,p.anchorOffset)||!gv(f.node,f.offset,p.focusNode,p.focusOffset))&&!this.suppressWidgetCursorChange(p,u))&&(this.view.observer.ignore(()=>{xt.android&&xt.chrome&&i.contains(p.focusNode)&&wge(p.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let m=Kv(this.view.root);if(m)if(u.empty){if(xt.gecko){let v=vge(d.node,d.offset);if(v&&v!=3){let y=(v==1?MQ:RQ)(d.node,d.offset);y&&(d=new hl(y.node,y.offset))}}m.collapse(d.node,d.offset),u.bidiLevel!=null&&m.caretBidiLevel!==void 0&&(m.caretBidiLevel=u.bidiLevel)}else if(m.extend){m.collapse(d.node,d.offset);try{m.extend(f.node,f.offset)}catch{}}else{let v=document.createRange();u.anchor>u.head&&([d,f]=[f,d]),v.setEnd(f.node,f.offset),v.setStart(d.node,d.offset),m.removeAllRanges(),m.addRange(v)}a&&this.view.root.activeElement==i&&(i.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(d,f)),this.impreciseAnchor=d.precise?null:new hl(p.anchorNode,p.anchorOffset),this.impreciseHead=f.precise?null:new hl(p.focusNode,p.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&gv(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,i=Kv(e.root),{anchorNode:r,anchorOffset:s}=e.observer.selectionRange;if(!i||!n.empty||!n.assoc||!i.modify)return;let a=this.lineAt(n.head,n.assoc);if(!a)return;let l=a.posAtStart;if(n.head==l||n.head==l+a.length)return;let u=this.coordsAt(n.head,-1),d=this.coordsAt(n.head,1);if(!u||!d||u.bottom>d.top)return;let f=this.domAtPos(n.head+n.assoc,n.assoc);i.collapse(f.node,f.offset),i.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&&i.collapse(r,s)}posFromDOM(e,n){let i=this.tile.nearest(e);if(!i)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=i.posAtStart;if(i.isComposite()){let s;if(e==i.dom)s=i.dom.childNodes[n];else{let a=xu(e)==0?0:n==0?-1:1;for(;;){let l=e.parentNode;if(l==i.dom)break;a==0&&l.firstChild!=l.lastChild&&(e==l.firstChild?a=-1:a=1),e=l}a<0?s=e:s=e.nextSibling}if(s==i.dom.firstChild)return r;for(;s&&!ur.get(s);)s=s.nextSibling;if(!s)return r+i.length;for(let a=0,l=r;;a++){let u=i.children[a];if(u.dom==s)return l;l+=u.length+u.breakAfter}}else return i.isText()?e==i.dom?r+n:r+(n?i.length:0):r}domAtPos(e,n){let{tile:i,offset:r}=this.tile.resolveBlock(e,n);return i.isWidget()?i.domPosFor(r,n):i.domIn(r,n)}inlineDOMNearPos(e,n){let i,r=-1,s=!1,a,l=-1,u=!1;return this.tile.blockTiles((d,f)=>{if(d.isWidget()){if(d.flags&32&&f>=e)return!0;d.flags&16&&(s=!0)}else{let p=f+d.length;if(f<=e&&(i=d,r=e-f,s=p<e),p>=e&&!a&&(a=d,l=e-f,u=f>e),f>e&&a)return!0}}),!i&&!a?this.domAtPos(e,n):(s&&a?i=null:u&&i&&(a=null),i&&n<0||!a?i.domIn(r,n):a.domIn(l,n))}coordsAt(e,n,i){let{tile:r,offset:s}=this.tile.resolveBlock(e,n);return r.isWidget()?r.widget instanceof Qk?null:r.coordsInWidget(s,n,!0):r.coordsIn(s,n,i)}lineAt(e,n){let{tile:i}=this.tile.resolveBlock(e,n);return i.isLine()?i:null}coordsForChar(e){let{tile:n,offset:i}=this.tile.resolveBlock(e,1);if(!n.isLine())return null;function r(s,a){if(s.isComposite())for(let l of s.children){if(l.length>=a){let u=r(l,a);if(u)return u}if(a-=l.length,a<0)break}else if(s.isText()&&a<s.length){let l=is(s.text,a);if(l==a)return null;let u=Jv(s.dom,a,l).getClientRects();for(let d=0;d<u.length;d++){let f=u[d];if(d==u.length-1||f.top<f.bottom&&f.left<f.right)return f}}return null}return r(n,i)}measureVisibleLineHeights(e){let n=[],{from:i,to:r}=e,s=this.view.contentDOM.clientWidth,a=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,u=this.view.textDirection==Si.LTR,d=0,f=(p,m,v)=>{for(let y=0;y<p.children.length&&!(m>r);y++){let b=p.children[y],A=m+b.length,w=b.dom.getBoundingClientRect(),{height:S}=w;if(v&&!y&&(d+=w.top-v.top),b instanceof du)A>i&&f(b,m,w);else if(m>=i&&(d>0&&n.push(-d),n.push(S+d),d=0,a)){let j=b.dom.lastChild,C=j?mv(j):[];if(C.length){let k=C[C.length-1],E=u?k.right-w.left:w.right-k.left;E>l&&(l=E,this.minWidth=s,this.minWidthFrom=m,this.minWidthTo=A)}}v&&y==p.children.length-1&&(d+=v.bottom-w.bottom),m=A+b.breakAfter}};return f(this.tile,0,null),n}textDirectionAt(e){let{tile:n}=this.tile.resolveBlock(e,1);return getComputedStyle(n.dom).direction=="rtl"?Si.RTL:Si.LTR}measureTextSize(){let e=this.tile.blockTiles(a=>{if(a.isLine()&&a.children.length&&a.length<=20){let l=0,u;for(let d of a.children){if(!d.isText()||/[^ -~]/.test(d.text))return;let f=mv(d.dom);if(f.length!=1)return;l+=f[0].width,u=f[0].height}if(l)return{lineHeight:a.dom.getBoundingClientRect().height,charWidth:l/a.length,textHeight:u}}});if(e)return e;let n=document.createElement("div"),i,r,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 a=mv(n.firstChild)[0];i=n.getBoundingClientRect().height,r=a&&a.width?a.width/27:7,s=a&&a.height?a.height:i,n.remove()}),{lineHeight:i,charWidth:r,textHeight:s}}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let i=0,r=0;;r++){let s=r==n.viewports.length?null:n.viewports[r],a=s?s.from-1:this.view.state.doc.length;if(a>i){let l=(n.lineBlockAt(a).bottom-n.lineBlockAt(i).top)/this.view.scaleY;e.push(Bt.replace({widget:new Qk(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,a))}if(!s)break;i=s.to+1}return Bt.set(e)}updateDeco(){let e=1,n=this.view.state.facet(cj).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),i=!1,r=this.view.state.facet(sD).map((s,a)=>{let l=typeof s=="function";return l&&(i=!0),l?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[e++]=i,n.push(Sn.join(r))),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(GQ).map(s=>typeof s=="function"?s(this.view):s)}scrollIntoView(e){if(e.isSnapshot){let d=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=d.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let d of this.view.state.facet(WQ))try{if(d(this.view,e.range,e))return!0}catch(f){Ks(this.view.state,f,"scroll handler")}let{range:n}=e,i=this.coordsAt(n.head,n.assoc||(n.head>n.anchor?-1:1)),r;if(!i)return;!n.empty&&(r=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(i={left:Math.min(i.left,r.left),top:Math.min(i.top,r.top),right:Math.max(i.right,r.right),bottom:Math.max(i.bottom,r.bottom)});let s=oD(this.view),a={left:i.left-s.left,top:i.top-s.top,right:i.right+s.right,bottom:i.bottom+s.bottom},{offsetWidth:l,offsetHeight:u}=this.view.scrollDOM;if(qme(this.view.scrollDOM,a,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,l),-l),Math.max(Math.min(e.yMargin,u),-u),this.view.textDirection==Si.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 d=this.view.docView.lineAt(n.head,1);d&&d.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let n=i=>i.isWidget()||i.children.some(n);return n(this.tile.resolveBlock(e,1).tile)}destroy(){F2(this.tile)}}function F2(t,e){let n=e==null?void 0:e.get(t);if(n!=1){n==null&&t.destroy();for(let i of t.children)F2(i,e)}}function mge(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 JQ(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let i=MQ(n.focusNode,n.focusOffset),r=RQ(n.focusNode,n.focusOffset),s=i||r;if(r&&i&&r.node!=i.node){let l=ur.get(r.node);if(!l||l.isText()&&l.text!=r.node.nodeValue)s=r;else if(t.docView.lastCompositionAfterCursor){let u=ur.get(i.node);!u||u.isText()&&u.text!=i.node.nodeValue||(s=r)}}if(t.docView.lastCompositionAfterCursor=s!=i,!s)return null;let a=e-s.offset;return{from:a,to:a+s.node.nodeValue.length,node:s.node}}function gge(t,e,n){let i=JQ(t,n);if(!i)return null;let{node:r,from:s,to:a}=i,l=r.nodeValue;if(/[\n\r]/.test(l)||t.state.doc.sliceString(i.from,i.to)!=l)return null;let u=e.invertedDesc;return{range:new Ca(u.mapPos(s),u.mapPos(a),s,a),text:r}}function vge(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 yge=class{constructor(){this.changes=[]}compareRange(e,n){hm(e,n,this.changes)}comparePoint(e,n){hm(e,n,this.changes)}boundChange(e){hm(e,e,this.changes)}};function xge(t,e,n){let i=new yge;return Sn.compare(t,e,n,i),i.changes}class bge{constructor(){this.changes=[]}compareRange(e,n){hm(e,n,this.changes)}comparePoint(){}boundChange(e){hm(e,e,this.changes)}}function Age(t,e,n){let i=new bge;return Sn.compare(t,e,n,i),i.changes}function wge(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 Sge(t,e){let n=!1;return e&&t.iterChangedRanges((i,r)=>{i<e.to&&r>e.from&&(n=!0)}),n}class Qk extends Cl{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 jge(t,e,n=1){let i=t.charCategorizer(e),r=t.doc.lineAt(e),s=e-r.from;if(r.length==0)return Le.cursor(e);s==0?n=1:s==r.length&&(n=-1);let a=s,l=s;n<0?a=is(r.text,s,!1):l=is(r.text,s);let u=i(r.text.slice(a,l));for(;a>0;){let d=is(r.text,a,!1);if(i(r.text.slice(d,a))!=u)break;a=d}for(;l<r.length;){let d=is(r.text,l);if(i(r.text.slice(l,d))!=u)break;l=d}return Le.undirectionalRange(a+r.from,l+r.from)}function Cge(t,e,n,i,r){let s=Math.round((i-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let l=t.viewState.heightOracle.textHeight,u=Math.floor((r-n.top-(t.defaultLineHeight-l)*.5)/l);s+=u*t.viewState.heightOracle.lineLength}let a=t.state.sliceDoc(n.from,n.to);return n.from+k2(a,s,t.state.tabSize)}function $2(t,e,n){let i=t.lineBlockAt(e);if(Array.isArray(i.type)){let r;for(let s of i.type){if(s.from>e)break;if(!(s.to<e)){if(s.from<e&&s.to>e)return s;(!r||s.type==ws.Text&&(r.type!=s.type||(n<0?s.from<e:s.to>e)))&&(r=s)}}return r||i}return i}function _ge(t,e,n,i){let r=$2(t,e.head,e.assoc||-1),s=!i||r.type!=ws.Text||!(t.lineWrapping||r.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(s){let a=t.dom.getBoundingClientRect(),l=t.textDirectionAt(r.from),u=t.posAtCoords({x:n==(l==Si.LTR)?a.right-1:a.left+1,y:(s.top+s.bottom)/2});if(u!=null)return Le.cursor(u,n?-1:1)}return Le.cursor(n?r.to:r.from,n?-1:1)}function pP(t,e,n,i){let r=t.state.doc.lineAt(e.head),s=t.bidiSpans(r),a=t.textDirectionAt(r.from);for(let l=e,u=null;;){let d=ege(r,s,a,l,n),f=LQ;if(!d){if(r.number==(n?t.state.doc.lines:1))return l;f=`
`,r=t.state.doc.line(r.number+(n?1:-1)),s=t.bidiSpans(r),d=t.visualLineSide(r,!n)}if(u){if(!u(f))return l}else{if(!i)return d;u=i(f)}l=d}}function kge(t,e,n){let i=t.state.charCategorizer(e),r=i(n);return s=>{let a=i(s);return r==qi.Space&&(r=a),r==a}}function Tge(t,e,n,i){let r=e.head,s=n?1:-1;if(r==(n?t.state.doc.length:0))return Le.cursor(r,e.assoc);let a=e.goalColumn,l,u=t.contentDOM.getBoundingClientRect(),d=t.coordsAtPos(r,e.assoc||((e.empty?n:e.head==e.from)?1:-1)),f=t.documentTop;if(d)a==null&&(a=d.left-u.left),l=s<0?d.top:d.bottom;else{let y=t.viewState.lineBlockAt(r);a==null&&(a=Math.min(u.right-u.left,t.defaultCharacterWidth*(r-y.from))),l=(s<0?y.top:y.bottom)+f}let p=u.left+a,m=t.viewState.heightOracle.textHeight>>1,v=i??m;for(let y=0;;y+=m){let b=l+(v+y)*s,A=z2(t,{x:p,y:b},!1,s);if(n?b>u.bottom:b<u.top)return Le.cursor(A.pos,A.assoc);let w=t.coordsAtPos(A.pos,A.assoc),S=w?(w.top+w.bottom)/2:0;if(!w||(n?S>l:S<l))return Le.cursor(A.pos,A.assoc,void 0,a)}}function vv(t,e,n){for(;;){let i=0;for(let r of t)r.between(e-1,e+1,(s,a,l)=>{if(e>s&&e<a){let u=i||n||(e-s<a-e?-1:1);e=u<0?s:a,i=u}});if(!i)return e}}function eY(t,e){let n=null;for(let i=0;i<e.ranges.length;i++){let r=e.ranges[i],s=null;if(r.empty){let a=vv(t,r.from,0);a!=r.from&&(s=Le.cursor(a,-1))}else{let a=vv(t,r.from,-1),l=vv(t,r.to,1);(a!=r.from||l!=r.to)&&(r.undirectional?s=Le.undirectionalRange(r.from,r.to):s=Le.range(r.from==r.anchor?a:l,r.from==r.head?a:l))}s&&(n||(n=e.ranges.slice()),n[i]=s)}return n?Le.create(n,e.mainIndex):e}function Yk(t,e,n){let i=vv(t.state.facet(ix).map(r=>r(t)),n.from,e.head>n.from?-1:1);return i==n.from?n:Le.cursor(i,i<n.from?1:-1)}class Jl{constructor(e,n){this.pos=e,this.assoc=n}}function z2(t,e,n,i){let r=t.contentDOM.getBoundingClientRect(),s=r.top+t.viewState.paddingTop,{x:a,y:l}=e,u=l-s,d;for(;;){if(u<0)return new Jl(0,1);if(u>t.viewState.docHeight)return new Jl(t.state.doc.length,-1);if(d=t.elementAtHeight(u),i==null)break;if(d.type==ws.Text){if(i<0?d.to<t.viewport.from:d.from>t.viewport.to)break;let m=t.docView.coordsAt(i<0?d.from:d.to,i>0?-1:1);if(m&&(i<0?m.top<=u+s:m.bottom>=u+s))break}let p=t.viewState.heightOracle.textHeight/2;u=i>0?d.bottom+p:d.top-p}if(t.viewport.from>=d.to||t.viewport.to<=d.from){if(n)return null;if(d.type==ws.Text){let p=Cge(t,r,d,a,l);return new Jl(p,p==d.from?1:-1)}}if(d.type!=ws.Text)return u<(d.top+d.bottom)/2?new Jl(d.from,1):new Jl(d.to,-1);let f=t.docView.lineAt(d.from,2);return(!f||f.length!=d.length)&&(f=t.docView.lineAt(d.from,-2)),new Oge(t,a,l,t.textDirectionAt(d.from)).scanTile(f,d.from)}class Oge{constructor(e,n,i,r){this.view=e,this.x=n,this.y=i,this.baseDir=r,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:i,spans:r}=this.bidiSpansAt(e);return r[nc.find(r,e-i.from,-1,n)].level==this.baseDir}dirAt(e,n){let{line:i,spans:r}=this.bidiSpansAt(e);return r[nc.find(r,e-i.from,-1,n)].dir}bidiIn(e,n){let{spans:i,line:r}=this.bidiSpansAt(e);return i.length>1||i.length&&(i[0].level!=this.baseDir||i[0].to+r.from<n)}scan(e,n,i=!1){let r=0,s=e.length-1,a=new Set,l=this.bidiIn(e[0],e[s]),u,d,f=-1,p=1e9,m;e:for(;r<s;){let y=s-r,b=r+s>>1;t:if(a.has(b)){let w=r+Math.floor(Math.random()*y);for(let S=0;S<y;S++){if(!a.has(w)){b=w;break t}w++,w==s&&(w=r)}break e}a.add(b);let A=n(b);if(A)for(let w=0;w<A.length;w++){let S=A[w],j=0;if(!(S.width==0&&A.length>1)){if(S.bottom<this.y)(!u||u.bottom<S.bottom)&&(u=S),j=1;else if(S.top>this.y)(!d||d.top>S.top)&&(d=S),j=-1;else{let C=S.left>this.x?this.x-S.left:S.right<this.x?this.x-S.right:0,k=Math.abs(C);k<p&&(f=b,p=k,m=S),C&&(j=C<0==(this.baseDir==Si.LTR)?-1:1)}j==-1&&(!l||this.baseDirAt(e[b],1))?s=b:j==1&&(!l||this.baseDirAt(e[b+1],-1))&&(r=b+1)}}}if(!m){if(!d&&!u)return{i:e[0],after:!1};let y=u&&(!d||this.y-u.bottom<d.top-this.y)?u:d;return this.y=(y.top+y.bottom)/2,this.scan(e,n,!0)}if(p&&!i){let{top:y,bottom:b}=m;if(u&&u.bottom>(y+y+b)/3)return this.y=u.bottom-1,this.scan(e,n,!0);if(d&&d.top<(y+b+b)/3)return this.y=d.top+1,this.scan(e,n,!0)}let v=(l?this.dirAt(e[f],1):this.baseDir)==Si.LTR;return{i:f,after:this.x>(m.left+m.right)/2==v}}scanText(e,n){let i=[];for(let s=0;s<e.length;s=is(e.text,s))i.push(n+s);i.push(n+e.length);let r=this.scan(i,s=>{let a=i[s]-n,l=i[s+1]-n;return Jv(e.dom,a,l).getClientRects()});return r.after?new Jl(i[r.i+1],-1):new Jl(i[r.i],1)}scanTile(e,n){if(!e.length)return new Jl(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 i=[n];for(let l=0,u=n;l<e.children.length;l++)i.push(u+=e.children[l].length);let r=this.scan(i,l=>{let u=e.children[l];return u.flags&48?null:(u.dom.nodeType==1?u.dom:Jv(u.dom,0,u.length)).getClientRects()}),s=e.children[r.i],a=i[r.i];return s.isText()?this.scanText(s,a):s.isComposite()?this.scanTile(s,a):r.after?new Jl(i[r.i+1],-1):new Jl(a,1)}}const Fp="";class Ege{constructor(e,n){this.points=e,this.view=n,this.text="",this.lineSeparator=n.state.facet(kn.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Fp}readRange(e,n){if(!e)return this;let i=e.parentNode;for(let r=e;;){this.findPointBefore(i,r);let s=this.text.length;this.readNode(r);let a=ur.get(r),l=r.nextSibling;if(l==n){a!=null&&a.breakAfter&&!l&&i!=this.view.contentDOM&&this.lineBreak();break}let u=ur.get(l);(a&&u?a.breakAfter:(a?a.breakAfter:K1(r))||K1(l)&&(r.nodeName!="BR"||a!=null&&a.isWidget())&&this.text.length>s)&&!Rge(l,n)&&this.lineBreak(),r=l}return this.findPointBefore(i,n),this}readTextNode(e){let n=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,n.length));for(let i=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,a=1,l;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,i),a=this.lineSeparator.length):(l=r.exec(n))&&(s=l.index,a=l[0].length),this.append(n.slice(i,s<0?n.length:s)),s<0)break;if(this.lineBreak(),a>1)for(let u of this.points)u.node==e&&u.pos>this.text.length&&(u.pos-=a-1);i=s+a}}readNode(e){let n=ur.get(e),i=n&&n.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let r=i.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.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 i of this.points)i.node==e&&e.childNodes[i.offset]==n&&(i.pos=this.text.length)}findPointInside(e,n){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(Mge(e,i.node,i.offset)?n:0))}}function Mge(t,e,n){for(;;){if(!e||n<xu(e))return!1;if(e==t)return!0;n=ad(e)+1,e=e.parentNode}}function Rge(t,e){let n;for(;!(t==e||!t);t=t.nextSibling){let i=ur.get(t);if(!(i!=null&&i.isWidget()))return!1;i&&(n||(n=[])).push(i)}if(n)for(let i of n){let r=i.overrideDOMText;if(r!=null&&r.length)return!1}return!0}class mP{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class Dge{constructor(e,n,i,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:s,impreciseAnchor:a}=e.docView,l=e.state.selection;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=tY(e.docView.tile,n,i,0))){let u=s||a?[]:Ige(e),d=new Ege(u,e);d.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=d.text,this.newSel=Bge(u,this.bounds.from)}else{let u=e.observer.selectionRange,d=s&&s.node==u.focusNode&&s.offset==u.focusOffset||!N2(e.contentDOM,u.focusNode)?l.main.head:e.docView.posFromDOM(u.focusNode,u.focusOffset),f=a&&a.node==u.anchorNode&&a.offset==u.anchorOffset||!N2(e.contentDOM,u.anchorNode)?l.main.anchor:e.docView.posFromDOM(u.anchorNode,u.anchorOffset),p=e.viewport;if((xt.ios||xt.chrome)&&d!=f&&Math.min(d,f)<=l.main.from&&Math.max(d,f)>=l.main.to&&(p.from>0||p.to<e.state.doc.length)){let m=Math.min(d,f),v=Math.max(d,f),y=p.from-m,b=p.to-v;(y==0||y==1||m==0)&&(b==0||b==-1||v==e.state.doc.length)&&(d=0,f=e.state.doc.length)}if(e.inputState.composing>-1&&l.ranges.length>1)this.newSel=l.replaceRange(Le.range(f,d));else if(e.lineWrapping&&f==d&&!(l.main.empty&&l.main.head==d)&&e.inputState.lastTouchTime>Date.now()-100){let m=e.coordsAtPos(d,-1),v=0;m&&(v=e.inputState.lastTouchY<=m.bottom?-1:1),this.newSel=Le.create([Le.cursor(d,v)])}else this.newSel=Le.single(f,d)}}}function tY(t,e,n,i){if(t.isComposite()){let r=-1,s=-1,a=-1,l=-1;for(let u=0,d=i,f=i;u<t.children.length;u++){let p=t.children[u],m=d+p.length;if(d<e&&m>n)return tY(p,e,n,d);if(m>=e&&r==-1&&(r=u,s=d),d>n&&p.dom.parentNode==t.dom){a=u,l=f;break}f=m,d=m+p.breakAfter}return{from:s,to:l<0?i+t.length:l,startDOM:(r?t.children[r-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:a<t.children.length&&a>=0?t.children[a].dom:null}}else return t.isText()?{from:i,to:i+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function nY(t,e){let n,{newSel:i}=e,{state:r}=t,s=r.selection.main,a=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:l,to:u}=e.bounds,d=s.from,f=null;(a===8||xt.android&&e.text.length<u-l)&&(d=s.to,f="end");let p=r.doc.sliceString(l,u,Fp),m,v;!s.empty&&s.from>=l&&s.to<=u&&(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:zn.of(e.text.slice(s.from-l,m).split(Fp))}:(v=iY(p,e.text,d-l,f))&&(xt.chrome&&a==13&&v.toB==v.from+2&&e.text.slice(v.from,v.toB)==Fp+Fp&&v.toB--,n={from:l+v.from,to:l+v.toA,insert:zn.of(e.text.slice(v.from,v.toB).split(Fp))})}else i&&(!t.hasFocus&&r.facet(ou)||tw(i,s))&&(i=null);if(!n&&!i)return!1;if((xt.mac||xt.android)&&n&&n.from==n.to&&n.from==s.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(i&&n.insert.length==2&&(i=Le.single(i.main.anchor-1,i.main.head-1)),n={from:n.from,to:n.to,insert:zn.of([n.insert.toString().replace("."," ")])}):r.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:r.toText(t.inputState.insertingText)}:xt.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==`
 `&&t.lineWrapping&&(i&&(i=Le.single(i.main.anchor-1,i.main.head-1)),n={from:s.from,to:s.to,insert:zn.of([" "])}),n)return aD(t,n,i,a);if(i&&!tw(i,s)){let l=!1,u="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(l=!0),u=t.inputState.lastSelectionOrigin,u=="select.pointer"&&(i=eY(r.facet(ix).map(d=>d(t)),i))),t.dispatch({selection:i,scrollIntoView:l,userEvent:u}),!0}else return!1}function aD(t,e,n,i=-1){if(xt.ios&&t.inputState.flushIOSKey(e))return!0;let r=t.state.selection.main;if(xt.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&t.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&dm(t.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||i==8&&e.insert.length<e.to-e.from&&e.to>r.head)&&dm(t.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&dm(t.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let a,l=()=>a||(a=Nge(t,e,n));return t.state.facet(HQ).some(u=>u(t,e.from,e.to,s,l))||t.dispatch(l()),!0}function Nge(t,e,n){let i,r=t.state,s=r.selection.main,a=-1;if(e.from==e.to&&e.from<s.from||e.from>s.to){let u=e.from<s.from?-1:1,d=u<0?s.from:s.to,f=vv(r.facet(ix).map(p=>p(t)),d,u);e.from==f&&(a=f)}if(a>-1)i={changes:e,selection:Le.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let u=s.from<e.from?r.sliceDoc(s.from,e.from):"",d=s.to>e.to?r.sliceDoc(e.to,s.to):"";i=r.replaceSelection(t.state.toText(u+e.insert.sliceString(0,void 0,t.state.lineBreak)+d))}else{let u=r.changes(e),d=n&&n.main.to<=u.newLength?n.main:void 0;if(r.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&&JQ(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;i=r.changeByRange(y=>{if(y.from==s.from&&y.to==s.to)return{changes:u,range:d||y.map(u)};let b=y.to-v,A=b-f.length;if(t.state.sliceDoc(A,b)!=f||b>=p.from&&A<=p.to)return{range:y};let w=r.changes({from:A,to:b,insert:e.insert}),S=y.to-s.to;return{changes:w,range:d?Le.range(Math.max(0,d.anchor+S),Math.max(0,d.head+S)):y.map(w)}})}else i={changes:u,selection:d&&r.selection.replaceRange(d)}}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)),r.update(i,{userEvent:l,scrollIntoView:!0})}function iY(t,e,n,i){let r=Math.min(t.length,e.length),s=0;for(;s<r&&t.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==r&&t.length==e.length)return null;let a=t.length,l=e.length;for(;a>0&&l>0&&t.charCodeAt(a-1)==e.charCodeAt(l-1);)a--,l--;if(i=="end"){let u=Math.max(0,s-Math.min(a,l));n-=a+u-s}if(a<s&&t.length<e.length){let u=n<=s&&n>=a?s-n:0;s-=u,l=s+(l-a),a=s}else if(l<s){let u=n<=s&&n>=l?s-n:0;s-=u,a=s+(a-l),l=s}return{from:s,toA:a,toB:l}}function Ige(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}=t.observer.selectionRange;return n&&(e.push(new mP(n,i)),(r!=n||s!=i)&&e.push(new mP(r,s))),e}function Bge(t,e){if(t.length==0)return null;let n=t[0].pos,i=t.length==2?t[1].pos:n;return n>-1&&i>-1?Le.single(n+e,i+e):null}function tw(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class Lge{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,xt.safari&&e.contentDOM.addEventListener("input",()=>null),xt.gecko&&Jge(e.contentDOM.ownerDocument)}handleEvent(e){!Wge(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 i=this.handlers[e];if(i){for(let r of i.observers)r(this.view,n);for(let r of i.handlers){if(n.defaultPrevented)break;if(r(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=Fge(e),i=this.handlers,r=this.view.contentDOM;for(let s in n)if(s!="scroll"){let a=!n[s].handlers.length,l=i[s];l&&a!=!l.handlers.length&&(r.removeEventListener(s,this.handleEvent),l=null),l||r.addEventListener(s,this.handleEvent,{passive:a})}for(let s in i)s!="scroll"&&!n[s]&&r.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&&sY.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),xt.android&&xt.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if(xt.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&(rY.some(n=>n.keyCode==e.keyCode)&&!e.ctrlKey||$ge.indexOf(e.key)>-1&&e.ctrlKey)){let n={ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey};return n.shiftKey&&xt.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&Pge(this.view.win)&&(n.shiftKey=!1),this.pendingIOSKey={key:e.key,keyCode:e.keyCode,mods:n},setTimeout(()=>this.flushIOSKey(),250),!0}return 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,dm(this.view.contentDOM,n.key,n.keyCode,n.mods))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:xt.safari&&!xt.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 Pge(t){return t.visualViewport?t.visualViewport.height*t.visualViewport.scale/t.document.documentElement.clientHeight<.85:!1}function gP(t,e){return(n,i)=>{try{return e.call(t,i,n)}catch(r){Ks(n.state,r)}}}function Fge(t){let e=Object.create(null);function n(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of t){let r=i.spec,s=r&&r.plugin.domEventHandlers,a=r&&r.plugin.domEventObservers;if(s)for(let l in s){let u=s[l];u&&n(l).handlers.push(gP(i.value,u))}if(a)for(let l in a){let u=a[l];u&&n(l).observers.push(gP(i.value,u))}}for(let i in bl)n(i).handlers.push(bl[i]);for(let i in io)n(i).observers.push(io[i]);return e}const rY=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],$ge="dthko",sY=[16,17,18,20,91,92,224,225],Jb=6;function eA(t){return Math.max(0,t)*.7+8}function zge(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class Hge{constructor(e,n,i,r){this.view=e,this.startEvent=n,this.style=i,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=TQ(e.contentDOM),this.atoms=e.state.facet(ix).map(a=>a(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(kn.allowMultipleSelections)&&qge(e,n),this.dragging=Yge(e,n)&&lY(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&&zge(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,i=0,r=0,s=0,a=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let u=oD(this.view);e.clientX-u.left<=r+Jb?n=-eA(r-e.clientX):e.clientX+u.right>=a-Jb&&(n=eA(e.clientX-a)),e.clientY-u.top<=s+Jb?i=-eA(s-e.clientY):e.clientY+u.bottom>=l-Jb&&(i=eA(e.clientY-l)),this.setScrollSpeed(n,i)}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,i=eY(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!i.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,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 qge(t,e){let n=t.state.facet(PQ);return n.length?n[0](e):xt.mac?e.metaKey:e.ctrlKey}function Qge(t,e){let n=t.state.facet(FQ);return n.length?n[0](e):xt.mac?!e.altKey:!e.ctrlKey}function Yge(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let i=Kv(t.root);if(!i||i.rangeCount==0)return!0;let r=i.getRangeAt(0).getClientRects();for(let s=0;s<r.length;s++){let a=r[s];if(a.left<=e.clientX&&a.right>=e.clientX&&a.top<=e.clientY&&a.bottom>=e.clientY)return!0}return!1}function Wge(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,i;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(i=ur.get(n))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(e))return!1;return!0}const bl=Object.create(null),io=Object.create(null),oY=xt.ie&&xt.ie_version<15||xt.ios&&xt.webkit_version<604;function Uge(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(),aY(t,n.value)},50)}function dj(t,e,n){for(let i of t.facet(e))n=i(n,t);return n}function aY(t,e){e=dj(t.state,nD,e);let{state:n}=t,i,r=1,s=n.toText(e),a=s.lines==n.selection.ranges.length;if(H2!=null&&n.selection.ranges.every(u=>u.empty)&&H2==s.toString()){let u=-1;i=n.changeByRange(d=>{let f=n.doc.lineAt(d.from);if(f.from==u)return{range:d};u=f.from;let p=n.toText((a?s.line(r++).text:e)+n.lineBreak);return{changes:{from:f.from,insert:p},range:Le.cursor(d.from+p.length)}})}else a?i=n.changeByRange(u=>{let d=s.line(r++);return{changes:{from:u.from,to:u.to,insert:d.text},range:Le.cursor(u.from+d.length)}}):i=n.replaceSelection(s);t.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}io.scroll=t=>{let e=t.inputState;e.lastScrollTop=t.scrollDOM.scrollTop,e.lastScrollLeft=t.scrollDOM.scrollLeft,xt.ios&&!e.touchActive&&(e.lastIOSMomentumScroll=Date.now())};io.wheel=io.mousewheel=t=>{t.inputState.lastWheelEvent=Date.now()};bl.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);io.touchstart=(t,e)=>{let n=t.inputState,i=e.targetTouches[0];n.touchActive=!0,n.lastTouchTime=Date.now(),i&&(n.lastTouchX=i.clientX,n.lastTouchY=i.clientY),n.setSelectionOrigin("select.pointer")};io.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};io.touchend=(t,e)=>{t.inputState.touchActive=!1};bl.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let i of t.state.facet($Q))if(n=i(t,e),n)break;if(!n&&e.button==0&&(n=Gge(t,e)),n){let i=!t.hasFocus;t.inputState.startMouseSelection(new Hge(t,e,n,i)),i&&t.observer.ignore(()=>{OQ(t.contentDOM);let s=t.root.activeElement;s&&!s.contains(t.contentDOM)&&s.blur()});let r=t.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function vP(t,e,n,i){if(i==1)return Le.cursor(e,n);if(i==2)return jge(t.state,e,n);{let r=t.docView.lineAt(e,n),s=t.state.doc.lineAt(r?r.posAtEnd:e),a=r?r.posAtStart:s.from,l=r?r.posAtEnd:s.to;return l<t.state.doc.length&&l==s.to&&l++,Le.undirectionalRange(a,l)}}const Vge=xt.ie&&xt.ie_version<=11;let yP=null,xP=0,bP=0;function lY(t){if(!Vge)return t.detail;let e=yP,n=bP;return yP=t,bP=Date.now(),xP=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(xP+1)%3:1}function Gge(t,e){let n=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),i=lY(e),r=t.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),r=r.map(s.changes))},get(s,a,l){let u=t.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),d,f=vP(t,u.pos,u.assoc,i);if(n.pos!=u.pos&&!a){let p=vP(t,n.pos,n.assoc,i),m=Math.min(p.from,f.from),v=Math.max(p.to,f.to);f=m<f.from?Le.range(m,v,f.assoc):Le.range(v,m,f.assoc)}return a?r.replaceRange(r.main.extend(f.from,f.to,f.assoc)):l&&i==1&&r.ranges.length>1&&(d=Xge(r,u.pos))?d:l?r.addRange(f):Le.create([f])}}}function Xge(t,e){for(let n=0;n<t.ranges.length;n++){let{from:i,to:r}=t.ranges[n];if(i<=e&&r>=e)return Le.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}bl.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let r=t.docView.tile.nearest(e.target);if(r&&r.isWidget()){let s=r.posAtStart,a=s+r.length;(s>=n.to||a<=n.from)&&(n=Le.undirectionalRange(s,a))}}let{inputState:i}=t;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",dj(t.state,iD,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};bl.dragend=t=>(t.inputState.draggedContent=null,!1);function AP(t,e,n,i){if(n=dj(t.state,nD,n),!n)return;let r=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=t.inputState,a=i&&s&&Qge(t,e)?{from:s.from,to:s.to}:null,l={from:r,insert:n},u=t.state.changes(a?[a,l]:l);t.focus(),t.dispatch({changes:u,selection:{anchor:u.mapPos(r,-1),head:u.mapPos(r,1)},userEvent:a?"move.drop":"input.drop"}),t.inputState.draggedContent=null}bl.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let i=Array(n.length),r=0,s=()=>{++r==n.length&&AP(t,e,i.filter(a=>a!=null).join(t.state.lineBreak),!1)};for(let a=0;a<n.length;a++){let l=new FileReader;l.onerror=s,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[a]=l.result),s()},l.readAsText(n[a])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return AP(t,e,i,!0),!0}return!1};bl.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=oY?null:e.clipboardData;return n?(aY(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(Uge(t),!1)};function Kge(t,e){let n=t.dom.parentNode;if(!n)return;let i=n.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),t.focus()},50)}function Zge(t){let e=[],n=[],i=!1;for(let r of t.selection.ranges)r.empty||(e.push(t.sliceDoc(r.from,r.to)),n.push(r));if(!e.length){let r=-1;for(let{from:s}of t.selection.ranges){let a=t.doc.lineAt(s);a.number>r&&(e.push(a.text),n.push({from:a.from,to:Math.min(t.doc.length,a.to+1)})),r=a.number}i=!0}return{text:dj(t,iD,e.join(t.lineBreak)),ranges:n,linewise:i}}let H2=null;bl.copy=bl.cut=(t,e)=>{if(!pv(t.contentDOM,t.observer.selectionRange))return!1;let{text:n,ranges:i,linewise:r}=Zge(t.state);if(!n&&!r)return!1;H2=r?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let s=oY?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(Kge(t,n),!1)};const cY=Ac.define();function uY(t,e){let n=[];for(let i of t.facet(qQ)){let r=i(t,e);r&&n.push(r)}return n.length?t.update({effects:n,annotations:cY.of(!0)}):null}function hY(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=uY(t.state,e);n?t.dispatch(n):t.update([])}},10)}io.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),hY(t)};io.blur=t=>{t.observer.clearSelectionRange(),hY(t)};io.compositionstart=io.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};io.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,xt.chrome&&xt.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};io.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};bl.beforeinput=(t,e)=>{var n,i;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"),a=e.getTargetRanges();if(s&&a.length){let l=a[0],u=t.posAtDOM(l.startContainer,l.startOffset),d=t.posAtDOM(l.endContainer,l.endOffset);return aD(t,{from:u,to:d,insert:t.state.toText(s)},null),!0}}let r;if(xt.chrome&&xt.android&&(r=rY.find(s=>s.inputType==e.inputType))&&(t.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let s=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var a;(((a=window.visualViewport)===null||a===void 0?void 0:a.height)||0)>s+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return xt.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),xt.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>io.compositionend(t,e),20),!1};const wP=new Set;function Jge(t){wP.has(t)||(wP.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const SP=["pre-wrap","normal","pre-line","break-spaces"];let eg=!1;function jP(){eg=!1}class e0e{constructor(e){this.lineWrapping=e,this.doc=zn.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let i=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((n-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}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 SP.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let i=0;i<e.length;i++){let r=e[i];r<0?i++:this.heightSamples[Math.floor(r*10)]||(n=!0,this.heightSamples[Math.floor(r*10)]=!0)}return n}refresh(e,n,i,r,s,a){let l=SP.indexOf(e)>-1,u=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=n,this.charWidth=i,this.textHeight=r,this.lineLength=s,u){this.heightSamples={};for(let d=0;d<a.length;d++){let f=a[d];f<0?d++:this.heightSamples[Math.floor(f*10)]=!0}}return u}}class t0e{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class rl{constructor(e,n,i,r,s){this.from=e,this.length=n,this.top=i,this.height=r,this._content=s}get type(){return typeof this._content=="number"?ws.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 Pf?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 rl(this.from,this.length+e.length,this.top,this.height+e.height,n)}}var Ti=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})(Ti||(Ti={}));const KA=.001;class to{constructor(e,n,i=2){this.length=e,this.height=n,this.flags=i}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)>KA&&(eg=!0),this.height=e)}replace(e,n,i){return to.of(i)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,i,r){let s=this,a=i.doc;for(let l=r.length-1;l>=0;l--){let{fromA:u,toA:d,fromB:f,toB:p}=r[l],m=s.lineAt(u,Ti.ByPosNoHeight,i.setDoc(n),0,0),v=m.to>=d?m:s.lineAt(d,Ti.ByPosNoHeight,i,0,0);for(p+=v.to-d,d=v.to;l>0&&m.from<=r[l-1].toA;)u=r[l-1].fromA,f=r[l-1].fromB,l--,u<m.from&&(m=s.lineAt(u,Ti.ByPosNoHeight,i,0,0));f+=m.from-u,u=m.from;let y=lD.build(i.setDoc(a),e,f,p);s=nw(s,s.replace(u,d,y))}return s.updateHeight(i,0)}static empty(){return new Uo(0,0,0)}static of(e){if(e.length==1)return e[0];let n=0,i=e.length,r=0,s=0;for(;;)if(n==i)if(r>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),i+=1+l.break,r-=l.size}else if(s>r*2){let l=e[i];l.break?e.splice(i,1,l.left,null,l.right):e.splice(i,1,l.left,l.right),i+=2+l.break,s-=l.size}else break;else if(r<s){let l=e[n++];l&&(r+=l.size)}else{let l=e[--i];l&&(s+=l.size)}let a=0;return e[n-1]==null?(a=1,n--):e[n]==null&&(a=1,i++),new i0e(to.of(e.slice(0,n)),a,to.of(e.slice(i)))}}function nw(t,e){return t==e?t:(t.constructor!=e.constructor&&(eg=!0),e)}to.prototype.size=1;const n0e=Bt.replace({});class dY extends to{constructor(e,n,i){super(e,n),this.deco=i,this.spaceAbove=0}mainBlock(e,n){return new rl(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,n,i,r){return this.spaceAbove&&e<i+this.spaceAbove?new rl(r,0,i,this.spaceAbove,n0e):this.mainBlock(i,r)}lineAt(e,n,i,r,s){let a=this.mainBlock(r,s);return this.spaceAbove?this.blockAt(0,i,r,s).join(a):a}forEachLine(e,n,i,r,s,a){e<=s+this.length&&n>=s&&a(this.lineAt(0,Ti.ByPos,i,r,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,i=!1,r){return r&&r.from<=n&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Uo extends dY{constructor(e,n,i){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(e,n){return new rl(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,n,i){let r=i[0];return i.length==1&&(r instanceof Uo||r instanceof ms&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof ms?r=new Uo(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):to.of(i)}updateHeight(e,n=0,i=!1,r){return r&&r.from<=n&&r.more?this.setMeasuredHeight(r):(i||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 ms extends to{constructor(e){super(e,0)}heightMetrics(e,n){let i=e.doc.lineAt(n).number,r=e.doc.lineAt(n+this.length).number,s=r-i+1,a,l=0;if(e.lineWrapping){let u=Math.min(this.height,e.lineHeight*s);a=u/s,this.length>s+1&&(l=(this.height-u)/(this.length-s-1))}else a=this.height/s;return{firstLine:i,lastLine:r,perLine:a,perChar:l}}blockAt(e,n,i,r){let{firstLine:s,lastLine:a,perLine:l,perChar:u}=this.heightMetrics(n,r);if(n.lineWrapping){let d=r+(e<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length)),f=n.doc.lineAt(d),p=l+f.length*u,m=Math.max(i,e-p/2);return new rl(f.from,f.length,m,p,0)}else{let d=Math.max(0,Math.min(a-s,Math.floor((e-i)/l))),{from:f,length:p}=n.doc.line(s+d);return new rl(f,p,i+l*d,l,0)}}lineAt(e,n,i,r,s){if(n==Ti.ByHeight)return this.blockAt(e,i,r,s);if(n==Ti.ByPosNoHeight){let{from:v,to:y}=i.doc.lineAt(e);return new rl(v,y-v,0,0,0)}let{firstLine:a,perLine:l,perChar:u}=this.heightMetrics(i,s),d=i.doc.lineAt(e),f=l+d.length*u,p=d.number-a,m=r+l*p+u*(d.from-s-p);return new rl(d.from,d.length,Math.max(r,Math.min(m,r+this.height-f)),f,0)}forEachLine(e,n,i,r,s,a){e=Math.max(e,s),n=Math.min(n,s+this.length);let{firstLine:l,perLine:u,perChar:d}=this.heightMetrics(i,s);for(let f=e,p=r;f<=n;){let m=i.doc.lineAt(f);if(f==e){let y=m.number-l;p+=u*y+d*(e-s-y)}let v=u+d*m.length;a(new rl(m.from,m.length,p,v,0)),p+=v,f=m.to+1}}replace(e,n,i){let r=this.length-n;if(r>0){let s=i[i.length-1];s instanceof ms?i[i.length-1]=new ms(s.length+r):i.push(null,new ms(r-1))}if(e>0){let s=i[0];s instanceof ms?i[0]=new ms(e+s.length):i.unshift(new ms(e-1),null)}return to.of(i)}decomposeLeft(e,n){n.push(new ms(e-1),null)}decomposeRight(e,n){n.push(null,new ms(this.length-e-1))}updateHeight(e,n=0,i=!1,r){let s=n+this.length;if(r&&r.from<=n+this.length&&r.more){let a=[],l=Math.max(n,r.from),u=-1;for(r.from>n&&a.push(new ms(r.from-n-1).updateHeight(e,n));l<=s&&r.more;){let f=e.doc.lineAt(l).length;a.length&&a.push(null);let p=r.heights[r.index++],m=0;p<0&&(m=-p,p=r.heights[r.index++]),u==-1?u=p:Math.abs(p-u)>=KA&&(u=-2);let v=new Uo(f,p,m);v.outdated=!1,a.push(v),l+=f+1}l<=s&&a.push(null,new ms(s-l).updateHeight(e,l));let d=to.of(a);return(u<0||Math.abs(d.height-this.height)>=KA||Math.abs(u-this.heightMetrics(e,n).perLine)>=KA)&&(eg=!0),nw(this,d)}else(i||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class i0e extends to{constructor(e,n,i){super(e.length+n+i.length,e.height+i.height,n|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,n,i,r){let s=i+this.left.height;return e<s?this.left.blockAt(e,n,i,r):this.right.blockAt(e,n,s,r+this.left.length+this.break)}lineAt(e,n,i,r,s){let a=r+this.left.height,l=s+this.left.length+this.break,u=n==Ti.ByHeight?e<a:e<l,d=u?this.left.lineAt(e,n,i,r,s):this.right.lineAt(e,n,i,a,l);if(this.break||(u?d.to<l:d.from>l))return d;let f=n==Ti.ByPosNoHeight?Ti.ByPosNoHeight:Ti.ByPos;return u?d.join(this.right.lineAt(l,f,i,a,l)):this.left.lineAt(l,f,i,r,s).join(d)}forEachLine(e,n,i,r,s,a){let l=r+this.left.height,u=s+this.left.length+this.break;if(this.break)e<u&&this.left.forEachLine(e,n,i,r,s,a),n>=u&&this.right.forEachLine(e,n,i,l,u,a);else{let d=this.lineAt(u,Ti.ByPos,i,r,s);e<d.from&&this.left.forEachLine(e,d.from-1,i,r,s,a),d.to>=e&&d.from<=n&&a(d),n>d.to&&this.right.forEachLine(d.to+1,n,i,l,u,a)}}replace(e,n,i){let r=this.left.length+this.break;if(n<r)return this.balanced(this.left.replace(e,n,i),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,n-r,i));let s=[];e>0&&this.decomposeLeft(e,s);let a=s.length;for(let l of i)s.push(l);if(e>0&&CP(s,a-1),n<this.length){let l=s.length;this.decomposeRight(n,s),CP(s,l)}return to.of(s)}decomposeLeft(e,n){let i=this.left.length;if(e<=i)return this.left.decomposeLeft(e,n);n.push(this.left),this.break&&(i++,e>=i&&n.push(null)),e>i&&this.right.decomposeLeft(e-i,n)}decomposeRight(e,n){let i=this.left.length,r=i+this.break;if(e>=r)return this.right.decomposeRight(e-r,n);e<i&&this.left.decomposeRight(e,n),this.break&&e<r&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?to.of(this.break?[e,null,n]:[e,n]):(this.left=nw(this.left,e),this.right=nw(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,i=!1,r){let{left:s,right:a}=this,l=n+s.length+this.break,u=null;return r&&r.from<=n+s.length&&r.more?u=s=s.updateHeight(e,n,i,r):s.updateHeight(e,n,i),r&&r.from<=l+a.length&&r.more?u=a=a.updateHeight(e,l,i,r):a.updateHeight(e,l,i),u?this.balanced(s,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function CP(t,e){let n,i;t[e]==null&&(n=t[e-1])instanceof ms&&(i=t[e+1])instanceof ms&&t.splice(e-1,3,new ms(n.length+1+i.length))}const r0e=5;class lD{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 i=Math.min(n,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof Uo?r.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Uo(i-this.pos,-1,0)),this.writtenTo=i,n>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,i){if(e<n||i.heightRelevant){let r=i.widget?i.widget.estimatedHeight:0,s=i.widget?i.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let a=n-e;i.block?this.addBlock(new dY(a,r,i)):(a||s||r>=r0e)&&this.addLineDeco(r,s,a)}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 Uo(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,n){let i=new ms(n-e);return this.oracle.doc.lineAt(e).to==n&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Uo)return e;let n=new Uo(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,i){let r=this.ensureLine();r.length+=i,r.collapsed+=i,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=n,this.writtenTo=this.pos=this.pos+i}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof Uo)&&!this.isCovered?this.nodes.push(new Uo(0,-1,0)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let i=e;for(let r of this.nodes)r instanceof Uo&&r.updateHeight(this.oracle,i),i+=r?r.length:1;return this.nodes}static build(e,n,i,r){let s=new lD(i,e);return Sn.spans(n,i,r,s,0),s.finish(i)}}function s0e(t,e,n){let i=new o0e;return Sn.compare(t,e,n,i,0),i.changes}class o0e{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,i,r){(e<n||i&&i.heightRelevant||r&&r.heightRelevant)&&hm(e,n,this.changes,5)}}function a0e(t,e){let n=t.getBoundingClientRect(),i=t.ownerDocument,r=i.defaultView||window,s=Math.max(0,n.left),a=Math.min(r.innerWidth,n.right),l=Math.max(0,n.top),u=Math.min(r.innerHeight,n.bottom);for(let d=t.parentNode;d&&d!=i.body;)if(d.nodeType==1){let f=d,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),a=Math.min(a,m.right),l=Math.max(l,m.top),u=Math.min(d==t.parentNode?r.innerHeight:u,m.bottom)}d=p.position=="absolute"||p.position=="fixed"?f.offsetParent:f.parentNode}else if(d.nodeType==11)d=d.host;else break;return{left:s-n.left,right:Math.max(s,a)-n.left,top:l-(n.top+e),bottom:Math.max(l,u)-(n.top+e)}}function l0e(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 c0e(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class Wk{constructor(e,n,i,r){this.from=e,this.to=n,this.size=i,this.displaySize=r}static same(e,n){if(e.length!=n.length)return!1;for(let i=0;i<e.length;i++){let r=e[i],s=n[i];if(r.from!=s.from||r.to!=s.to||r.size!=s.size)return!1}return!0}draw(e,n){return Bt.replace({widget:new u0e(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class u0e extends Cl{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 _P{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=kP,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Si.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let i=n.facet(rD).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new e0e(i),this.stateDeco=TP(n),this.heightMap=to.empty().applyChanges(this.stateDeco,zn.empty,this.heightOracle.setDoc(n.doc),[new Ca(0,0,0,n.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Bt.set(this.lineGaps.map(r=>r.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let i=0;i<=1;i++){let r=i?n.head:n.anchor;if(!e.some(({from:s,to:a})=>r>=s&&r<=a)){let{from:s,to:a}=this.lineBlockAt(r);e.push(new tA(s,a))}}return this.viewports=e.sort((i,r)=>i.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?kP:new cD(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(K0(e,this.scaler))})}update(e,n=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=TP(this.state);let r=e.changedRanges,s=Ca.extendWithRanges(r,s0e(i,this.stateDeco,e?e.changes:Br.empty(this.state.doc.length))),a=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);jP(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=a||eg)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let u=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.head<u.from||n.range.head>u.to)||!this.viewportIsAppropriate(u))&&(u=this.getViewport(0,n));let d=u.from!=this.viewport.from||u.to!=this.viewport.to;this.viewport=u,e.flags|=this.updateForViewport(),(d||!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(YQ)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,n=e.contentDOM,i=window.getComputedStyle(n),r=this.heightOracle,s=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?Si.RTL:Si.LTR;let a=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",l=n.getBoundingClientRect(),u=a||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let d=0,f=0;if(l.width&&l.height){let{scaleX:k,scaleY:E}=kQ(n,l);(k>.005&&Math.abs(this.scaleX-k)>.005||E>.005&&Math.abs(this.scaleY-E)>.005)&&(this.scaleX=k,this.scaleY=E,d|=16,a=u=!0)}let p=(parseInt(i.paddingTop)||0)*this.scaleY,m=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=p||this.paddingBottom!=m)&&(this.paddingTop=p,this.paddingBottom=m,d|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(u=!0),this.editorWidth=e.scrollDOM.clientWidth,d|=16);let v=TQ(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=EQ(this.scrollParent||e.win);let b=(this.printing?c0e:a0e)(n,this.paddingTop),A=b.top-this.pixelViewport.top,w=b.bottom-this.pixelViewport.bottom;this.pixelViewport=b;let S=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(S!=this.inView&&(this.inView=S,S&&(u=!0)),!this.inView&&!this.scrollTarget&&!l0e(e.dom))return 0;let j=l.width;if((this.contentDOMWidth!=j||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,d|=16),u){let k=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(k)&&(a=!0),a||r.lineWrapping&&Math.abs(j-this.contentDOMWidth)>r.charWidth){let{lineHeight:E,charWidth:M,textHeight:R}=e.docView.measureTextSize();a=E>0&&r.refresh(s,E,M,R,Math.max(5,j/M),k),a&&(e.docView.minWidth=0,d|=16)}A>0&&w>0?f=Math.max(A,w):A<0&&w<0&&(f=Math.min(A,w)),jP();for(let E of this.viewports){let M=E.from==this.viewport.from?k:e.docView.measureVisibleLineHeights(E);this.heightMap=(a?to.empty().applyChanges(this.stateDeco,zn.empty,this.heightOracle,[new Ca(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,a,new t0e(E.from,M))}eg&&(d|=2)}let C=!this.viewportIsAppropriate(this.viewport,f)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return C&&(d&2&&(d|=this.updateScaler()),this.viewport=this.getViewport(f,this.scrollTarget),d|=this.updateForViewport()),(d&2||C)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),d|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),d}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:a,visibleBottom:l}=this,u=new tA(r.lineAt(a-i*1e3,Ti.ByHeight,s,0,0).from,r.lineAt(l+(1-i)*1e3,Ti.ByHeight,s,0,0).to);if(n){let{head:d}=n.range;if(d<u.from||d>u.to){let f=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),p=r.lineAt(d,Ti.ByPos,s,0,0),m;n.y=="center"?m=(p.top+p.bottom)/2-f/2:n.y=="start"||n.y=="nearest"&&d<u.from?m=p.top:m=p.bottom-f,u=new tA(r.lineAt(m-1e3/2,Ti.ByHeight,s,0,0).from,r.lineAt(m+f+1e3/2,Ti.ByHeight,s,0,0).to)}}return u}mapViewport(e,n){let i=n.mapPos(e.from,-1),r=n.mapPos(e.to,1);return new tA(this.heightMap.lineAt(i,Ti.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,Ti.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},i=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,Ti.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(n,Ti.ByPos,this.heightOracle,0,0),{visibleTop:a,visibleBottom:l}=this;return(e==0||r<=a-Math.max(10,Math.min(-i,250)))&&(n==this.state.doc.length||s>=l+Math.max(10,Math.min(i,250)))&&r>a-2*1e3&&s<l+2*1e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let i=[];for(let r of e)n.touchesRange(r.from,r.to)||i.push(new Wk(n.mapPos(r.from),n.mapPos(r.to),r.size,r.displaySize));return i}ensureLineGaps(e,n){let i=this.heightOracle.lineWrapping,r=i?1e4:2e3,s=r>>1,a=r<<1;if(this.defaultTextDirection!=Si.LTR&&!i)return[];let l=[],u=(f,p,m,v)=>{if(p-f<s)return;let y=this.state.selection.main,b=[y.from];y.empty||b.push(y.to);for(let w of b)if(w>f&&w<p){u(f,w-10,m,v),u(w+10,p,m,v);return}let A=d0e(e,w=>w.from>=m.from&&w.to<=m.to&&Math.abs(w.from-f)<s&&Math.abs(w.to-p)<s&&!b.some(S=>w.from<S&&w.to>S));if(!A){if(p<m.to&&n&&i&&n.visibleRanges.some(j=>j.from<=p&&j.to>=p)){let j=n.moveToLineBoundary(Le.cursor(p),!1,!0).head;j>f&&(p=j)}let w=this.gapSize(m,f,p,v),S=i||w<2e6?w:2e6;A=new Wk(f,p,w,S)}l.push(A)},d=f=>{if(f.length<a||f.type!=ws.Text)return;let p=h0e(f.from,f.to,this.stateDeco);if(p.total<a)return;let m=this.scrollTarget?this.scrollTarget.range.head:null,v,y;if(i){let b=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,A,w;if(m!=null){let S=iA(p,m),j=((this.visibleBottom-this.visibleTop)/2+b)/f.height;A=S-j,w=S+j}else A=(this.visibleTop-f.top-b)/f.height,w=(this.visibleBottom-f.top+b)/f.height;v=nA(p,A),y=nA(p,w)}else{let b=p.total*this.heightOracle.charWidth,A=r*this.heightOracle.charWidth,w=0;if(b>2e6)for(let E of e)E.from>=f.from&&E.from<f.to&&E.size!=E.displaySize&&E.from*this.heightOracle.charWidth+w<this.pixelViewport.left&&(w=E.size-E.displaySize);let S=this.pixelViewport.left+w,j=this.pixelViewport.right+w,C,k;if(m!=null){let E=iA(p,m),M=((j-S)/2+A)/b;C=E-M,k=E+M}else C=(S-A)/b,k=(j+A)/b;v=nA(p,C),y=nA(p,k)}v>f.from&&u(f.from,v,f,p),y<f.to&&u(y,f.to,f,p)};for(let f of this.viewportLines)Array.isArray(f.type)?f.type.forEach(d):d(f);return l}gapSize(e,n,i,r){let s=iA(r,i)-iA(r,n);return this.heightOracle.lineWrapping?e.height*s:r.total*this.heightOracle.charWidth*s}updateLineGaps(e){Wk.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Bt.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 i=[];Sn.spans(n,this.viewport.from,this.viewport.to,{span(s,a){i.push({from:s,to:a})},point(){}},20);let r=0;if(i.length!=this.visibleRanges.length)r=12;else for(let s=0;s<i.length&&!(r&8);s++){let a=this.visibleRanges[s],l=i[s];(a.from!=l.from||a.to!=l.to)&&(r|=4,e&&e.mapPos(a.from,-1)==l.from&&e.mapPos(a.to,1)==l.to||(r|=8))}return this.visibleRanges=i,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||K0(this.heightMap.lineAt(e,Ti.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)||K0(this.heightMap.lineAt(this.scaler.fromDOM(e),Ti.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 K0(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 tA{constructor(e,n){this.from=e,this.to=n}}function h0e(t,e,n){let i=[],r=t,s=0;return Sn.spans(n,t,e,{span(){},point(a,l){a>r&&(i.push({from:r,to:a}),s+=a-r),r=l}},20),r<e&&(i.push({from:r,to:e}),s+=e-r),{total:s,ranges:i}}function nA({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=1)return e[e.length-1].to;let i=Math.floor(t*n);for(let r=0;;r++){let{from:s,to:a}=e[r],l=a-s;if(i<=l)return s+i;i-=l}}function iA(t,e){let n=0;for(let{from:i,to:r}of t.ranges){if(e<=r){n+=e-i;break}n+=r-i}return n/t.total}function d0e(t,e){for(let n of t)if(e(n))return n}const kP={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function TP(t){let e=t.facet(cj).filter(i=>typeof i!="function"),n=t.facet(sD).filter(i=>typeof i!="function");return n.length&&e.push(Sn.join(n)),e}class cD{constructor(e,n,i){let r=0,s=0,a=0;this.viewports=i.map(({from:l,to:u})=>{let d=n.lineAt(l,Ti.ByPos,e,0,0).top,f=n.lineAt(u,Ti.ByPos,e,0,0).bottom;return r+=f-d,{from:l,to:u,top:d,bottom:f,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(n.height-r);for(let l of this.viewports)l.domTop=a+(l.top-s)*this.scale,a=l.domBottom=l.domTop+(l.bottom-l.top),s=l.bottom}toDOM(e){for(let n=0,i=0,r=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.top)return r+(e-i)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);i=s.bottom,r=s.domBottom}}fromDOM(e){for(let n=0,i=0,r=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.domTop)return i+(e-r)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);i=s.bottom,r=s.domBottom}}eq(e){return e instanceof cD?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((n,i)=>n.from==e.viewports[i].from&&n.to==e.viewports[i].to):!1}}function K0(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),i=e.toDOM(t.bottom);return new rl(t.from,t.length,n,i-n,Array.isArray(t._content)?t._content.map(r=>K0(r,e)):t._content)}const rA=bt.define({combine:t=>t.join(" ")}),q2=bt.define({combine:t=>t.indexOf(!0)>-1}),Q2=sd.newName(),fY=sd.newName(),pY=sd.newName(),mY={"&light":"."+fY,"&dark":"."+pY};function Y2(t,e,n){return new sd(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,r=>{if(r=="&")return t;if(!n||!n[r])throw new RangeError(`Unsupported selector: ${r}`);return n[r]}):t+" "+i}})}const f0e=Y2("."+Q2,{"&":{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"}},mY),p0e={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Uk=xt.ie&&xt.ie_version<=11;class m0e{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Qme,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 i of n)this.queue.push(i);(xt.ie&&xt.ie_version<=11||xt.ios&&e.composing)&&n.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&xt.android&&e.constructor.EDIT_CONTEXT!==!1&&!(xt.chrome&&xt.chrome_version<126)&&(this.editContext=new v0e(e),e.state.facet(ou)&&(e.contentDOM.editContext=this.editContext.editContext)),Uk&&(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,i)=>n!=e[i]))){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:i}=this,r=this.selectionRange;if(i.state.facet(ou)?i.root.activeElement!=this.dom:!pv(this.dom,r))return;let s=r.anchorNode&&i.docView.tile.nearest(r.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(xt.ie&&xt.ie_version<=11||xt.android&&xt.chrome)&&!i.state.selection.main.empty&&r.focusNode&&gv(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=Kv(e.root);if(!n)return!1;let i=xt.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&g0e(this.view,n)||n;if(!i||this.selectionRange.eq(i))return!1;let r=pv(this.dom,i);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&Wme(this.dom,i)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(i),r&&(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 i=this.dom;i;)if(i.nodeType==1)!n&&e<this.scrollTargets.length&&this.scrollTargets[e]==i?e++:n||(n=this.scrollTargets.slice(0,e)),n&&n.push(i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;if(e<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,e)),n){for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);for(let i of this.scrollTargets=n)i.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,p0e),Uk&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Uk&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,n){var i;if(!this.delayedAndroidKey){let r=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&dm(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((i=this.delayedAndroidKey)===null||i===void 0)&&i.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,i=-1,r=!1;for(let s of e){let a=this.readMutation(s);a&&(a.typeOver&&(r=!0),n==-1?{from:n,to:i}=a:(n=Math.min(a.from,n),i=Math.max(a.to,i)))}return{from:n,to:i,typeOver:r}}readChange(){let{from:e,to:n,typeOver:i}=this.processRecords(),r=this.selectionChanged&&pv(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new Dge(this.view,e,n,i);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 i=this.view.state,r=nY(this.view,n);return this.view.state==i&&(n.domChanged||n.newSel&&!tw(this.view.state.selection,n.newSel.main))&&this.view.update([]),r}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 i=OP(n,e.previousSibling||e.target.previousSibling,-1),r=OP(n,e.nextSibling||e.target.nextSibling,1);return{from:i?n.posAfter(i):n.posAtStart,to:r?n.posBefore(r):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(ou)!=e.state.facet(ou)&&(e.view.contentDOM.editContext=e.state.facet(ou)?this.editContext.editContext:null))}destroy(){var e,n,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let r of this.scrollTargets)r.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 OP(t,e,n){for(;e;){let i=ur.get(e);if(i&&i.parent==t)return i;let r=e.parentNode;e=r!=t.dom?r:n>0?e.nextSibling:e.previousSibling}return null}function EP(t,e){let n=e.startContainer,i=e.startOffset,r=e.endContainer,s=e.endOffset,a=t.docView.domAtPos(t.state.selection.main.anchor,1);return gv(a.node,a.offset,r,s)&&([n,i,r,s]=[r,s,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}}function g0e(t,e){if(e.getComposedRanges){let r=e.getComposedRanges(t.root)[0];if(r)return EP(t,r)}let n=null;function i(r){r.preventDefault(),r.stopImmediatePropagation(),n=r.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",i,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",i,!0),n?EP(t,n):null}class v0e{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=i=>{let r=e.state.selection.main,{anchor:s,head:a}=r,l=this.toEditorPos(i.updateRangeStart),u=this.toEditorPos(i.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:l,drifted:!1});let d=u-l>i.text.length;l==this.from&&s<this.from?l=s:u==this.to&&s>this.to&&(u=s);let f=iY(e.state.sliceDoc(l,u),i.text,(d?r.from:r.to)-l,d?"end":null);if(!f){let m=Le.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));tw(m,r)||e.dispatch({selection:m,userEvent:"select"});return}let p={from:f.from+l,to:f.toA+l,insert:zn.of(i.text.slice(f.from,f.toB).split(`
`))};if((xt.mac||xt.android)&&p.from==a-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(p={from:l,to:u,insert:zn.of([i.text.replace("."," ")])}),this.pendingContextChange=p,!e.state.readOnly){let m=this.to-this.from+(p.to-p.from+p.insert.length);aD(e,p,Le.single(this.toEditorPos(i.selectionStart,m),this.toEditorPos(i.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,i.updateRangeStart-1),Math.min(n.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let r=[],s=null;for(let a=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);a<l;a++){let u=e.coordsForChar(a);s=u&&new DOMRect(u.left,u.top,u.right-u.left,u.bottom-u.top)||s||new DOMRect,r.push(s)}n.updateCharacterBounds(i.rangeStart,r)},this.handlers.textformatupdate=i=>{let r=[];for(let s of i.getTextFormats()){let a=s.underlineStyle,l=s.underlineThickness;if(!/none/i.test(a)&&!/none/i.test(l)){let u=this.toEditorPos(s.rangeStart),d=this.toEditorPos(s.rangeEnd);if(u<d){let f=`text-decoration: underline ${/^[a-z]/.test(a)?a+" ":a=="Dashed"?"dashed ":a=="Squiggle"?"wavy ":""}${/thin/i.test(l)?1:2}px`;r.push(Bt.mark({attributes:{style:f}}).range(u,d))}}}e.dispatch({effects:UQ.of(Bt.set(r))})},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:i}=this.composing;this.composing=null,i&&this.reset(e.state)}};for(let i in this.handlers)n.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{let r=Kv(i.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,i=!1,r=this.pendingContextChange;return e.changes.iterChanges((s,a,l,u,d)=>{if(i)return;let f=d.length-(a-s);if(r&&a>=r.to)if(r.from==s&&r.to==a&&r.insert.eq(d)){r=this.pendingContextChange=null,n+=f,this.to+=f;return}else r=null,this.revertPending(e.state);if(s+=n,a+=n,a<=this.from)this.from+=f,this.to+=f;else if(s<this.to){if(s<this.from||a>this.to||this.to-this.from+d.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(a),d.toString()),this.to+=f}n+=f}),r&&!i&&this.revertPending(e.state),!i}update(e){let n=this.pendingContextChange,i=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(i.from,i.to)&&e.transactions.some(r=>!r.isUserEvent("input.type")&&r.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,i=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),r=this.toContextPos(n.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(i,r)}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 i=this.composing;return i&&i.drifted?i.editorBase+(e-i.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 ut{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:i}=e;this.dispatchTransactions=e.dispatchTransactions||i&&(r=>r.forEach(s=>i(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||Yme(e.parent)||document,this.viewState=new _P(this,e.state||kn.create(e)),e.scrollTo&&e.scrollTo.is(Zb)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Up).map(r=>new zk(r));for(let r of this.plugins)r.update(this);this.observer=new m0e(this),this.inputState=new Lge(this),this.inputState.ensureHandlers(this.plugins),this.docView=new fP(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 Mr?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,i=!1,r,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 a=this.hasFocus,l=0,u=null;e.some(m=>m.annotation(cY))?(this.inputState.notifiedFocused=a,l=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,u=uY(s,a),u||(l=1));let d=this.observer.delayedAndroidKey,f=null;if(d?(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(kn.phrases)!=this.state.facet(kn.phrases))return this.setState(s);r=Z1.create(this,s,e),r.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:b}=this.state.facet(ut.cursorScrollMargin);p=new fm(v.empty?v:Le.cursor(v.head,v.head>v.anchor?-1:1),"nearest","nearest",b,y)}for(let v of m.effects)v.is(Zb)&&(p=v.value.clip(this.state))}this.viewState.update(r,p),this.bidiCache=iw.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),n=this.docView.update(r),this.state.facet(X0)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(m=>m.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(rA)!=r.state.facet(rA)&&(this.viewState.mustMeasureContent=!0),(n||i||p||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!r.empty)for(let m of this.state.facet(P2))try{m(r)}catch(v){Ks(this.state,v,"update listener")}(u||f)&&Promise.resolve().then(()=>{u&&this.state==u.startState&&this.dispatch(u),f&&!nY(this,f)&&d.force&&dm(this.contentDOM,d.key,d.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 i of this.plugins)i.destroy(this);this.viewState=new _P(this,e),this.plugins=e.facet(Up).map(i=>new zk(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new fP(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(Up),i=e.state.facet(Up);if(n!=i){let r=[];for(let s of i){let a=n.indexOf(s);if(a<0)r.push(new zk(s));else{let l=this.plugins[a];l.mustUpdate=e,r.push(l)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r<this.plugins.length;r++)this.plugins[r].update(this);n!=i&&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(i){Ks(this.state,i,"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,i=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:a}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(a<0)if(EQ(i||this.win))s=-1,a=this.viewState.heightMap.height;else{let v=this.viewState.scrollAnchorAt(r);s=v.from,a=v.top}this.updateState=1;let u=this.viewState.measure();if(!u&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let d=[];u&4||([this.measureRequests,d]=[d,this.measureRequests]);let f=d.map(v=>{try{return v.read(this)}catch(y){return Ks(this.state,y),MP}}),p=Z1.create(this,this.state,[]),m=!1;p.flags|=u,n?n.flags|=u:n=p,this.updateState=2,p.empty||(this.updatePlugins(p),this.inputState.update(p),this.updateAttrs(),m=this.docView.update(p),m&&this.docViewUpdate());for(let v=0;v<d.length;v++)if(f[v]!=MP)try{let y=d[v];y.write&&y.write(f[v],this)}catch(y){Ks(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,a=-1;continue}else{let y=((s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-a)/this.scaleY;if((y>1||y<-1)&&!(xt.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r=r+y,i?i.scrollTop+=y:this.win.scrollBy(0,y),a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let l of this.state.facet(P2))l(n)}get themeClasses(){return Q2+" "+(this.state.facet(q2)?pY:fY)+" "+this.state.facet(rA)}updateAttrs(){let e=RP(this,VQ,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(ou)?"true":"false",class:"cm-content",style:`${xt.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),RP(this,rD,n);let i=this.observer.ignore(()=>{let r=aP(this.contentDOM,this.contentAttrs,n),s=aP(this.dom,this.editorAttrs,e);return r||s});return this.editorAttrs=e,this.contentAttrs=n,i}showAnnouncements(e){let n=!0;for(let i of e)for(let r of i.effects)if(r.is(ut.announce)){n&&(this.announceDOM.textContent=""),n=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(X0);let e=this.state.facet(ut.cspNonce);sd.mount(this.root,this.styleModules.concat(f0e).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(i=>i.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,i){return Yk(this,e,pP(this,e,n,i))}moveByGroup(e,n){return Yk(this,e,pP(this,e,n,i=>kge(this,e.head,i)))}visualLineSide(e,n){let i=this.bidiSpans(e),r=this.textDirectionAt(e.from),s=i[n?i.length-1:0];return Le.cursor(s.side(n,r)+e.from,s.forward(!n,r)?1:-1)}moveToLineBoundary(e,n,i=!0){return _ge(this,e,n,i)}moveVertically(e,n,i){return Yk(this,e,Tge(this,e,n,i))}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 i=z2(this,e,n);return i&&i.pos}posAndSideAtCoords(e,n=!0){return this.readMeasured(),z2(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let i=this.state.doc.lineAt(e),r=this.bidiSpans(i),s=r[nc.find(r,e-i.from,-1,n)];return this.docView.coordsAt(e,n,s.dir==Si.RTL)}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(QQ)||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>y0e)return BQ(e.length);let n=this.textDirectionAt(e.from),i;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==n&&(s.fresh||IQ(s.isolates,i=uP(this,e))))return s.order;i||(i=uP(this,e));let r=Jme(e.text,n,i);return this.bidiCache.push(new iw(e.from,e.to,n,i,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||xt.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{OQ(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 i,r,s,a;return Zb.of(new fm(typeof e=="number"?Le.cursor(e):e,(i=n.y)!==null&&i!==void 0?i:"nearest",(r=n.x)!==null&&r!==void 0?r:"nearest",(s=n.yMargin)!==null&&s!==void 0?s:5,(a=n.xMargin)!==null&&a!==void 0?a:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return Zb.of(new fm(Le.cursor(i.from),"start","start",i.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 Ji.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Ji.define(()=>({}),{eventObservers:e})}static theme(e,n){let i=sd.newName(),r=[rA.of(i),X0.of(Y2(`.${i}`,e))];return n&&n.dark&&r.push(q2.of(!0)),r}static baseTheme(e){return Mu.lowest(X0.of(Y2("."+Q2,e,mY)))}static findFromDOM(e){var n;let i=e.querySelector(".cm-content"),r=i&&ur.get(i)||ur.get(e);return((n=r==null?void 0:r.root)===null||n===void 0?void 0:n.view)||null}}ut.styleModule=X0;ut.inputHandler=HQ;ut.clipboardInputFilter=nD;ut.clipboardOutputFilter=iD;ut.scrollHandler=WQ;ut.focusChangeEffect=qQ;ut.perLineTextDirection=QQ;ut.exceptionSink=zQ;ut.updateListener=P2;ut.editable=ou;ut.mouseSelectionStyle=$Q;ut.dragMovesSelection=FQ;ut.clickAddsSelectionRange=PQ;ut.decorations=cj;ut.blockWrappers=GQ;ut.outerDecorations=sD;ut.atomicRanges=ix;ut.bidiIsolatedRanges=XQ;ut.cursorScrollMargin=bt.define({combine:t=>{let e=5,n=5;for(let i of t)typeof i=="number"?e=n=i:{x:e,y:n}=i;return{x:e,y:n}}});ut.scrollMargins=KQ;ut.darkTheme=q2;ut.cspNonce=bt.define({combine:t=>t.length?t[0]:""});ut.contentAttributes=rD;ut.editorAttributes=VQ;ut.lineWrapping=ut.contentAttributes.of({class:"cm-lineWrapping"});ut.announce=Xt.define();const y0e=4096,MP={};class iw{constructor(e,n,i,r,s,a){this.from=e,this.to=n,this.dir=i,this.isolates=r,this.fresh=s,this.order=a}static update(e,n){if(n.empty&&!e.some(s=>s.fresh))return e;let i=[],r=e.length?e[e.length-1].dir:Si.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let a=e[s];a.dir==r&&!n.touchesRange(a.from,a.to)&&i.push(new iw(n.mapPos(a.from,1),n.mapPos(a.to,-1),a.dir,a.isolates,!1,a.order))}return i}}function RP(t,e,n){for(let i=t.state.facet(e),r=i.length-1;r>=0;r--){let s=i[r],a=typeof s=="function"?s(t):s;a&&JR(a,n)}return n}const x0e=xt.mac?"mac":xt.windows?"win":xt.linux?"linux":"key";function b0e(t,e){const n=t.split(/-(?!$)/);let i=n[n.length-1];i=="Space"&&(i=" ");let r,s,a,l;for(let u=0;u<n.length-1;++u){const d=n[u];if(/^(cmd|meta|m)$/i.test(d))l=!0;else if(/^a(lt)?$/i.test(d))r=!0;else if(/^(c|ctrl|control)$/i.test(d))s=!0;else if(/^s(hift)?$/i.test(d))a=!0;else if(/^mod$/i.test(d))e=="mac"?l=!0:s=!0;else throw new Error("Unrecognized modifier name: "+d)}return r&&(i="Alt-"+i),s&&(i="Ctrl-"+i),l&&(i="Meta-"+i),a&&(i="Shift-"+i),i}function sA(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 A0e=Mu.default(ut.domEventHandlers({keydown(t,e){return vY(gY(e.state),t,e,"editor")}})),Gh=bt.define({enables:A0e}),DP=new WeakMap;function gY(t){let e=t.facet(Gh),n=DP.get(e);return n||DP.set(e,n=j0e(e.reduce((i,r)=>i.concat(r),[]))),n}function w0e(t,e,n){return vY(gY(t.state),e,t,n)}let Oh=null;const S0e=4e3;function j0e(t,e=x0e){let n=Object.create(null),i=Object.create(null),r=(a,l)=>{let u=i[a];if(u==null)i[a]=l;else if(u!=l)throw new Error("Key binding "+a+" is used both as a regular binding and as a multi-stroke prefix")},s=(a,l,u,d,f)=>{var p,m;let v=n[a]||(n[a]=Object.create(null)),y=l.split(/ (?!$)/).map(w=>b0e(w,e));for(let w=1;w<y.length;w++){let S=y.slice(0,w).join(" ");r(S,!0),v[S]||(v[S]={preventDefault:!0,stopPropagation:!1,run:[j=>{let C=Oh={view:j,prefix:S,scope:a};return setTimeout(()=>{Oh==C&&(Oh=null)},S0e),!0}]})}let b=y.join(" ");r(b,!1);let A=v[b]||(v[b]={preventDefault:!1,stopPropagation:!1,run:((m=(p=v._any)===null||p===void 0?void 0:p.run)===null||m===void 0?void 0:m.slice())||[]});u&&A.run.push(u),d&&(A.preventDefault=!0),f&&(A.stopPropagation=!0)};for(let a of t){let l=a.scope?a.scope.split(" "):["editor"];if(a.any)for(let d of l){let f=n[d]||(n[d]=Object.create(null));f._any||(f._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:p}=a;for(let m in f)f[m].run.push(v=>p(v,W2))}let u=a[e]||a.key;if(u)for(let d of l)s(d,u,a.run,a.preventDefault,a.stopPropagation),a.shift&&s(d,"Shift-"+u,a.shift,a.preventDefault,a.stopPropagation)}return n}let W2=null;function vY(t,e,n,i){W2=e;let r=Pme(e),s=bo(r,0),a=Zl(s)==r.length&&r!=" ",l="",u=!1,d=!1,f=!1;Oh&&Oh.view==n&&Oh.scope==i&&(l=Oh.prefix+" ",sY.indexOf(e.keyCode)<0&&(d=!0,Oh=null));let p=new Set,m=A=>{if(A){for(let w of A.run)if(!p.has(w)&&(p.add(w),w(n)))return A.stopPropagation&&(f=!0),!0;A.preventDefault&&(A.stopPropagation&&(f=!0),d=!0)}return!1},v=t[i],y,b;return v&&(m(v[l+sA(r,e,!a)])?u=!0:a&&(e.altKey||e.metaKey||e.ctrlKey)&&!(xt.windows&&e.ctrlKey&&e.altKey)&&!(xt.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(y=od[e.keyCode])&&y!=r?(m(v[l+sA(y,e,!0)])||e.shiftKey&&(b=Gv[e.keyCode])!=r&&b!=y&&m(v[l+sA(b,e,!1)]))&&(u=!0):a&&e.shiftKey&&m(v[l+sA(r,e,!0)])&&(u=!0),!u&&m(v._any)&&(u=!0)),d&&(u=!0),u&&f&&e.stopPropagation(),W2=null,u}class Mf{constructor(e,n,i,r,s){this.className=e,this.left=n,this.top=i,this.width=r,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,i){if(i.empty){let r=e.coordsAtPos(i.head,i.assoc||1);if(!r)return[];let s=yY(e);return[new Mf(n,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return C0e(e,n,i)}}function yY(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==Si.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function NP(t,e,n,i){let r=t.coordsAtPos(e,n*2);if(!r)return i;let s=t.dom.getBoundingClientRect(),a=(r.top+r.bottom)/2,l=t.posAtCoords({x:s.left+1,y:a}),u=t.posAtCoords({x:s.right-1,y:a});return l==null||u==null?i:{from:Math.max(i.from,Math.min(l,u)),to:Math.min(i.to,Math.max(l,u))}}function C0e(t,e,n){if(n.to<=t.viewport.from||n.from>=t.viewport.to)return[];let i=Math.max(n.from,t.viewport.from),r=Math.min(n.to,t.viewport.to),s=t.textDirection==Si.LTR,a=t.contentDOM,l=a.getBoundingClientRect(),u=yY(t),d=a.querySelector(".cm-line"),f=d&&window.getComputedStyle(d),p=l.left+(f?parseInt(f.paddingLeft)+Math.min(0,parseInt(f.textIndent)):0),m=l.right-(f?parseInt(f.paddingRight):0),v=$2(t,i,1),y=$2(t,r,-1),b=v.type==ws.Text?v:null,A=y.type==ws.Text?y:null;if(b&&(t.lineWrapping||v.widgetLineBreaks)&&(b=NP(t,i,1,b)),A&&(t.lineWrapping||y.widgetLineBreaks)&&(A=NP(t,r,-1,A)),b&&A&&b.from==A.from&&b.to==A.to)return S(j(n.from,n.to,b));{let k=b?j(n.from,null,b):C(v,!1),E=A?j(null,n.to,A):C(y,!0),M=[];return(b||v).to<(A||y).from-(b&&A?1:0)||v.widgetLineBreaks>1&&k.bottom+t.defaultLineHeight/2<E.top?M.push(w(p,k.bottom,m,E.top)):k.bottom<E.top&&t.elementAtHeight((k.bottom+E.top)/2).type==ws.Text&&(k.bottom=E.top=(k.bottom+E.top)/2),S(k).concat(M).concat(S(E))}function w(k,E,M,R){return new Mf(e,k-u.left,E-u.top,Math.max(0,M-k),R-E)}function S({top:k,bottom:E,horizontal:M}){let R=[];for(let D=0;D<M.length;D+=2)R.push(w(M[D],k,M[D+1],E));return R}function j(k,E,M){let R=1e9,D=-1e9,F=[];function I(L,q,N,P,Y){let K=t.coordsAtPos(L,L==M.to?-2:2),W=t.coordsAtPos(N,N==M.from?2:-2);!K||!W||(R=Math.min(K.top,W.top,R),D=Math.max(K.bottom,W.bottom,D),Y==Si.LTR?F.push(s&&q?p:K.left,s&&P?m:W.right):F.push(!s&&P?p:W.left,!s&&q?m:K.right))}let Q=k??M.from,G=E??M.to;for(let L of t.visibleRanges)if(L.to>Q&&L.from<G)for(let q=Math.max(L.from,Q),N=Math.min(L.to,G);;){let P=t.state.doc.lineAt(q);for(let Y of t.bidiSpans(P)){let K=Y.from+P.from,W=Y.to+P.from;if(K>=N)break;W>q&&I(Math.max(K,q),k==null&&K<=Q,Math.min(W,N),E==null&&W>=G,Y.dir)}if(q=P.to+1,q>=N)break}return F.length==0&&I(Q,k==null,G,E==null,t.textDirection),{top:R,bottom:D,horizontal:F}}function C(k,E){let M=l.top+(E?k.top:k.bottom);return{top:M,bottom:M,horizontal:[]}}}function _0e(t,e){return t.constructor==e.constructor&&t.eq(e)}class k0e{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(ZA)!=e.state.facet(ZA)&&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,i=e.facet(ZA);for(;n<i.length&&i[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,i)=>!_0e(n,this.drawn[i]))){let n=this.dom.firstChild,i=0;for(let r of e)r.update&&n&&r.constructor&&this.drawn[i].constructor&&r.update(n,this.drawn[i])?(n=n.nextSibling,i++):this.dom.insertBefore(r.draw(),n);for(;n;){let r=n.nextSibling;n.remove(),n=r}this.drawn=e,xt.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const ZA=bt.define();function xY(t){return[Ji.define(e=>new k0e(e,t)),ZA.of(t)]}const tg=bt.define({combine(t){return wc(t,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function T0e(t={}){return[tg.of(t),O0e,E0e,M0e,YQ.of(!0)]}function bY(t){return t.startState.facet(tg)!=t.state.facet(tg)}const O0e=xY({above:!0,markers(t){let{state:e}=t,n=e.facet(tg),i=[];for(let r of e.selection.ranges){let s=r==e.selection.main;if(r.empty||n.drawRangeCursor&&!(s&&xt.ios&&n.iosSelectionHandles)){let a=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=r.empty?r:Le.cursor(r.head,r.assoc);for(let u of Mf.forRange(t,a,l))i.push(u)}}return i},update(t,e){t.transactions.some(i=>i.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=bY(t);return n&&IP(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){IP(e.state,t)},class:"cm-cursorLayer"});function IP(t,e){e.style.animationDuration=t.facet(tg).cursorBlinkRate+"ms"}const E0e=xY({above:!1,markers(t){let e=[],{main:n,ranges:i}=t.state.selection;for(let r of i)if(!r.empty)for(let s of Mf.forRange(t,"cm-selectionBackground",r))e.push(s);if(xt.ios&&!n.empty&&t.state.facet(tg).iosSelectionHandles){for(let r of Mf.forRange(t,"cm-selectionHandle cm-selectionHandle-start",Le.cursor(n.from,1)))e.push(r);for(let r of Mf.forRange(t,"cm-selectionHandle cm-selectionHandle-end",Le.cursor(n.to,1)))e.push(r)}return e},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||bY(t)},class:"cm-selectionLayer"}),M0e=Mu.highest(ut.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"}}}})),AY=Xt.define({map(t,e){return t==null?null:e.mapPos(t)}}),Z0=Ss.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((n,i)=>i.is(AY)?i.value:n,t)}}),R0e=Ji.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(Z0);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(Z0)!=n||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(Z0),n=e!=null&&t.coordsAtPos(e);if(!n)return null;let i=t.scrollDOM.getBoundingClientRect();return{left:n.left-i.left+t.scrollDOM.scrollLeft*t.scaleX,top:n.top-i.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(Z0)!=t&&this.view.dispatch({effects:AY.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 D0e(){return[Z0,R0e]}function BP(t,e,n,i,r){e.lastIndex=0;for(let s=t.iterRange(n,i),a=n,l;!s.next().done;a+=s.value.length)if(!s.lineBreak)for(;l=e.exec(s.value);)r(a+l.index,l)}function N0e(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 i=[];for(let{from:r,to:s}of n)r=Math.max(t.state.doc.lineAt(r).from,r-e),s=Math.min(t.state.doc.lineAt(s).to,s+e),i.length&&i[i.length-1].to>=r?i[i.length-1].to=s:i.push({from:r,to:s});return i}class I0e{constructor(e){const{regexp:n,decoration:i,decorate:r,boundary:s,maxLength:a=1e3}=e;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,r)this.addMatch=(l,u,d,f)=>r(f,d,d+l[0].length,l,u);else if(typeof i=="function")this.addMatch=(l,u,d,f)=>{let p=i(l,u,d);p&&f(d,d+l[0].length,p)};else if(i)this.addMatch=(l,u,d,f)=>f(d,d+l[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=a}createDeco(e){let n=new yu,i=n.add.bind(n);for(let{from:r,to:s}of N0e(e,this.maxLength))BP(e.state.doc,this.regexp,r,s,(a,l)=>this.addMatch(l,e,a,i));return n.finish()}updateDeco(e,n){let i=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((s,a,l,u)=>{u>=e.view.viewport.from&&l<=e.view.viewport.to&&(i=Math.min(l,i),r=Math.max(u,r))}),e.viewportMoved||r-i>1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,n.map(e.changes),i,r):n}updateRange(e,n,i,r){for(let s of e.visibleRanges){let a=Math.max(s.from,i),l=Math.min(s.to,r);if(l>=a){let u=e.state.doc.lineAt(a),d=u.to<l?e.state.doc.lineAt(l):u,f=Math.max(s.from,u.from),p=Math.min(s.to,d.to);if(this.boundary){for(;a>u.from;a--)if(this.boundary.test(u.text[a-1-u.from])){f=a;break}for(;l<d.to;l++)if(this.boundary.test(d.text[l-d.from])){p=l;break}}let m=[],v,y=(b,A,w)=>m.push(w.range(b,A));if(u==d)for(this.regexp.lastIndex=f-u.from;(v=this.regexp.exec(u.text))&&v.index<p-u.from;)this.addMatch(v,e,v.index+u.from,y);else BP(e.state.doc,this.regexp,f,p,(b,A)=>this.addMatch(A,e,b,y));n=n.update({filterFrom:f,filterTo:p,filter:(b,A)=>b<f||A>p,add:m})}}return n}}const U2=/x/.unicode!=null?"gu":"g",B0e=new RegExp(`[\0-\b
--­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF￹-￼]`,U2),L0e={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 Vk=null;function P0e(){var t;if(Vk==null&&typeof document<"u"&&document.body){let e=document.body.style;Vk=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return Vk||!1}const JA=bt.define({combine(t){let e=wc(t,{render:null,specialChars:B0e,addSpecialChars:null});return(e.replaceTabs=!P0e())&&(e.specialChars=new RegExp("	|"+e.specialChars.source,U2)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,U2)),e}});function wY(t={}){return[JA.of(t),F0e()]}let LP=null;function F0e(){return LP||(LP=Ji.fromClass(class{constructor(t){this.view=t,this.decorations=Bt.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(JA)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new I0e({regexp:t.specialChars,decoration:(e,n,i)=>{let{doc:r}=n.state,s=bo(e[0],0);if(s==9){let a=r.lineAt(i),l=n.state.tabSize,u=kg(a.text,l,i-a.from);return Bt.replace({widget:new q0e((l-u%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=Bt.replace({widget:new H0e(t,s)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(JA);t.startState.facet(JA)!=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 $0e="•";function z0e(t){return t>=32?$0e:t==10?"␤":String.fromCharCode(9216+t)}class H0e extends Cl{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=z0e(this.code),i=e.state.phrase("Control character")+" "+(L0e[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,i,n);if(r)return r;let s=document.createElement("span");return s.textContent=n,s.title=i,s.setAttribute("aria-label",i),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class q0e extends Cl{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 Q0e(){return W0e}const Y0e=Bt.line({class:"cm-activeLine"}),W0e=Ji.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 i of t.state.selection.ranges){let r=t.lineBlockAt(i.head);r.from>e&&(n.push(Y0e.range(r.from)),e=r.from)}return Bt.set(n)}},{decorations:t=>t.decorations});class U0e extends Cl{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?mv(e.firstChild):[];if(!n.length)return null;let i=window.getComputedStyle(e.parentNode),r=Zv(n[0],i.direction!="rtl"),s=parseInt(i.lineHeight);return r.bottom-r.top>s*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+s}:r}ignoreEvent(){return!1}}function SY(t){let e=Ji.fromClass(class{constructor(n){this.view=n,this.placeholder=t?Bt.set([Bt.widget({widget:new U0e(t),side:1}).range(0)]):Bt.none}get decorations(){return this.view.state.doc.length?Bt.none:this.placeholder}},{decorations:n=>n.decorations});return typeof t=="string"?[e,ut.contentAttributes.of({"aria-placeholder":t})]:e}const V2=2e3;function V0e(t,e,n){let i=Math.min(e.line,n.line),r=Math.max(e.line,n.line),s=[];if(e.off>V2||n.off>V2||e.col<0||n.col<0){let a=Math.min(e.off,n.off),l=Math.max(e.off,n.off);for(let u=i;u<=r;u++){let d=t.doc.line(u);d.length<=l&&s.push(Le.range(d.from+a,d.to+l))}}else{let a=Math.min(e.col,n.col),l=Math.max(e.col,n.col);for(let u=i;u<=r;u++){let d=t.doc.line(u),f=k2(d.text,a,t.tabSize,!0);if(f<0)s.push(Le.cursor(d.to));else{let p=k2(d.text,l,t.tabSize);s.push(Le.range(d.from+f,d.from+p))}}}return s}function G0e(t,e){let n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}function PP(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1),i=t.state.doc.lineAt(n),r=n-i.from,s=r>V2?-1:r==i.length?G0e(t,e.clientX):kg(i.text,t.state.tabSize,n-i.from);return{line:i.number,col:s,off:r}}function X0e(t,e){let n=PP(t,e),i=t.state.selection;return n?{update(r){if(r.docChanged){let s=r.changes.mapPos(r.startState.doc.line(n.line).from),a=r.state.doc.lineAt(s);n={line:a.number,col:n.col,off:Math.min(n.off,a.length)},i=i.map(r.changes)}},get(r,s,a){let l=PP(t,r);if(!l)return i;let u=V0e(t.state,n,l);return u.length?a?Le.create(u.concat(i.ranges)):Le.create(u):i}}:null}function K0e(t){let e=(n=>n.altKey&&n.button==0);return ut.mouseSelectionStyle.of((n,i)=>e(i)?X0e(n,i):null)}const Z0e={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},J0e={style:"cursor: crosshair"};function eve(t={}){let[e,n]=Z0e[t.key||"Alt"],i=Ji.fromClass(class{constructor(r){this.view=r,this.isDown=!1}set(r){this.isDown!=r&&(this.isDown=r,this.view.update([]))}},{eventObservers:{keydown(r){this.set(r.keyCode==e||n(r))},keyup(r){(r.keyCode==e||!n(r))&&this.set(!1)},mousemove(r){this.set(n(r))}}});return[i,ut.contentAttributes.of(r=>{var s;return!((s=r.plugin(i))===null||s===void 0)&&s.isDown?J0e:null})]}const oA="-10000px";class jY{constructor(e,n,i,r){this.facet=n,this.createTooltipView=i,this.removeTooltipView=r,this.input=e.state.facet(n),this.tooltips=this.input.filter(a=>a);let s=null;this.tooltipViews=this.tooltips.map(a=>s=i(a,s))}update(e,n){var i;let r=e.state.facet(this.facet),s=r.filter(u=>u);if(r===this.input){for(let u of this.tooltipViews)u.update&&u.update(e);return!1}let a=[],l=n?[]:null;for(let u=0;u<s.length;u++){let d=s[u],f=-1;if(d){for(let p=0;p<this.tooltips.length;p++){let m=this.tooltips[p];m&&m.create==d.create&&(f=p)}if(f<0)a[u]=this.createTooltipView(d,u?a[u-1]:null),l&&(l[u]=!!d.above);else{let p=a[u]=this.tooltipViews[f];l&&(l[u]=n[f]),p.update&&p.update(e)}}}for(let u of this.tooltipViews)a.indexOf(u)<0&&(this.removeTooltipView(u),(i=u.destroy)===null||i===void 0||i.call(u));return n&&(l.forEach((u,d)=>n[d]=u),n.length=l.length),this.input=r,this.tooltips=s,this.tooltipViews=a,!0}}function tve(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const Gk=bt.define({combine:t=>{var e,n,i;return{position:xt.ios?"absolute":((e=t.find(r=>r.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((n=t.find(r=>r.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((i=t.find(r=>r.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||tve}}}),FP=new WeakMap,uD=Ji.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(Gk);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 jY(t,hD,(n,i)=>this.createTooltip(n,i),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,i=t.state.facet(Gk);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;n=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.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),i=e?e.dom:null;if(n.dom.classList.add("cm-tooltip"),t.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",n.dom.appendChild(r)}return n.dom.style.position=this.position,n.dom.style.top=oA,n.dom.style.left="0px",this.container.insertBefore(n.dom,i),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 i of this.manager.tooltipViews)i.dom.remove(),(t=i.destroy)===null||t===void 0||t.call(i);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(xt.safari){let a=s.getBoundingClientRect();n=Math.abs(a.top+1e4)>1||Math.abs(a.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 i=this.view.scrollDOM.getBoundingClientRect(),r=oD(this.view);return{visible:{left:i.left+r.left,top:i.top+r.top,right:i.right-r.right,bottom:i.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,a)=>{let l=this.manager.tooltipViews[a];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(Gk).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:i,scaleX:r,scaleY:s}=t,a=[];for(let l=0;l<this.manager.tooltips.length;l++){let u=this.manager.tooltips[l],d=this.manager.tooltipViews[l],{dom:f}=d,p=t.pos[l],m=t.size[l];if(!p||u.clip!==!1&&(p.bottom<=Math.max(n.top,i.top)||p.top>=Math.min(n.bottom,i.bottom)||p.right<Math.max(n.left,i.left)-.1||p.left>Math.min(n.right,i.right)+.1)){f.style.top=oA;continue}let v=u.arrow?d.dom.querySelector(".cm-tooltip-arrow"):null,y=v?7:0,b=m.right-m.left,A=(e=FP.get(d))!==null&&e!==void 0?e:m.bottom-m.top,w=d.offset||ive,S=this.view.textDirection==Si.LTR,j=m.width>i.right-i.left?S?i.left:i.right-m.width:S?Math.max(i.left,Math.min(p.left-(v?14:0)+w.x,i.right-b)):Math.min(Math.max(i.left,p.left-b+(v?14:0)-w.x),i.right-b),C=this.above[l];!u.strictSide&&(C?p.top-A-y-w.y<i.top:p.bottom+A+y+w.y>i.bottom)&&C==i.bottom-p.bottom>p.top-i.top&&(C=this.above[l]=!C);let k=(C?p.top-i.top:i.bottom-p.bottom)-y;if(k<A&&d.resize!==!1){if(k<this.view.defaultLineHeight){f.style.top=oA;continue}FP.set(d,A),f.style.height=(A=k)/s+"px"}else f.style.height&&(f.style.height="");let E=C?p.top-A-y-w.y:p.bottom+y+w.y,M=j+b;if(d.overlap!==!0)for(let R of a)R.left<M&&R.right>j&&R.top<E+A&&R.bottom>E&&(E=C?R.top-A-2-y:R.bottom+y+2);if(this.position=="absolute"?(f.style.top=(E-t.parent.top)/s+"px",$P(f,(j-t.parent.left)/r)):(f.style.top=E/s+"px",$P(f,j/r)),v){let R=p.left+(S?w.x:-w.x)-(j+14-7);v.style.left=R/r+"px"}d.overlap!==!0&&a.push({left:j,top:E,right:M,bottom:E+A}),f.classList.toggle("cm-tooltip-above",C),f.classList.toggle("cm-tooltip-below",!C),d.positioned&&d.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=oA}},{eventObservers:{scroll(){this.maybeMeasure()}}});function $P(t,e){let n=parseInt(t.style.left,10);(isNaN(n)||Math.abs(e-n)>1)&&(t.style.left=e+"px")}const nve=ut.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"}}}),ive={x:0,y:0},hD=bt.define({enables:[uD,nve]}),rw=bt.define({combine:t=>t.reduce((e,n)=>e.concat(n),[])});class fj{static create(e){return new fj(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new jY(e,rw,(n,i)=>this.createHostedView(n,i),n=>n.dom.remove())}createHostedView(e,n){let i=e.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}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 i of this.manager.tooltipViews){let r=i[e];if(r!==void 0){if(n===void 0)n=r;else if(n!==r)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 rve=hD.compute([rw],t=>{let e=t.facet(rw);return e.length===0?null:{pos:Math.min(...e.map(n=>n.pos)),end:Math.max(...e.map(n=>{var i;return(i=n.end)!==null&&i!==void 0?i:n.pos})),create:fj.create,above:e[0].above,arrow:e.some(n=>n.arrow)}}),CY=bt.define();class sve{constructor(e,n,i,r,s,a){this.view=e,this.source=n,this.field=i,this.locked=r,this.setHover=s,this.hoverTime=a,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,i=e.docView.tile.nearest(n.target);if(!i)return;let r,s=1;if(i.isWidget())r=i.posAtStart;else{if(r=e.posAtCoords(n),r==null)return;let a=e.coordsAtPos(r);if(!a||n.y<a.top||n.y>a.bottom||n.x<a.left-e.defaultCharacterWidth||n.x>a.right+e.defaultCharacterWidth)return;let l=e.bidiSpans(e.state.doc.lineAt(r)).find(d=>d.from<=r&&d.to>=r),u=l&&l.dir==Si.RTL?-1:1;s=n.x<a.left?-u:u}this.activateHover(e,r,s)}activateHover(e,n,i,r){let s=this.source(e,n,i),a=l=>{if(l&&!(Array.isArray(l)&&!l.length)){let u=Array.isArray(l)?l:[l];r&&this.locked.set(u,r),e.dispatch({effects:this.setHover.of(u)})}};if(s&&"then"in s){let l=this.pending={pos:n};s.then(u=>{this.pending==l&&(this.pending=null,a(u))},u=>Ks(e.state,u,"hover tooltip"))}else a(s)}get tooltip(){let e=this.view.plugin(uD),n=e?e.manager.tooltips.findIndex(i=>i.create==fj.create):-1;return n>-1?e.manager.tooltipViews[n]:null}mousemove(e){var n,i;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:r,tooltip:s}=this;if(r.length&&!this.locked.has(r)&&s&&!ove(s.dom,e)||this.pending){let{pos:a}=r[0]||this.pending,l=(i=(n=r[0])===null||n===void 0?void 0:n.end)!==null&&i!==void 0?i:a;(a==l?this.view.posAtCoords(this.lastMove)!=a:!ave(this.view,a,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:i}=this;i&&i.dom.contains(e.relatedTarget)?this.watchTooltipLeave(i.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let n=i=>{e.removeEventListener("mouseleave",n);let{active:r}=this;r.length&&!this.locked.has(r)&&!this.view.dom.contains(i.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 aA=4;function ove(t,e){let{left:n,right:i,top:r,bottom:s}=t.getBoundingClientRect(),a;if(a=t.querySelector(".cm-tooltip-arrow")){let l=a.getBoundingClientRect();r=Math.min(l.top,r),s=Math.max(l.bottom,s)}return e.clientX>=n-aA&&e.clientX<=i+aA&&e.clientY>=r-aA&&e.clientY<=s+aA}function ave(t,e,n,i,r,s){let a=t.scrollDOM.getBoundingClientRect(),l=t.documentTop+t.documentPadding.top+t.contentHeight;if(a.left>i||a.right<i||a.top>r||Math.min(a.bottom,l)<r)return!1;let u=t.posAtCoords({x:i,y:r},!1);return u>=e&&u<=n}function lve(t,e={}){let n=Xt.define(),i=new WeakMap,r=Ss.define({create(){return[]},update(a,l){let u=i.get(a);if(a.length&&(e.hideOnChange&&(l.docChanged||l.selection)?a=[]:u&&u(l)?a=[]:e.hideOn&&(a=a.filter(d=>!e.hideOn(l,d)))),l.docChanged&&a.length){let d=[];for(let f of a){let p=l.changes.mapPos(f.pos,-1,As.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)),d.push(m)}}a=d}for(let d of l.effects)d.is(n)&&(a=d.value,u=void 0),(d.is(uve)&&!d.value||d.value==r)&&(a=[]);return a.length&&u&&i.set(a,u),a},provide:a=>rw.from(a)});const s=Ji.define(a=>new sve(a,t,r,i,n,e.hoverTime||300));return{active:r,extension:[r,s,CY.of(s),rve]}}function cve(t,e,n,i={}){var r;let s=t.state.facet(CY).map(a=>t.plugin(a)).filter(a=>!!a);if(i.tooltip&&i.tooltip.active){let a=s.find(l=>l.field==i.tooltip.active);a&&(s=[a])}for(let a of s)a.activateHover(t,e,n,(r=i.until)!==null&&r!==void 0?r:(()=>!1))}function _Y(t,e){let n=t.plugin(uD);if(!n)return null;let i=n.manager.tooltips.indexOf(e);return i<0?null:n.manager.tooltipViews[i]}const uve=Xt.define(),zP=bt.define({combine(t){let e,n;for(let i of t)e=e||i.topContainer,n=n||i.bottomContainer;return{topContainer:e,bottomContainer:n}}});function dD(t,e){let n=t.plugin(kY),i=n?n.specs.indexOf(e):-1;return i>-1?n.panels[i]:null}const kY=Ji.fromClass(class{constructor(t){this.input=t.state.facet(ey),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(zP);this.top=new lA(t,!0,e.topContainer),this.bottom=new lA(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(zP);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new lA(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new lA(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(ey);if(n!=this.input){let i=n.filter(u=>u),r=[],s=[],a=[],l=[];for(let u of i){let d=this.specs.indexOf(u),f;d<0?(f=u(t.view),l.push(f)):(f=this.panels[d],f.update&&f.update(t)),r.push(f),(f.top?s:a).push(f)}this.specs=i,this.panels=r,this.top.sync(s),this.bottom.sync(a);for(let u of l)u.dom.classList.add("cm-panel"),u.mount&&u.mount()}else for(let i of this.panels)i.update&&i.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>ut.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class lA{constructor(e,n,i){this.view=e,this.top=n,this.container=i,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=HP(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=HP(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 HP(t){let e=t.nextSibling;return t.remove(),e}const ey=bt.define({enables:kY});function hve(t,e){let n,i=new Promise(a=>n=a),r=a=>dve(a,e,n);t.state.field(Xk,!1)?t.dispatch({effects:TY.of(r)}):t.dispatch({effects:Xt.appendConfig.of(Xk.init(()=>[r]))});let s=OY.of(r);return{close:s,result:i.then(a=>((t.win.queueMicrotask||(u=>t.win.setTimeout(u,10)))(()=>{t.state.field(Xk).indexOf(r)>-1&&t.dispatch({effects:s})}),a))}}const Xk=Ss.define({create(){return[]},update(t,e){for(let n of e.effects)n.is(TY)?t=[n.value].concat(t):n.is(OY)&&(t=t.filter(i=>i!=n.value));return t},provide:t=>ey.computeN([t],e=>e.field(t))}),TY=Xt.define(),OY=Xt.define();function dve(t,e,n){let i=e.content?e.content(t,()=>a(null)):null;if(!i){if(i=fi("form"),e.input){let l=fi("input",e.input);/^(text|password|number|email|tel|url)$/.test(l.type)&&l.classList.add("cm-textfield"),l.name||(l.name="input"),i.appendChild(fi("label",(e.label||"")+": ",l))}else i.appendChild(document.createTextNode(e.label||""));i.appendChild(document.createTextNode(" ")),i.appendChild(fi("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let r=i.nodeName=="FORM"?[i]:i.querySelectorAll("form");for(let l=0;l<r.length;l++){let u=r[l];u.addEventListener("keydown",d=>{d.keyCode==27?(d.preventDefault(),a(null)):d.keyCode==13&&(d.preventDefault(),a(u))}),u.addEventListener("submit",d=>{d.preventDefault(),a(u)})}let s=fi("div",i,fi("button",{onclick:()=>a(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 a(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=i.querySelector(e.focus):l=i.querySelector("input")||i.querySelector("button"),l&&"select"in l?l.select():l&&"focus"in l&&l.focus()}}}}class bu extends rd{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}bu.prototype.elementClass="";bu.prototype.toDOM=void 0;bu.prototype.mapMode=As.TrackBefore;bu.prototype.startSide=bu.prototype.endSide=-1;bu.prototype.point=!0;const e1=bt.define(),fve=bt.define(),pve={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Sn.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},yv=bt.define();function mve(t){return[EY(),yv.of({...pve,...t})]}const qP=bt.define({combine:t=>t.some(e=>e)});function EY(t){return[gve]}const gve=Ji.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(yv).map(e=>new YP(t,e)),this.fixed=!t.state.facet(qP);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,i=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(i<(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(qP)!=!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=Sn.iter(this.view.state.facet(e1),this.view.viewport.from),i=[],r=this.gutters.map(s=>new vve(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(s.type)){let a=!0;for(let l of s.type)if(l.type==ws.Text&&a){G2(n,i,l.from);for(let u of r)u.line(this.view,l,i);a=!1}else if(l.widget)for(let u of r)u.widget(this.view,l)}else if(s.type==ws.Text){G2(n,i,s.from);for(let a of r)a.line(this.view,s,i)}else if(s.widget)for(let a of r)a.widget(this.view,s);for(let s of r)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(yv),n=t.state.facet(yv),i=t.docChanged||t.heightChanged||t.viewportChanged||!Sn.eq(t.startState.facet(e1),t.state.facet(e1),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let r of this.gutters)r.update(t)&&(i=!0);else{i=!0;let r=[];for(let s of n){let a=e.indexOf(s);a<0?r.push(new YP(this.view,s)):(this.gutters[a].update(t),r.push(this.gutters[a]))}for(let s of this.gutters)s.dom.remove(),r.indexOf(s)<0&&s.destroy();for(let s of r)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=r}return i}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>ut.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let i=n.dom.offsetWidth*e.scaleX,r=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==Si.LTR?{left:i,right:r}:{right:i,left:r}})});function QP(t){return Array.isArray(t)?t:[t]}function G2(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class vve{constructor(e,n,i){this.gutter=e,this.height=i,this.i=0,this.cursor=Sn.iter(e.markers,n.from)}addElement(e,n,i){let{gutter:r}=this,s=(n.top-this.height)/e.scaleY,a=n.height/e.scaleY;if(this.i==r.elements.length){let l=new MY(e,a,s,i);r.elements.push(l),r.dom.appendChild(l.dom)}else r.elements[this.i].update(e,a,s,i);this.height=n.bottom,this.i++}line(e,n,i){let r=[];G2(this.cursor,r,n.from),i.length&&(r=r.concat(i));let s=this.gutter.config.lineMarker(e,n,r);s&&r.unshift(s);let a=this.gutter;r.length==0&&!a.config.renderEmptyElements||this.addElement(e,n,r)}widget(e,n){let i=this.gutter.config.widgetMarker(e,n.widget,n),r=i?[i]:null;for(let s of e.state.facet(fve)){let a=s(e,n.widget,n);a&&(r||(r=[])).push(a)}r&&this.addElement(e,n,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class YP{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 i in n.domEventHandlers)this.dom.addEventListener(i,r=>{let s=r.target,a;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let u=s.getBoundingClientRect();a=(u.top+u.bottom)/2}else a=r.clientY;let l=e.lineBlockAtHeight(a-e.documentTop);n.domEventHandlers[i](e,l,r)&&r.preventDefault()});this.markers=QP(n.markers(e)),n.initialSpacer&&(this.spacer=new MY(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=QP(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],e);r!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[r])}let i=e.view.viewport;return!Sn.eq(this.markers,n,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class MY{constructor(e,n,i,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,i,r)}update(e,n,i,r){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),yve(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,n){let i="cm-gutterElement",r=this.dom.firstChild;for(let s=0,a=0;;){let l=a,u=s<n.length?n[s++]:null,d=!1;if(u){let f=u.elementClass;f&&(i+=" "+f);for(let p=a;p<this.markers.length;p++)if(this.markers[p].compare(u)){l=p,d=!0;break}}else l=this.markers.length;for(;a<l;){let f=this.markers[a++];if(f.toDOM){f.destroy(r);let p=r.nextSibling;r.remove(),r=p}}if(!u)break;u.toDOM&&(d?r=r.nextSibling:this.dom.insertBefore(u.toDOM(e),r)),d&&a++}this.dom.className=i,this.markers=n}destroy(){this.setMarkers(null,[])}}function yve(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 xve=bt.define(),bve=bt.define(),Vp=bt.define({combine(t){return wc(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,n){let i=Object.assign({},e);for(let r in n){let s=i[r],a=n[r];i[r]=s?(l,u,d)=>s(l,u,d)||a(l,u,d):a}return i}})}});class Kk extends bu{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Zk(t,e){return t.state.facet(Vp).formatNumber(e,t.state)}const Ave=yv.compute([Vp],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(xve)},lineMarker(e,n,i){return i.some(r=>r.toDOM)?null:new Kk(Zk(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,i)=>{for(let r of e.state.facet(bve)){let s=r(e,n,i);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(Vp)!=e.state.facet(Vp),initialSpacer(e){return new Kk(Zk(e,WP(e.state.doc.lines)))},updateSpacer(e,n){let i=Zk(n.view,WP(n.view.state.doc.lines));return i==e.number?e:new Kk(i)},domEventHandlers:t.facet(Vp).domEventHandlers,side:"before"}));function wve(t={}){return[Vp.of(t),EY(),Ave]}function WP(t){let e=9;for(;e<t;)e=e*10+9;return e}const Sve=new class extends bu{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},jve=e1.compute(["selection"],t=>{let e=[],n=-1;for(let i of t.selection.ranges){let r=t.doc.lineAt(i.head).from;r>n&&(n=r,e.push(Sve.range(r)))}return Sn.of(e)});function Cve(){return jve}var Jk;const Gp=new xn;function _ve(t){return bt.define({combine:t?e=>e.concat(t):void 0})}const kve=new xn;class dl{constructor(e,n,i=[],r=""){this.data=e,this.name=r,kn.prototype.hasOwnProperty("tree")||Object.defineProperty(kn.prototype,"tree",{get(){return Hr(this)}}),this.parser=n,this.extension=[ld.of(this),kn.languageData.of((s,a,l)=>{let u=UP(s,a,l),d=u.type.prop(Gp);if(!d)return[];let f=s.facet(d),p=u.type.prop(kve);if(p){let m=u.resolve(a-u.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(i)}isActiveAt(e,n,i=-1){return UP(e,n,i).type.prop(Gp)==this.data}findRegions(e){let n=e.facet(ld);if((n==null?void 0:n.data)==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let i=[],r=(s,a)=>{if(s.prop(Gp)==this.data){i.push({from:a,to:a+s.length});return}let l=s.prop(xn.mounted);if(l){if(l.tree.prop(Gp)==this.data){if(l.overlay)for(let u of l.overlay)i.push({from:u.from+a,to:u.to+a});else i.push({from:a,to:a+s.length});return}else if(l.overlay){let u=i.length;if(r(l.tree,l.overlay[0].from+a),i.length>u)return}}for(let u=0;u<s.children.length;u++){let d=s.children[u];d instanceof yr&&r(d,s.positions[u]+a)}};return r(Hr(e),0),i}get allowsNesting(){return!0}}dl.setState=Xt.define();function UP(t,e,n){let i=t.facet(ld),r=Hr(t).topNode;if(!i||i.allowsNesting)for(let s=r;s;s=s.enter(e,n,lr.ExcludeBuffers|lr.EnterBracketed))s.type.isTop&&(r=s);return r}class sw extends dl{constructor(e,n,i){super(e,n,[],i),this.parser=n}static define(e){let n=_ve(e.languageData);return new sw(n,e.parser.configure({props:[Gp.add(i=>i.isTop?n:void 0)]}),e.name)}configure(e,n){return new sw(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Hr(t){let e=t.field(dl.state,!1);return e?e.tree:yr.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 i=this.cursorPos-this.string.length;return e<i||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-i,n-i)}}let I0=null;class ow{constructor(e,n,i=[],r,s,a,l,u){this.parser=e,this.state=n,this.fragments=i,this.tree=r,this.treeLen=s,this.viewport=a,this.skipped=l,this.scheduleOn=u,this.parse=null,this.tempSkipped=[]}static create(e,n,i){return new ow(e,n,[],yr.empty,0,i,[],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!=yr.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}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 r=this.parse.advance();if(r)if(this.fragments=this.withoutTempSkipped(Of.addTree(r,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(i=this.parse.stoppedAt)!==null&&i!==void 0?i:this.state.doc.length,this.tree=r,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(Of.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=I0;I0=this;try{return e()}finally{I0=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=VP(e,n.from,n.to);return e}changes(e,n){let{fragments:i,tree:r,treeLen:s,viewport:a,skipped:l}=this;if(this.takeTree(),!e.empty){let u=[];if(e.iterChangedRanges((d,f,p,m)=>u.push({fromA:d,toA:f,fromB:p,toB:m})),i=Of.applyChanges(i,u),r=yr.empty,s=0,a={from:e.mapPos(a.from,-1),to:e.mapPos(a.to,1)},this.skipped.length){l=[];for(let d of this.skipped){let f=e.mapPos(d.from,1),p=e.mapPos(d.to,-1);f<p&&l.push({from:f,to:p})}}}return new ow(this.parser,n,i,r,s,a,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 i=0;i<this.skipped.length;i++){let{from:r,to:s}=this.skipped[i];r<e.to&&s>e.from&&(this.fragments=VP(this.fragments,r,s),this.skipped.splice(i--,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 I7{createParse(n,i,r){let s=r[0].from,a=r[r.length-1].to;return{parsedPos:s,advance(){let u=I0;if(u){for(let d of r)u.tempSkipped.push(d);e&&(u.scheduleOn=u.scheduleOn?Promise.all([u.scheduleOn,e]):e)}return this.parsedPos=a,new yr(_o.none,[],[],a-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 I0}}function VP(t,e,n){return Of.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class ng{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),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,i)||n.takeTree(),new ng(n)}static init(e){let n=Math.min(3e3,e.doc.length),i=ow.create(e.facet(ld).parser,e,{from:0,to:n});return i.work(20,n)||i.takeTree(),new ng(i)}}dl.state=Ss.define({create:ng.init,update(t,e){for(let n of e.effects)if(n.is(dl.setState))return n.value;return e.startState.facet(ld)!=e.state.facet(ld)?ng.init(e.state):t.apply(e)}});let RY=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(RY=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const eT=typeof navigator<"u"&&(!((Jk=navigator.scheduling)===null||Jk===void 0)&&Jk.isInputPending)?()=>navigator.scheduling.isInputPending():null,Ove=Ji.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(dl.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(dl.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=RY(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:i,viewport:{to:r}}=this.view,s=i.field(dl.state);if(s.tree==s.context.tree&&s.context.isDone(r+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!eT?Math.max(25,e.timeRemaining()-5):1e9),l=s.context.treeLen<r&&i.doc.length>r+1e3,u=s.context.work(()=>eT&&eT()||Date.now()>a,r+(l?0:1e5));this.chunkBudget-=Date.now()-n,(u||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:dl.setState.of(new ng(s.context))})),this.chunkBudget>0&&!(u&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Ks(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()}}}),ld=bt.define({combine(t){return t.length?t[0]:null},enables:t=>[dl.state,Ove,ut.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]}),Eve=bt.define(),rx=bt.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 aw(t){let e=t.facet(rx);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function ty(t,e){let n="",i=t.tabSize,r=t.facet(rx)[0];if(r=="	"){for(;e>=i;)n+="	",e-=i;r=" "}for(let s=0;s<e;s++)n+=r;return n}function fD(t,e){t instanceof kn&&(t=new pj(t));for(let i of t.state.facet(Eve)){let r=i(t,e);if(r!==void 0)return r}let n=Hr(t.state);return n.length>=e?Rve(t,n,e):null}class pj{constructor(e,n={}){this.state=e,this.options=n,this.unit=aw(e)}lineAt(e,n=1){let i=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=i.from&&r<=i.to?s&&r==e?{text:"",from:e}:(n<0?r<e:r<=e)?{text:i.text.slice(r-i.from),from:r}:{text:i.text.slice(0,r-i.from),from:i.from}:i}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:i,from:r}=this.lineAt(e,n);return i.slice(e-r,Math.min(i.length,e+100-r))}column(e,n=1){let{text:i,from:r}=this.lineAt(e,n),s=this.countColumn(i,e-r),a=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return a>-1&&(s+=a-this.countColumn(i,i.search(/\S|$/))),s}countColumn(e,n=e.length){return kg(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:i,from:r}=this.lineAt(e,n),s=this.options.overrideIndentation;if(s){let a=s(r);if(a>-1)return a}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Mve=new xn;function Rve(t,e,n){let i=e.resolveStack(n),r=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(r!=i.node){let s=[];for(let a=r;a&&!(a.from<i.node.from||a.to>i.node.to||a.from==i.node.from&&a.type==i.node.type);a=a.parent)s.push(a);for(let a=s.length-1;a>=0;a--)i={node:s[a],next:i}}return DY(i,t,n)}function DY(t,e,n){for(let i=t;i;i=i.next){let r=Nve(i.node);if(r)return r(pD.create(e,n,i))}return 0}function Dve(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function Nve(t){let e=t.type.prop(Mve);if(e)return e;let n=t.firstChild,i;if(n&&(i=n.type.prop(xn.closedBy))){let r=t.lastChild,s=r&&i.indexOf(r.name)>-1;return a=>Pve(a,!0,1,void 0,s&&!Dve(a)?r.from:void 0)}return t.parent==null?Ive:null}function Ive(){return 0}class pD extends pj{constructor(e,n,i){super(e.state,e.options),this.base=e,this.pos=n,this.context=i}get node(){return this.context.node}static create(e,n,i){return new pD(e,n,i)}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 i=e.resolve(n.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(Bve(i,e))break;n=this.state.doc.lineAt(i.from)}return this.lineIndent(n.from)}continue(){return DY(this.context.next,this.base,this.pos)}}function Bve(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function Lve(t){let e=t.node,n=e.childAfter(e.from),i=e.lastChild;if(!n)return null;let r=t.options.simulateBreak,s=t.state.doc.lineAt(n.from),a=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let l=n.to;;){let u=e.childAfter(l);if(!u||u==i)return null;if(!u.type.isSkipped){if(u.from>=a)return null;let d=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+d}}l=u.to}}function Pve(t,e,n,i,r){let s=t.textAfter,a=s.match(/^\s*/)[0].length,l=i&&s.slice(a,a+i.length)==i||r==t.pos+a,u=Lve(t);return u?l?t.column(u.from):t.column(u.to):t.baseIndent+(l?0:t.unit*n)}const Fve=200;function NY(){return kn.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:i}=t.newSelection.main,r=n.lineAt(i);if(i>r.from+Fve)return t;let s=n.sliceString(r.from,i);if(!e.some(d=>d.test(s)))return t;let{state:a}=t,l=-1,u=[];for(let{head:d}of a.selection.ranges){let f=a.doc.lineAt(d);if(f.from==l)continue;l=f.from;let p=fD(a,f.from);if(p==null)continue;let m=/^\s*/.exec(f.text)[0],v=ty(a,p);m!=v&&u.push({from:f.from,to:f.from+m.length,insert:v})}return u.length?[t,{changes:u,sequential:!0}]:t})}const $ve=bt.define(),zve=new xn;function Hve(t,e,n){let i=Hr(t);if(i.length<n)return null;let r=i.resolveStack(n,1),s=null;for(let a=r;a;a=a.next){let l=a.node;if(l.to<=n||l.from>n)continue;if(s&&l.from<e)break;let u=l.type.prop(zve);if(u&&(l.to<i.length-50||i.length==t.doc.length||!qve(l))){let d=u(l,t);d&&d.from<=n&&d.from>=e&&d.to>n&&(s=d)}}return s}function qve(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function lw(t,e,n){for(let i of t.facet($ve)){let r=i(t,e,n);if(r)return r}return Hve(t,e,n)}function IY(t,e){let n=e.mapPos(t.from,1),i=e.mapPos(t.to,-1);return n>=i?void 0:{from:n,to:i}}const mj=Xt.define({map:IY}),sx=Xt.define({map:IY});function BY(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some(i=>i.from<=n&&i.to>=n)||e.push(t.lineBlockAt(n));return e}const zf=Ss.define({create(){return Bt.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((i,r)=>t=GP(t,i,r)),t=t.map(e.changes);let n=[];for(let i of e.effects)i.is(mj)&&!Qve(t,i.value.from,i.value.to)?n.push(i.value):i.is(sx)&&(t=t.update({filter:(r,s)=>i.value.from!=r||i.value.to!=s,filterFrom:i.value.from,filterTo:i.value.to}));if(n.length){let{preparePlaceholder:i}=e.state.facet(FY),r=n.map(s=>(i?Bt.replace({widget:new Kve(i(e.state,s))}):XP).range(s.from,s.to));t=t.update({add:r})}return e.selection&&(t=GP(t,e.selection.main.head)),t},provide:t=>ut.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(i,r)=>{n.push(i,r)}),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 i=t[n++],r=t[n++];if(typeof i!="number"||typeof r!="number")throw new RangeError("Invalid JSON for fold state");e.push(XP.range(i,r))}return Bt.set(e,!0)}});function GP(t,e,n=e){let i=!1;return t.between(e,n,(r,s)=>{r<n&&s>e&&(i=!0)}),i?t.update({filterFrom:e,filterTo:n,filter:(r,s)=>r>=n||s<=e}):t}function cw(t,e,n){var i;let r=null;return(i=t.field(zf,!1))===null||i===void 0||i.between(e,n,(s,a)=>{(!r||r.from>s)&&(r={from:s,to:a})}),r}function Qve(t,e,n){let i=!1;return t.between(e,e,(r,s)=>{r==e&&s==n&&(i=!0)}),i}function LY(t,e){return t.field(zf,!1)?e:e.concat(Xt.appendConfig.of($Y()))}const Yve=t=>{for(let e of BY(t)){let n=lw(t.state,e.from,e.to);if(n)return t.dispatch({effects:LY(t.state,[mj.of(n),PY(t,n)])}),!0}return!1},Wve=t=>{if(!t.state.field(zf,!1))return!1;let e=[];for(let n of BY(t)){let i=cw(t.state,n.from,n.to);i&&e.push(sx.of(i),PY(t,i,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function PY(t,e,n=!0){let i=t.state.doc.lineAt(e.from).number,r=t.state.doc.lineAt(e.to).number;return ut.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${i} ${t.state.phrase("to")} ${r}.`)}const Uve=t=>{let{state:e}=t,n=[];for(let i=0;i<e.doc.length;){let r=t.lineBlockAt(i),s=lw(e,r.from,r.to);s&&n.push(mj.of(s)),i=(s?t.lineBlockAt(s.to):r).to+1}return n.length&&t.dispatch({effects:LY(t.state,n)}),!!n.length},Vve=t=>{let e=t.state.field(zf,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(i,r)=>{n.push(sx.of({from:i,to:r}))}),t.dispatch({effects:n}),!0},Gve=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:Yve},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:Wve},{key:"Ctrl-Alt-[",run:Uve},{key:"Ctrl-Alt-]",run:Vve}],Xve={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},FY=bt.define({combine(t){return wc(t,Xve)}});function $Y(t){return[zf,eye]}function zY(t,e){let{state:n}=t,i=n.facet(FY),r=a=>{let l=t.lineBlockAt(t.posAtDOM(a.target)),u=cw(t.state,l.from,l.to);u&&t.dispatch({effects:sx.of(u)}),a.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(t,r,e);let s=document.createElement("span");return s.textContent=i.placeholderText,s.setAttribute("aria-label",n.phrase("folded code")),s.title=n.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=r,s}const XP=Bt.replace({widget:new class extends Cl{toDOM(t){return zY(t,null)}}});class Kve extends Cl{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return zY(e,this.value)}}const Zve={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class tT extends bu{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 Jve(t={}){let e={...Zve,...t},n=new tT(e,!0),i=new tT(e,!1),r=Ji.fromClass(class{constructor(a){this.from=a.viewport.from,this.markers=this.buildMarkers(a)}update(a){(a.docChanged||a.viewportChanged||a.startState.facet(ld)!=a.state.facet(ld)||a.startState.field(zf,!1)!=a.state.field(zf,!1)||Hr(a.startState)!=Hr(a.state)||e.foldingChanged(a))&&(this.markers=this.buildMarkers(a.view))}buildMarkers(a){let l=new yu;for(let u of a.viewportLineBlocks){let d=cw(a.state,u.from,u.to)?i:lw(a.state,u.from,u.to)?n:null;d&&l.add(u.from,u.from,d)}return l.finish()}}),{domEventHandlers:s}=e;return[r,mve({class:"cm-foldGutter",markers(a){var l;return((l=a.plugin(r))===null||l===void 0?void 0:l.markers)||Sn.empty},initialSpacer(){return new tT(e,!1)},domEventHandlers:{...s,click:(a,l,u)=>{if(s.click&&s.click(a,l,u))return!0;let d=cw(a.state,l.from,l.to);if(d)return a.dispatch({effects:sx.of(d)}),!0;let f=lw(a.state,l.from,l.to);return f?(a.dispatch({effects:mj.of(f)}),!0):!1}}}),$Y()]}const eye=ut.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 Uf{constructor(e,n){this.specs=e;let i;function r(l){let u=sd.newName();return(i||(i=Object.create(null)))["."+u]=l,u}const s=typeof n.all=="string"?n.all:n.all?r(n.all):void 0,a=n.scope;this.scope=a instanceof dl?l=>l.prop(Gp)==a.data:a?l=>l==a:void 0,this.style=P7(e.map(l=>({tag:l.tag,class:l.class||r(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=i?new sd(i):null,this.themeType=n.themeType}static define(e,n){return new Uf(e,n||{})}}const X2=bt.define(),HY=bt.define({combine(t){return t.length?[t[0]]:null}});function nT(t){let e=t.facet(X2);return e.length?e:t.facet(HY)}function gj(t,e){let n=[nye],i;return t instanceof Uf&&(t.module&&n.push(ut.styleModule.of(t.module)),i=t.themeType),e!=null&&e.fallback?n.push(HY.of(t)):i?n.push(X2.computeN([ut.darkTheme],r=>r.facet(ut.darkTheme)==(i=="dark")?[t]:[])):n.push(X2.of(t)),n}class tye{constructor(e){this.markCache=Object.create(null),this.tree=Hr(e.state),this.decorations=this.buildDeco(e,nT(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=Hr(e.state),i=nT(e.state),r=i!=nT(e.startState),{viewport:s}=e.view,a=e.changes.mapPos(this.decoratedTo,1);n.length<s.to&&!r&&n.type==this.tree.type&&a>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(n!=this.tree||e.viewportChanged||r)&&(this.tree=n,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=s.to)}buildDeco(e,n){if(!n||!this.tree.length)return Bt.none;let i=new yu;for(let{from:r,to:s}of e.visibleRanges)Rde(this.tree,n,(a,l,u)=>{i.add(a,l,this.markCache[u]||(this.markCache[u]=Bt.mark({class:u})))},r,s);return i.finish()}}const nye=Mu.high(Ji.fromClass(tye,{decorations:t=>t.decorations})),iye=Uf.define([{tag:ye.meta,color:"#404740"},{tag:ye.link,textDecoration:"underline"},{tag:ye.heading,textDecoration:"underline",fontWeight:"bold"},{tag:ye.emphasis,fontStyle:"italic"},{tag:ye.strong,fontWeight:"bold"},{tag:ye.strikethrough,textDecoration:"line-through"},{tag:ye.keyword,color:"#708"},{tag:[ye.atom,ye.bool,ye.url,ye.contentSeparator,ye.labelName],color:"#219"},{tag:[ye.literal,ye.inserted],color:"#164"},{tag:[ye.string,ye.deleted],color:"#a11"},{tag:[ye.regexp,ye.escape,ye.special(ye.string)],color:"#e40"},{tag:ye.definition(ye.variableName),color:"#00f"},{tag:ye.local(ye.variableName),color:"#30a"},{tag:[ye.typeName,ye.namespace],color:"#085"},{tag:ye.className,color:"#167"},{tag:[ye.special(ye.variableName),ye.macroName],color:"#256"},{tag:ye.definition(ye.propertyName),color:"#00c"},{tag:ye.comment,color:"#940"},{tag:ye.invalid,color:"#f00"}]),rye=ut.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),qY=1e4,QY="()[]{}",YY=bt.define({combine(t){return wc(t,{afterCursor:!0,brackets:QY,maxScanDistance:qY,renderMatch:aye})}}),sye=Bt.mark({class:"cm-matchingBracket"}),oye=Bt.mark({class:"cm-nonmatchingBracket"});function aye(t){let e=[],n=t.matched?sye:oye;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 KP(t){let e=[],n=t.facet(YY);for(let i of t.selection.ranges){if(!i.empty)continue;let r=ic(t,i.head,-1,n)||i.head>0&&ic(t,i.head-1,1,n)||n.afterCursor&&(ic(t,i.head,1,n)||i.head<t.doc.length&&ic(t,i.head+1,-1,n));r&&(e=e.concat(n.renderMatch(r,t)))}return Bt.set(e,!0)}const lye=Ji.fromClass(class{constructor(t){this.paused=!1,this.decorations=KP(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=KP(t.state),this.paused=!1))}},{decorations:t=>t.decorations}),cye=[lye,rye];function WY(t={}){return[YY.of(t),cye]}const uye=new xn;function K2(t,e,n){let i=t.prop(e<0?xn.openedBy:xn.closedBy);if(i)return i;if(t.name.length==1){let r=n.indexOf(t.name);if(r>-1&&r%2==(e<0?1:0))return[n[r+e]]}return null}function Z2(t){let e=t.type.prop(uye);return e?e(t.node):t}function ic(t,e,n,i={}){let r=i.maxScanDistance||qY,s=i.brackets||QY,a=Hr(t),l=a.resolveInner(e,n);for(let u=l;u;u=u.parent){let d=K2(u.type,n,s);if(d&&u.from<u.to){let f=Z2(u);if(f&&(n>0?e>=f.from&&e<f.to:e>f.from&&e<=f.to))return hye(t,e,n,u,f,d,s)}}return dye(t,e,n,a,l.type,r,s)}function hye(t,e,n,i,r,s,a){let l=i.parent,u={from:r.from,to:r.to},d=0,f=l==null?void 0:l.cursor();if(f&&(n<0?f.childBefore(i.from):f.childAfter(i.to)))do if(n<0?f.to<=i.from:f.from>=i.to){if(d==0&&s.indexOf(f.type.name)>-1&&f.from<f.to){let p=Z2(f);return{start:u,end:p?{from:p.from,to:p.to}:void 0,matched:!0}}else if(K2(f.type,n,a))d++;else if(K2(f.type,-n,a)){if(d==0){let p=Z2(f);return{start:u,end:p&&p.from<p.to?{from:p.from,to:p.to}:void 0,matched:!1}}d--}}while(n<0?f.prevSibling():f.nextSibling());return{start:u,matched:!1}}function dye(t,e,n,i,r,s,a){if(n<0?!e:e==t.doc.length)return null;let l=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),u=a.indexOf(l);if(u<0||u%2==0!=n>0)return null;let d={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 b=n>0?0:v.length-1,A=n>0?v.length:-1;b!=A;b+=n){let w=a.indexOf(v[b]);if(!(w<0||i.resolveInner(y+b,1).type!=r))if(w%2==0==n>0)p++;else{if(p==1)return{start:d,end:{from:y+b,to:y+b+1},matched:w>>1==u>>1};p--}}n>0&&(m+=v.length)}return f.done?{start:d,matched:!1}:null}const fye=Object.create(null),ZP=[_o.none],JP=[],e6=Object.create(null),pye=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"]])pye[t]=mye(fye,e);function iT(t,e){JP.indexOf(t)>-1||(JP.push(t),console.warn(e))}function mye(t,e){let n=[];for(let l of e.split(" ")){let u=[];for(let d of l.split(".")){let f=t[d]||ye[d];f?typeof f=="function"?u.length?u=u.map(f):iT(d,`Modifier ${d} used at start of tag`):u.length?iT(d,`Tag ${d} used as modifier`):u=Array.isArray(f)?f:[f]:iT(d,`Unknown highlighting tag ${d}`)}for(let d of u)n.push(d)}if(!n.length)return 0;let i=e.replace(/ /g,"_"),r=i+" "+n.map(l=>l.id),s=e6[r];if(s)return s.id;let a=e6[r]=_o.define({id:ZP.length,name:i,props:[B7({[i]:n})]});return ZP.push(a),a.id}Si.RTL,Si.LTR;function gye(t,e){if(!e||e.type.id!==lm)return null;const n={card:Xl.CardOneToOne,matchingLabels:[],on:!1,include:[],fill:{lhs:null,rhs:null}},i=e.getChild(Ofe);if(i){n.on=i.getChild(xfe)!==null;const a=i.getChild(am),l=a?a.getChildren(qv):[];for(const p of l)n.matchingLabels.push(t.sliceDoc(p.from,p.to));const u=i.getChild(bfe),d=i.getChild(Afe),f=u||d;if(f){n.card=u?Xl.CardManyToOne:Xl.CardOneToMany;const p=f.nextSibling,m=(p==null?void 0:p.getChildren(qv))||[];for(const v of m)n.include.push(t.sliceDoc(v.from,v.to))}}const r=e.getChild(Efe);if(r){const a=r.getChild(Mfe),l=r.getChild(Rfe),u=r.getChild(Dfe),d=f=>{const p=f.getChild(oj);return p?parseFloat(t.sliceDoc(p.from,p.to)):null};if(a){const f=d(a);n.fill.lhs=f,n.fill.rhs=f}l&&(n.fill.lhs=d(l)),u&&(n.fill.rhs=d(u))}return lf(e,qR,QR,YR)&&n.card===Xl.CardOneToOne&&(n.card=Xl.CardManyToMany),n}let vye=class{constructor(e){this.tree=Hr(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){const n=e.node.parent;if((n==null?void 0:n.type.id)===au)continue;if(e.to!==this.tree.topNode.to){const i=e.node.parent;this.diagnostics.push({severity:"error",message:"unexpected expression",from:i?i.from:e.from,to:i?i.to:e.to})}}}checkAST(e){if(!e)return oe.none;switch(e.type.id){case Hv:this.checkAggregationExpr(e);break;case lm:this.checkBinaryExpr(e);break;case d2:this.checkCallFunction(e);break;case Z7:this.checkAST(e.getChild("Expr"));break;case J7:{const n=this.checkAST(e.getChild("Expr"));n!==oe.scalar&&n!==oe.vector&&this.addDiagnostic(e,`unary expression only allowed on expressions of type scalar or instant vector, got ${n}`);break}case K7:{this.checkAnchoredSmoothedExpr(e,[m2,p2,f2]);break}case X7:{this.checkAnchoredSmoothedExpr(e,[V7,U7,m2,p2,f2]);break}case il:{const n=this.checkAST(e.getChild("Expr"));n!==oe.vector&&this.addDiagnostic(e,`subquery is only allowed on instant vector, got ${n} in ${e.name} instead`);const i=this.getSubqueryStepDurationExpr(e);i&&this.isTopLevelDurationRangeExpr(i)&&this.addDiagnosticWithSeverity(i,"range() is not meaningful as a subquery resolution step; consider a concrete duration","warning");break}case au:{this.checkAST(e.getChild("Expr")),e.getChild(fme)||this.addDiagnostic(e,"offset requires a duration expression");break}case Gl:this.checkAST(e.getChild("Expr"));break;case Jy:this.checkVectorSelector(e);break;case WR:{const n=this.checkAST(e.getChild("Expr"));n!==oe.vector&&n!==oe.matrix&&this.addDiagnostic(e,"@ modifier must be preceded by an instant selector vector or range vector selector or a subquery");break}}return ql(e)}checkAggregationExpr(e){var n;const i=(n=e.firstChild)===null||n===void 0?void 0:n.firstChild;if(!i){this.addDiagnostic(e,"aggregation operator expected in aggregation expression but got nothing");return}const r=e.getChild(hu),s=r?r.getChildren("Expr"):[];if(!s.length){this.addDiagnostic(e,"unable to find the parameter for the expression");return}this.expectType(s[s.length-1],oe.vector,"aggregation expression"),(i.type.id===q7||i.type.id===F7||i.type.id===z7||i.type.id===H7||i.type.id===wfe)&&this.expectType(s[0],oe.scalar,"aggregation parameter"),i.type.id===$7&&this.expectType(s[0],oe.string,"aggregation parameter")}checkBinaryExpr(e){const n=e.firstChild,i=e.lastChild;if(!n||!i){this.addDiagnostic(e,"left or right expression is missing in binary expression");return}const r=this.checkAST(n),s=this.checkAST(i),a=e.getChild(Q7),l=lf(e,a2,Yv,u2,h2,l2,c2),u=U1(e,W7),d=U1(e,Y7),f=lf(e,qR,QR,YR);a?l||this.addDiagnostic(e,"bool modifier can only be used on comparison operators"):r===oe.scalar&&s===oe.scalar&&(l?this.addDiagnostic(e,"comparisons between scalars must use BOOL modifier"):u?this.addDiagnostic(e,'operator ">/" not allowed for Scalar operations'):d&&this.addDiagnostic(e,'operator "</" not allowed for Scalar operations'));const p=gye(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`);r!==oe.scalar&&r!==oe.vector&&this.addDiagnostic(n,"binary expression must contain only scalar and instant vector types"),s!==oe.scalar&&s!==oe.vector&&this.addDiagnostic(i,"binary expression must contain only scalar and instant vector types"),(r!==oe.vector||s!==oe.vector)&&p!==null?p.matchingLabels.length>0&&this.addDiagnostic(e,"vector matching only allowed between instant vectors"):f&&(((p==null?void 0:p.card)===Xl.CardOneToMany||(p==null?void 0:p.card)===Xl.CardManyToOne)&&this.addDiagnostic(e,"no grouping allowed for set operations"),(p==null?void 0:p.card)!==Xl.CardManyToMany&&this.addDiagnostic(e,"set operations must always be many-to-many")),(r===oe.scalar||s===oe.scalar)&&f&&this.addDiagnostic(e,"set operator not allowed in binary scalar expression")}checkCallFunction(e){var n;const i=(n=e.firstChild)===null||n===void 0?void 0:n.firstChild;if(!i){this.addDiagnostic(e,"function not defined");return}const r=e.getChild(hu),s=r?r.getChildren("Expr"):[],a=nQ(i.type.id),l=a.argTypes.length;if(a.variadic===0)s.length!==l&&this.addDiagnostic(e,`expected ${l} argument(s) in call to "${a.name}", got ${s.length}`);else{const d=l-1;if(d>s.length)this.addDiagnostic(e,`expected at least ${d} argument(s) in call to "${a.name}", got ${s.length}`);else{const f=d+a.variadic;a.variadic>0&&f<s.length&&this.addDiagnostic(e,`expected at most ${f} argument(s) in call to "${a.name}", got ${s.length}`)}}a.name==="info"&&s.length>1&&s[1].getChild(Y1)&&this.addDiagnostic(e,`expected label selectors as the second argument to "info" function, got ${s[1].type}`);let u=0;for(let d=0;d<s.length;d++){if(u=d,u>=a.argTypes.length){if(a.variadic===0)break;u=a.argTypes.length-1}this.expectType(s[d],a.argTypes[u],`call to function "${a.name}"`)}}checkAnchoredSmoothedExpr(e,n){var i,r;const s=ql(e);if(s!==oe.vector&&s!==oe.matrix){this.addDiagnostic(e,`smoothed/anchored expression only allowed on instant vector or range vector selector, got ${s} instead`);return}const a=(i=e.parent)===null||i===void 0?void 0:i.parent;if(!a||a.type.id!==d2)return;const l=(r=a.firstChild)===null||r===void 0?void 0:r.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(cm),i=[Qv,Ef,zh];let r=[];for(const u of i)r=r.concat(rQ(n?n.getChildren(u):[],this.state));let s="";const a=e.getChild(Y1);if(a&&(s=this.state.sliceDoc(a.from,a.to)),s!==""){const u=r.find(d=>d.name==="__name__");u&&this.addDiagnostic(e,`metric name must not be set twice: ${s} or ${u.value}`),r.push(new iQ(ex,"__name__",s))}else{const u=r.filter(d=>d.name==="__name__");u.length>1&&this.addDiagnostic(e,`metric name must not be set twice: ${u[0].value} or ${u[1].value}`)}r.every(u=>u.matchesEmpty())&&this.addDiagnostic(e,"vector selector must contain at least one non-empty matcher")}expectType(e,n,i){const r=this.checkAST(e);r!==n&&this.addDiagnostic(e,`expected type ${n} in ${i}, got ${r}`)}addDiagnostic(e,n){this.addDiagnosticWithSeverity(e,n,"error")}addDiagnosticWithSeverity(e,n,i){this.diagnostics.push({severity:i,message:n,from:e.from,to:e.to})}isTopLevelDurationRangeExpr(e){return e.getChild(dme)!==null}getSubqueryStepDurationExpr(e){const n=e.getChildren(hv);return n.length<2?null:n[n.length-1]}};class UY{constructor(e,n,i,r){this.state=e,this.pos=n,this.explicit=i,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let n=Hr(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),i=Math.max(n.from,this.pos-250),r=n.text.slice(i-n.from,this.pos-n.from),s=r.search(VY(e,!1));return s<0?null:{from:i+s,to:this.pos,text:r.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,n,i){e=="abort"&&this.abortListeners&&(this.abortListeners.push(n),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function t6(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 yye(t){let e=Object.create(null),n=Object.create(null);for(let{label:r}of t){e[r[0]]=!0;for(let s=1;s<r.length;s++)n[r[s]]=!0}let i=t6(e)+t6(n)+"*$";return[new RegExp("^"+i),new RegExp(i)]}function xye(t){let e=t.map(r=>typeof r=="string"?{label:r}:r),[n,i]=e.every(r=>/^\w+$/.test(r.label))?[/\w*$/,/\w+$/]:yye(e);return r=>{let s=r.matchBefore(i);return s||r.explicit?{from:s?s.from:r.pos,options:e,validFor:n}:null}}class n6{constructor(e,n,i,r){this.completion=e,this.source=n,this.match=i,this.score=r}}function Rf(t){return t.selection.main.from}function VY(t,e){var n;let{source:i}=t,r=e&&i[0]!="^",s=i[i.length-1]!="$";return!r&&!s?t:new RegExp(`${r?"^":""}(?:${i})${s?"$":""}`,(n=t.flags)!==null&&n!==void 0?n:t.ignoreCase?"i":"")}const mD=Ac.define();function bye(t,e,n,i){let{main:r}=t.selection,s=n-r.from,a=i-r.from;return{...t.changeByRange(l=>{if(l!=r&&n!=i&&t.sliceDoc(l.from+s,l.from+a)!=t.sliceDoc(n,i))return{range:l};let u=t.toText(e);return{changes:{from:l.from+s,to:i==r.from?l.to:l.from+a,insert:u},range:Le.cursor(l.from+s+u.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const i6=new WeakMap;function Aye(t){if(!Array.isArray(t))return t;let e=i6.get(t);return e||i6.set(t,e=xye(t)),e}const uw=Xt.define(),ny=Xt.define();class wye{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 i=bo(e,n),r=Zl(i);this.chars.push(i);let s=e.slice(n,n+r),a=s.toUpperCase();this.folded.push(bo(a==s?s.toLowerCase():a,0)),n+=r}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:i,any:r,precise:s,byWord:a}=this;if(n.length==1){let S=bo(e,0),j=Zl(S),C=j==e.length?0:-100;if(S!=n[0])if(S==i[0])C+=-200;else return null;return this.ret(C,[0,j])}let l=e.indexOf(this.pattern);if(l==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let u=n.length,d=0;if(l<0){for(let S=0,j=Math.min(e.length,200);S<j&&d<u;){let C=bo(e,S);(C==n[d]||C==i[d])&&(r[d++]=S),S+=Zl(C)}if(d<u)return null}let f=0,p=0,m=!1,v=0,y=-1,b=-1,A=/[a-z]/.test(e),w=!0;for(let S=0,j=Math.min(e.length,200),C=0;S<j&&p<u;){let k=bo(e,S);l<0&&(f<u&&k==n[f]&&(s[f++]=S),v<u&&(k==n[v]||k==i[v]?(v==0&&(y=S),b=S+1,v++):v=0));let E,M=k<255?k>=48&&k<=57||k>=97&&k<=122?2:k>=65&&k<=90?1:0:(E=VR(k))!=E.toLowerCase()?1:E!=E.toUpperCase()?2:0;(!S||M==1&&A||C==0&&M!=0)&&(n[p]==k||i[p]==k&&(m=!0)?a[p++]=S:a.length&&(w=!1)),C=M,S+=Zl(k)}return p==u&&a[0]==0&&w?this.result(-100+(m?-200:0),a,e):v==u&&y==0?this.ret(-200-e.length+(b==e.length?0:-100),[0,b]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):v==u?this.ret(-900-e.length,[y,b]):p==u?this.result(-100+(m?-200:0)+-700+(w?0:-1100),a,e):n.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,n,i){let r=[],s=0;for(let a of n){let l=a+(this.astral?Zl(bo(i,a)):1);s&&r[s-1]==a?r[s-1]=l:(r[s++]=a,r[s++]=l)}return this.ret(e-i.length,r)}}class Sye{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),i=n==this.pattern?0:n.toLowerCase()==this.folded?-200:null;return i==null?null:(this.matched=[0,n.length],this.score=i+(e.length==this.pattern.length?0:-100),this)}}const ts=bt.define({combine(t){return wc(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:jye,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)=>i=>r6(e(i),n(i)),optionClass:(e,n)=>i=>r6(e(i),n(i)),addToOptions:(e,n)=>e.concat(n),filterStrict:(e,n)=>e||n})}});function r6(t,e){return t?e?t+" "+e:t:e}function jye(t,e,n,i,r,s){let a=t.textDirection==Si.RTL,l=a,u=!1,d="top",f,p,m=e.left-r.left,v=r.right-e.right,y=i.right-i.left,b=i.bottom-i.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(r.top,Math.min(n.top,r.bottom-b))-e.top,p=Math.min(400,l?m:v);else{u=!0,p=Math.min(400,(a?e.right:r.right-e.left)-30);let S=r.bottom-e.bottom;S>=b||S>e.top?f=n.bottom-e.top:(d="bottom",f=e.bottom-n.top)}let A=(e.bottom-e.top)/s.offsetHeight,w=(e.right-e.left)/s.offsetWidth;return{style:`${d}: ${f/A}px; max-width: ${p/w}px`,class:"cm-completionInfo-"+(u?a?"left-narrow":"right-narrow":l?"left":"right")}}const gD=Xt.define();function Cye(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(n){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),n.type&&i.classList.add(...n.type.split(/\s+/g).map(r=>"cm-completionIcon-"+r)),i.setAttribute("aria-hidden","true"),i},position:20}),e.push({render(n,i,r,s){let a=document.createElement("span");a.className="cm-completionLabel";let l=n.displayLabel||n.label,u=0;for(let d=0;d<s.length;){let f=s[d++],p=s[d++];f>u&&a.appendChild(document.createTextNode(l.slice(u,f)));let m=a.appendChild(document.createElement("span"));m.appendChild(document.createTextNode(l.slice(f,p))),m.className="cm-completionMatchedText",u=p}return u<l.length&&a.appendChild(document.createTextNode(l.slice(u))),a},position:50},{render(n){if(!n.detail)return null;let i=document.createElement("span");return i.className="cm-completionDetail",i.textContent=n.detail,i},position:80}),e.sort((n,i)=>n.position-i.position).map(n=>n.render)}function rT(t,e,n){if(t<=n)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let r=Math.floor(e/n);return{from:r*n,to:(r+1)*n}}let i=Math.ceil((t-e)/n);return{from:t-i*n,to:t-(i-1)*n}}class _ye{constructor(e,n,i){this.view=e,this.stateField=n,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:u=>this.placeInfo(u),key:this},this.space=null,this.currentClass="";let r=e.state.field(n),{options:s,selected:a}=r.open,l=e.state.facet(ts);this.optionContent=Cye(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=rT(s.length,a,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",u=>{let{options:d}=e.state.field(n).open;for(let f=u.target,p;f&&f!=this.dom;f=f.parentNode)if(f.nodeName=="LI"&&(p=/-(\d+)$/.exec(f.id))&&+p[1]<d.length){this.applyCompletion(e,d[+p[1]]),u.preventDefault();return}if(u.target==this.list){let f=this.list.classList.contains("cm-completionListIncompleteTop")&&u.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains("cm-completionListIncompleteBottom")&&u.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;f!=null&&(e.dispatch({effects:gD.of(f)}),u.preventDefault())}}),this.dom.addEventListener("focusout",u=>{let d=e.state.field(this.stateField,!1);d&&d.tooltip&&e.state.facet(ts).closeOnBlur&&u.relatedTarget!=e.contentDOM&&e.dispatch({effects:ny.of(null)})}),this.showOptions(s,r.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 i=e.state.field(this.stateField),r=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),i!=r){let{options:s,selected:a,disabled:l}=i.open;(!r.open||r.open.options!=s)&&(this.range=rT(s.length,a,e.state.facet(ts).maxRenderedOptions),this.showOptions(s,i.id)),this.updateSel(),l!=((n=r.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 i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of n.split(" "))i&&this.dom.classList.add(i);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=rT(n.options.length,n.selected,this.view.state.facet(ts).maxRenderedOptions),this.showOptions(n.options,e.id));let i=this.updateSelectedOption(n.selected);if(i){this.destroyInfo();let{completion:r}=n.options[n.selected],{info:s}=r;if(!s)return;let a=typeof s=="string"?document.createTextNode(s):s(r);if(!a)return;"then"in a?a.then(l=>{l&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(l,r)}).catch(l=>Ks(this.view.state,l,"completion info")):(this.addInfoPane(a,r),i.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,n){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",i.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)i.appendChild(e),this.infoDestroy=null;else{let{dom:r,destroy:s}=e;i.appendChild(r),this.infoDestroy=s||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let n=null;for(let i=this.list.firstChild,r=this.range.from;i;i=i.nextSibling,r++)i.nodeName!="LI"||!i.id?r--:r==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),n=i):i.hasAttribute("aria-selected")&&(i.removeAttribute("aria-selected"),i.removeAttribute("aria-describedby"));return n&&Tye(this.list,n),n}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let n=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),s=this.space;if(!s){let a=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:a.clientWidth,bottom:a.clientHeight}}return r.top>Math.min(s.bottom,n.bottom)-10||r.bottom<Math.max(s.top,n.top)+10?null:this.view.state.facet(ts).positionInfo(this.view,n,r,i,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,i){const r=document.createElement("ul");r.id=n,r.setAttribute("role","listbox"),r.setAttribute("aria-expanded","true"),r.setAttribute("aria-label",this.view.state.phrase("Completions")),r.addEventListener("mousedown",a=>{a.target==r&&a.preventDefault()});let s=null;for(let a=i.from;a<i.to;a++){let{completion:l,match:u}=e[a],{section:d}=l;if(d){let m=typeof d=="string"?d:d.name;if(m!=s&&(a>i.from||i.from==0))if(s=m,typeof d!="string"&&d.header)r.appendChild(d.header(d));else{let v=r.appendChild(document.createElement("completion-section"));v.textContent=m}}const f=r.appendChild(document.createElement("li"));f.id=n+"-"+a,f.setAttribute("role","option");let p=this.optionClass(l);p&&(f.className=p);for(let m of this.optionContent){let v=m(l,this.view.state,this.view,u);v&&f.appendChild(v)}}return i.from&&r.classList.add("cm-completionListIncompleteTop"),i.to<e.length&&r.classList.add("cm-completionListIncompleteBottom"),r}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function kye(t,e){return n=>new _ye(n,t,e)}function Tye(t,e){let n=t.getBoundingClientRect(),i=e.getBoundingClientRect(),r=n.height/t.offsetHeight;i.top<n.top?t.scrollTop-=(n.top-i.top)/r:i.bottom>n.bottom&&(t.scrollTop+=(i.bottom-n.bottom)/r)}function s6(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function Oye(t,e){let n=[],i=null,r=null,s=f=>{n.push(f);let{section:p}=f.completion;if(p){i||(i=[]);let m=typeof p=="string"?p:p.name;i.some(v=>v.name==m)||i.push(typeof p=="string"?{name:m}:p)}},a=e.facet(ts);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 n6(m,f.source,p?p(m):[],1e9-n.length));else{let m=e.sliceDoc(f.from,f.to),v,y=a.filterStrict?new Sye(m):new wye(m);for(let b of f.result.options)if(v=y.match(b.label)){let A=b.displayLabel?p?p(b,v.matched):[]:v.matched,w=v.score+(b.boost||0);if(s(new n6(b,f.source,A,w)),typeof b.section=="object"&&b.section.rank==="dynamic"){let{name:S}=b.section;r||(r=Object.create(null)),r[S]=Math.max(w,r[S]||-1e9)}}}}if(i){let f=Object.create(null),p=0,m=(v,y)=>(v.rank==="dynamic"&&y.rank==="dynamic"?r[y.name]-r[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 i.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=[],u=null,d=a.compareCompletions;for(let f of n.sort((p,m)=>m.score-p.score||d(p.completion,m.completion))){let p=f.completion;!u||u.label!=p.label||u.detail!=p.detail||u.type!=null&&p.type!=null&&u.type!=p.type||u.apply!=p.apply||u.boost!=p.boost?l.push(f):s6(f.completion)>s6(u)&&(l[l.length-1]=f),u=f.completion}return l}class Xp{constructor(e,n,i,r,s,a){this.options=e,this.attrs=n,this.tooltip=i,this.timestamp=r,this.selected=s,this.disabled=a}setSelected(e,n){return e==this.selected||e>=this.options.length?this:new Xp(this.options,o6(n,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,n,i,r,s,a){if(r&&!a&&e.some(d=>d.isPending))return r.setDisabled();let l=Oye(e,n);if(!l.length)return r&&e.some(d=>d.isPending)?r.setDisabled():null;let u=n.facet(ts).selectOnOpen?0:-1;if(r&&r.selected!=u&&r.selected!=-1){let d=r.options[r.selected].completion;for(let f=0;f<l.length;f++)if(l[f].completion==d){u=f;break}}return new Xp(l,o6(i,u),{pos:e.reduce((d,f)=>f.hasResult()?Math.min(d,f.from):d,1e8),create:Iye,above:s.aboveCursor},r?r.timestamp:Date.now(),u,!1)}map(e){return new Xp(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new Xp(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class hw{constructor(e,n,i){this.active=e,this.id=n,this.open=i}static start(){return new hw(Dye,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:n}=e,i=n.facet(ts),s=(i.override||n.languageDataAt("autocomplete",Rf(n)).map(Aye)).map(u=>(this.active.find(f=>f.source==u)||new _a(u,this.active.some(f=>f.state!=0)?1:0)).update(e,i));s.length==this.active.length&&s.every((u,d)=>u==this.active[d])&&(s=this.active);let a=this.open,l=e.effects.some(u=>u.is(vD));a&&e.docChanged&&(a=a.map(e.changes)),e.selection||s.some(u=>u.hasResult()&&e.changes.touchesRange(u.from,u.to))||!Eye(s,this.active)||l?a=Xp.build(s,n,this.id,a,i,l):a&&a.disabled&&!s.some(u=>u.isPending)&&(a=null),!a&&s.every(u=>!u.isPending)&&s.some(u=>u.hasResult())&&(s=s.map(u=>u.hasResult()?new _a(u.source,0):u));for(let u of e.effects)u.is(gD)&&(a=a&&a.setSelected(u.value,this.id));return s==this.active&&a==this.open?this:new hw(s,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?Mye:Rye}}function Eye(t,e){if(t==e)return!0;for(let n=0,i=0;;){for(;n<t.length&&!t[n].hasResult();)n++;for(;i<e.length&&!e[i].hasResult();)i++;let r=n==t.length,s=i==e.length;if(r||s)return r==s;if(t[n++].result!=e[i++].result)return!1}}const Mye={"aria-autocomplete":"list"},Rye={};function o6(t,e){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":t};return e>-1&&(n["aria-activedescendant"]=t+"-"+e),n}const Dye=[];function GY(t,e){if(t.isUserEvent("input.complete")){let i=t.annotation(mD);if(i&&e.activateOnCompletion(i))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 _a{constructor(e,n,i=!1){this.source=e,this.state=n,this.explicit=i}hasResult(){return!1}get isPending(){return this.state==1}update(e,n){let i=GY(e,n),r=this;(i&8||i&16&&this.touches(e))&&(r=new _a(r.source,0)),i&4&&r.state==0&&(r=new _a(this.source,1)),r=r.updateFor(e,i);for(let s of e.effects)if(s.is(uw))r=new _a(r.source,1,s.value);else if(s.is(ny))r=new _a(r.source,0);else if(s.is(vD))for(let a of s.value)a.source==r.source&&(r=a);return r}updateFor(e,n){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(Rf(e.state))}}class pm extends _a{constructor(e,n,i,r,s,a){super(e,3,n),this.limit=i,this.result=r,this.from=s,this.to=a}hasResult(){return!0}updateFor(e,n){var i;if(!(n&3))return this.map(e.changes);let r=this.result;r.map&&!e.changes.empty&&(r=r.map(r,e.changes));let s=e.changes.mapPos(this.from),a=e.changes.mapPos(this.to,1),l=Rf(e.state);if(l>a||!r||n&2&&(Rf(e.startState)==this.from||l<this.limit))return new _a(this.source,n&4?1:0);let u=e.changes.mapPos(this.limit);return Nye(r.validFor,e.state,s,a)?new pm(this.source,this.explicit,u,r,s,a):r.update&&(r=r.update(r,s,a,new UY(e.state,l,!1)))?new pm(this.source,this.explicit,u,r,r.from,(i=r.to)!==null&&i!==void 0?i:Rf(e.state)):new _a(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 pm(this.source,this.explicit,e.mapPos(this.limit),n,e.mapPos(this.from),e.mapPos(this.to,1)):new _a(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function Nye(t,e,n,i){if(!t)return!1;let r=e.sliceDoc(n,i);return typeof t=="function"?t(r,n,i,e):VY(t,!0).test(r)}const vD=Xt.define({map(t,e){return t.map(n=>n.map(e))}}),Ao=Ss.define({create(){return hw.start()},update(t,e){return t.update(e)},provide:t=>[hD.from(t,e=>e.tooltip),ut.contentAttributes.from(t,e=>e.attrs)]});function yD(t,e){const n=e.completion.apply||e.completion.label;let i=t.state.field(Ao).active.find(r=>r.source==e.source);return i instanceof pm?(typeof n=="string"?t.dispatch({...bye(t.state,n,i.from,i.to),annotations:mD.of(e.completion)}):n(t,e.completion,i.from,i.to),!0):!1}const Iye=kye(Ao,yD);function cA(t,e="option"){return n=>{let i=n.state.field(Ao,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp<n.state.facet(ts).interactionDelay)return!1;let r=1,s;e=="page"&&(s=_Y(n,i.open.tooltip))&&(r=Math.max(2,Math.floor(s.dom.offsetHeight/s.dom.querySelector("li").offsetHeight)-1));let{length:a}=i.open.options,l=i.open.selected>-1?i.open.selected+r*(t?1:-1):t?0:a-1;return l<0?l=e=="page"?0:a-1:l>=a&&(l=e=="page"?a-1:0),n.dispatch({effects:gD.of(l)}),!0}}const Bye=t=>{let e=t.state.field(Ao,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<t.state.facet(ts).interactionDelay?!1:yD(t,e.open.options[e.open.selected])},sT=t=>t.state.field(Ao,!1)?(t.dispatch({effects:uw.of(!0)}),!0):!1,Lye=t=>{let e=t.state.field(Ao,!1);return!e||!e.active.some(n=>n.state!=0)?!1:(t.dispatch({effects:ny.of(null)}),!0)};class Pye{constructor(e,n){this.active=e,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const Fye=50,$ye=1e3,zye=Ji.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(Ao).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(Ao),n=t.state.facet(ts);if(!t.selectionSet&&!t.docChanged&&t.startState.field(Ao)==e)return;let i=t.transactions.some(s=>{let a=GY(s,n);return a&8||(s.selection||s.docChanged)&&!(a&3)});for(let s=0;s<this.running.length;s++){let a=this.running[s];if(i||a.context.abortOnDocChange&&t.docChanged||a.updates.length+t.transactions.length>Fye&&Date.now()-a.time>$ye){for(let l of a.context.abortListeners)try{l()}catch(u){Ks(this.view.state,u)}a.context.abortListeners=null,this.running.splice(s--,1)}else a.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(s=>s.effects.some(a=>a.is(uw)))&&(this.pendingStart=!0);let r=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(s=>s.isPending&&!this.running.some(a=>a.active.source==s.source))?setTimeout(()=>this.startUpdate(),r):-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(Ao);for(let n of e.active)n.isPending&&!this.running.some(i=>i.active.source==n.source)&&this.startQuery(n);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(ts).updateSyncTime))}startQuery(t){let{state:e}=this.view,n=Rf(e),i=new UY(e,n,t.explicit,this.view),r=new Pye(t,i);this.running.push(r),Promise.resolve(t.source(i)).then(s=>{r.context.aborted||(r.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:ny.of(null)}),Ks(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(ts).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],n=this.view.state.facet(ts),i=this.view.state.field(Ao);for(let r=0;r<this.running.length;r++){let s=this.running[r];if(s.done===void 0)continue;if(this.running.splice(r--,1),s.done){let l=Rf(s.updates.length?s.updates[0].startState:this.view.state),u=Math.min(l,s.done.from+(s.active.explicit?0:1)),d=new pm(s.active.source,s.active.explicit,u,s.done,s.done.from,(t=s.done.to)!==null&&t!==void 0?t:l);for(let f of s.updates)d=d.update(f,n);if(d.hasResult()){e.push(d);continue}}let a=i.active.find(l=>l.source==s.active.source);if(a&&a.isPending)if(s.done==null){let l=new _a(s.active.source,0);for(let u of s.updates)l=l.update(u,n);l.isPending||e.push(l)}else this.startQuery(a)}(e.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:vD.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(Ao,!1);if(e&&e.tooltip&&this.view.state.facet(ts).closeOnBlur){let n=e.open&&_Y(this.view,e.open.tooltip);(!n||!n.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:ny.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:uw.of(!1)}),20),this.composing=0}}}),Hye=typeof navigator=="object"&&/Win/.test(navigator.platform),qye=Mu.highest(ut.domEventHandlers({keydown(t,e){let n=e.state.field(Ao,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||t.key.length>1||t.ctrlKey&&!(Hye&&t.altKey)||t.metaKey)return!1;let i=n.open.options[n.open.selected],r=n.active.find(a=>a.source==i.source),s=i.completion.commitCharacters||r.result.commitCharacters;return s&&s.indexOf(t.key)>-1&&yD(e,i),!1}})),XY=ut.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 Qye{constructor(e,n,i,r){this.field=e,this.line=n,this.from=i,this.to=r}}class xD{constructor(e,n,i){this.field=e,this.from=n,this.to=i}map(e){let n=e.mapPos(this.from,-1,As.TrackDel),i=e.mapPos(this.to,1,As.TrackDel);return n==null||i==null?null:new xD(this.field,n,i)}}class bD{constructor(e,n){this.lines=e,this.fieldPositions=n}instantiate(e,n){let i=[],r=[n],s=e.doc.lineAt(n),a=/^\s*/.exec(s.text)[0];for(let u of this.lines){if(i.length){let d=a,f=/^\t*/.exec(u)[0].length;for(let p=0;p<f;p++)d+=e.facet(rx);r.push(n+d.length-f),u=d+u.slice(f)}i.push(u),n+=u.length+1}let l=this.fieldPositions.map(u=>new xD(u.field,r[u.line]+u.from,r[u.line]+u.to));return{text:i,ranges:l}}static parse(e){let n=[],i=[],r=[],s;for(let a of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(a);){let l=s[1]?+s[1]:null,u=s[2]||s[3]||"",d=-1;l===0&&(l=1e9);let f=u.replace(/\\[{}]/g,p=>p[1]);for(let p=0;p<n.length;p++)(l!=null?n[p].seq==l:f&&n[p].name==f)&&(d=p);if(d<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}),d=p;for(let m of r)m.field>=d&&m.field++}for(let p of r)if(p.line==i.length&&p.from>s.index){let m=s[2]?3+(s[1]||"").length:2;p.from-=m,p.to-=m}r.push(new Qye(d,i.length,s.index,s.index+f.length)),a=a.slice(0,s.index)+u+a.slice(s.index+s[0].length)}a=a.replace(/\\([{}])/g,(l,u,d)=>{for(let f of r)f.line==i.length&&f.from>d&&(f.from--,f.to--);return u}),i.push(a)}return new bD(i,r)}}let Yye=Bt.widget({widget:new class extends Cl{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),Wye=Bt.mark({class:"cm-snippetField"});class Tg{constructor(e,n){this.ranges=e,this.active=n,this.deco=Bt.set(e.map(i=>(i.from==i.to?Yye:Wye).range(i.from,i.to)),!0)}map(e){let n=[];for(let i of this.ranges){let r=i.map(e);if(!r)return null;n.push(r)}return new Tg(n,this.active)}selectionInsideField(e){return e.ranges.every(n=>this.ranges.some(i=>i.field==this.active&&i.from<=n.from&&i.to>=n.to))}}const ox=Xt.define({map(t,e){return t&&t.map(e)}}),Uye=Xt.define(),iy=Ss.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(ox))return n.value;if(n.is(Uye)&&t)return new Tg(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=>ut.decorations.from(t,e=>e?e.deco:Bt.none)});function AD(t,e){return Le.create(t.filter(n=>n.field==e).map(n=>Le.range(n.from,n.to)))}function jh(t){let e=bD.parse(t);return(n,i,r,s)=>{let{text:a,ranges:l}=e.instantiate(n.state,r),{main:u}=n.state.selection,d={changes:{from:r,to:s==u.from?u.to:s,insert:zn.of(a)},scrollIntoView:!0,annotations:i?[mD.of(i),Mr.userEvent.of("input.complete")]:void 0};if(l.length&&(d.selection=AD(l,0)),l.some(f=>f.field>0)){let f=new Tg(l,0),p=d.effects=[ox.of(f)];n.state.field(iy,!1)===void 0&&p.push(Xt.appendConfig.of([iy,Zye,Jye,XY]))}n.dispatch(n.state.update(d))}}function KY(t){return({state:e,dispatch:n})=>{let i=e.field(iy,!1);if(!i||t<0&&i.active==0)return!1;let r=i.active+t,s=t>0&&!i.ranges.some(a=>a.field==r+t);return n(e.update({selection:AD(i.ranges,r),effects:ox.of(s?null:new Tg(i.ranges,r)),scrollIntoView:!0})),!0}}const Vye=({state:t,dispatch:e})=>t.field(iy,!1)?(e(t.update({effects:ox.of(null)})),!0):!1,Gye=KY(1),Xye=KY(-1),Kye=[{key:"Tab",run:Gye,shift:Xye},{key:"Escape",run:Vye}],a6=bt.define({combine(t){return t.length?t[0]:Kye}}),Zye=Mu.highest(Gh.compute([a6],t=>t.facet(a6))),Jye=ut.domEventHandlers({mousedown(t,e){let n=e.state.field(iy,!1),i;if(!n||(i=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let r=n.ranges.find(s=>s.from<=i&&s.to>=i);return!r||r.field==n.active?!1:(e.dispatch({selection:AD(n.ranges,r.field),effects:ox.of(n.ranges.some(s=>s.field>r.field)?new Tg(n.ranges,r.field):null),scrollIntoView:!0}),!0)}}),ry={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},uf=Xt.define({map(t,e){let n=e.mapPos(t,-1,As.TrackAfter);return n??void 0}}),wD=new class extends rd{};wD.startSide=1;wD.endSide=-1;const ZY=Ss.define({create(){return Sn.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:i=>i>=n.from&&i<=n.to})}for(let n of e.effects)n.is(uf)&&(t=t.update({add:[wD.range(n.value,n.value+1)]}));return t}});function JY(){return[txe,ZY]}const oT="()[]{}<>«»»«［］｛｝";function eW(t){for(let e=0;e<oT.length;e+=2)if(oT.charCodeAt(e)==t)return oT.charAt(e+1);return VR(t<128?t:t+1)}function tW(t,e){return t.languageDataAt("closeBrackets",e)[0]||ry}const exe=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),txe=ut.inputHandler.of((t,e,n,i)=>{if((exe?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let r=t.state.selection.main;if(i.length>2||i.length==2&&Zl(bo(i,0))==1||e!=r.from||n!=r.to)return!1;let s=ixe(t.state,i);return s?(t.dispatch(s),!0):!1}),nxe=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=tW(t,t.selection.main.head).brackets||ry.brackets,r=null,s=t.changeByRange(a=>{if(a.empty){let l=rxe(t.doc,a.head);for(let u of i)if(u==l&&vj(t.doc,a.head)==eW(bo(u,0)))return{changes:{from:a.head-u.length,to:a.head+u.length},range:Le.cursor(a.head-u.length)}}return{range:r=a}});return r||e(t.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!r},nW=[{key:"Backspace",run:nxe}];function ixe(t,e){let n=tW(t,t.selection.main.head),i=n.brackets||ry.brackets;for(let r of i){let s=eW(bo(r,0));if(e==r)return s==r?axe(t,r,i.indexOf(r+r+r)>-1,n):sxe(t,r,s,n.before||ry.before);if(e==s&&iW(t,t.selection.main.from))return oxe(t,r,s)}return null}function iW(t,e){let n=!1;return t.field(ZY).between(0,t.doc.length,i=>{i==e&&(n=!0)}),n}function vj(t,e){let n=t.sliceString(e,e+2);return n.slice(0,Zl(bo(n,0)))}function rxe(t,e){let n=t.sliceString(e-2,e);return Zl(bo(n,0))==n.length?n:n.slice(1)}function sxe(t,e,n,i){let r=null,s=t.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:n,from:a.to}],effects:uf.of(a.to+e.length),range:Le.range(a.anchor+e.length,a.head+e.length)};let l=vj(t.doc,a.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:e+n,from:a.head},effects:uf.of(a.head+e.length),range:Le.cursor(a.head+e.length)}:{range:r=a}});return r?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function oxe(t,e,n){let i=null,r=t.changeByRange(s=>s.empty&&vj(t.doc,s.head)==n?{changes:{from:s.head,to:s.head+n.length,insert:n},range:Le.cursor(s.head+n.length)}:i={range:s});return i?null:t.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function axe(t,e,n,i){let r=i.stringPrefixes||ry.stringPrefixes,s=null,a=t.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:uf.of(l.to+e.length),range:Le.range(l.anchor+e.length,l.head+e.length)};let u=l.head,d=vj(t.doc,u),f;if(d==e){if(l6(t,u))return{changes:{insert:e+e,from:u},effects:uf.of(u+e.length),range:Le.cursor(u+e.length)};if(iW(t,u)){let m=n&&t.sliceDoc(u,u+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:u,to:u+m.length,insert:m},range:Le.cursor(u+m.length)}}}else{if(n&&t.sliceDoc(u-2*e.length,u)==e+e&&(f=c6(t,u-2*e.length,r))>-1&&l6(t,f))return{changes:{insert:e+e+e+e,from:u},effects:uf.of(u+e.length),range:Le.cursor(u+e.length)};if(t.charCategorizer(u)(d)!=qi.Word&&c6(t,u,r)>-1&&!lxe(t,u,e,r))return{changes:{insert:e+e,from:u},effects:uf.of(u+e.length),range:Le.cursor(u+e.length)}}return{range:s=l}});return s?null:t.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function l6(t,e){let n=Hr(t).resolveInner(e+1);return n.parent&&n.from==e}function lxe(t,e,n,i){let r=Hr(t).resolveInner(e,-1),s=i.reduce((a,l)=>Math.max(a,l.length),0);for(let a=0;a<5;a++){let l=t.sliceDoc(r.from,Math.min(r.to,r.from+n.length+s)),u=l.indexOf(n);if(!u||u>-1&&i.indexOf(l.slice(0,u))>-1){let f=r.firstChild;for(;f&&f.from==r.from&&f.to-f.from>n.length+u;){if(t.sliceDoc(f.to-n.length,f.to)==n)return!1;f=f.firstChild}return!0}let d=r.to==e&&r.parent;if(!d)break;r=d}return!1}function c6(t,e,n){let i=t.charCategorizer(e);if(i(t.sliceDoc(e-1,e))!=qi.Word)return e;for(let r of n){let s=e-r.length;if(t.sliceDoc(s,e)==r&&i(t.sliceDoc(s-1,s))!=qi.Word)return s}return-1}function rW(t={}){return[qye,Ao,ts.of(t),zye,cxe,XY]}const SD=[{key:"Ctrl-Space",run:sT},{mac:"Alt-`",run:sT},{mac:"Alt-i",run:sT},{key:"Escape",run:Lye},{key:"ArrowDown",run:cA(!0)},{key:"ArrowUp",run:cA(!1)},{key:"PageDown",run:cA(!0,"page")},{key:"PageUp",run:cA(!1,"page")},{key:"Enter",run:Bye}],cxe=Mu.highest(Gh.computeN([ts],t=>t.facet(ts).defaultKeymap?[SD]:[])),jD=[{label:"y"},{label:"w"},{label:"d"},{label:"h"},{label:"m"},{label:"s"},{label:"ms"}],uxe=[{label:"step()",info:"Resolves to the current query step duration",type:"keyword"},{label:"range()",info:"Resolves to the total query range duration",type:"keyword"},{label:"min_of(, )",info:"Returns the minimum of two durations",type:"keyword",apply:jh("min_of(${duration_a}, ${duration_b})")},{label:"max_of(, )",info:"Returns the maximum of two durations",type:"keyword",apply:jh("max_of(${duration_a}, ${duration_b})")}],hxe=[{label:"^"},{label:"*"},{label:"/"},{label:"%"},{label:"+"},{label:"-"}],dxe=[{label:"="},{label:"!="},{label:"=~"},{label:"!~"}],sW=[{label:"^"},{label:"*"},{label:"/"},{label:"%"},{label:"+"},{label:"-"},{label:"=="},{label:">="},{label:">"},{label:"<"},{label:"</"},{label:">/"},{label:"<="},{label:"!="},{label:"atan2"},{label:"and"},{label:"or"},{label:"unless"}],fxe=[{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"}],pxe=[{label:"start()",info:"resolve to the start of the query",type:"keyword"},{label:"end()",info:"resolve to the end of the query",type:"keyword"}],mxe=[{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:"start_timestamp",detail:"function",info:"Return the start timestamp for the samples in the input vector",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"}],oW=[{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"}],gxe=[{label:"by",info:"Keep the listed labels, remove all others.",type:"keyword"},{label:"without",info:"Remove the listed labels, preserve all others.",type:"keyword"}],vxe=[{label:"nan",info:"Floating-point NaN value",type:"constant"},{label:"inf",info:"Floating-point infinity",type:"constant"}],yxe=[{label:"sum(rate(__input_vector__[5m]))",type:"function",detail:"snippet",info:"Sum over rates of increase",apply:jh("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:jh("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:jh('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:jh("topk(${__rank_number__}, ${__input_vector__})")},{label:"bottomk(__rank_number__, __input_vector__)",type:"function",detail:"snippet",info:"Smallest k elements by sample value",apply:jh("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:jh('count_values("${__label_name__}", ${__metric__})')}],qa={matchOp:dxe,binOp:sW,duration:jD,durationExpr:uxe,durationExprOperator:hxe,binOpModifier:fxe,atModifier:pxe,functionIdentifier:mxe,aggregateOp:oW,aggregateOpModifier:gxe,number:vxe};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.DurationExpr=10]="DurationExpr",t[t.DurationExprOperator=11]="DurationExprOperator",t[t.Offset=12]="Offset",t[t.Bool=13]="Bool",t[t.AtModifiers=14]="AtModifiers",t[t.Number=15]="Number"})(wt||(wt={}));function xxe(t,e){const n=UR(t,Hv);if(!n)return"";let i="";return n.cursor().iterate(r=>{if(r.type.id===Jy&&(i=J0(r.node,e),i))return!1}),i}function J0(t,e){let n=UR(t,Jy);return!n||(n=n.getChild(Y1),!n)?"":e.sliceDoc(n.from,n.to)}function bxe(t,e,n,i=!1,r=!0){const s=wxe(t);return i&&s.push(...yxe),{from:e,to:n,options:s,validFor:r?/^[a-zA-Z0-9_:]+$/:void 0}}function Axe(t){return t.replace(/([\\"])/g,"\\$1")}function CD(t,e,n){return e.type.id===hu&&n>=e.to&&e.from<e.to&&t.sliceDoc(e.to-1,e.to)===")"}function wxe(t){var e;const n=new Set,i=[];for(const r of t){const s=typeof r.info=="string"?r.info:"",a=typeof r.apply=="string"?r.apply:"",l=`${r.label}|${(e=r.type)!==null&&e!==void 0?e:""}|${s}|${a}`;n.has(l)||(n.add(l),i.push(r))}return i}function Sxe(t,e,n){var i,r;return e.type.id===0||CD(t,e,n)?n:e.type.id===cm||e.type.id===am||e.type.id===hu||e.type.id===Gl||e.type.id===il?e.to-1:e.type.id===Xm&&(((i=e.parent)===null||i===void 0?void 0:i.type.id)===zh||((r=e.parent)===null||r===void 0?void 0:r.type.id)===Ef)?e.parent.to-1:e.to}const jxe=new RegExp(`^(\\d+(${jD.map(t=>t.label).join("|")}))+$`);function u6(t,e){if(e.from>=e.to)return!1;const n=t.sliceDoc(e.from,e.to);return jxe.test(n)}function Cxe(t,e){let n=t.from+1;return t.firstChild!==null&&(n=e),n}function _xe(t,e,n){var i,r,s,a,l,u,d;const f=t.doc.slice(e.from,n).toString();let p=e.from;return CD(t,e,n)?p=n:e.type.id===cm||e.type.id===am?p=Cxe(e,n):e.type.id===hu&&e.firstChild===null||e.type.id===Xm&&(((i=e.parent)===null||i===void 0?void 0:i.type.id)===zh||((r=e.parent)===null||r===void 0?void 0:r.type.id)===Ef)?p++:(e.type.id===Gl||e.type.id===il||e.type.id===au||e.type.id===G7&&!jD.map(m=>m.label).includes(f[f.length-1])||e.type.id===oj&&((s=e.parent)===null||s===void 0?void 0:s.type.id)===0&&((a=e.parent.parent)===null||a===void 0?void 0:a.type.id)===il||e.type.id===hu&&aW(e)&&e.firstChild!==null||e.type.id===0&&(((l=e.parent)===null||l===void 0?void 0:l.type.id)===au||((u=e.parent)===null||u===void 0?void 0:u.type.id)===Gl||((d=e.parent)===null||d===void 0?void 0:d.type.id)===il&&e.parent.getChild(hv)!==null))&&(p=n),p}function aW(t){var e;const n=t.parent;if(n!==null&&((e=n.firstChild)===null||e===void 0?void 0:e.type.id)===_fe){const i=n.firstChild.firstChild;if(i!==null&&[q7,F7,z7,H7,$7].includes(i.type.id))return!0}return!1}function kxe(t,e,n){var i,r,s,a,l,u,d,f,p,m,v,y,b,A,w,S,j,C,k,E,M,R,D,F;const I=[];switch(e.type.id){case 0:{if(((i=e.parent)===null||i===void 0?void 0:i.type.id)===au||((r=e.parent)===null||r===void 0?void 0:r.type.id)===Gl||((s=e.parent)===null||s===void 0?void 0:s.type.id)===il&&e.parent.getChild(hv)!==null){t.sliceDoc(e.from,e.to).length>0&&I.push({kind:wt.Duration});break}if(((a=e.parent)===null||a===void 0?void 0:a.type.id)===zh||((l=e.parent)===null||l===void 0?void 0:l.type.id)===Ef){I.push({kind:wt.MatchOp});break}const Q=t.sliceDoc(e.from,e.to);sW.filter(G=>G.label.includes(Q)).length>0&&I.push({kind:wt.BinOp});break}case Y1:{if(((u=e.parent)===null||u===void 0?void 0:u.type.id)===0){const L=e.parent.parent;if((L==null?void 0:L.type.id)===WR){I.push({kind:wt.AtModifiers});break}if((L==null?void 0:L.type.id)===Hv){I.push({kind:wt.AggregateOpModifier},{kind:wt.BinOp});break}if((L==null?void 0:L.type.id)===Jy){const q=J0(e,t);oW.filter(N=>N.label===q).length>0&&I.push({kind:wt.AggregateOpModifier}),I.push({kind:wt.BinOp},{kind:wt.Offset});break}if((L==null?void 0:L.type.id)===Gl||(L==null?void 0:L.type.id)===au||(L==null?void 0:L.type.id)===il||(L==null?void 0:L.type.id)===hv){I.push({kind:wt.DurationExpr});break}if(L&&U1(L,"Expr")){I.push({kind:wt.BinOp},{kind:wt.Offset});break}}const Q=(d=e.parent)===null||d===void 0?void 0:d.parent;if(!Q){I.push({kind:wt.MetricName,metricName:t.sliceDoc(e.from,e.to)});break}U1(Q,"Expr","Expr")&&Q.type.id!==hu?Q.type.id===lm&&!lf(Q,0)&&(I.push({kind:wt.MetricName,metricName:t.sliceDoc(e.from,e.to)},{kind:wt.Function},{kind:wt.Aggregation},{kind:wt.BinOpModifier},{kind:wt.Number}),lf(Q,a2,l2,c2,u2,h2,Yv)&&!lf(Q,Q7)&&I.push({kind:wt.Bool})):(I.push({kind:wt.MetricName,metricName:t.sliceDoc(e.from,e.to)},{kind:wt.Function},{kind:wt.Aggregation}),Q.type.id!==hu&&Q.type.id!==Gl&&I.push({kind:wt.Number}));break}case Cfe:e.firstChild!==null&&e.firstChild.type.id===0&&I.push({kind:wt.MetricName,metricName:""},{kind:wt.Function},{kind:wt.Aggregation},{kind:wt.Number});break;case am:I.push({kind:wt.LabelName,metricName:xxe(e,t)});break;case cm:{if(n>=e.to)break;I.push({kind:wt.LabelName,metricName:J0(e,t)});break}case qv:if(((f=e.parent)===null||f===void 0?void 0:f.type.id)===am)I.push({kind:wt.LabelName});else if(((p=e.parent)===null||p===void 0?void 0:p.type.id)===zh)I.push({kind:wt.LabelName,metricName:J0(e,t)});else if(((m=e.parent)===null||m===void 0?void 0:m.type.id)===0){const Q=e.parent.parent;((Q==null?void 0:Q.type.id)===Gl||(Q==null?void 0:Q.type.id)===au||(Q==null?void 0:Q.type.id)===il)&&I.push({kind:wt.DurationExpr})}break;case Xm:if(((v=e.parent)===null||v===void 0?void 0:v.type.id)===zh||((y=e.parent)===null||y===void 0?void 0:y.type.id)===Ef){let Q="";((b=e.parent.firstChild)===null||b===void 0?void 0:b.type.id)===qv?Q=t.sliceDoc(e.parent.firstChild.from,e.parent.firstChild.to):((A=e.parent.firstChild)===null||A===void 0?void 0:A.type.id)===Qv&&(Q=t.sliceDoc(e.parent.firstChild.from,e.parent.firstChild.to).slice(1,-1));const G=J0(e,t),L=UR(e,cm),q=[Qv,Ef,zh];let N=[];for(const P of q)N=N.concat(rQ(L?L.getChildren(P):[],t));I.push({kind:wt.LabelValue,metricName:G,labelName:Q,matchers:N})}else((S=(w=e.parent)===null||w===void 0?void 0:w.parent)===null||S===void 0?void 0:S.type.id)===am?I.push({kind:wt.LabelName}):((C=(j=e.parent)===null||j===void 0?void 0:j.parent)===null||C===void 0?void 0:C.type.id)===cm&&I.push({kind:wt.MetricName,metricName:t.sliceDoc(e.from,e.to).slice(1,-1)});break;case oj:((k=e.parent)===null||k===void 0?void 0:k.type.id)===0&&((E=e.parent.parent)===null||E===void 0?void 0:E.type.id)===il?u6(t,e)||I.push({kind:wt.Duration}):I.push({kind:wt.Number});break;case G7:u6(t,e)||I.push({kind:wt.Duration});break;case Gl:case il:case au:break;case hu:if(CD(t,e,n)){((M=e.parent)===null||M===void 0?void 0:M.type.id)===Hv&&!lf(e.parent,kfe)&&I.push({kind:wt.AggregateOpModifier}),I.push({kind:wt.BinOp});break}if(aW(e)){if(e.firstChild===null||e.firstChild.from<=n&&e.firstChild.to>=n){I.push({kind:wt.Number});break}I.push({kind:wt.MetricName,metricName:""},{kind:wt.Function},{kind:wt.Aggregation});break}I.push({kind:wt.MetricName,metricName:""},{kind:wt.Function},{kind:wt.Aggregation});break;case Yv:((R=e.parent)===null||R===void 0?void 0:R.type.id)===W1?I.push({kind:wt.MatchOp}):((D=e.parent)===null||D===void 0?void 0:D.type.id)===lm&&I.push({kind:wt.BinOp});break;case ex:case eQ:case tQ:case W1:I.push({kind:wt.MatchOp});break;case Tfe:case Nfe:case Ife:case Bfe:case Lfe:case Pfe:((F=e.parent)===null||F===void 0?void 0:F.type.id)===hv?I.push({kind:wt.DurationExprOperator}):I.push({kind:wt.BinOp});break;case a2:case l2:case c2:case W7:case Y7:case u2:case h2:case qR:case YR:case QR:case lm:I.push({kind:wt.BinOp});break}return I}class aT{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:i}=e,r=Hr(n).resolve(i,-1),s=kxe(n,r,i);let a=Promise.resolve([]),l=!1,u=!0;for(const d of s)switch(d.kind){case wt.Aggregation:l=!0,a=a.then(f=>f.concat(qa.aggregateOp));break;case wt.Function:l=!0,a=a.then(f=>f.concat(qa.functionIdentifier));break;case wt.BinOpModifier:a=a.then(f=>f.concat(qa.binOpModifier));break;case wt.BinOp:a=a.then(f=>f.concat(qa.binOp));break;case wt.MatchOp:a=a.then(f=>f.concat(qa.matchOp));break;case wt.AggregateOpModifier:a=a.then(f=>f.concat(qa.aggregateOpModifier));break;case wt.Duration:u=!1,a=a.then(f=>f.concat(qa.duration));break;case wt.DurationExpr:u=!1,a=a.then(f=>f.concat(qa.durationExpr));break;case wt.DurationExprOperator:u=!1,a=a.then(f=>f.concat(qa.durationExprOperator));break;case wt.Offset:a=a.then(f=>f.concat([{label:"offset"}]));break;case wt.Bool:a=a.then(f=>f.concat([{label:"bool"}]));break;case wt.AtModifiers:a=a.then(f=>f.concat(qa.atModifier));break;case wt.Number:a=a.then(f=>f.concat(qa.number));break;case wt.MetricName:a=a.then(f=>this.autocompleteMetricName(f,d));break;case wt.LabelName:a=a.then(f=>this.autocompleteLabelName(f,d));break;case wt.LabelValue:a=a.then(f=>this.autocompleteLabelValue(f,d))}return a.then(d=>bxe(d,_xe(n,r,i),Sxe(n,r,i),l,u))}autocompleteMetricName(e,n){if(!this.prometheusClient)return e;const i=new Map;return this.prometheusClient.metricNames(n.metricName).then(r=>{var s;for(const a of r)i.set(a,{label:a,type:"constant"});if(r.length<=this.maxMetricsMetadata)return(s=this.prometheusClient)===null||s===void 0?void 0:s.metricMetadata()}).then(r=>{var s;if(r)for(const[a,l]of i){const u=(s=r[a])!==null&&s!==void 0?s:r[a.replace(/(_count|_sum|_bucket|_total)$/,"")];if(u){if(u.length>1)for(const d of u)l.detail===""?l.detail=d.type:l.detail!==d.type&&(l.detail="unknown",l.info="multiple different definitions for this metric"),l.info===""?l.info=d.help:l.info!==d.help&&(l.info="multiple different definitions for this metric");else if(u.length===1){let{type:d,help:f}=u[0];(d==="histogram"||d==="summary")&&(a.endsWith("_count")&&(d="counter",f=`The total number of observations for: ${f}`),a.endsWith("_sum")&&(d="counter",f=`The total sum of observations for: ${f}`),a.endsWith("_bucket")&&(d="counter",f=`The total count of observations for a bucket in the histogram: ${f}`)),l.detail=d,l.info=f}}}return e.concat(Array.from(i.values()))})}autocompleteLabelName(e,n){return this.prometheusClient?this.prometheusClient.labelNames(n.metricName).then(i=>e.concat(i.map(r=>({label:r,type:"constant"})))):e}autocompleteLabelValue(e,n){return!this.prometheusClient||!n.labelName?e:this.prometheusClient.labelValues(n.labelName,n.metricName,n.matchers).then(i=>e.concat(i.map(r=>({label:r,apply:Axe(r),type:"text"}))))}}var Txe={hasSubscribers:!1},Oxe=Txe,Exe=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,lW=new Set,h6=typeof process=="object"&&process?process:{},Mxe=(t,e,n,i)=>{typeof h6.emitWarning=="function"?h6.emitWarning(t,e,n,i):console.error(`[${n}] ${e}: ${t}`)},Rxe=t=>!lW.has(t),vh=t=>!!t&&t===Math.floor(t)&&t>0&&isFinite(t),cW=t=>vh(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?t1:null:null,t1=class extends Array{constructor(t){super(t),this.fill(0)}},oc,Rm,Dxe=(oc=class{constructor(e,n){Ke(this,"heap");Ke(this,"length");if(!$(oc,Rm))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}static create(e){let n=cW(e);if(!n)return[];Fe(oc,Rm,!0);let i=new oc(e,n);return Fe(oc,Rm,!1),i}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Rm=new WeakMap,lt(oc,Rm,!1),oc),f8,p8,wa,Ho,Ua,wf,Va,Dm,Nm,Ga,Dr,Xa,Or,Ii,en,Ys,qo,Is,Jr,Ka,es,Za,Ja,Qo,Yo,el,Im,Ws,Sf,et,J2,jf,su,py,Wo,uW,Cf,Bm,my,yh,xh,eE,$p,n1,hW,dW,i1,ki,tE,fW,pW,ev,nE,tv,bh,iE,Lm,d6=(Lm=class{constructor(e){lt(this,et);lt(this,wa);lt(this,Ho);lt(this,Ua);lt(this,wf);lt(this,Va);lt(this,Dm);lt(this,Nm);lt(this,Ga);Ke(this,"ttl");Ke(this,"ttlResolution");Ke(this,"ttlAutopurge");Ke(this,"updateAgeOnGet");Ke(this,"updateAgeOnHas");Ke(this,"allowStale");Ke(this,"noDisposeOnSet");Ke(this,"noUpdateTTL");Ke(this,"maxEntrySize");Ke(this,"sizeCalculation");Ke(this,"noDeleteOnFetchRejection");Ke(this,"noDeleteOnStaleGet");Ke(this,"allowStaleOnFetchAbort");Ke(this,"allowStaleOnFetchRejection");Ke(this,"ignoreFetchAbort");Ke(this,"backgroundFetchSize");lt(this,Dr);lt(this,Xa);lt(this,Or);lt(this,Ii);lt(this,en);lt(this,Ys);lt(this,qo);lt(this,Is);lt(this,Jr);lt(this,Ka);lt(this,es);lt(this,Za);lt(this,Ja);lt(this,Qo);lt(this,Yo);lt(this,el);lt(this,Im);lt(this,Ws);lt(this,Sf);lt(this,jf,()=>{});lt(this,su,()=>{});lt(this,py,()=>{});lt(this,Wo,()=>!1);lt(this,Cf,e=>{});lt(this,Bm,(e,n,i)=>{});lt(this,my,(e,n,i,r)=>{if(i||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Ke(this,f8,"LRUCache");let{max:n=0,ttl:i,ttlResolution:r=1,ttlAutopurge:s,updateAgeOnGet:a,updateAgeOnHas:l,allowStale:u,dispose:d,onInsert:f,disposeAfter:p,noDisposeOnSet:m,noUpdateTTL:v,maxSize:y=0,maxEntrySize:b=0,sizeCalculation:A,fetchMethod:w,memoMethod:S,noDeleteOnFetchRejection:j,noDeleteOnStaleGet:C,allowStaleOnFetchRejection:k,allowStaleOnFetchAbort:E,ignoreFetchAbort:M,backgroundFetchSize:R=1,perf:D}=e;if(this.backgroundFetchSize=R,D!==void 0&&typeof(D==null?void 0:D.now)!="function")throw new TypeError("perf option must have a now() method if specified");if(Fe(this,Ga,D??Exe),n!==0&&!vh(n))throw new TypeError("max option must be a nonnegative integer");let F=n?cW(n):Array;if(!F)throw new Error("invalid max value: "+n);if(Fe(this,wa,n),Fe(this,Ho,y),this.maxEntrySize=b||$(this,Ho),this.sizeCalculation=A,this.sizeCalculation){if(!$(this,Ho)&&!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(S!==void 0&&typeof S!="function")throw new TypeError("memoMethod must be a function if defined");if(Fe(this,Nm,S),w!==void 0&&typeof w!="function")throw new TypeError("fetchMethod must be a function if specified");if(Fe(this,Dm,w),Fe(this,Im,!!w),Fe(this,Or,new Map),Fe(this,Ii,Array.from({length:n}).fill(void 0)),Fe(this,en,Array.from({length:n}).fill(void 0)),Fe(this,Ys,new F(n)),Fe(this,qo,new F(n)),Fe(this,Is,0),Fe(this,Jr,0),Fe(this,Ka,Dxe.create(n)),Fe(this,Dr,0),Fe(this,Xa,0),typeof d=="function"&&Fe(this,Ua,d),typeof f=="function"&&Fe(this,wf,f),typeof p=="function"?(Fe(this,Va,p),Fe(this,es,[])):(Fe(this,Va,void 0),Fe(this,es,void 0)),Fe(this,el,!!$(this,Ua)),Fe(this,Sf,!!$(this,wf)),Fe(this,Ws,!!$(this,Va)),this.noDisposeOnSet=!!m,this.noUpdateTTL=!!v,this.noDeleteOnFetchRejection=!!j,this.allowStaleOnFetchRejection=!!k,this.allowStaleOnFetchAbort=!!E,this.ignoreFetchAbort=!!M,this.maxEntrySize!==0){if($(this,Ho)!==0&&!vh($(this,Ho)))throw new TypeError("maxSize must be a positive integer if specified");if(!vh(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");We(this,et,uW).call(this)}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!C,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!l,this.ttlResolution=vh(r)||r===0?r:1,this.ttlAutopurge=!!s,this.ttl=i||0,this.ttl){if(!vh(this.ttl))throw new TypeError("ttl must be a positive integer if specified");We(this,et,J2).call(this)}if($(this,wa)===0&&this.ttl===0&&$(this,Ho)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!$(this,wa)&&!$(this,Ho)){let I="LRU_CACHE_UNBOUNDED";Rxe(I)&&(lW.add(I),Mxe("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",I,Lm))}}get perf(){return $(this,Ga)}static unsafeExposeInternals(e){return{starts:$(e,Ja),ttls:$(e,Qo),autopurgeTimers:$(e,Yo),sizes:$(e,Za),keyMap:$(e,Or),keyList:$(e,Ii),valList:$(e,en),next:$(e,Ys),prev:$(e,qo),get head(){return $(e,Is)},get tail(){return $(e,Jr)},free:$(e,Ka),isBackgroundFetch:n=>{var i;return We(i=e,et,ki).call(i,n)},backgroundFetch:(n,i,r,s)=>{var a;return We(a=e,et,i1).call(a,n,i,r,s)},moveToTail:n=>{var i;return We(i=e,et,tv).call(i,n)},indexes:n=>{var i;return We(i=e,et,yh).call(i,n)},rindexes:n=>{var i;return We(i=e,et,xh).call(i,n)},isStale:n=>{var i;return $(i=e,Wo).call(i,n)}}}get max(){return $(this,wa)}get maxSize(){return $(this,Ho)}get calculatedSize(){return $(this,Xa)}get size(){return $(this,Dr)}get fetchMethod(){return $(this,Dm)}get memoMethod(){return $(this,Nm)}get dispose(){return $(this,Ua)}get onInsert(){return $(this,wf)}get disposeAfter(){return $(this,Va)}getRemainingTTL(e){return $(this,Or).has(e)?1/0:0}*entries(){for(let e of We(this,et,yh).call(this))$(this,en)[e]!==void 0&&$(this,Ii)[e]!==void 0&&!We(this,et,ki).call(this,$(this,en)[e])&&(yield[$(this,Ii)[e],$(this,en)[e]])}*rentries(){for(let e of We(this,et,xh).call(this))$(this,en)[e]!==void 0&&$(this,Ii)[e]!==void 0&&!We(this,et,ki).call(this,$(this,en)[e])&&(yield[$(this,Ii)[e],$(this,en)[e]])}*keys(){for(let e of We(this,et,yh).call(this)){let n=$(this,Ii)[e];n!==void 0&&!We(this,et,ki).call(this,$(this,en)[e])&&(yield n)}}*rkeys(){for(let e of We(this,et,xh).call(this)){let n=$(this,Ii)[e];n!==void 0&&!We(this,et,ki).call(this,$(this,en)[e])&&(yield n)}}*values(){for(let e of We(this,et,yh).call(this))$(this,en)[e]!==void 0&&!We(this,et,ki).call(this,$(this,en)[e])&&(yield $(this,en)[e])}*rvalues(){for(let e of We(this,et,xh).call(this))$(this,en)[e]!==void 0&&!We(this,et,ki).call(this,$(this,en)[e])&&(yield $(this,en)[e])}[(p8=Symbol.iterator,f8=Symbol.toStringTag,p8)](){return this.entries()}find(e,n={}){for(let i of We(this,et,yh).call(this)){let r=$(this,en)[i],s=We(this,et,ki).call(this,r)?r.__staleWhileFetching:r;if(s!==void 0&&e(s,$(this,Ii)[i],this))return We(this,et,ev).call(this,$(this,Ii)[i],n)}}forEach(e,n=this){for(let i of We(this,et,yh).call(this)){let r=$(this,en)[i],s=We(this,et,ki).call(this,r)?r.__staleWhileFetching:r;s!==void 0&&e.call(n,s,$(this,Ii)[i],this)}}rforEach(e,n=this){for(let i of We(this,et,xh).call(this)){let r=$(this,en)[i],s=We(this,et,ki).call(this,r)?r.__staleWhileFetching:r;s!==void 0&&e.call(n,s,$(this,Ii)[i],this)}}purgeStale(){let e=!1;for(let n of We(this,et,xh).call(this,{allowStale:!0}))$(this,Wo).call(this,n)&&(We(this,et,bh).call(this,$(this,Ii)[n],"expire"),e=!0);return e}info(e){let n=$(this,Or).get(e);if(n===void 0)return;let i=$(this,en)[n],r=We(this,et,ki).call(this,i)?i.__staleWhileFetching:i;if(r===void 0)return;let s={value:r};if($(this,Qo)&&$(this,Ja)){let a=$(this,Qo)[n],l=$(this,Ja)[n];if(a&&l){let u=a-($(this,Ga).now()-l);s.ttl=u,s.start=Date.now()}}return $(this,Za)&&(s.size=$(this,Za)[n]),s}dump(){let e=[];for(let n of We(this,et,yh).call(this,{allowStale:!0})){let i=$(this,Ii)[n],r=$(this,en)[n],s=We(this,et,ki).call(this,r)?r.__staleWhileFetching:r;if(s===void 0||i===void 0)continue;let a={value:s};if($(this,Qo)&&$(this,Ja)){a.ttl=$(this,Qo)[n];let l=$(this,Ga).now()-$(this,Ja)[n];a.start=Math.floor(Date.now()-l)}$(this,Za)&&(a.size=$(this,Za)[n]),e.unshift([i,a])}return e}load(e){this.clear();for(let[n,i]of e){if(i.start){let r=Date.now()-i.start;i.start=$(this,Ga).now()-r}We(this,et,$p).call(this,n,i.value,i)}}set(e,n,i={}){let{status:r=void 0}=i;return i.status=r,r&&(r.op="set",r.key=e,n!==void 0&&(r.value=n),r.cache=this),We(this,et,$p).call(this,e,n,i)}pop(){var e;try{for(;$(this,Dr);){let n=$(this,en)[$(this,Is)];if(We(this,et,n1).call(this,!0),We(this,et,ki).call(this,n)){if(n.__staleWhileFetching)return n.__staleWhileFetching}else if(n!==void 0)return n}}finally{if($(this,Ws)&&$(this,es)){let n=$(this,es),i;for(;i=n==null?void 0:n.shift();)(e=$(this,Va))==null||e.call(this,...i)}}}has(e,n={}){let{status:i=void 0}=n;return n.status=i,i&&(i.op="has",i.key=e,i.cache=this),We(this,et,hW).call(this,e,n)}peek(e,n={}){let{status:i=void 0}=n;return i&&(i.op="peek",i.key=e,i.cache=this),n.status=i,We(this,et,dW).call(this,e,n)}fetch(e,n={}){let{status:i=void 0}=n;return n.status=i,i&&n.context&&(i.context=n.context),We(this,et,tE).call(this,e,n)}forceFetch(e,n={}){let{status:i=void 0}=n;return n.status=i,i&&n.context&&(i.context=n.context),We(this,et,fW).call(this,e,n)}memo(e,n={}){let{status:i=void 0}=n;n.status=i,i&&(i.op="memo",i.key=e,n.context&&(i.context=n.context),i.cache=this);let r=We(this,et,pW).call(this,e,n);return i&&(i.value=r),r}get(e,n={}){let{status:i=void 0}=n;n.status=i,i&&(i.op="get",i.key=e,i.cache=this);let r=We(this,et,ev).call(this,e,n);return i&&(r!==void 0&&(i.value=r),Oxe.hasSubscribers),r}delete(e){return We(this,et,bh).call(this,e,"delete")}clear(){return We(this,et,iE).call(this,"delete")}},wa=new WeakMap,Ho=new WeakMap,Ua=new WeakMap,wf=new WeakMap,Va=new WeakMap,Dm=new WeakMap,Nm=new WeakMap,Ga=new WeakMap,Dr=new WeakMap,Xa=new WeakMap,Or=new WeakMap,Ii=new WeakMap,en=new WeakMap,Ys=new WeakMap,qo=new WeakMap,Is=new WeakMap,Jr=new WeakMap,Ka=new WeakMap,es=new WeakMap,Za=new WeakMap,Ja=new WeakMap,Qo=new WeakMap,Yo=new WeakMap,el=new WeakMap,Im=new WeakMap,Ws=new WeakMap,Sf=new WeakMap,et=new WeakSet,J2=function(){let e=new t1($(this,wa)),n=new t1($(this,wa));Fe(this,Qo,e),Fe(this,Ja,n);let i=this.ttlAutopurge?Array.from({length:$(this,wa)}):void 0;Fe(this,Yo,i),Fe(this,py,(u,d,f=$(this,Ga).now())=>{n[u]=d!==0?f:0,e[u]=d,r(u,d)}),Fe(this,jf,u=>{n[u]=e[u]!==0?$(this,Ga).now():0,r(u,e[u])});let r=this.ttlAutopurge?(u,d)=>{if(i!=null&&i[u]&&(clearTimeout(i[u]),i[u]=void 0),d&&d!==0&&i){let f=setTimeout(()=>{$(this,Wo).call(this,u)?(We(this,et,bh).call(this,$(this,Ii)[u],"expire"),i[u]=void 0):r(u,l(u))},d+1);f.unref&&f.unref(),i[u]=f}}:()=>{};Fe(this,su,(u,d)=>{if(e[d]){let f=e[d],p=n[d];if(!f||!p)return;u.ttl=f,u.start=p,u.now=s||a();let m=u.now-p;u.remainingTTL=f-m}});let s=0,a=()=>{let u=$(this,Ga).now();if(this.ttlResolution>0){s=u;let d=setTimeout(()=>s=0,this.ttlResolution);d.unref&&d.unref()}return u};this.getRemainingTTL=u=>{let d=$(this,Or).get(u);return d===void 0?0:l(d)};let l=u=>{let d=e[u],f=n[u];if(!d||!f)return 1/0;let p=(s||a())-f;return d-p};Fe(this,Wo,u=>{let d=n[u],f=e[u];return!!f&&!!d&&(s||a())-d>f})},jf=new WeakMap,su=new WeakMap,py=new WeakMap,Wo=new WeakMap,uW=function(){let e=new t1($(this,wa));Fe(this,Xa,0),Fe(this,Za,e),Fe(this,Cf,n=>{Fe(this,Xa,$(this,Xa)-e[n]),e[n]=0}),Fe(this,my,(n,i,r,s)=>{if(!vh(r)){if(We(this,et,ki).call(this,i))return this.backgroundFetchSize;if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(r=s(i,n),!vh(r))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 r}),Fe(this,Bm,(n,i,r)=>{if(e[n]=i,$(this,Ho)){let s=$(this,Ho)-e[n];for(;$(this,Xa)>s;)We(this,et,n1).call(this,!0)}Fe(this,Xa,$(this,Xa)+e[n]),r&&(r.entrySize=i,r.totalCalculatedSize=$(this,Xa))})},Cf=new WeakMap,Bm=new WeakMap,my=new WeakMap,yh=function*({allowStale:e=this.allowStale}={}){if($(this,Dr))for(let n=$(this,Jr);We(this,et,eE).call(this,n)&&((e||!$(this,Wo).call(this,n))&&(yield n),n!==$(this,Is));)n=$(this,qo)[n]},xh=function*({allowStale:e=this.allowStale}={}){if($(this,Dr))for(let n=$(this,Is);We(this,et,eE).call(this,n)&&((e||!$(this,Wo).call(this,n))&&(yield n),n!==$(this,Jr));)n=$(this,Ys)[n]},eE=function(e){return e!==void 0&&$(this,Or).get($(this,Ii)[e])===e},$p=function(e,n,i,r){var y,b,A,w,S,j,C,k;let{ttl:s=this.ttl,start:a,noDisposeOnSet:l=this.noDisposeOnSet,sizeCalculation:u=this.sizeCalculation,status:d}=i,f=We(this,et,ki).call(this,n);if(n===void 0)return d&&(d.set="deleted"),this.delete(e),this;let{noUpdateTTL:p=this.noUpdateTTL}=i;d&&!f&&(d.value=n);let m=$(this,my).call(this,e,n,i.size||0,u,d);if(this.maxEntrySize&&m>this.maxEntrySize)return We(this,et,bh).call(this,e,"set"),d&&(d.set="miss",d.maxEntrySizeExceeded=!0),this;let v=$(this,Dr)===0?void 0:$(this,Or).get(e);if(v===void 0)v=$(this,Dr)===0?$(this,Jr):$(this,Ka).length!==0?$(this,Ka).pop():$(this,Dr)===$(this,wa)?We(this,et,n1).call(this,!1):$(this,Dr),$(this,Ii)[v]=e,$(this,en)[v]=n,$(this,Or).set(e,v),$(this,Ys)[$(this,Jr)]=v,$(this,qo)[v]=$(this,Jr),Fe(this,Jr,v),qd(this,Dr)._++,$(this,Bm).call(this,v,m,d),d&&(d.set="add"),p=!1,$(this,Sf)&&!f&&((y=$(this,wf))==null||y.call(this,n,e,"add"));else{We(this,et,tv).call(this,v);let E=$(this,en)[v];if(n!==E){if(!l)if(We(this,et,ki).call(this,E)){E!==r&&E.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:M}=E;M!==void 0&&M!==n&&($(this,el)&&((b=$(this,Ua))==null||b.call(this,M,e,"set")),$(this,Ws)&&((A=$(this,es))==null||A.push([M,e,"set"])))}else $(this,el)&&((w=$(this,Ua))==null||w.call(this,E,e,"set")),$(this,Ws)&&((S=$(this,es))==null||S.push([E,e,"set"]));if($(this,Cf).call(this,v),$(this,Bm).call(this,v,m,d),$(this,en)[v]=n,!f){let M=E&&We(this,et,ki).call(this,E)?E.__staleWhileFetching:E,R=M===void 0?"add":n!==M?"replace":"update";d&&(d.set=R,M!==void 0&&(d.oldValue=M)),$(this,Sf)&&((j=this.onInsert)==null||j.call(this,n,e,R))}}else f||(d&&(d.set="update"),$(this,Sf)&&((C=this.onInsert)==null||C.call(this,n,e,"update")))}if(s!==0&&!$(this,Qo)&&We(this,et,J2).call(this),$(this,Qo)&&(p||$(this,py).call(this,v,s,a),d&&$(this,su).call(this,d,v)),!l&&$(this,Ws)&&$(this,es)){let E=$(this,es),M;for(;M=E==null?void 0:E.shift();)(k=$(this,Va))==null||k.call(this,...M)}return this},n1=function(e){var l,u,d;let n=$(this,Is),i=$(this,Ii)[n],r=$(this,en)[n],s=We(this,et,ki).call(this,r);s&&r.__abortController.abort(new Error("evicted"));let a=s?r.__staleWhileFetching:r;return($(this,el)||$(this,Ws))&&a!==void 0&&($(this,el)&&((l=$(this,Ua))==null||l.call(this,a,i,"evict")),$(this,Ws)&&((u=$(this,es))==null||u.push([a,i,"evict"]))),$(this,Cf).call(this,n),(d=$(this,Yo))!=null&&d[n]&&(clearTimeout($(this,Yo)[n]),$(this,Yo)[n]=void 0),e&&($(this,Ii)[n]=void 0,$(this,en)[n]=void 0,$(this,Ka).push(n)),$(this,Dr)===1?(Fe(this,Is,Fe(this,Jr,0)),$(this,Ka).length=0):Fe(this,Is,$(this,Ys)[n]),$(this,Or).delete(i),qd(this,Dr)._--,n},hW=function(e,n={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:r}=n,s=$(this,Or).get(e);if(s!==void 0){let a=$(this,en)[s];if(We(this,et,ki).call(this,a)&&a.__staleWhileFetching===void 0)return!1;if($(this,Wo).call(this,s))r&&(r.has="stale",$(this,su).call(this,r,s));else return i&&$(this,jf).call(this,s),r&&(r.has="hit",$(this,su).call(this,r,s)),!0}else r&&(r.has="miss");return!1},dW=function(e,n){let{status:i,allowStale:r=this.allowStale}=n,s=$(this,Or).get(e);if(s===void 0||!r&&$(this,Wo).call(this,s)){i&&(i.peek=s===void 0?"miss":"stale");return}let a=$(this,en)[s],l=We(this,et,ki).call(this,a)?a.__staleWhileFetching:a;return i&&(l!==void 0?(i.peek="hit",i.value=l):i.peek="miss"),l},i1=function(e,n,i,r){let s=n===void 0?void 0:$(this,en)[n];if(We(this,et,ki).call(this,s))return s;let a=new AbortController,{signal:l}=i;l==null||l.addEventListener("abort",()=>a.abort(l.reason),{signal:a.signal});let u={signal:a.signal,options:i,context:r},d=(b,A=!1)=>{let{aborted:w}=a.signal,S=i.ignoreFetchAbort&&b!==void 0,j=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&b!==void 0);if(i.status&&(w&&!A?(i.status.fetchAborted=!0,i.status.fetchError=a.signal.reason,S&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),w&&!S&&!A)return p(a.signal.reason,j);let C=v,k=$(this,en)[n];return(k===v||k===void 0&&S&&A)&&(b===void 0?C.__staleWhileFetching!==void 0?$(this,en)[n]=C.__staleWhileFetching:We(this,et,bh).call(this,e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),We(this,et,$p).call(this,e,b,u.options,C))),b},f=b=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=b),p(b,!1)),p=(b,A)=>{let{aborted:w}=a.signal,S=w&&i.allowStaleOnFetchAbort,j=S||i.allowStaleOnFetchRejection,C=j||i.noDeleteOnFetchRejection,k=v;if($(this,en)[n]===v&&(!C||!A&&k.__staleWhileFetching===void 0?We(this,et,bh).call(this,e,"fetch"):S||($(this,en)[n]=k.__staleWhileFetching)),j)return i.status&&k.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),k.__staleWhileFetching;if(k.__returned===k)throw b},m=(b,A)=>{var S;let w=(S=$(this,Dm))==null?void 0:S.call(this,e,s,u);a.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(b(void 0),i.allowStaleOnFetchAbort&&(b=j=>d(j,!0)))}),w&&w instanceof Promise?w.then(j=>b(j===void 0?void 0:j),A):w!==void 0&&b(w)};i.status&&(i.status.fetchDispatched=!0);let v=new Promise(m).then(d,f),y=Object.assign(v,{__abortController:a,__staleWhileFetching:s,__returned:void 0});return n===void 0?(We(this,et,$p).call(this,e,y,{...u.options,status:void 0}),n=$(this,Or).get(e)):$(this,en)[n]=y,y},ki=function(e){if(!$(this,Im))return!1;let n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof AbortController},tE=async function(e,n={}){let{allowStale:i=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:u=0,sizeCalculation:d=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:p=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:v=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,context:b,forceRefresh:A=!1,status:w,signal:S}=n;if(w&&(w.op="fetch",w.key=e,A&&(w.forceRefresh=!0),w.cache=this),!$(this,Im))return w&&(w.fetch="get"),We(this,et,ev).call(this,e,{allowStale:i,updateAgeOnGet:r,noDeleteOnStaleGet:s,status:w});let j={allowStale:i,updateAgeOnGet:r,noDeleteOnStaleGet:s,ttl:a,noDisposeOnSet:l,size:u,sizeCalculation:d,noUpdateTTL:f,noDeleteOnFetchRejection:p,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:y,ignoreFetchAbort:v,status:w,signal:S},C=$(this,Or).get(e);if(C===void 0){w&&(w.fetch="miss");let k=We(this,et,i1).call(this,e,C,j,b);return k.__returned=k}else{let k=$(this,en)[C];if(We(this,et,ki).call(this,k)){let D=i&&k.__staleWhileFetching!==void 0;return w&&(w.fetch="inflight",D&&(w.returnedStale=!0)),D?k.__staleWhileFetching:k.__returned=k}let E=$(this,Wo).call(this,C);if(!A&&!E)return w&&(w.fetch="hit"),We(this,et,tv).call(this,C),r&&$(this,jf).call(this,C),w&&$(this,su).call(this,w,C),k;let M=We(this,et,i1).call(this,e,C,j,b),R=M.__staleWhileFetching!==void 0&&i;return w&&(w.fetch=E?"stale":"refresh",R&&E&&(w.returnedStale=!0)),R?M.__staleWhileFetching:M.__returned=M}},fW=async function(e,n={}){let i=await We(this,et,tE).call(this,e,n);if(i===void 0)throw new Error("fetch() returned undefined");return i},pW=function(e,n={}){let i=$(this,Nm);if(!i)throw new Error("no memoMethod provided to constructor");let{context:r,status:s,forceRefresh:a,...l}=n;s&&a&&(s.forceRefresh=!0);let u=We(this,et,ev).call(this,e,l),d=a||u===void 0;if(s&&(s.memo=d?"miss":"hit",d||(s.value=u)),!d)return u;let f=i(e,u,{options:l,context:r});return s&&(s.value=f),We(this,et,$p).call(this,e,f,l),f},ev=function(e,n={}){let{allowStale:i=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:a}=n,l=$(this,Or).get(e);if(l===void 0){a&&(a.get="miss");return}let u=$(this,en)[l],d=We(this,et,ki).call(this,u);return a&&$(this,su).call(this,a,l),$(this,Wo).call(this,l)?d?(a&&(a.get="stale-fetching"),i&&u.__staleWhileFetching!==void 0?(a&&(a.returnedStale=!0),u.__staleWhileFetching):void 0):(s||We(this,et,bh).call(this,e,"expire"),a&&(a.get="stale"),i?(a&&(a.returnedStale=!0),u):void 0):(a&&(a.get=d?"fetching":"hit"),We(this,et,tv).call(this,l),r&&$(this,jf).call(this,l),d?u.__staleWhileFetching:u)},nE=function(e,n){$(this,qo)[n]=e,$(this,Ys)[e]=n},tv=function(e){e!==$(this,Jr)&&(e===$(this,Is)?Fe(this,Is,$(this,Ys)[e]):We(this,et,nE).call(this,$(this,qo)[e],$(this,Ys)[e]),We(this,et,nE).call(this,$(this,Jr),e),Fe(this,Jr,e))},bh=function(e,n){var r,s,a,l,u;let i=!1;if($(this,Dr)!==0){let d=$(this,Or).get(e);if(d!==void 0)if((r=$(this,Yo))!=null&&r[d]&&(clearTimeout($(this,Yo)[d]),$(this,Yo)[d]=void 0),i=!0,$(this,Dr)===1)We(this,et,iE).call(this,n);else{$(this,Cf).call(this,d);let f=$(this,en)[d];if(We(this,et,ki).call(this,f)?f.__abortController.abort(new Error("deleted")):($(this,el)||$(this,Ws))&&($(this,el)&&((s=$(this,Ua))==null||s.call(this,f,e,n)),$(this,Ws)&&((a=$(this,es))==null||a.push([f,e,n]))),$(this,Or).delete(e),$(this,Ii)[d]=void 0,$(this,en)[d]=void 0,d===$(this,Jr))Fe(this,Jr,$(this,qo)[d]);else if(d===$(this,Is))Fe(this,Is,$(this,Ys)[d]);else{let p=$(this,qo)[d];$(this,Ys)[p]=$(this,Ys)[d];let m=$(this,Ys)[d];$(this,qo)[m]=$(this,qo)[d]}qd(this,Dr)._--,$(this,Ka).push(d)}}if($(this,Ws)&&((l=$(this,es))!=null&&l.length)){let d=$(this,es),f;for(;f=d==null?void 0:d.shift();)(u=$(this,Va))==null||u.call(this,...f)}return i},iE=function(e){var n,i,r,s;for(let a of We(this,et,xh).call(this,{allowStale:!0})){let l=$(this,en)[a];if(We(this,et,ki).call(this,l))l.__abortController.abort(new Error("deleted"));else{let u=$(this,Ii)[a];$(this,el)&&((n=$(this,Ua))==null||n.call(this,l,u,e)),$(this,Ws)&&((i=$(this,es))==null||i.push([l,u,e]))}}if($(this,Or).clear(),$(this,en).fill(void 0),$(this,Ii).fill(void 0),$(this,Qo)&&$(this,Ja)){$(this,Qo).fill(0),$(this,Ja).fill(0);for(let a of $(this,Yo)??[])a!==void 0&&clearTimeout(a);(r=$(this,Yo))==null||r.fill(void 0)}if($(this,Za)&&$(this,Za).fill(0),Fe(this,Is,0),Fe(this,Jr,0),$(this,Ka).length=0,Fe(this,Xa,0),Fe(this,Dr,0),$(this,Ws)&&$(this,es)){let a=$(this,es),l;for(;l=a==null?void 0:a.shift();)(s=$(this,Va))==null||s.call(this,...l)}},Lm);const Nxe=400,Ixe=422,Bxe=503;class Lxe{constructor(e){this.httpMethod="POST",this.apiPrefix="/api/v1",this.fetchFn=(n,i)=>fetch(n,i),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 r=new Date,s=new Date(r.getTime()-this.lookbackInterval);n.set("start",s.toISOString()),n.set("end",r.toISOString())}e&&e.length>0&&n.set("match[]",Bk(e));const i=this.buildRequest(this.labelsEndpoint(),n);return this.fetchAPI(i.uri,{method:this.httpMethod,body:i.body}).catch(r=>(this.errorHandler&&this.errorHandler(r),[]))}labelValues(e,n,i){const r=new URLSearchParams;if(this.lookbackInterval){const s=new Date,a=new Date(s.getTime()-this.lookbackInterval);r.set("start",a.toISOString()),r.set("end",s.toISOString())}return n&&n.length>0&&r.set("match[]",Bk(n,i,e)),this.fetchAPI(`${this.labelValuesEndpoint().replace(/:name/gi,e)}?${r}`).catch(s=>(this.errorHandler&&this.errorHandler(s),[]))}metricMetadata(){return this.fetchAPI(this.metricMetadataEndpoint()).catch(e=>(this.errorHandler&&this.errorHandler(e),{}))}series(e,n,i){const r=new URLSearchParams;if(this.lookbackInterval){const a=new Date,l=new Date(a.getTime()-this.lookbackInterval);r.set("start",l.toISOString()),r.set("end",a.toISOString())}r.set("match[]",Bk(e,n,i));const s=this.buildRequest(this.seriesEndpoint(),r);return this.fetchAPI(s.uri,{method:this.httpMethod,body:s.body}).catch(a=>(this.errorHandler&&this.errorHandler(a),[]))}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 i=new AbortController;return this.abortControllers.add(i),n?(n.headers=this.requestHeaders,n.signal=i.signal):n={headers:this.requestHeaders,signal:i.signal},this.fetchFn(this.url+e,n).then(r=>{if(!r.ok&&![Nxe,Ixe,Bxe].includes(r.status))throw new Error(r.statusText);return r}).then(r=>r.json()).then(r=>{if(r.status==="error")throw new Error(r.error!==void 0?r.error:'missing "error" field in response JSON');if(r.data===void 0)throw new Error('missing "data" field in response JSON');return r.data}).finally(()=>{this.abortControllers.delete(i)})}buildRequest(e,n){let i=e,r=n;return this.httpMethod==="GET"&&(i=`${i}?${n}`,r=null),{uri:i,body:r}}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 Pxe{constructor(e){const n={ttl:e&&e.maxAge?e.maxAge:3e5,ttlAutopurge:!0};this.completeAssociation=new d6(n),this.metricMetadata={},this.labelValues=new d6(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(i=>{const r=this.getAssociations(e);for(const[s,a]of Object.entries(i)){if(s==="__name__")continue;const l=r.get(s);l===void 0?r.set(s,new Set([a])):l.add(a)}})}setLabelValuesAssociation(e,n,i){const r=this.getAssociations(e),s=r.get(n);s===void 0?r.set(n,new Set(i)):i.forEach(a=>{s.add(a)})}setLabelNamesAssociation(e,n){const i=this.getAssociations(e);n.forEach(r=>{r!=="__name__"&&(i.has(r)||i.set(r,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,i){i&&i.length>0&&this.setLabelValuesAssociation(i,e,n),this.labelValues.set(e,n)}getLabelValues(e,n){if(!n||n.length===0){const r=this.labelValues.get(e);return r||[]}const i=this.completeAssociation.get(n);if(i){const r=i.get(e);return r?Array.from(r):[]}return[]}}class Fxe{constructor(e,n){this.client=e,this.cache=new Pxe(n)}labelNames(e){const n=this.cache.getLabelNames(e);return n&&n.length>0?Promise.resolve(n):this.client.labelNames(e).then(i=>(this.cache.setLabelNames(i,e),this.cache.getLabelNames(e)))}labelValues(e,n){const i=this.cache.getLabelValues(e,n);return i&&i.length>0?Promise.resolve(i):this.client.labelValues(e,n).then(r=>(this.cache.setLabelValues(e,r,n),r))}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 $xe(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 rE(t){return t!=null&&t.completeStrategy?t.completeStrategy:t!=null&&t.remote?$xe(t.remote)?new aT(t.remote,t.maxMetricsMetadata):new aT(new Fxe(new Lxe(t.remote),t.remote.cache),t.maxMetricsMetadata):new aT}class f6{constructor(e,n,i){this.from=e,this.to=n,this.diagnostic=i}}class nf{constructor(e,n,i){this.diagnostics=e,this.panel=n,this.selected=i}static init(e,n,i){let r=i.facet(rc).markerFilter;r&&(e=r(e,i));let s=e.slice().sort((v,y)=>v.from-y.from||v.to-y.to),a=new yu,l=[],u=0,d=i.doc.iter(),f=0,p=i.doc.length;for(let v=0;;){let y=v==s.length?null:s[v];if(!y&&!l.length)break;let b,A;if(l.length)b=u,A=l.reduce((j,C)=>Math.min(j,C.to),y&&y.from>b?y.from:1e8);else{if(b=y.from,b>p)break;A=y.to,l.push(y),v++}for(;v<s.length;){let j=s[v];if(j.from==b&&(j.to>j.from||j.to==b))l.push(j),v++,A=Math.min(j.to,A);else{A=Math.min(j.from,A);break}}A=Math.min(A,p);let w=!1;if(l.some(j=>j.from==b&&(j.to==A||A==p))&&(w=b==A,!w&&A-b<10)){let j=b-(f+d.value.length);j>0&&(d.next(j),f=b);for(let C=b;;){if(C>=A){w=!0;break}if(!d.lineBreak&&f+d.value.length>C)break;C=f+d.value.length,f+=d.value.length,d.next()}}let S=tbe(l);if(w)a.add(b,b,Bt.widget({widget:new Kxe(S),diagnostics:l.slice()}));else{let j=l.reduce((C,k)=>k.markClass?C+" "+k.markClass:C,"");a.add(b,A,Bt.mark({class:"cm-lintRange cm-lintRange-"+S+j,diagnostics:l.slice(),inclusiveEnd:l.some(C=>C.to>A)}))}if(u=A,u==p)break;for(let j=0;j<l.length;j++)l[j].to<=u&&l.splice(j--,1)}let m=a.finish();return new nf(m,n,cd(m))}}function cd(t,e=null,n=0){let i=null;return t.between(n,1e9,(r,s,{spec:a})=>{if(!(e&&a.diagnostics.indexOf(e)<0))if(!i)i=new f6(r,s,e||a.diagnostics[0]);else{if(a.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new f6(i.from,s,i.diagnostic)}}),i}function zxe(t,e){let n=e.pos,i=e.end||n,r=t.state.facet(rc).hideOn(t,n,i);if(r!=null)return r;let s=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(a=>a.is(_D))||t.changes.touchesRange(s.from,Math.max(s.to,i)))}function mW(t,e){return t.field(Zo,!1)?e:e.concat(Xt.appendConfig.of(AW))}function Hxe(t,e){return{effects:mW(t,[_D.of(e)])}}const _D=Xt.define(),kD=Xt.define(),gW=Xt.define(),Zo=Ss.define({create(){return new nf(Bt.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let n=t.diagnostics.map(e.changes),i=null,r=t.panel;if(t.selected){let s=e.changes.mapPos(t.selected.from,1);i=cd(n,t.selected.diagnostic,s)||cd(n,null,s)}!n.size&&r&&e.state.facet(rc).autoPanel&&(r=null),t=new nf(n,r,i)}for(let n of e.effects)if(n.is(_D)){let i=e.state.facet(rc).autoPanel?n.value.length?sy.open:null:t.panel;t=nf.init(n.value,i,e.state)}else n.is(kD)?t=new nf(t.diagnostics,n.value?sy.open:null,t.selected):n.is(gW)&&(t=new nf(t.diagnostics,t.panel,n.value));return t},provide:t=>[ey.from(t,e=>e.panel),ut.decorations.from(t,e=>e.diagnostics)]}),qxe=Bt.mark({class:"cm-lintRange cm-lintRange-active"});function Qxe(t,e,n){let{diagnostics:i}=t.state.field(Zo),r,s=-1,a=-1;i.between(e-(n<0?1:0),e+(n>0?1:0),(u,d,{spec:f})=>{if(e>=u&&e<=d&&(u==d||(e>u||n>0)&&(e<d||n<0)))return r=f.diagnostics,s=u,a=d,!1});let l=t.state.facet(rc).tooltipFilter;return r&&l&&(r=l(r,t.state)),r?{pos:s,end:a,above:!0,create(){return{dom:Yxe(t,r)}}}:null}function Yxe(t,e){return fi("ul",{class:"cm-tooltip-lint"},e.map(n=>xW(t,n,!1)))}const Wxe=t=>{let e=t.state.field(Zo,!1);(!e||!e.panel)&&t.dispatch({effects:mW(t.state,[kD.of(!0)])});let n=dD(t,sy.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},p6=t=>{let e=t.state.field(Zo,!1);return!e||!e.panel?!1:(t.dispatch({effects:kD.of(!1)}),!0)},Uxe=t=>{let e=t.state.field(Zo,!1);if(!e)return!1;let n=t.state.selection.main,i=cd(e.diagnostics,null,n.to+1);return!i&&(i=cd(e.diagnostics,null,0),!i||i.from==n.from&&i.to==n.to)?!1:(t.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),cve(t,i.from,1,{tooltip:bW,until:r=>r.docChanged||r.newSelection.main.head<i.from||r.newSelection.main.head>i.to}),!0)},vW=[{key:"Mod-Shift-m",run:Wxe,preventDefault:!0},{key:"F8",run:Uxe}],Vxe=Ji.fromClass(class{constructor(t){this.view=t,this.timeout=-1,this.set=!0;let{delay:e}=t.state.facet(rc);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(rc);n.length&&Gxe(n.map(i=>Promise.resolve(i(this.view))),i=>{this.view.state.doc==e.doc&&this.view.dispatch(Hxe(this.view.state,i.reduce((r,s)=>r.concat(s))))},i=>{Ks(this.view.state,i)})}}update(t){let e=t.state.facet(rc);(t.docChanged||e!=t.startState.facet(rc)||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 Gxe(t,e,n){let i=[],r=-1;for(let s of t)s.then(a=>{i.push(a),clearTimeout(r),i.length==t.length?e(i):r=setTimeout(()=>e(i),200)},n)}const rc=bt.define({combine(t){return{sources:t.map(e=>e.source).filter(e=>e!=null),...wc(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:m6,tooltipFilter:m6,needsRefresh:(e,n)=>e?n?i=>e(i)||n(i):e:n,hideOn:(e,n)=>e?n?(i,r,s)=>e(i,r,s)||n(i,r,s):e:n,autoPanel:(e,n)=>e||n})}}});function m6(t,e){return t?e?(n,i)=>e(t(n,i),i):t:e}function Xxe(t,e={}){return[rc.of({source:t,config:e}),Vxe,AW]}function yW(t){let e=[];if(t)e:for(let{name:n}of t){for(let i=0;i<n.length;i++){let r=n[i];if(/[a-zA-Z]/.test(r)&&!e.some(s=>s.toLowerCase()==r.toLowerCase())){e.push(r);continue e}}e.push("")}return e}function xW(t,e,n){var i;let r=n?yW(e.actions):[];return fi("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},fi("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(i=e.actions)===null||i===void 0?void 0:i.map((s,a)=>{let l=!1,u=v=>{if(v.preventDefault(),l)return;l=!0;let y=cd(t.state.field(Zo).diagnostics,e);y&&s.apply(t,y.from,y.to)},{name:d}=s,f=r[a]?d.indexOf(r[a]):-1,p=f<0?d:[d.slice(0,f),fi("u",d.slice(f,f+1)),d.slice(f+1)],m=s.markClass?" "+s.markClass:"";return fi("button",{type:"button",class:"cm-diagnosticAction"+m,onclick:u,onmousedown:u,"aria-label":` Action: ${d}${f<0?"":` (access key "${r[a]})"`}.`},p)}),e.source&&fi("div",{class:"cm-diagnosticSource"},e.source))}class Kxe extends Cl{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return fi("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class g6{constructor(e,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=xW(e,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class sy{constructor(e){this.view=e,this.items=[];let n=r=>{if(!(r.ctrlKey||r.altKey||r.metaKey)){if(r.keyCode==27)p6(this.view),this.view.focus();else if(r.keyCode==38||r.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(r.keyCode==40||r.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(r.keyCode==36)this.moveSelection(0);else if(r.keyCode==35)this.moveSelection(this.items.length-1);else if(r.keyCode==13)this.view.focus();else if(r.keyCode>=65&&r.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],a=yW(s.actions);for(let l=0;l<a.length;l++)if(a[l].toUpperCase().charCodeAt(0)==r.keyCode){let u=cd(this.view.state.field(Zo).diagnostics,s);u&&s.actions[l].apply(e,u.from,u.to)}}else return;r.preventDefault()}},i=r=>{for(let s=0;s<this.items.length;s++)this.items[s].dom.contains(r.target)&&this.moveSelection(s)};this.list=fi("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:n,onclick:i}),this.dom=fi("div",{class:"cm-panel-lint"},this.list,fi("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>p6(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Zo).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(Zo),i=0,r=!1,s=null,a=new Set;for(e.between(0,this.view.state.doc.length,(l,u,{spec:d})=>{for(let f of d.diagnostics){if(a.has(f))continue;a.add(f);let p=-1,m;for(let v=i;v<this.items.length;v++)if(this.items[v].diagnostic==f){p=v;break}p<0?(m=new g6(this.view,f),this.items.splice(i,0,m),r=!0):(m=this.items[p],p>i&&(this.items.splice(i,p-i),r=!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"),i++}});i<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new g6(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),r=!0),s?(this.list.setAttribute("aria-activedescendant",s.id),this.view.requestMeasure({key:this,read:()=>({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:u})=>{let d=u.height/this.list.offsetHeight;l.top<u.top?this.list.scrollTop-=(u.top-l.top)/d:l.bottom>u.bottom&&(this.list.scrollTop+=(l.bottom-u.bottom)/d)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let e=this.list.firstChild;function n(){let i=e;e=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;e!=i.dom;)n();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e);for(;e;)n()}moveSelection(e){if(this.selectedIndex<0)return;let n=this.view.state.field(Zo),i=cd(n.diagnostics,this.items[e].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:gW.of(i)})}static open(e){return new sy(e)}}function Zxe(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 uA(t){return Zxe(`<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 Jxe=ut.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:uA("#f11")},".cm-lintRange-warning":{backgroundImage:uA("orange")},".cm-lintRange-info":{backgroundImage:uA("#999")},".cm-lintRange-hint":{backgroundImage:uA("#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 ebe(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function tbe(t){let e="hint",n=1;for(let i of t){let r=ebe(i.severity);r>n&&(n=r,e=i.severity)}return e}const bW=lve(Qxe,{hideOn:zxe}),AW=[Zo,ut.decorations.compute([Zo],t=>{let{selected:e,panel:n}=t.field(Zo);return!e||!n||e.from==e.to?Bt.none:Bt.set([qxe.range(e.from,e.to)])}),bW,Jxe];class nbe{promQL(){return e=>{const n=new vye(e.state);return n.analyze(),n.getDiagnostics()}}}function ibe(){return new nbe}function rbe(t,e){return Xxe(t.call(e))}var sE;(function(t){t.PromQL="PromQL",t.MetricName="MetricName"})(sE||(sE={}));function sbe(t){return sw.define({parser:yfe.configure({top:t}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"#"}}})}class wW{constructor(){this.complete=rE(),this.lint=ibe(),this.enableLinter=!0,this.enableCompletion=!0}setComplete(e){return this.complete=rE(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=sE.PromQL){const n=sbe(e);let i=[n];if(this.enableCompletion){const r=n.data.of({autocomplete:s=>this.complete.promQL(s)});i=i.concat(r)}return this.enableLinter&&(i=i.concat(rbe(this.lint.promQL,this.lint))),i}}function dw(){return dw=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)({}).hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},dw.apply(null,arguments)}function TD(t,e){if(t==null)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.indexOf(i)!==-1)continue;n[i]=t[i]}return n}const obe=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),i=ED(t.state,n.from);return i.line?abe(t):i.block?cbe(t):!1};function OD(t,e){return({state:n,dispatch:i})=>{if(n.readOnly)return!1;let r=t(e,n);return r?(i(n.update(r)),!0):!1}}const abe=OD(dbe,0),lbe=OD(SW,0),cbe=OD((t,e)=>SW(t,e,hbe(e)),0);function ED(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const B0=50;function ube(t,{open:e,close:n},i,r){let s=t.sliceDoc(i-B0,i),a=t.sliceDoc(r,r+B0),l=/\s*$/.exec(s)[0].length,u=/^\s*/.exec(a)[0].length,d=s.length-l;if(s.slice(d-e.length,d)==e&&a.slice(u,u+n.length)==n)return{open:{pos:i-l,margin:l&&1},close:{pos:r+u,margin:u&&1}};let f,p;r-i<=2*B0?f=p=t.sliceDoc(i,r):(f=t.sliceDoc(i,i+B0),p=t.sliceDoc(r-B0,r));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:i+m+e.length,margin:/\s/.test(f.charAt(m+e.length))?1:0},close:{pos:r-v-n.length,margin:/\s/.test(p.charAt(y-1))?1:0}}:null}function hbe(t){let e=[];for(let n of t.selection.ranges){let i=t.doc.lineAt(n.from),r=n.to<=i.to?i:t.doc.lineAt(n.to);r.from>i.from&&r.from==n.to&&(r=n.to==i.to+1?i:t.doc.lineAt(n.to-1));let s=e.length-1;s>=0&&e[s].to>i.from?e[s].to=r.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return e}function SW(t,e,n=e.selection.ranges){let i=n.map(s=>ED(e,s.from).block);if(!i.every(s=>s))return null;let r=n.map((s,a)=>ube(e,i[a],s.from,s.to));if(t!=2&&!r.every(s=>s))return{changes:e.changes(n.map((s,a)=>r[a]?[]:[{from:s.from,insert:i[a].open+" "},{from:s.to,insert:" "+i[a].close}]))};if(t!=1&&r.some(s=>s)){let s=[];for(let a=0,l;a<r.length;a++)if(l=r[a]){let u=i[a],{open:d,close:f}=l;s.push({from:d.pos-u.open.length,to:d.pos+d.margin},{from:f.pos-f.margin,to:f.pos+u.close.length})}return{changes:s}}return null}function dbe(t,e,n=e.selection.ranges){let i=[],r=-1;e:for(let{from:s,to:a}of n){let l=i.length,u=1e9,d;for(let f=s;f<=a;){let p=e.doc.lineAt(f);if(d==null&&(d=ED(e,p.from).line,!d))continue e;if(p.from>r&&(s==a||a>p.from)){r=p.from;let m=/^\s*/.exec(p.text)[0].length,v=m==p.length,y=p.text.slice(m,m+d.length)==d?m:-1;m<p.text.length&&m<u&&(u=m),i.push({line:p,comment:y,token:d,indent:m,empty:v,single:!1})}f=p.to+1}if(u<1e9)for(let f=l;f<i.length;f++)i[f].indent<i[f].line.text.length&&(i[f].indent=u);i.length==l+1&&(i[l].single=!0)}if(t!=2&&i.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:l,token:u,indent:d,empty:f,single:p}of i)(p||!f)&&s.push({from:l.from+d,insert:u+" "});let a=e.changes(s);return{changes:a,selection:e.selection.map(a,1)}}else if(t!=1&&i.some(s=>s.comment>=0)){let s=[];for(let{line:a,comment:l,token:u}of i)if(l>=0){let d=a.from+l,f=d+u.length;a.text[f-a.from]==" "&&f++,s.push({from:d,to:f})}return{changes:s}}return null}const oE=Ac.define(),fbe=Ac.define(),pbe=bt.define(),jW=bt.define({combine(t){return wc(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(i,r)=>e(i,r)||n(i,r)})}}),CW=Ss.define({create(){return sc.empty},update(t,e){let n=e.state.facet(jW),i=e.annotation(oE);if(i){let u=jo.fromTransaction(e,i.selection),d=i.side,f=d==0?t.undone:t.done;return u?f=fw(f,f.length,n.minDepth,u):f=OW(f,e.startState.selection),new sc(d==0?i.rest:f,d==0?f:i.rest)}let r=e.annotation(fbe);if((r=="full"||r=="before")&&(t=t.isolate()),e.annotation(Mr.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let s=jo.fromTransaction(e),a=e.annotation(Mr.time),l=e.annotation(Mr.userEvent);return s?t=t.addChanges(s,a,l,n,e):e.selection&&(t=t.addSelection(e.startState.selection,a,l,n.newGroupDelay)),(r=="full"||r=="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 sc(t.done.map(jo.fromJSON),t.undone.map(jo.fromJSON))}});function _W(t={}){return[CW,jW.of(t),ut.domEventHandlers({beforeinput(e,n){let i=e.inputType=="historyUndo"?kW:e.inputType=="historyRedo"?aE:null;return i?(e.preventDefault(),i(n)):!1}})]}function yj(t,e){return function({state:n,dispatch:i}){if(!e&&n.readOnly)return!1;let r=n.field(CW,!1);if(!r)return!1;let s=r.pop(t,n,e);return s?(i(s),!0):!1}}const kW=yj(0,!1),aE=yj(1,!1),mbe=yj(0,!0),gbe=yj(1,!0);class jo{constructor(e,n,i,r,s){this.changes=e,this.effects=n,this.mapped=i,this.startSelection=r,this.selectionsAfter=s}setSelAfter(e){return new jo(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,i;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:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(e){return new jo(e.changes&&Br.fromJSON(e.changes),[],e.mapped&&lc.fromJSON(e.mapped),e.startSelection&&Le.fromJSON(e.startSelection),e.selectionsAfter.map(Le.fromJSON))}static fromTransaction(e,n){let i=ka;for(let r of e.startState.facet(pbe)){let s=r(e);s.length&&(i=i.concat(s))}return!i.length&&e.changes.empty?null:new jo(e.changes.invert(e.startState.doc),i,void 0,n||e.startState.selection,ka)}static selection(e){return new jo(void 0,ka,void 0,void 0,e)}}function fw(t,e,n,i){let r=e+1>n+20?e-n-1:0,s=t.slice(r,e);return s.push(i),s}function vbe(t,e){let n=[],i=!1;return t.iterChangedRanges((r,s)=>n.push(r,s)),e.iterChangedRanges((r,s,a,l)=>{for(let u=0;u<n.length;){let d=n[u++],f=n[u++];l>=d&&a<=f&&(i=!0)}}),i}function ybe(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,i)=>n.empty!=e.ranges[i].empty).length===0}function TW(t,e){return t.length?e.length?t.concat(e):t:e}const ka=[],xbe=200;function OW(t,e){if(t.length){let n=t[t.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-xbe));return i.length&&i[i.length-1].eq(e)?t:(i.push(e),fw(t,t.length-1,1e9,n.setSelAfter(i)))}else return[jo.selection([e])]}function bbe(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 lT(t,e){if(!t.length)return t;let n=t.length,i=ka;for(;n;){let r=Abe(t[n-1],e,i);if(r.changes&&!r.changes.empty||r.effects.length){let s=t.slice(0,n);return s[n-1]=r,s}else e=r.mapped,n--,i=r.selectionsAfter}return i.length?[jo.selection(i)]:ka}function Abe(t,e,n){let i=TW(t.selectionsAfter.length?t.selectionsAfter.map(l=>l.map(e)):ka,n);if(!t.changes)return jo.selection(i);let r=t.changes.map(e),s=e.mapDesc(t.changes,!0),a=t.mapped?t.mapped.composeDesc(s):s;return new jo(r,Xt.mapEffects(t.effects,e),a,t.startSelection.map(s),i)}const wbe=/^(input\.type|delete)($|\.)/;class sc{constructor(e,n,i=0,r=void 0){this.done=e,this.undone=n,this.prevTime=i,this.prevUserEvent=r}isolate(){return this.prevTime?new sc(this.done,this.undone):this}addChanges(e,n,i,r,s){let a=this.done,l=a[a.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!i||wbe.test(i))&&(!l.selectionsAfter.length&&n-this.prevTime<r.newGroupDelay&&r.joinToEvent(s,vbe(l.changes,e.changes))||i=="input.type.compose")?a=fw(a,a.length-1,r.minDepth,new jo(e.changes.compose(l.changes),TW(Xt.mapEffects(e.effects,l.changes),l.effects),l.mapped,l.startSelection,ka)):a=fw(a,a.length,r.minDepth,e),new sc(a,ka,n,i)}addSelection(e,n,i,r){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:ka;return s.length>0&&n-this.prevTime<r&&i==this.prevUserEvent&&i&&/^select($|\.)/.test(i)&&ybe(s[s.length-1],e)?this:new sc(OW(this.done,e),this.undone,n,i)}addMapping(e){return new sc(lT(this.done,e),lT(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,i){let r=e==0?this.done:this.undone;if(r.length==0)return null;let s=r[r.length-1],a=s.selectionsAfter[0]||(s.startSelection?s.startSelection.map(s.changes.invertedDesc,1):n.selection);if(i&&s.selectionsAfter.length)return n.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:oE.of({side:e,rest:bbe(r),selection:a}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let l=r.length==1?ka:r.slice(0,r.length-1);return s.mapped&&(l=lT(l,s.mapped)),n.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:oE.of({side:e,rest:l,selection:a}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}sc.empty=new sc(ka,ka);const EW=[{key:"Mod-z",run:kW,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:aE,preventDefault:!0},{linux:"Ctrl-Shift-z",run:aE,preventDefault:!0},{key:"Mod-u",run:mbe,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:gbe,preventDefault:!0}];function Og(t,e){return Le.create(t.ranges.map(e),t.mainIndex)}function _l(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function kl({state:t,dispatch:e},n){let i=Og(t.selection,n);return i.eq(t.selection,!0)?!1:(e(_l(t,i)),!0)}function xj(t,e){return Le.cursor(e?t.to:t.from)}function MW(t,e){return kl(t,n=>n.empty?t.moveByChar(n,e):xj(n,e))}function $s(t){return t.textDirectionAt(t.state.selection.main.head)==Si.LTR}const RW=t=>MW(t,!$s(t)),DW=t=>MW(t,$s(t));function NW(t,e){return kl(t,n=>n.empty?t.moveByGroup(n,e):xj(n,e))}const Sbe=t=>NW(t,!$s(t)),jbe=t=>NW(t,$s(t));function Cbe(t,e,n){if(e.type.prop(n))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function bj(t,e,n){let i=Hr(t).resolveInner(e.head),r=n?xn.closedBy:xn.openedBy;for(let u=e.head;;){let d=n?i.childAfter(u):i.childBefore(u);if(!d)break;Cbe(t,d,r)?i=d:u=n?d.to:d.from}let s=i.type.prop(r),a,l;return s&&(a=n?ic(t,i.from,1):ic(t,i.to,-1))&&a.matched?l=n?a.end.to:a.end.from:l=n?i.to:i.from,Le.cursor(l,n?-1:1)}const _be=t=>kl(t,e=>bj(t.state,e,!$s(t))),kbe=t=>kl(t,e=>bj(t.state,e,$s(t)));function IW(t,e){return kl(t,n=>{if(!n.empty)return xj(n,e);let i=t.moveVertically(n,e);return i.head!=n.head?i:t.moveToLineBoundary(n,e)})}const BW=t=>IW(t,!1),LW=t=>IW(t,!0);function PW(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,i=0,r;if(e){for(let s of t.state.facet(ut.scrollMargins)){let a=s(t);a!=null&&a.top&&(n=Math.max(a==null?void 0:a.top,n)),a!=null&&a.bottom&&(i=Math.max(a==null?void 0:a.bottom,i))}r=t.scrollDOM.clientHeight-n-i}else r=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:i,selfScroll:e,height:Math.max(t.defaultLineHeight,r-5)}}function FW(t,e){let n=PW(t),{state:i}=t,r=Og(i.selection,a=>a.empty?t.moveVertically(a,e,n.height):xj(a,e));if(r.eq(i.selection))return!1;let s;if(n.selfScroll){let a=t.coordsAtPos(i.selection.main.head),l=t.scrollDOM.getBoundingClientRect(),u=l.top+n.marginTop,d=l.bottom-n.marginBottom;a&&a.top>u&&a.bottom<d&&(s=ut.scrollIntoView(r.main.head,{y:"start",yMargin:a.top-u}))}return t.dispatch(_l(i,r),{effects:s}),!0}const v6=t=>FW(t,!1),lE=t=>FW(t,!0);function bd(t,e,n){let i=t.lineBlockAt(e.head),r=t.moveToLineBoundary(e,n);if(r.head==e.head&&r.head!=(n?i.to:i.from)&&(r=t.moveToLineBoundary(e,n,!1)),!n&&r.head==i.from&&i.length){let s=/^\s*/.exec(t.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;s&&e.head!=i.from+s&&(r=Le.cursor(i.from+s))}return r}const Tbe=t=>kl(t,e=>bd(t,e,!0)),Obe=t=>kl(t,e=>bd(t,e,!1)),Ebe=t=>kl(t,e=>bd(t,e,!$s(t))),Mbe=t=>kl(t,e=>bd(t,e,$s(t))),Rbe=t=>kl(t,e=>Le.cursor(t.lineBlockAt(e.head).from,1)),Dbe=t=>kl(t,e=>Le.cursor(t.lineBlockAt(e.head).to,-1));function Nbe(t,e,n){let i=!1,r=Og(t.selection,s=>{let a=ic(t,s.head,-1)||ic(t,s.head,1)||s.head>0&&ic(t,s.head-1,1)||s.head<t.doc.length&&ic(t,s.head+1,-1);if(!a||!a.end)return s;i=!0;let l=a.start.from==s.head?a.end.to:a.end.from;return Le.cursor(l)});return i?(e(_l(t,r)),!0):!1}const Ibe=({state:t,dispatch:e})=>Nbe(t,e);function Ba(t,e,n){let i=Og(t.state.selection,r=>{r.undirectional&&r.head>=r.anchor!=e&&(r=Le.range(r.head,r.anchor));let s=n(r);return Le.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return i.eq(t.state.selection)?!1:(t.dispatch(_l(t.state,i)),!0)}function $W(t,e){return Ba(t,e,n=>t.moveByChar(n,e))}const zW=t=>$W(t,!$s(t)),HW=t=>$W(t,$s(t));function qW(t,e){return Ba(t,e,n=>t.moveByGroup(n,e))}const Bbe=t=>qW(t,!$s(t)),Lbe=t=>qW(t,$s(t)),Pbe=t=>{let e=!$s(t);return Ba(t,e,n=>bj(t.state,n,e))},Fbe=t=>{let e=$s(t);return Ba(t,e,n=>bj(t.state,n,e))};function QW(t,e){return Ba(t,e,n=>t.moveVertically(n,e))}const YW=t=>QW(t,!1),WW=t=>QW(t,!0);function UW(t,e){return Ba(t,e,n=>t.moveVertically(n,e,PW(t).height))}const y6=t=>UW(t,!1),x6=t=>UW(t,!0),$be=t=>Ba(t,!0,e=>bd(t,e,!0)),zbe=t=>Ba(t,!1,e=>bd(t,e,!1)),Hbe=t=>{let e=!$s(t);return Ba(t,e,n=>bd(t,n,e))},qbe=t=>{let e=$s(t);return Ba(t,e,n=>bd(t,n,e))},Qbe=t=>Ba(t,!1,e=>Le.cursor(t.lineBlockAt(e.head).from)),Ybe=t=>Ba(t,!0,e=>Le.cursor(t.lineBlockAt(e.head).to)),b6=({state:t,dispatch:e})=>(e(_l(t,{anchor:0})),!0),A6=({state:t,dispatch:e})=>(e(_l(t,{anchor:t.doc.length})),!0),w6=({state:t,dispatch:e})=>(e(_l(t,{anchor:t.selection.main.anchor,head:0})),!0),S6=({state:t,dispatch:e})=>(e(_l(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),Wbe=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),Ube=({state:t,dispatch:e})=>{let n=Aj(t).map(({from:i,to:r})=>Le.range(i,Math.min(r+1,t.doc.length)));return e(t.update({selection:Le.create(n),userEvent:"select"})),!0},Vbe=({state:t,dispatch:e})=>{let n=Og(t.selection,i=>{let r=Hr(t),s=r.resolveStack(i.from,1);if(i.empty){let a=r.resolveStack(i.from,-1);a.node.from>=s.node.from&&a.node.to<=s.node.to&&(s=a)}for(let a=s;a;a=a.next){let{node:l}=a;if((l.from<i.from&&l.to>=i.to||l.to>i.to&&l.from<=i.from)&&a.next)return Le.range(l.to,l.from)}return i});return n.eq(t.selection)?!1:(e(_l(t,n)),!0)};function VW(t,e){let{state:n}=t,i=n.selection,r=n.selection.ranges.slice();for(let s of n.selection.ranges){let a=n.doc.lineAt(s.head);if(e?a.to<t.state.doc.length:a.from>0)for(let l=s;;){let u=t.moveVertically(l,e);if(u.head<a.from||u.head>a.to){r.some(d=>d.head==u.head)||r.push(u);break}else{if(u.head==l.head)break;l=u}}}return r.length==i.ranges.length?!1:(t.dispatch(_l(n,Le.create(r,r.length-1))),!0)}const Gbe=t=>VW(t,!1),Xbe=t=>VW(t,!0),Kbe=({state:t,dispatch:e})=>{let n=t.selection,i=null;return n.ranges.length>1?i=Le.create([n.main]):n.main.empty||(i=Le.create([Le.cursor(n.main.head)])),i?(e(_l(t,i)),!0):!1};function ax(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:i}=t,r=i.changeByRange(s=>{let{from:a,to:l}=s;if(a==l){let u=e(s);u<a?(n="delete.backward",u=hA(t,u,!1)):u>a&&(n="delete.forward",u=hA(t,u,!0)),a=Math.min(a,u),l=Math.max(l,u)}else a=hA(t,a,!1),l=hA(t,l,!0);return a==l?{range:s}:{changes:{from:a,to:l},range:Le.cursor(a,a<s.head?-1:1)}});return r.changes.empty?!1:(t.dispatch(i.update(r,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?ut.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function hA(t,e,n){if(t instanceof ut)for(let i of t.state.facet(ut.atomicRanges).map(r=>r(t)))i.between(e,e,(r,s)=>{r<e&&s>e&&(e=n?s:r)});return e}const GW=(t,e,n)=>ax(t,i=>{let r=i.from,{state:s}=t,a=s.doc.lineAt(r),l,u;if(n&&!e&&r>a.from&&r<a.from+200&&!/[^ \t]/.test(l=a.text.slice(0,r-a.from))){if(l[l.length-1]=="	")return r-1;let d=kg(l,s.tabSize),f=d%aw(s)||aw(s);for(let p=0;p<f&&l[l.length-1-p]==" ";p++)r--;u=r}else u=is(a.text,r-a.from,e,e)+a.from,u==r&&a.number!=(e?s.doc.lines:1)?u+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(a.text.slice(u-a.from,r-a.from))&&(u=is(a.text,u-a.from,!1,!1)+a.from);return u}),cE=t=>GW(t,!1,!0),XW=t=>GW(t,!0,!1),KW=(t,e)=>ax(t,n=>{let i=n.head,{state:r}=t,s=r.doc.lineAt(i),a=r.charCategorizer(i);for(let l=null;;){if(i==(e?s.to:s.from)){i==n.head&&s.number!=(e?r.doc.lines:1)&&(i+=e?1:-1);break}let u=is(s.text,i-s.from,e)+s.from,d=s.text.slice(Math.min(i,u)-s.from,Math.max(i,u)-s.from),f=a(d);if(l!=null&&f!=l)break;(d!=" "||i!=n.head)&&(l=f),i=u}return i}),ZW=t=>KW(t,!1),Zbe=t=>KW(t,!0),Jbe=t=>ax(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),eAe=t=>ax(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),tAe=t=>ax(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),nAe=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:zn.of(["",""])},range:Le.cursor(i.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},iAe=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(i=>{if(!i.empty||i.from==0||i.from==t.doc.length)return{range:i};let r=i.from,s=t.doc.lineAt(r),a=r==s.from?r-1:is(s.text,r-s.from,!1)+s.from,l=r==s.to?r+1:is(s.text,r-s.from,!0)+s.from;return{changes:{from:a,to:l,insert:t.doc.slice(r,l).append(t.doc.slice(a,r))},range:Le.cursor(l)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Aj(t){let e=[],n=-1;for(let i of t.selection.ranges){let r=t.doc.lineAt(i.from),s=t.doc.lineAt(i.to);if(!i.empty&&i.to==s.from&&(s=t.doc.lineAt(i.to-1)),n>=r.number){let a=e[e.length-1];a.to=s.to,a.ranges.push(i)}else e.push({from:r.from,to:s.to,ranges:[i]});n=s.number+1}return e}function JW(t,e,n){if(t.readOnly)return!1;let i=[],r=[];for(let s of Aj(t)){if(n?s.to==t.doc.length:s.from==0)continue;let a=t.doc.lineAt(n?s.to+1:s.from-1),l=a.length+1;if(n){i.push({from:s.to,to:a.to},{from:s.from,insert:a.text+t.lineBreak});for(let u of s.ranges)r.push(Le.range(Math.min(t.doc.length,u.anchor+l),Math.min(t.doc.length,u.head+l)))}else{i.push({from:a.from,to:s.from},{from:s.to,insert:t.lineBreak+a.text});for(let u of s.ranges)r.push(Le.range(u.anchor-l,u.head-l))}}return i.length?(e(t.update({changes:i,scrollIntoView:!0,selection:Le.create(r,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const rAe=({state:t,dispatch:e})=>JW(t,e,!1),sAe=({state:t,dispatch:e})=>JW(t,e,!0);function eU(t,e,n){if(t.readOnly)return!1;let i=[];for(let s of Aj(t))n?i.push({from:s.from,insert:t.doc.slice(s.from,s.to)+t.lineBreak}):i.push({from:s.to,insert:t.lineBreak+t.doc.slice(s.from,s.to)});let r=t.changes(i);return e(t.update({changes:r,selection:t.selection.map(r,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const oAe=({state:t,dispatch:e})=>eU(t,e,!1),aAe=({state:t,dispatch:e})=>eU(t,e,!0),lAe=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(Aj(e).map(({from:r,to:s})=>(r>0?r--:s<e.doc.length&&s++,{from:r,to:s}))),i=Og(e.selection,r=>{let s;if(t.lineWrapping){let a=t.lineBlockAt(r.head),l=t.coordsAtPos(r.head,r.assoc||1);l&&(s=a.bottom+t.documentTop-l.bottom+t.defaultLineHeight/2)}return t.moveVertically(r,!0,s)}).map(n);return t.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function cAe(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=Hr(t).resolveInner(e),i=n.childBefore(e),r=n.childAfter(e),s;return i&&r&&i.to<=e&&r.from>=e&&(s=i.type.prop(xn.closedBy))&&s.indexOf(r.name)>-1&&t.doc.lineAt(i.to).from==t.doc.lineAt(r.from).from&&!/\S/.test(t.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}const uE=tU(!1),uAe=tU(!0);function tU(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let i=e.changeByRange(r=>{let{from:s,to:a}=r,l=e.doc.lineAt(s),u=!t&&s==a&&cAe(e,s);t&&(s=a=(a<=l.to?l:e.doc.lineAt(a)).to);let d=new pj(e,{simulateBreak:s,simulateDoubleBreak:!!u}),f=fD(d,s);for(f==null&&(f=kg(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));a<l.to&&/\s/.test(l.text[a-l.from]);)a++;u?{from:s,to:a}=u:s>l.from&&s<l.from+100&&!/\S/.test(l.text.slice(0,s))&&(s=l.from);let p=["",ty(e,f)];return u&&p.push(ty(e,d.lineIndent(l.from,-1))),{changes:{from:s,to:a,insert:zn.of(p)},range:Le.cursor(s+1+p[1].length)}});return n(e.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function MD(t,e){let n=-1;return t.changeByRange(i=>{let r=[];for(let a=i.from;a<=i.to;){let l=t.doc.lineAt(a);l.number>n&&(i.empty||i.to>l.from)&&(e(l,r,i),n=l.number),a=l.to+1}let s=t.changes(r);return{changes:r,range:Le.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}const hAe=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),i=new pj(t,{overrideIndentation:s=>{let a=n[s];return a??-1}}),r=MD(t,(s,a,l)=>{let u=fD(i,s.from);if(u==null)return;/\S/.test(s.text)||(u=0);let d=/^\s*/.exec(s.text)[0],f=ty(t,u);(d!=f||l.from<s.from+d.length)&&(n[s.from]=u,a.push({from:s.from,to:s.from+d.length,insert:f}))});return r.changes.empty||e(t.update(r,{userEvent:"indent"})),!0},nU=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(MD(t,(n,i)=>{i.push({from:n.from,insert:t.facet(rx)})}),{userEvent:"input.indent"})),!0),iU=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(MD(t,(n,i)=>{let r=/^\s*/.exec(n.text)[0];if(!r)return;let s=kg(r,t.tabSize),a=0,l=ty(t,Math.max(0,s-aw(t)));for(;a<r.length&&a<l.length&&r.charCodeAt(a)==l.charCodeAt(a);)a++;i.push({from:n.from+a,to:n.from+r.length,insert:l.slice(a)})}),{userEvent:"delete.dedent"})),!0),dAe=t=>(t.setTabFocusMode(),!0),fAe=[{key:"Ctrl-b",run:RW,shift:zW,preventDefault:!0},{key:"Ctrl-f",run:DW,shift:HW},{key:"Ctrl-p",run:BW,shift:YW},{key:"Ctrl-n",run:LW,shift:WW},{key:"Ctrl-a",run:Rbe,shift:Qbe},{key:"Ctrl-e",run:Dbe,shift:Ybe},{key:"Ctrl-d",run:XW},{key:"Ctrl-h",run:cE},{key:"Ctrl-k",run:Jbe},{key:"Ctrl-Alt-h",run:ZW},{key:"Ctrl-o",run:nAe},{key:"Ctrl-t",run:iAe},{key:"Ctrl-v",run:lE}],pAe=[{key:"ArrowLeft",run:RW,shift:zW,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Sbe,shift:Bbe,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Ebe,shift:Hbe,preventDefault:!0},{key:"ArrowRight",run:DW,shift:HW,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:jbe,shift:Lbe,preventDefault:!0},{mac:"Cmd-ArrowRight",run:Mbe,shift:qbe,preventDefault:!0},{key:"ArrowUp",run:BW,shift:YW,preventDefault:!0},{mac:"Cmd-ArrowUp",run:b6,shift:w6},{mac:"Ctrl-ArrowUp",run:v6,shift:y6},{key:"ArrowDown",run:LW,shift:WW,preventDefault:!0},{mac:"Cmd-ArrowDown",run:A6,shift:S6},{mac:"Ctrl-ArrowDown",run:lE,shift:x6},{key:"PageUp",run:v6,shift:y6},{key:"PageDown",run:lE,shift:x6},{key:"Home",run:Obe,shift:zbe,preventDefault:!0},{key:"Mod-Home",run:b6,shift:w6},{key:"End",run:Tbe,shift:$be,preventDefault:!0},{key:"Mod-End",run:A6,shift:S6},{key:"Enter",run:uE,shift:uE},{key:"Mod-a",run:Wbe},{key:"Backspace",run:cE,shift:cE,preventDefault:!0},{key:"Delete",run:XW,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:ZW,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:Zbe,preventDefault:!0},{mac:"Mod-Backspace",run:eAe,preventDefault:!0},{mac:"Mod-Delete",run:tAe,preventDefault:!0}].concat(fAe.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),rU=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:_be,shift:Pbe},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:kbe,shift:Fbe},{key:"Alt-ArrowUp",run:rAe},{key:"Shift-Alt-ArrowUp",run:oAe},{key:"Alt-ArrowDown",run:sAe},{key:"Shift-Alt-ArrowDown",run:aAe},{key:"Mod-Alt-ArrowUp",run:Gbe},{key:"Mod-Alt-ArrowDown",run:Xbe},{key:"Escape",run:Kbe},{key:"Mod-Enter",run:uAe},{key:"Alt-l",mac:"Ctrl-l",run:Ube},{key:"Mod-i",run:Vbe,preventDefault:!0},{key:"Mod-[",run:iU},{key:"Mod-]",run:nU},{key:"Mod-Alt-\\",run:hAe},{key:"Shift-Mod-k",run:lAe},{key:"Shift-Mod-\\",run:Ibe},{key:"Mod-/",run:obe},{key:"Alt-A",run:lbe},{key:"Ctrl-m",mac:"Shift-Alt-m",run:dAe}].concat(pAe),mAe={key:"Tab",run:nU,shift:iU},j6=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class ig{constructor(e,n,i=0,r=e.length,s,a){this.test=a,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,r),this.bufferStart=i,this.normalize=s?l=>s(j6(l)):j6,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 bo(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=VR(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=Zl(e);let r=this.normalize(n);if(r.length)for(let s=0,a=i,l=!0;;s++){let u=r.charCodeAt(s),d=this.match(u,a,l,this.bufferPos+this.bufferStart,s==r.length-1);if(d)return this.value=d,this;if(s==r.length-1)break;l&&s<n.length&&n.charCodeAt(s)==u?a++:l=!1}}}match(e,n,i,r,s){let a=null;for(let l=0;l<this.matches.length;){let u=this.matches[l],d=!1;this.query.charCodeAt(u.index)==e&&(u.index==this.query.length-1?a={from:u.from,to:r,precise:s&&u.precise}:(u.index++,d=!0)),d?l++:this.matches.splice(l,1)}return this.query.charCodeAt(0)==e&&(this.query.length==1?a={from:n,to:r,precise:i&&s}:this.matches.push({from:n,index:1,precise:i})),a&&this.test&&!this.test(a.from,a.to,this.buffer,this.bufferStart)&&(a=null),a}}typeof Symbol<"u"&&(ig.prototype[Symbol.iterator]=function(){return this});const sU={from:-1,to:-1,match:/.*/.exec(""),precise:!0},RD="gm"+(/x/.unicode==null?"":"u");class oU{constructor(e,n,i,r=0,s=e.length){if(this.text=e,this.to=s,this.curLine="",this.done=!1,this.value=sU,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new aU(e,n,i,r,s);this.re=new RegExp(n,RD+(i!=null&&i.ignoreCase?"i":"")),this.test=i==null?void 0:i.test,this.iter=e.iter();let a=e.lineAt(r);this.curLineStart=a.from,this.matchPos=pw(e,r),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 i=this.curLineStart+n.index,r=i+n[0].length;if(this.matchPos=pw(this.text,r+(i==r?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(i<r||i>this.value.to)&&(!this.test||this.test(i,r,n)))return this.value={from:i,to:r,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 cT=new WeakMap;class mm{constructor(e,n){this.from=e,this.text=n}get to(){return this.from+this.text.length}static get(e,n,i){let r=cT.get(e);if(!r||r.from>=i||r.to<=n){let l=new mm(n,e.sliceString(n,i));return cT.set(e,l),l}if(r.from==n&&r.to==i)return r;let{text:s,from:a}=r;return a>n&&(s=e.sliceString(n,a)+s,a=n),r.to<i&&(s+=e.sliceString(r.to,i)),cT.set(e,new mm(a,s)),new mm(n,s.slice(n-a,i-a))}}class aU{constructor(e,n,i,r,s){this.text=e,this.to=s,this.done=!1,this.value=sU,this.matchPos=pw(e,r),this.re=new RegExp(n,RD+(i!=null&&i.ignoreCase?"i":"")),this.test=i==null?void 0:i.test,this.flat=mm.get(e,r,this.chunkEnd(r+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 i=this.flat.from+n.index,r=i+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,r,n)))return this.value={from:i,to:r,precise:!0,match:n},this.matchPos=pw(this.text,r+(i==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=mm.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(oU.prototype[Symbol.iterator]=aU.prototype[Symbol.iterator]=function(){return this});function gAe(t){try{return new RegExp(t,RD),!0}catch{return!1}}function pw(t,e){if(e>=t.length)return e;let n=t.lineAt(e),i;for(;e<n.to&&(i=n.text.charCodeAt(e-n.from))>=56320&&i<57344;)e++;return e}const vAe=t=>{let{state:e}=t,n=String(e.doc.lineAt(t.state.selection.main.head).number),{close:i,result:r}=hve(t,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:n},focus:!0,submitLabel:e.phrase("go")});return r.then(s=>{let a=s&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(s.elements.line.value);if(!a){t.dispatch({effects:i});return}let l=e.doc.lineAt(e.selection.main.head),[,u,d,f,p]=a,m=f?+f.slice(1):0,v=d?+d:l.number;if(d&&p){let A=v/100;u&&(A=A*(u=="-"?-1:1)+l.number/e.doc.lines),v=Math.round(e.doc.lines*A)}else d&&u&&(v=v*(u=="-"?-1:1)+l.number);let y=e.doc.line(Math.max(1,Math.min(e.doc.lines,v))),b=Le.cursor(y.from+Math.max(0,Math.min(m,y.length)));t.dispatch({effects:[i,ut.scrollIntoView(b.from,{y:"center"})],selection:b})}),!0},yAe={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},xAe=bt.define({combine(t){return wc(t,yAe,{highlightWordAroundCursor:(e,n)=>e||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function lU(t){return[jAe,SAe]}const bAe=Bt.mark({class:"cm-selectionMatch"}),AAe=Bt.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function C6(t,e,n,i){return(n==0||t(e.sliceDoc(n-1,n))!=qi.Word)&&(i==e.doc.length||t(e.sliceDoc(i,i+1))!=qi.Word)}function wAe(t,e,n,i){return t(e.sliceDoc(n,n+1))==qi.Word&&t(e.sliceDoc(i-1,i))==qi.Word}const SAe=Ji.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(xAe),{state:n}=t,i=n.selection;if(i.ranges.length>1)return Bt.none;let r=i.main,s,a=null;if(r.empty){if(!e.highlightWordAroundCursor)return Bt.none;let u=n.wordAt(r.head);if(!u)return Bt.none;a=n.charCategorizer(r.head),s=n.sliceDoc(u.from,u.to)}else{let u=r.to-r.from;if(u<e.minSelectionLength||u>200)return Bt.none;if(e.wholeWords){if(s=n.sliceDoc(r.from,r.to),a=n.charCategorizer(r.head),!(C6(a,n,r.from,r.to)&&wAe(a,n,r.from,r.to)))return Bt.none}else if(s=n.sliceDoc(r.from,r.to),!s)return Bt.none}let l=[];for(let u of t.visibleRanges){let d=new ig(n.doc,s,u.from,u.to);for(;!d.next().done;){let{from:f,to:p}=d.value;if((!a||C6(a,n,f,p))&&(r.empty&&f<=r.from&&p>=r.to?l.push(AAe.range(f,p)):(f>=r.to||p<=r.from)&&l.push(bAe.range(f,p)),l.length>e.maxMatches))return Bt.none}}return Bt.set(l)}},{decorations:t=>t.decorations}),jAe=ut.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),CAe=({state:t,dispatch:e})=>{let{selection:n}=t,i=Le.create(n.ranges.map(r=>t.wordAt(r.head)||Le.cursor(r.head)),n.mainIndex);return i.eq(n)?!1:(e(t.update({selection:i})),!0)};function _Ae(t,e){let{main:n,ranges:i}=t.selection,r=t.wordAt(n.head),s=r&&r.from==n.from&&r.to==n.to;for(let a=!1,l=new ig(t.doc,e,i[i.length-1].to);;)if(l.next(),l.done){if(a)return null;l=new ig(t.doc,e,0,Math.max(0,i[i.length-1].from-1)),a=!0}else{if(a&&i.some(u=>u.from==l.value.from))continue;if(s){let u=t.wordAt(l.value.from);if(!u||u.from!=l.value.from||u.to!=l.value.to)continue}return l.value}}const kAe=({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(s=>s.from===s.to))return CAe({state:t,dispatch:e});let i=t.sliceDoc(n[0].from,n[0].to);if(t.selection.ranges.some(s=>t.sliceDoc(s.from,s.to)!=i))return!1;let r=_Ae(t,i);return r?(e(t.update({selection:t.selection.addRange(Le.range(r.from,r.to),!1),effects:ut.scrollIntoView(r.to)})),!0):!1},Eg=bt.define({combine(t){return wc(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new zAe(e),scrollToMatch:e=>ut.scrollIntoView(e)})}});class cU{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||gAe(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,i)=>i=="n"?`
`:i=="r"?"\r":i=="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 DAe(this):new EAe(this)}getCursor(e,n=0,i){let r=e.doc?e:kn.create({doc:e});return i==null&&(i=r.doc.length),this.regexp?Hp(this,r,n,i):zp(this,r,n,i)}}class uU{constructor(e){this.spec=e}}function TAe(t,e,n){return(i,r,s,a)=>{if(n&&!n(i,r,s,a))return!1;let l=i>=a&&r<=a+s.length?s.slice(i-a,r-a):e.doc.sliceString(i,r);return t(l,e,i,r)}}function zp(t,e,n,i){let r;return t.wholeWord&&(r=OAe(e.doc,e.charCategorizer(e.selection.main.head))),t.test&&(r=TAe(t.test,e,r)),new ig(e.doc,t.unquoted,n,i,t.caseSensitive?void 0:s=>s.toLowerCase(),r)}function OAe(t,e){return(n,i,r,s)=>((s>n||s+r.length<i)&&(s=Math.max(0,n-2),r=t.sliceString(s,Math.min(t.length,i+2))),(e(mw(r,n-s))!=qi.Word||e(gw(r,n-s))!=qi.Word)&&(e(gw(r,i-s))!=qi.Word||e(mw(r,i-s))!=qi.Word))}class EAe extends uU{constructor(e){super(e)}nextMatch(e,n,i){let r=zp(this.spec,e,i,e.doc.length).nextOverlapping();if(r.done){let s=Math.min(e.doc.length,n+this.spec.unquoted.length);r=zp(this.spec,e,0,s).nextOverlapping()}return r.done||r.value.from==n&&r.value.to==i?null:r.value}prevMatchInRange(e,n,i){for(let r=i;;){let s=Math.max(n,r-1e4-this.spec.unquoted.length),a=zp(this.spec,e,s,r),l=null;for(;!a.nextOverlapping().done;)l=a.value;if(l)return l;if(s==n)return null;r-=1e4}}prevMatch(e,n,i){let r=this.prevMatchInRange(e,0,n);return r||(r=this.prevMatchInRange(e,Math.max(0,i-this.spec.unquoted.length),e.doc.length)),r&&(r.from!=n||r.to!=i)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,n){let i=zp(this.spec,e,0,e.doc.length),r=[];for(;!i.next().done;){if(r.length>=n)return null;r.push(i.value)}return r}highlight(e,n,i,r){let s=zp(this.spec,e,Math.max(0,n-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}function MAe(t,e,n){return(i,r,s)=>(!n||n(i,r,s))&&t(s[0],e,i,r)}function Hp(t,e,n,i){let r;return t.wholeWord&&(r=RAe(e.charCategorizer(e.selection.main.head))),t.test&&(r=MAe(t.test,e,r)),new oU(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:r},n,i)}function mw(t,e){return t.slice(is(t,e,!1),e)}function gw(t,e){return t.slice(e,is(t,e))}function RAe(t){return(e,n,i)=>!i[0].length||(t(mw(i.input,i.index))!=qi.Word||t(gw(i.input,i.index))!=qi.Word)&&(t(gw(i.input,i.index+i[0].length))!=qi.Word||t(mw(i.input,i.index+i[0].length))!=qi.Word)}class DAe extends uU{nextMatch(e,n,i){let r=Hp(this.spec,e,i,e.doc.length).next();return r.done&&(r=Hp(this.spec,e,0,n).next()),r.done?null:r.value}prevMatchInRange(e,n,i){for(let r=1;;r++){let s=Math.max(n,i-r*1e4),a=Hp(this.spec,e,s,i),l=null;for(;!a.next().done;)l=a.value;if(l&&(s==n||l.from>s+10))return l;if(s==n)return null}}prevMatch(e,n,i){return this.prevMatchInRange(e,0,n)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,i)=>{if(i=="&")return e.match[0];if(i=="$")return"$";for(let r=i.length;r>0;r--){let s=+i.slice(0,r);if(s>0&&s<e.match.length)return e.match[s]+i.slice(r)}return n})}matchAll(e,n){let i=Hp(this.spec,e,0,e.doc.length),r=[];for(;!i.next().done;){if(r.length>=n)return null;r.push(i.value)}return r}highlight(e,n,i,r){let s=Hp(this.spec,e,Math.max(0,n-250),Math.min(i+250,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}const oy=Xt.define(),DD=Xt.define(),Xh=Ss.define({create(t){return new uT(hE(t).create(),null)},update(t,e){for(let n of e.effects)n.is(oy)?t=new uT(n.value.create(),t.panel):n.is(DD)&&(t=new uT(t.query,n.value?ND:null));return t},provide:t=>ey.from(t,e=>e.panel)});class uT{constructor(e,n){this.query=e,this.panel=n}}const NAe=Bt.mark({class:"cm-searchMatch"}),IAe=Bt.mark({class:"cm-searchMatch cm-searchMatch-selected"}),BAe=Ji.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(Xh))}update(t){let e=t.state.field(Xh);(e!=t.startState.field(Xh)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return Bt.none;let{view:n}=this,i=new yu;for(let r=0,s=n.visibleRanges,a=s.length;r<a;r++){let{from:l,to:u}=s[r];for(;r<a-1&&u>s[r+1].from-500;)u=s[++r].to;t.highlight(n.state,l,u,(d,f)=>{let p=n.state.selection.ranges.some(m=>m.from==d&&m.to==f);i.add(d,f,p?IAe:NAe)})}return i.finish()}},{decorations:t=>t.decorations});function lx(t){return e=>{let n=e.state.field(Xh,!1);return n&&n.query.spec.valid?t(e,n):fU(e)}}const vw=lx((t,{query:e})=>{let{to:n}=t.state.selection.main,i=e.nextMatch(t.state,n,n);if(!i)return!1;let r=Le.single(i.from,i.to),s=t.state.facet(Eg);return t.dispatch({selection:r,effects:[ID(t,i),s.scrollToMatch(r.main,t)],userEvent:"select.search"}),dU(t),!0}),yw=lx((t,{query:e})=>{let{state:n}=t,{from:i}=n.selection.main,r=e.prevMatch(n,i,i);if(!r)return!1;let s=Le.single(r.from,r.to),a=t.state.facet(Eg);return t.dispatch({selection:s,effects:[ID(t,r),a.scrollToMatch(s.main,t)],userEvent:"select.search"}),dU(t),!0}),LAe=lx((t,{query:e})=>{let n=e.matchAll(t.state,1e3);return!n||!n.length?!1:(t.dispatch({selection:Le.create(n.map(i=>Le.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),PAe=({state:t,dispatch:e})=>{let n=t.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:i,to:r}=n.main,s=[],a=0;for(let l=new ig(t.doc,t.sliceDoc(i,r));!l.next().done;){if(s.length>1e3)return!1;l.value.from==i&&(a=s.length),s.push(Le.range(l.value.from,l.value.to))}return e(t.update({selection:Le.create(s,a),userEvent:"select.search.matches"})),!0},_6=lx((t,{query:e})=>{let{state:n}=t,{from:i,to:r}=n.selection.main;if(n.readOnly)return!1;let s=e.nextMatch(n,i,i);if(!s)return!1;let a=s,l=[],u,d,f=[];a.precise?a.from==i&&a.to==r&&(d=n.toText(e.getReplacement(a)),l.push({from:a.from,to:a.to,insert:d}),a=e.nextMatch(n,a.from,a.to),f.push(ut.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(i).number)+"."))):a=e.nextMatch(n,a.from,a.to);let p=t.state.changes(l);return a&&(u=Le.single(a.from,a.to).map(p),f.push(ID(t,a)),f.push(n.facet(Eg).scrollToMatch(u.main,t))),t.dispatch({changes:p,selection:u,effects:f,userEvent:"input.replace"}),!0}),FAe=lx((t,{query:e})=>{if(t.state.readOnly)return!1;let n=[];for(let r of e.matchAll(t.state,1e9)){let{from:s,to:a,precise:l}=r;l&&n.push({from:s,to:a,insert:e.getReplacement(r)})}if(!n.length)return!1;let i=t.state.phrase("replaced $ matches",n.length)+".";return t.dispatch({changes:n,effects:ut.announce.of(i),userEvent:"input.replace.all"}),!0});function ND(t){return t.state.facet(Eg).createPanel(t)}function hE(t,e){var n,i,r,s,a;let l=t.selection.main,u=l.empty||l.to>l.from+100?"":t.sliceDoc(l.from,l.to);if(e&&!u)return e;let d=t.facet(Eg);return new cU({search:((n=e==null?void 0:e.literal)!==null&&n!==void 0?n:d.literal)?u:u.replace(/\n/g,"\\n"),caseSensitive:(i=e==null?void 0:e.caseSensitive)!==null&&i!==void 0?i:d.caseSensitive,literal:(r=e==null?void 0:e.literal)!==null&&r!==void 0?r:d.literal,regexp:(s=e==null?void 0:e.regexp)!==null&&s!==void 0?s:d.regexp,wholeWord:(a=e==null?void 0:e.wholeWord)!==null&&a!==void 0?a:d.wholeWord})}function hU(t){let e=dD(t,ND);return e&&e.dom.querySelector("[main-field]")}function dU(t){let e=hU(t);e&&e==t.root.activeElement&&e.select()}const fU=t=>{let e=t.state.field(Xh,!1);if(e&&e.panel){let n=hU(t);if(n&&n!=t.root.activeElement){let i=hE(t.state,e.query.spec);i.valid&&t.dispatch({effects:oy.of(i)}),n.focus(),n.select()}}else t.dispatch({effects:[DD.of(!0),e?oy.of(hE(t.state,e.query.spec)):Xt.appendConfig.of(qAe)]});return!0},pU=t=>{let e=t.state.field(Xh,!1);if(!e||!e.panel)return!1;let n=dD(t,ND);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:DD.of(!1)}),!0},$Ae=[{key:"Mod-f",run:fU,scope:"editor search-panel"},{key:"F3",run:vw,shift:yw,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:vw,shift:yw,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:pU,scope:"editor search-panel"},{key:"Mod-Shift-l",run:PAe},{key:"Mod-Alt-g",run:vAe},{key:"Mod-d",run:kAe,preventDefault:!0}];class zAe{constructor(e){this.view=e;let n=this.query=e.state.field(Xh).query.spec;this.commit=this.commit.bind(this),this.searchField=fi("input",{value:n.search,placeholder:Fo(e,"Find"),"aria-label":Fo(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=fi("input",{value:n.replace,placeholder:Fo(e,"Replace"),"aria-label":Fo(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=fi("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=fi("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=fi("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function i(r,s,a){return fi("button",{class:"cm-button",name:r,onclick:s,type:"button"},a)}this.dom=fi("div",{onkeydown:r=>this.keydown(r),class:"cm-search"},[this.searchField,i("next",()=>vw(e),[Fo(e,"next")]),i("prev",()=>yw(e),[Fo(e,"previous")]),i("select",()=>LAe(e),[Fo(e,"all")]),fi("label",null,[this.caseField,Fo(e,"match case")]),fi("label",null,[this.reField,Fo(e,"regexp")]),fi("label",null,[this.wordField,Fo(e,"by word")]),...e.state.readOnly?[]:[fi("br"),this.replaceField,i("replace",()=>_6(e),[Fo(e,"replace")]),i("replaceAll",()=>FAe(e),[Fo(e,"replace all")])],fi("button",{name:"close",onclick:()=>pU(e),"aria-label":Fo(e,"close"),type:"button"},["×"])])}commit(){let e=new cU({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:oy.of(e)}))}keydown(e){w0e(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?yw:vw)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),_6(this.view))}update(e){for(let n of e.transactions)for(let i of n.effects)i.is(oy)&&!i.value.eq(this.query)&&this.setQuery(i.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(Eg).top}}function Fo(t,e){return t.state.phrase(e)}const dA=30,fA=/[\s\.,:;?!]/;function ID(t,{from:e,to:n}){let i=t.state.doc.lineAt(e),r=t.state.doc.lineAt(n).to,s=Math.max(i.from,e-dA),a=Math.min(r,n+dA),l=t.state.sliceDoc(s,a);if(s!=i.from){for(let u=0;u<dA;u++)if(!fA.test(l[u+1])&&fA.test(l[u])){l=l.slice(u);break}}if(a!=r){for(let u=l.length-1;u>l.length-dA;u--)if(!fA.test(l[u-1])&&fA.test(l[u])){l=l.slice(0,u);break}}return ut.announce.of(`${t.state.phrase("current match")}. ${l} ${t.state.phrase("on line")} ${i.number}.`)}const HAe=ut.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"}}),qAe=[Xh,Mu.low(BAe),HAe];var k6=function(e){e===void 0&&(e={});var n=e,i=n.crosshairCursor,r=i===void 0?!1:i,s=[];e.closeBracketsKeymap!==!1&&(s=s.concat(nW)),e.defaultKeymap!==!1&&(s=s.concat(rU)),e.searchKeymap!==!1&&(s=s.concat($Ae)),e.historyKeymap!==!1&&(s=s.concat(EW)),e.foldKeymap!==!1&&(s=s.concat(Gve)),e.completionKeymap!==!1&&(s=s.concat(SD)),e.lintKeymap!==!1&&(s=s.concat(vW));var a=[];return e.lineNumbers!==!1&&a.push(wve()),e.highlightActiveLineGutter!==!1&&a.push(Cve()),e.highlightSpecialChars!==!1&&a.push(wY()),e.history!==!1&&a.push(_W()),e.foldGutter!==!1&&a.push(Jve()),e.drawSelection!==!1&&a.push(T0e()),e.dropCursor!==!1&&a.push(D0e()),e.allowMultipleSelections!==!1&&a.push(kn.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&a.push(NY()),e.syntaxHighlighting!==!1&&a.push(gj(iye,{fallback:!0})),e.bracketMatching!==!1&&a.push(WY()),e.closeBrackets!==!1&&a.push(JY()),e.autocompletion!==!1&&a.push(rW()),e.rectangularSelection!==!1&&a.push(K0e()),r!==!1&&a.push(eve()),e.highlightActiveLine!==!1&&a.push(Q0e()),e.highlightSelectionMatches!==!1&&a.push(lU()),e.tabSize&&typeof e.tabSize=="number"&&a.push(rx.of(" ".repeat(e.tabSize))),a.concat([Gh.of(s.flat())]).filter(Boolean)};const QAe="#e5c07b",T6="#e06c75",YAe="#56b6c2",WAe="#ffffff",r1="#abb2bf",dE="#7d8799",UAe="#61afef",VAe="#98c379",O6="#d19a66",GAe="#c678dd",XAe="#21252b",E6="#2c313a",M6="#282c34",hT="#353a42",KAe="#3E4451",R6="#528bff",ZAe=ut.theme({"&":{color:r1,backgroundColor:M6},".cm-content":{caretColor:R6},".cm-cursor, .cm-dropCursor":{borderLeftColor:R6},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:KAe},".cm-panels":{backgroundColor:XAe,color:r1},".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:M6,color:dE,border:"none"},".cm-activeLineGutter":{backgroundColor:E6},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:hT},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:hT,borderBottomColor:hT},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:E6,color:r1}}},{dark:!0}),JAe=Uf.define([{tag:ye.keyword,color:GAe},{tag:[ye.name,ye.deleted,ye.character,ye.propertyName,ye.macroName],color:T6},{tag:[ye.function(ye.variableName),ye.labelName],color:UAe},{tag:[ye.color,ye.constant(ye.name),ye.standard(ye.name)],color:O6},{tag:[ye.definition(ye.name),ye.separator],color:r1},{tag:[ye.typeName,ye.className,ye.number,ye.changed,ye.annotation,ye.modifier,ye.self,ye.namespace],color:QAe},{tag:[ye.operator,ye.operatorKeyword,ye.url,ye.escape,ye.regexp,ye.link,ye.special(ye.string)],color:YAe},{tag:[ye.meta,ye.comment],color:dE},{tag:ye.strong,fontWeight:"bold"},{tag:ye.emphasis,fontStyle:"italic"},{tag:ye.strikethrough,textDecoration:"line-through"},{tag:ye.link,color:dE,textDecoration:"underline"},{tag:ye.heading,fontWeight:"bold",color:T6},{tag:[ye.atom,ye.bool,ye.special(ye.variableName)],color:O6},{tag:[ye.processingInstruction,ye.string,ye.inserted],color:VAe},{tag:ye.invalid,color:WAe}]),e1e=[ZAe,gj(JAe)];var t1e=ut.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),n1e=function(e){e===void 0&&(e={});var n=e,i=n.indentWithTab,r=i===void 0?!0:i,s=n.editable,a=s===void 0?!0:s,l=n.readOnly,u=l===void 0?!1:l,d=n.theme,f=d===void 0?"light":d,p=n.placeholder,m=p===void 0?"":p,v=n.basicSetup,y=v===void 0?!0:v,b=[];switch(r&&b.unshift(Gh.of([mAe])),y&&(typeof y=="boolean"?b.unshift(k6()):b.unshift(k6(y))),m&&b.unshift(SY(m)),f){case"light":b.push(t1e);break;case"dark":b.push(e1e);break;case"none":break;default:b.push(f);break}return a===!1&&b.push(ut.editable.of(!1)),u&&b.push(kn.readOnly.of(!0)),[...b]},i1e=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 r1e{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(i){console.error("TimeoutLatch callback error:",i)}})}}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 D6{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 dT=null,s1e=()=>typeof window>"u"?new D6:(dT||(dT=new D6),dT),o1e=ut.theme({"& .cm-scroller":{height:"100% !important"}}),N6=null,fT=null;function a1e(t,e,n,i,r,s){if(!t&&!e&&!n&&!i&&!r&&!s)return null;var a=JSON.stringify({height:t,minHeight:e,maxHeight:n,width:i,minWidth:r,maxWidth:s});return a===N6||(N6=a,fT=ut.theme({"&":{height:t,minHeight:e,maxHeight:n,width:i,minWidth:r,maxWidth:s}})),fT}var I6=Ac.define(),l1e=200,c1e=[];function u1e(t){var e=t.value,n=t.selection,i=t.onChange,r=t.onStatistics,s=t.onCreateEditor,a=t.onUpdate,l=t.extensions,u=l===void 0?c1e:l,d=t.autoFocus,f=t.theme,p=f===void 0?"light":f,m=t.height,v=m===void 0?null:m,y=t.minHeight,b=y===void 0?null:y,A=t.maxHeight,w=A===void 0?null:A,S=t.width,j=S===void 0?null:S,C=t.minWidth,k=C===void 0?null:C,E=t.maxWidth,M=E===void 0?null:E,R=t.placeholder,D=R===void 0?"":R,F=t.editable,I=F===void 0?!0:F,Q=t.readOnly,G=Q===void 0?!1:Q,L=t.indentWithTab,q=L===void 0?!0:L,N=t.basicSetup,P=N===void 0?!0:N,Y=t.root,K=t.initialState,W=T.useState(),z=W[0],U=W[1],V=T.useState(),J=V[0],ee=V[1],ce=T.useState(),he=ce[0],Oe=ce[1],Te=T.useState(()=>({current:null}))[0],Re=T.useState(()=>({current:null}))[0],qe=a1e(v,b,w,j,k,M),ie=ut.updateListener.of(be=>{if(be.docChanged&&typeof i=="function"&&!be.transactions.some(Ve=>Ve.annotation(I6))){Te.current?Te.current.reset():(Te.current=new r1e(()=>{if(Re.current){var Ve=Re.current;Re.current=null,Ve()}Te.current=null},l1e),s1e().add(Te.current));var Be=be.state.doc,Ce=Be.toString();i(Ce,be)}r&&r(i1e(be))}),je=n1e({theme:p,editable:I,readOnly:G,placeholder:D,indentWithTab:q,basicSetup:P}),se=[ie,...qe?[qe]:[],o1e,...je];return a&&typeof a=="function"&&se.push(ut.updateListener.of(a)),se=se.concat(u),T.useLayoutEffect(()=>{if(z&&!he){var be={doc:e,selection:n,extensions:se},Be=K?kn.fromJSON(K.json,be,K.fields):kn.create(be);if(Oe(Be),!J){var Ce=new ut({state:Be,parent:z,root:Y});ee(Ce),s&&s(Ce,Be)}}return()=>{J&&(Oe(void 0),ee(void 0))}},[z,he]),T.useEffect(()=>{t.container&&U(t.container)},[t.container]),T.useEffect(()=>()=>{J&&(J.destroy(),ee(void 0)),Te.current&&(Te.current.cancel(),Te.current=null)},[J]),T.useEffect(()=>{d&&J&&J.focus()},[d,J]),T.useEffect(()=>{J&&J.dispatch({effects:Xt.reconfigure.of(se)})},[p,u,v,b,w,j,k,M,D,I,G,q,P,i,a]),T.useEffect(()=>{if(e!==void 0){var be=J?J.state.doc.toString():"";if(J&&e!==be){var Be=Te.current&&!Te.current.isDone,Ce=()=>{J&&e!==J.state.doc.toString()&&J.dispatch({changes:{from:0,to:J.state.doc.toString().length,insert:e||""},annotations:[I6.of(!0)]})};Be?Re.current=Ce:Ce()}}},[e,J]),{state:he,setState:Oe,view:J,setView:ee,container:z,setContainer:U}}var h1e=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],BD=T.forwardRef((t,e)=>{var n=t.className,i=t.value,r=i===void 0?"":i,s=t.selection,a=t.extensions,l=a===void 0?[]:a,u=t.onChange,d=t.onStatistics,f=t.onCreateEditor,p=t.onUpdate,m=t.autoFocus,v=t.theme,y=v===void 0?"light":v,b=t.height,A=t.minHeight,w=t.maxHeight,S=t.width,j=t.minWidth,C=t.maxWidth,k=t.basicSetup,E=t.placeholder,M=t.indentWithTab,R=t.editable,D=t.readOnly,F=t.root,I=t.initialState,Q=TD(t,h1e),G=T.useRef(null),L=u1e({root:F,value:r,autoFocus:m,theme:y,height:b,minHeight:A,maxHeight:w,width:S,minWidth:j,maxWidth:C,basicSetup:k,placeholder:E,indentWithTab:M,editable:R,readOnly:D,selection:s,onChange:u,onStatistics:d,onCreateEditor:f,onUpdate:p,extensions:l,initialState:I}),q=L.state,N=L.view,P=L.container,Y=L.setContainer;T.useImperativeHandle(e,()=>({editor:G.current,state:q,view:N}),[G,P,q,N]);var K=T.useCallback(z=>{G.current=z,Y(z)},[Y]);if(typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var W=typeof y=="string"?"cm-theme-"+y:"cm-theme";return o.jsx("div",dw({ref:K,className:""+W+(n?" "+n:"")},Q))});BD.displayName="CodeMirror";const mU=ut.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"}}),gU=ut.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}),d1e=ut.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}),vU=Uf.define([{tag:ye.number,color:"#09885a"},{tag:ye.string,color:"#a31515"},{tag:ye.keyword,color:"#008080"},{tag:ye.function(ye.variableName),color:"#008080"},{tag:ye.labelName,color:"#800000"},{tag:ye.operator},{tag:ye.modifier,color:"#008080"},{tag:ye.paren},{tag:ye.squareBracket},{tag:ye.brace},{tag:ye.invalid,color:"red"},{tag:ye.comment,color:"#888",fontStyle:"italic"}]),yU=Uf.define([{tag:ye.number,color:"#22c55e"},{tag:ye.string,color:"#fca5a5"},{tag:ye.keyword,color:"#14bfad"},{tag:ye.function(ye.variableName),color:"#14bfad"},{tag:ye.labelName,color:"#ff8585"},{tag:ye.operator},{tag:ye.modifier,color:"#14bfad"},{tag:ye.paren},{tag:ye.squareBracket},{tag:ye.brace},{tag:ye.invalid,color:"#ff3d3d"},{tag:ye.comment,color:"#9ca3af",fontStyle:"italic"}]),f1e="_input_k0obd_1",p1e={input:f1e},fE="api/v1",xU=({pathPrefix:t,path:e,params:n,recordResponseTime:i})=>async({signal:r})=>{var a;const s=n?`?${new URLSearchParams(n).toString()}`:"";try{const l=Date.now(),u=await fetch(`${t}/${fE}${e}${s}`,{cache:"no-store",credentials:"same-origin",signal:r});if(!u.ok&&!((a=u.headers.get("content-type"))!=null&&a.startsWith("application/json")))throw new Error(u.statusText);const d=await u.json();if(i&&i(Date.now()-l),d.status==="error")throw new Error(d.error!==void 0?d.error:'missing "error" field in response JSON');return d}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}}},ud=({key:t,path:e,params:n,enabled:i,recordResponseTime:r,refetchInterval:s})=>{const{pathPrefix:a}=xr();return mce({queryKey:t!==void 0?t:[e,n],retry:!1,refetchOnWindowFocus:!1,refetchInterval:s,gcTime:0,enabled:i,queryFn:xU({pathPrefix:a,path:e,params:n,recordResponseTime:r})})},br=({key:t,path:e,params:n})=>{const{pathPrefix:i}=xr();return gq({queryKey:t!==void 0?t:[e,n],retry:!1,refetchOnWindowFocus:!1,staleTime:1/0,gcTime:0,queryFn:xU({pathPrefix:i,path:e,params:n})})};function m1e(t){let e=t,n=!1;const i=new Set;return{getState(){return e},updateState(r){e=typeof r=="function"?r(e):r},setState(r){this.updateState(r),i.forEach(s=>s(e))},initialize(r){n||(e=r,n=!0)},subscribe(r){return i.add(r),()=>i.delete(r)}}}function g1e(t){return T.useSyncExternalStore(t.subscribe,()=>t.getState(),()=>t.getState())}let B6=0;function bU(t,e,n){const i=[],r=[],s=new Map;for(const a of t){const l=a.position||e,u=s.get(l);u?u.push(a):s.set(l,[a])}for(const a of s.values())a.sort((l,u)=>(u.priority??0)-(l.priority??0)||(l.__sequence??0)-(u.__sequence??0)),a.forEach((l,u)=>{u<n?r.push(l):i.push(l)});return{notifications:r,queue:i}}const v1e=()=>m1e({notifications:[],queue:[],defaultPosition:"bottom-right",limit:5}),Vf=v1e(),y1e=(t=Vf)=>g1e(t);function Mg(t,e){const n=t.getState(),i=e([...n.notifications,...n.queue]);for(const s of i)s.__sequence===void 0&&(s.__sequence=B6,B6+=1);const r=bU(i,n.defaultPosition,n.limit);t.setState({notifications:r.notifications,queue:r.queue,limit:n.limit,defaultPosition:n.defaultPosition})}function x1e(t,e=Vf){const n=t.id||Pm();return Mg(e,i=>t.id&&i.some(r=>r.id===t.id)?i:[...i,{...t,id:n}]),n}function AU(t,e=Vf){return Mg(e,n=>n.filter(i=>{var r;return i.id===t?((r=i.onClose)==null||r.call(i,i),!1):!0})),t}function b1e(t,e=Vf){return Mg(e,n=>n.map(i=>i.id===t.id?{...i,...t}:i)),t.id}function A1e(t=Vf){Mg(t,()=>[])}function w1e(t=Vf){const{defaultPosition:e,limit:n}=t.getState();Mg(t,i=>bU(i,e,n).notifications)}const ml={show:x1e,hide:AU,update:b1e,clean:A1e,cleanQueue:w1e,updateState:Mg},wU=["bottom-center","bottom-left","bottom-right","top-center","top-left","top-right"];function S1e(t,e){return t.reduce((n,i)=>(n[i.position||e].push(i),n),wU.reduce((n,i)=>(n[i]=[],n),{}))}const L6={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},j1e={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function C1e({state:t,maxHeight:e,position:n,transitionDuration:i}){const[r,s]=n.split("-"),a=s==="center"?`${r}-center`:s,l={opacity:0,maxHeight:e,transform:L6[a],transitionDuration:`${i}ms, ${i}ms, ${i}ms`,transitionTimingFunction:"cubic-bezier(.51,.3,0,1.21), cubic-bezier(.51,.3,0,1.21), linear",transitionProperty:"opacity, transform, max-height"},u={opacity:1,transform:j1e[a]},d={opacity:0,maxHeight:0,transform:L6[a]};return{...l,...{entering:u,entered:u,exiting:d,exited:d}[t]}}function _1e(t,e){return typeof e=="number"?e:e===!1||t===!1?!1:t}const k1e=120;function SU({data:t,onHide:e,autoClose:n,transitionDuration:i,allowDragDismiss:r,allowScrollDismiss:s,paused:a,onHoverStart:l,onHoverEnd:u,ref:d,style:f,...p}){const[m,v]=T.useState(0),[y,b]=T.useState(!1),[A,w]=T.useState(1),[S,j]=T.useState(!1),C=Ar(),{autoClose:k,message:E,allowClose:M,position:R,style:D,withCloseButton:F,onOpen:I,priority:Q,__sequence:G,...L}=t,q=_1e(n,t.autoClose),N=T.useRef(-1),P=T.useRef(-1),Y=T.useRef(-1),K=T.useRef(null),W=T.useRef(!1),z=T.useRef(0),U=M===!1,V=()=>window.clearTimeout(N.current),J=()=>window.clearTimeout(P.current),ee=()=>window.clearTimeout(Y.current),ce=Ze=>{z.current=Ze,v(Ze)},he=()=>{e(t.id),V(),J(),ee()},Oe=()=>{y||be||a||W.current||typeof q!="number"||(V(),N.current=window.setTimeout(he,q))},Te=Ze=>{var vt;return Ze*((((vt=K.current)==null?void 0:vt.offsetWidth)??440)+40)},Re=(Ze,vt)=>{var mn;const pn=((mn=K.current)==null?void 0:mn.offsetWidth)??440;return Math.abs(Ze)>pn*.35||vt>.5},qe=()=>{ee(),j(!1),ce(0)},ie=Ze=>{w(Ze),b(!0),j(!1),ce(Te(Ze)),V(),J(),ee(),P.current=window.setTimeout(he,i)},je=()=>{ee(),Y.current=window.setTimeout(()=>{j(!1),ce(0),Oe()},k1e)},{ref:se,active:be}=tZ(Ze=>{if(!y)if(Ze.first&&V(),Ze.last){if(Ze.tap||Ze.canceled){ce(0),Oe();return}const vt=Ze.movement[0],pn=vt===0?Ze.direction[0]===-1?-1:1:vt>0?1:-1;Re(vt,Ze.velocity[0])?ie(pn):(ce(0),Oe())}else ce(Ze.movement[0])},{axis:"x",threshold:5,filterTaps:!0,enabled:r&&!U&&!y}),Be=Dn(d,K,se),Ce=Fm(f,C),Ve=Fm(D,C),st={...Ce,...Ve},Ye=typeof st.opacity=="number"?st.opacity:1,Ge=y?0:1-Math.min(Math.abs(m)/200,1)*.6,dt=st.transitionDuration??`${i}ms, ${i}ms, ${i}ms`,nt={...st,"--notifications-state-transform":typeof st.transform=="string"?st.transform:"translateX(0)","--notifications-state-opacity":String(Ye),"--notifications-swipe-offset":`${m}px`,"--notifications-swipe-opacity":String(Ge),transform:"var(--notifications-state-transform) translate3d(var(--notifications-swipe-offset), 0, 0)",opacity:"calc(var(--notifications-state-opacity) * var(--notifications-swipe-opacity))",transitionDuration:be||S?"0ms, 0ms, 0ms":dt,cursor:"default",touchAction:"pan-y"},Ee=()=>{W.current=!0,V(),l==null||l()},Qe=()=>{W.current=!1,S||(qe(),Oe()),u==null||u()},Xe=T.useEffectEvent(Ze=>{if(y||be)return;const vt=Ze.currentTarget===document;if(!vt&&!W.current)return;const{deltaX:pn,deltaY:mn}=Ze;if(Math.abs(pn)<=Math.abs(mn)||pn===0||!s||U)return;vt||(Ze.preventDefault(),Ze.stopPropagation()),V(),j(!0);const un=z.current-pn,Qt=un>0?1:-1;if(Re(un,0)){ie(Qt);return}ce(un),je()});return T.useEffect(()=>{if(S)return document.addEventListener("wheel",Xe,{passive:!1}),()=>document.removeEventListener("wheel",Xe,{passive:!1})},[S]),T.useEffect(()=>{const Ze=()=>{y&&ce(Te(A))};return window.addEventListener("resize",Ze),()=>window.removeEventListener("resize",Ze)},[A,y]),T.useEffect(()=>{const Ze=K.current;if(Ze)return Ze.addEventListener("wheel",Xe,{passive:!1}),()=>Ze.removeEventListener("wheel",Xe,{passive:!1})},[]),T.useEffect(()=>()=>{J(),ee()},[]),T.useEffect(()=>{var Ze;(Ze=t.onOpen)==null||Ze.call(t,t)},[]),T.useEffect(()=>(Oe(),V),[q,be,y]),T.useEffect(()=>(a?V():Oe(),V),[a]),o.jsx(AS,{ref:Be,...p,style:nt,...L,withCloseButton:U?!1:F,onClose:he,onMouseEnter:Ee,onMouseLeave:Qe,children:E})}SU.displayName="@mantine/notifications/NotificationContainer";var jU={root:"m_b37d9ac7",notification:"m_5ed0edd0"};function pE(t,e){return pE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},pE(t,e)}function CU(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,pE(t,e)}const P6={disabled:!1},xw=Vn.createContext(null);var T1e=function(e){return e.scrollTop},nv="unmounted",Vd="exited",Gd="entering",qp="entered",mE="exiting",Ru=(function(t){CU(e,t);function e(i,r){var s;s=t.call(this,i,r)||this;var a=r,l=a&&!a.isMounting?i.enter:i.appear,u;return s.appearStatus=null,i.in?l?(u=Vd,s.appearStatus=Gd):u=qp:i.unmountOnExit||i.mountOnEnter?u=nv:u=Vd,s.state={status:u},s.nextCallback=null,s}e.getDerivedStateFromProps=function(r,s){var a=r.in;return a&&s.status===nv?{status:Vd}:null};var n=e.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(r){var s=null;if(r!==this.props){var a=this.state.status;this.props.in?a!==Gd&&a!==qp&&(s=Gd):(a===Gd||a===qp)&&(s=mE)}this.updateStatus(!1,s)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var r=this.props.timeout,s,a,l;return s=a=l=r,r!=null&&typeof r!="number"&&(s=r.exit,a=r.enter,l=r.appear!==void 0?r.appear:a),{exit:s,enter:a,appear:l}},n.updateStatus=function(r,s){if(r===void 0&&(r=!1),s!==null)if(this.cancelNextCallback(),s===Gd){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:Q0.findDOMNode(this);a&&T1e(a)}this.performEnter(r)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Vd&&this.setState({status:nv})},n.performEnter=function(r){var s=this,a=this.props.enter,l=this.context?this.context.isMounting:r,u=this.props.nodeRef?[l]:[Q0.findDOMNode(this),l],d=u[0],f=u[1],p=this.getTimeouts(),m=l?p.appear:p.enter;if(!r&&!a||P6.disabled){this.safeSetState({status:qp},function(){s.props.onEntered(d)});return}this.props.onEnter(d,f),this.safeSetState({status:Gd},function(){s.props.onEntering(d,f),s.onTransitionEnd(m,function(){s.safeSetState({status:qp},function(){s.props.onEntered(d,f)})})})},n.performExit=function(){var r=this,s=this.props.exit,a=this.getTimeouts(),l=this.props.nodeRef?void 0:Q0.findDOMNode(this);if(!s||P6.disabled){this.safeSetState({status:Vd},function(){r.props.onExited(l)});return}this.props.onExit(l),this.safeSetState({status:mE},function(){r.props.onExiting(l),r.onTransitionEnd(a.exit,function(){r.safeSetState({status:Vd},function(){r.props.onExited(l)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(r,s){s=this.setNextCallback(s),this.setState(r,s)},n.setNextCallback=function(r){var s=this,a=!0;return this.nextCallback=function(l){a&&(a=!1,s.nextCallback=null,r(l))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(r,s){this.setNextCallback(s);var a=this.props.nodeRef?this.props.nodeRef.current:Q0.findDOMNode(this),l=r==null&&!this.props.addEndListener;if(!a||l){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var u=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],d=u[0],f=u[1];this.props.addEndListener(d,f)}r!=null&&setTimeout(this.nextCallback,r)},n.render=function(){var r=this.state.status;if(r===nv)return null;var s=this.props,a=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=TD(s,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Vn.createElement(xw.Provider,{value:null},typeof a=="function"?a(r,l):Vn.cloneElement(Vn.Children.only(a),l))},e})(Vn.Component);Ru.contextType=xw;Ru.propTypes={};function Mp(){}Ru.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Mp,onEntering:Mp,onEntered:Mp,onExit:Mp,onExiting:Mp,onExited:Mp};Ru.UNMOUNTED=nv;Ru.EXITED=Vd;Ru.ENTERING=Gd;Ru.ENTERED=qp;Ru.EXITING=mE;function O1e(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function LD(t,e){var n=function(s){return e&&T.isValidElement(s)?e(s):s},i=Object.create(null);return t&&T.Children.map(t,function(r){return r}).forEach(function(r){i[r.key]=n(r)}),i}function E1e(t,e){t=t||{},e=e||{};function n(f){return f in e?e[f]:t[f]}var i=Object.create(null),r=[];for(var s in t)s in e?r.length&&(i[s]=r,r=[]):r.push(s);var a,l={};for(var u in e){if(i[u])for(a=0;a<i[u].length;a++){var d=i[u][a];l[i[u][a]]=n(d)}l[u]=n(u)}for(a=0;a<r.length;a++)l[r[a]]=n(r[a]);return l}function hf(t,e,n){return n[e]!=null?n[e]:t.props[e]}function M1e(t,e){return LD(t.children,function(n){return T.cloneElement(n,{onExited:e.bind(null,n),in:!0,appear:hf(n,"appear",t),enter:hf(n,"enter",t),exit:hf(n,"exit",t)})})}function R1e(t,e,n){var i=LD(t.children),r=E1e(e,i);return Object.keys(r).forEach(function(s){var a=r[s];if(T.isValidElement(a)){var l=s in e,u=s in i,d=e[s],f=T.isValidElement(d)&&!d.props.in;u&&(!l||f)?r[s]=T.cloneElement(a,{onExited:n.bind(null,a),in:!0,exit:hf(a,"exit",t),enter:hf(a,"enter",t)}):!u&&l&&!f?r[s]=T.cloneElement(a,{in:!1}):u&&l&&T.isValidElement(d)&&(r[s]=T.cloneElement(a,{onExited:n.bind(null,a),in:d.props.in,exit:hf(a,"exit",t),enter:hf(a,"enter",t)}))}}),r}var D1e=Object.values||function(t){return Object.keys(t).map(function(e){return t[e]})},N1e={component:"div",childFactory:function(e){return e}},Ch=(function(t){CU(e,t);function e(i,r){var s;s=t.call(this,i,r)||this;var a=s.handleExited.bind(O1e(s));return s.state={contextValue:{isMounting:!0},handleExited:a,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(r,s){var a=s.children,l=s.handleExited,u=s.firstRender;return{children:u?M1e(r,l):R1e(r,a,l),firstRender:!1}},n.handleExited=function(r,s){var a=LD(this.props.children);r.key in a||(r.props.onExited&&r.props.onExited(s),this.mounted&&this.setState(function(l){var u=dw({},l.children);return delete u[r.key],{children:u}}))},n.render=function(){var r=this.props,s=r.component,a=r.childFactory,l=TD(r,["component","childFactory"]),u=this.state.contextValue,d=D1e(this.state.children).map(a);return delete l.appear,delete l.enter,delete l.exit,s===null?Vn.createElement(xw.Provider,{value:u},d):Vn.createElement(xw.Provider,{value:u},Vn.createElement(s,l,d))},e})(Vn.Component);Ch.propTypes={};Ch.defaultProps=N1e;const I1e=Ru,B1e={position:"bottom-right",autoClose:4e3,transitionDuration:250,allowDragDismiss:!0,allowScrollDismiss:!0,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:Da("overlay"),store:Vf,withinPortal:!0,pauseResetOnHover:"all"},_U=(t,{zIndex:e,containerWidth:n})=>({root:{"--notifications-z-index":e==null?void 0:e.toString(),"--notifications-container-width":ge(n)}}),Sc=Pe(t=>{const e=we("Notifications",B1e,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,attributes:u,position:d,autoClose:f,transitionDuration:p,allowDragDismiss:m,allowScrollDismiss:v,containerWidth:y,notificationMaxHeight:b,limit:A,zIndex:w,store:S,portalProps:j,withinPortal:C,pauseResetOnHover:k,...E}=e,M=Ar(),R=y1e(S),D=k8(),F=Ay(),I=T.useRef({}),Q=T.useRef(0),[G,L]=T.useState(0),q=T.useCallback(()=>L(z=>z+1),[]),N=T.useCallback(()=>L(z=>Math.max(0,z-1)),[]),P=M.respectReducedMotion&&F?1:p,Y=gt({name:"Notifications",classes:jU,props:e,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:u,vars:l,varsResolver:_U});T.useEffect(()=>{S==null||S.updateState(z=>({...z,limit:A||5,defaultPosition:d}))},[A,d]),wu(()=>{R.notifications.length>Q.current&&setTimeout(()=>D(),0),Q.current=R.notifications.length},[R.notifications]);const K=S1e(R.notifications,d),W=wU.reduce((z,U)=>(z[U]=K[U].map(({style:V,...J})=>o.jsx(I1e,{timeout:P,onEnter:()=>I.current[J.id].offsetHeight,nodeRef:{current:I.current[J.id]},children:ee=>o.jsx(SU,{ref:ce=>{ce?I.current[J.id]=ce:delete I.current[J.id]},data:J,onHide:ce=>AU(ce,S),autoClose:f,transitionDuration:P,allowDragDismiss:m,allowScrollDismiss:v,paused:k==="all"?G>0:!1,onHoverStart:q,onHoverEnd:N,...Y("notification",{style:{...C1e({state:ee,position:U,transitionDuration:P,maxHeight:b}),...V}})})},J.id)),z),{});return o.jsxs(ed,{withinPortal:C,...j,children:[o.jsx(xe,{...Y("root"),"data-position":"top-center",...E,children:o.jsx(Ch,{children:W["top-center"]})}),o.jsx(xe,{...Y("root"),"data-position":"top-left",...E,children:o.jsx(Ch,{children:W["top-left"]})}),o.jsx(xe,{...Y("root",{className:Bf.classNames.fullWidth}),"data-position":"top-right",...E,children:o.jsx(Ch,{children:W["top-right"]})}),o.jsx(xe,{...Y("root",{className:Bf.classNames.fullWidth}),"data-position":"bottom-right",...E,children:o.jsx(Ch,{children:W["bottom-right"]})}),o.jsx(xe,{...Y("root"),"data-position":"bottom-left",...E,children:o.jsx(Ch,{children:W["bottom-left"]})}),o.jsx(xe,{...Y("root"),"data-position":"bottom-center",...E,children:o.jsx(Ch,{children:W["bottom-center"]})})]})});Sc.classes=jU;Sc.varsResolver=_U;Sc.displayName="@mantine/notifications/Notifications";Sc.show=ml.show;Sc.hide=ml.hide;Sc.update=ml.update;Sc.clean=ml.clean;Sc.cleanQueue=ml.cleanQueue;Sc.updateState=ml.updateState;function L1e(t){return t.replace(/[&<>"']/g,e=>{switch(e){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";default:return"&#039;"}})}function gE(t){return t.to-t.from+1}function kU(t,e){const n=t[e];let i=null;return e===0&&n.from!==0&&(i={from:0,to:n.from-1}),e>0&&(i={from:t[e-1].to+1,to:n.from-1}),i}function P1e(t,e){let n=0;for(let i=0;i<t.length;i++){const r=t[i],s=kU(t,i);s!==null&&(n=n-gE(s)/e),n=n+gE(r)**2}return n}class TU{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,i){const r=(i==null?void 0:i.shouldSort)!==void 0?i.shouldSort:this.conf.shouldSort;let s=[];for(let a=0;a<n.length;a++){const l=this.match(e,n[a],i);l!==null&&(l.index=a,s.push(l))}return r&&(s=s.sort((a,l)=>l.score-a.score)),s}match(e,n,i){let r=e,s=n;const a=(i==null?void 0:i.caseSensitive)!==void 0?i.caseSensitive:this.conf.caseSensitive,l=(i==null?void 0:i.includeMatches)!==void 0?i.includeMatches:this.conf.includeMatches,u=(i==null?void 0:i.shouldRender)!==void 0?i.shouldRender:this.conf.shouldRender;if(a||(r=r.toLowerCase(),s=s.toLowerCase()),r===s){const m=[{from:0,to:e.length-1}],v={original:n,rendered:u?this.render(n,m,i):n,score:1/0};return l&&(v.intervals=m),v}let d=[],f=0;for(let m=0;m<s.length-r.length+1;m++)if(s[m]===r[0]){const v=this.generateMatchingInterval(r,s,m,i);if(v===null)break;v.score>f&&(f=v.score,d=v.intervals)}if(d.length===0)return null;const p={original:n,rendered:u?this.render(n,d,i):n,score:f};return l&&(p.intervals=d),p}render(e,n,i){if(n.length==0)return e;let r="";const s=i!=null&&i.pre?i.pre:this.conf.pre,a=i!=null&&i.post?i.post:this.conf.post;for(let u=0;u<n.length;u++){const d=n[u],f=kU(n,u);let p="";f!==null&&(p=this.extractSubString(e,f,i));const m=this.extractSubString(e,d,i);r=`${r}${p}${s}${m}${a}`}const l=n[n.length-1];return l.to<e.length-1&&(r=r+this.extractSubString(e,{from:l.to+1,to:e.length},i)),r}extractSubString(e,n,i){const r=(i==null?void 0:i.escapeHTML)!==void 0?i.escapeHTML:this.conf.escapeHTML;let s=e.substr(n.from,gE(n));return r&&(s=L1e(s)),s}generateMatchingInterval(e,n,i,r){let s=[];(r==null?void 0:r.excludedChars)!==void 0?s=r.excludedChars:this.conf.excludedChars!==void 0&&(s=this.conf.excludedChars);let a=0;const l=[];for(let u=i;u<n.length&&a<e.length;){if(s.includes(n[u])){u++;continue}if(s.includes(e[a])){a++;continue}if(n[u]===e[a]){const d={from:u,to:u};a++,u++;for(let f=u;f<n.length&&a<e.length&&n[f]===e[a];f++)d.to=f,a++,u=f;l.push(d)}u++}return l.length===0||a!==e.length?null:{score:P1e(l,n.length),intervals:l}}}const OU=new TU;function F1e(t,e,n){return OU.match(t,e,n)}function F6(t,e,n){return OU.render(t,e,n)}const $1e=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]]);function z1e(t){return t>=55296&&t<=57343||t>1114111?65533:$1e.get(t)??t}function EU(t){const e=atob(t),n=e.length&-2,i=new Uint16Array(n/2);for(let r=0,s=0;r<n;r+=2){const a=e.charCodeAt(r),l=e.charCodeAt(r+1);i[s++]=a|l<<8}return i}const H1e=EU(" "),q1e=EU("AAJhZ2xxBwARABMAFQBtAg0AAAAAAA8AcAAmYG8AcwAnYHQAPmB0ADxg9SFvdCJg");var Us;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.FLAG13=8192]="FLAG13",t[t.BRANCH_LENGTH=8064]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Us||(Us={}));var Vi;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(Vi||(Vi={}));const $6=32;function vE(t){return t>=Vi.ZERO&&t<=Vi.NINE}function Q1e(t){return t>=Vi.UPPER_A&&t<=Vi.UPPER_F||t>=Vi.LOWER_A&&t<=Vi.LOWER_F}function Y1e(t){return t>=Vi.UPPER_A&&t<=Vi.UPPER_Z||t>=Vi.LOWER_A&&t<=Vi.LOWER_Z||vE(t)}function W1e(t){return t===Vi.EQUALS||Y1e(t)}var Xr;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(Xr||(Xr={}));var ec;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(ec||(ec={}));class U1e{constructor(e,n,i){Ke(this,"decodeTree");Ke(this,"emitCodePoint");Ke(this,"errors");Ke(this,"state",Xr.EntityStart);Ke(this,"consumed",1);Ke(this,"result",0);Ke(this,"treeIndex",0);Ke(this,"excess",1);Ke(this,"decodeMode",ec.Strict);Ke(this,"runConsumed",0);this.decodeTree=e,this.emitCodePoint=n,this.errors=i}startEntity(e){this.decodeMode=e,this.state=Xr.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(e,n){switch(this.state){case Xr.EntityStart:return e.charCodeAt(n)===Vi.NUM?(this.state=Xr.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=Xr.NamedEntity,this.stateNamedEntity(e,n));case Xr.NumericStart:return this.stateNumericStart(e,n);case Xr.NumericDecimal:return this.stateNumericDecimal(e,n);case Xr.NumericHex:return this.stateNumericHex(e,n);case Xr.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|$6)===Vi.LOWER_X?(this.state=Xr.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=Xr.NumericDecimal,this.stateNumericDecimal(e,n))}stateNumericHex(e,n){for(;n<e.length;){const i=e.charCodeAt(n);if(vE(i)||Q1e(i)){const r=i<=Vi.NINE?i-Vi.ZERO:(i|$6)-Vi.LOWER_A+10;this.result=this.result*16+r,this.consumed++,n++}else return this.emitNumericEntity(i,3)}return-1}stateNumericDecimal(e,n){for(;n<e.length;){const i=e.charCodeAt(n);if(vE(i))this.result=this.result*10+(i-Vi.ZERO),this.consumed++,n++;else return this.emitNumericEntity(i,2)}return-1}emitNumericEntity(e,n){var i;if(this.consumed<=n)return(i=this.errors)==null||i.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Vi.SEMI)this.consumed+=1;else if(this.decodeMode===ec.Strict)return 0;return this.emitCodePoint(z1e(this.result),this.consumed),this.errors&&(e!==Vi.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:i}=this;let r=i[this.treeIndex],s=(r&Us.VALUE_LENGTH)>>14;for(;n<e.length;){if(s===0&&(r&Us.FLAG13)!==0){const l=(r&Us.BRANCH_LENGTH)>>7;if(this.runConsumed===0){const u=r&Us.JUMP_TABLE;if(e.charCodeAt(n)!==u)return this.result===0?0:this.emitNotTerminatedNamedEntity();n++,this.excess++,this.runConsumed++}for(;this.runConsumed<l;){if(n>=e.length)return-1;const u=this.runConsumed-1,d=i[this.treeIndex+1+(u>>1)],f=u%2===0?d&255:d>>8&255;if(e.charCodeAt(n)!==f)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();n++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(l>>1),r=i[this.treeIndex],s=(r&Us.VALUE_LENGTH)>>14}if(n>=e.length)break;const a=e.charCodeAt(n);if(a===Vi.SEMI&&s!==0&&(r&Us.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);if(this.treeIndex=V1e(i,r,this.treeIndex+Math.max(1,s),a),this.treeIndex<0)return this.result===0||this.decodeMode===ec.Attribute&&(s===0||W1e(a))?0:this.emitNotTerminatedNamedEntity();if(r=i[this.treeIndex],s=(r&Us.VALUE_LENGTH)>>14,s!==0){if(a===Vi.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==ec.Strict&&(r&Us.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}n++,this.excess++}return-1}emitNotTerminatedNamedEntity(){var r;const{result:e,decodeTree:n}=this,i=(n[e]&Us.VALUE_LENGTH)>>14;return this.emitNamedEntityData(e,i,this.consumed),(r=this.errors)==null||r.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,i){const{decodeTree:r}=this;return this.emitCodePoint(n===1?r[e]&~(Us.VALUE_LENGTH|Us.FLAG13):r[e+1],i),n===3&&this.emitCodePoint(r[e+2],i),i}end(){var e;switch(this.state){case Xr.NamedEntity:return this.result!==0&&(this.decodeMode!==ec.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Xr.NumericDecimal:return this.emitNumericEntity(0,2);case Xr.NumericHex:return this.emitNumericEntity(0,3);case Xr.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Xr.EntityStart:return 0}}}function V1e(t,e,n,i){const r=(e&Us.BRANCH_LENGTH)>>7,s=e&Us.JUMP_TABLE;if(r===0)return s!==0&&i===s?n:-1;if(s){const d=i-s;return d<0||d>=r?-1:t[n+d]-1}const a=r+1>>1;let l=0,u=r-1;for(;l<=u;){const d=l+u>>>1,f=d>>1,m=t[n+f]>>(d&1)*8&255;if(m<i)l=d+1;else if(m>i)u=d-1;else return t[n+a+d]}return-1}var Nt;(function(t){t[t.Tab=9]="Tab",t[t.NewLine=10]="NewLine",t[t.FormFeed=12]="FormFeed",t[t.CarriageReturn=13]="CarriageReturn",t[t.Space=32]="Space",t[t.ExclamationMark=33]="ExclamationMark",t[t.Number=35]="Number",t[t.Amp=38]="Amp",t[t.SingleQuote=39]="SingleQuote",t[t.DoubleQuote=34]="DoubleQuote",t[t.Dash=45]="Dash",t[t.Slash=47]="Slash",t[t.Zero=48]="Zero",t[t.Nine=57]="Nine",t[t.Semi=59]="Semi",t[t.Lt=60]="Lt",t[t.Eq=61]="Eq",t[t.Gt=62]="Gt",t[t.Questionmark=63]="Questionmark",t[t.UpperA=65]="UpperA",t[t.LowerA=97]="LowerA",t[t.UpperF=70]="UpperF",t[t.LowerF=102]="LowerF",t[t.UpperZ=90]="UpperZ",t[t.LowerZ=122]="LowerZ",t[t.LowerX=120]="LowerX",t[t.OpeningSquareBracket=91]="OpeningSquareBracket"})(Nt||(Nt={}));var ze;(function(t){t[t.Text=1]="Text",t[t.BeforeTagName=2]="BeforeTagName",t[t.InTagName=3]="InTagName",t[t.InSelfClosingTag=4]="InSelfClosingTag",t[t.BeforeClosingTagName=5]="BeforeClosingTagName",t[t.InClosingTagName=6]="InClosingTagName",t[t.AfterClosingTagName=7]="AfterClosingTagName",t[t.BeforeAttributeName=8]="BeforeAttributeName",t[t.InAttributeName=9]="InAttributeName",t[t.AfterAttributeName=10]="AfterAttributeName",t[t.BeforeAttributeValue=11]="BeforeAttributeValue",t[t.InAttributeValueDq=12]="InAttributeValueDq",t[t.InAttributeValueSq=13]="InAttributeValueSq",t[t.InAttributeValueNq=14]="InAttributeValueNq",t[t.BeforeDeclaration=15]="BeforeDeclaration",t[t.InDeclaration=16]="InDeclaration",t[t.InProcessingInstruction=17]="InProcessingInstruction",t[t.BeforeComment=18]="BeforeComment",t[t.CDATASequence=19]="CDATASequence",t[t.DeclarationSequence=20]="DeclarationSequence",t[t.InSpecialComment=21]="InSpecialComment",t[t.InCommentLike=22]="InCommentLike",t[t.SpecialStartSequence=23]="SpecialStartSequence",t[t.InSpecialTag=24]="InSpecialTag",t[t.InPlainText=25]="InPlainText",t[t.InEntity=26]="InEntity"})(ze||(ze={}));function Xd(t){return t===Nt.Space||t===Nt.NewLine||t===Nt.Tab||t===Nt.FormFeed||t===Nt.CarriageReturn}function Rp(t){return t===Nt.Slash||t===Nt.Gt||Xd(t)}function G1e(t){return t>=Nt.LowerA&&t<=Nt.LowerZ||t>=Nt.UpperA&&t<=Nt.UpperZ}var sl;(function(t){t[t.NoValue=0]="NoValue",t[t.Unquoted=1]="Unquoted",t[t.Single=2]="Single",t[t.Double=3]="Double"})(sl||(sl={}));const rn={Empty:new Uint8Array(0),Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,33,62]),Doctype:new Uint8Array([100,111,99,116,121,112,101]),IframeEnd:new Uint8Array([60,47,105,102,114,97,109,101]),NoembedEnd:new Uint8Array([60,47,110,111,101,109,98,101,100]),NoframesEnd:new Uint8Array([60,47,110,111,102,114,97,109,101,115]),Plaintext:new Uint8Array([60,47,112,108,97,105,110,116,101,120,116]),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])},X1e=new Map([[rn.IframeEnd[2],rn.IframeEnd],[rn.NoembedEnd[2],rn.NoembedEnd],[rn.Plaintext[2],rn.Plaintext],[rn.ScriptEnd[2],rn.ScriptEnd],[rn.TitleEnd[2],rn.TitleEnd],[rn.XmpEnd[2],rn.XmpEnd]]);class MU{constructor({xmlMode:e=!1,decodeEntities:n=!0,recognizeSelfClosing:i=e},r){Ke(this,"cbs");Ke(this,"state",ze.Text);Ke(this,"buffer","");Ke(this,"sectionStart",0);Ke(this,"index",0);Ke(this,"entityStart",0);Ke(this,"baseState",ze.Text);Ke(this,"isSpecial",!1);Ke(this,"running",!0);Ke(this,"offset",0);Ke(this,"xmlMode");Ke(this,"decodeEntities");Ke(this,"recognizeSelfClosing");Ke(this,"entityDecoder");Ke(this,"currentSequence",rn.Empty);Ke(this,"sequenceIndex",0);this.cbs=r,this.xmlMode=e,this.decodeEntities=n,this.recognizeSelfClosing=i,this.entityDecoder=new U1e(e?q1e:H1e,(s,a)=>this.emitCodePoint(s,a))}reset(){this.state=ze.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=ze.Text,this.isSpecial=!1,this.currentSequence=rn.Empty,this.sequenceIndex=0,this.running=!0,this.offset=0}write(e){this.offset+=this.buffer.length,this.buffer=e,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(e){e===Nt.Lt||!this.decodeEntities&&this.fastForwardTo(Nt.Lt)?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=ze.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&e===Nt.Amp&&this.startEntity()}enterTagBody(){this.currentSequence===rn.Plaintext?(this.currentSequence=rn.Empty,this.state=ze.InPlainText):this.isSpecial?(this.state=ze.InSpecialTag,this.sequenceIndex=0):this.state=ze.Text}stateSpecialStartSequence(e){const n=e|32;if(this.sequenceIndex<this.currentSequence.length){if(n===this.currentSequence[this.sequenceIndex]){this.sequenceIndex++;return}if(this.sequenceIndex===3){if(this.currentSequence===rn.ScriptEnd&&n===rn.StyleEnd[3]){this.currentSequence=rn.StyleEnd,this.sequenceIndex=4;return}if(this.currentSequence===rn.TitleEnd&&n===rn.TextareaEnd[3]){this.currentSequence=rn.TextareaEnd,this.sequenceIndex=4;return}}else if(this.sequenceIndex===4&&this.currentSequence===rn.NoembedEnd&&n===rn.NoframesEnd[4]){this.currentSequence=rn.NoframesEnd,this.sequenceIndex=5;return}}else if(Rp(e)){this.sequenceIndex=0,this.state=ze.InTagName,this.stateInTagName(e);return}this.isSpecial=!1,this.currentSequence=rn.Empty,this.sequenceIndex=0,this.state=ze.InTagName,this.stateInTagName(e)}stateCDATASequence(e){e===rn.Cdata[this.sequenceIndex]?++this.sequenceIndex===rn.Cdata.length&&(this.state=ze.InCommentLike,this.currentSequence=rn.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.xmlMode?(this.state=ze.InDeclaration,this.stateInDeclaration(e)):(this.state=ze.InSpecialComment,this.stateInSpecialComment(e)))}fastForwardTo(e){for(;++this.index<this.buffer.length+this.offset;)if(this.buffer.charCodeAt(this.index-this.offset)===e)return!0;return this.index=this.buffer.length+this.offset-1,!1}emitComment(e){this.cbs.oncomment(this.sectionStart,this.index,e),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=ze.Text}stateInCommentLike(e){!this.xmlMode&&this.currentSequence===rn.CommentEnd&&this.sequenceIndex<=1&&this.index===this.sectionStart+this.sequenceIndex&&e===Nt.Gt?this.emitComment(this.sequenceIndex):this.currentSequence===rn.CommentEnd&&this.sequenceIndex===2&&e===Nt.Gt?this.emitComment(2):this.currentSequence===rn.CommentEnd&&this.sequenceIndex===this.currentSequence.length-1&&e!==Nt.Gt?this.sequenceIndex=+(e===Nt.Dash):e===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===rn.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index,2):this.cbs.oncomment(this.sectionStart,this.index,3),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=ze.Text):this.sequenceIndex===0?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):e!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}isTagStartChar(e){return this.xmlMode?!Rp(e):G1e(e)}stateInSpecialTag(e){if(this.sequenceIndex===this.currentSequence.length){if(Rp(e)){const n=this.index-this.currentSequence.length;if(this.sectionStart<n){const i=this.index;this.index=n,this.cbs.ontext(this.sectionStart,n),this.index=i}this.isSpecial=!1,this.sectionStart=n+2,this.stateInClosingTagName(e);return}this.sequenceIndex=0}(e|32)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:this.sequenceIndex===0?this.currentSequence===rn.TitleEnd||this.currentSequence===rn.TextareaEnd?this.decodeEntities&&e===Nt.Amp&&this.startEntity():this.fastForwardTo(Nt.Lt)&&(this.sequenceIndex=1):this.sequenceIndex=+(e===Nt.Lt)}stateBeforeTagName(e){var n,i;if(e===Nt.ExclamationMark)this.state=ze.BeforeDeclaration,this.sectionStart=this.index+1;else if(e===Nt.Questionmark)this.xmlMode?(this.state=ze.InProcessingInstruction,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.state=ze.InSpecialComment,this.sectionStart=this.index);else if(this.isTagStartChar(e)){this.sectionStart=this.index;const r=this.xmlMode||(i=(n=this.cbs).isInForeignContext)!=null&&i.call(n)?void 0:X1e.get(e|32);r===void 0?this.state=ze.InTagName:(this.isSpecial=!0,this.currentSequence=r,this.sequenceIndex=3,this.state=ze.SpecialStartSequence)}else e===Nt.Slash?this.state=ze.BeforeClosingTagName:(this.state=ze.Text,this.stateText(e))}stateInTagName(e){Rp(e)&&(this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=ze.BeforeAttributeName,this.stateBeforeAttributeName(e))}stateBeforeClosingTagName(e){Xd(e)?this.xmlMode||(this.state=ze.InSpecialComment,this.sectionStart=this.index):e===Nt.Gt?(this.state=ze.Text,this.xmlMode||(this.sectionStart=this.index+1)):(this.state=this.isTagStartChar(e)?ze.InClosingTagName:ze.InSpecialComment,this.sectionStart=this.index)}stateInClosingTagName(e){Rp(e)&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=ze.AfterClosingTagName,this.stateAfterClosingTagName(e))}stateAfterClosingTagName(e){(e===Nt.Gt||this.fastForwardTo(Nt.Gt))&&(this.state=ze.Text,this.sectionStart=this.index+1)}stateBeforeAttributeName(e){e===Nt.Gt?(this.cbs.onopentagend(this.index),this.enterTagBody(),this.sectionStart=this.index+1):e===Nt.Slash?this.state=ze.InSelfClosingTag:Xd(e)||(this.state=ze.InAttributeName,this.sectionStart=this.index)}stateInSelfClosingTag(e){if(e===Nt.Gt){if(this.cbs.onselfclosingtag(this.index),this.sectionStart=this.index+1,!this.recognizeSelfClosing){this.enterTagBody();return}this.state=ze.Text,this.isSpecial=!1,this.currentSequence=rn.Empty}else Xd(e)||(this.state=ze.BeforeAttributeName,this.stateBeforeAttributeName(e))}stateInAttributeName(e){(e===Nt.Eq||Rp(e))&&(this.cbs.onattribname(this.sectionStart,this.index),this.sectionStart=this.index,this.state=ze.AfterAttributeName,this.stateAfterAttributeName(e))}stateAfterAttributeName(e){e===Nt.Eq?this.state=ze.BeforeAttributeValue:e===Nt.Slash||e===Nt.Gt?(this.cbs.onattribend(sl.NoValue,this.sectionStart),this.sectionStart=-1,this.state=ze.BeforeAttributeName,this.stateBeforeAttributeName(e)):Xd(e)||(this.cbs.onattribend(sl.NoValue,this.sectionStart),this.state=ze.InAttributeName,this.sectionStart=this.index)}stateBeforeAttributeValue(e){e===Nt.DoubleQuote?(this.state=ze.InAttributeValueDq,this.sectionStart=this.index+1):e===Nt.SingleQuote?(this.state=ze.InAttributeValueSq,this.sectionStart=this.index+1):Xd(e)||(this.sectionStart=this.index,this.state=ze.InAttributeValueNq,this.stateInAttributeValueNoQuotes(e))}handleInAttributeValue(e,n){e===n||!this.decodeEntities&&this.fastForwardTo(n)?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(n===Nt.DoubleQuote?sl.Double:sl.Single,this.index+1),this.state=ze.BeforeAttributeName):this.decodeEntities&&e===Nt.Amp&&this.startEntity()}stateInAttributeValueDoubleQuotes(e){this.handleInAttributeValue(e,Nt.DoubleQuote)}stateInAttributeValueSingleQuotes(e){this.handleInAttributeValue(e,Nt.SingleQuote)}stateInAttributeValueNoQuotes(e){Xd(e)||e===Nt.Gt?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(sl.Unquoted,this.index),this.state=ze.BeforeAttributeName,this.stateBeforeAttributeName(e)):this.decodeEntities&&e===Nt.Amp&&this.startEntity()}stateBeforeDeclaration(e){e===Nt.OpeningSquareBracket?(this.state=ze.CDATASequence,this.sequenceIndex=0):this.xmlMode?this.state=e===Nt.Dash?ze.BeforeComment:ze.InDeclaration:(e|32)===rn.Doctype[0]?(this.state=ze.DeclarationSequence,this.currentSequence=rn.Doctype,this.sequenceIndex=1):e===Nt.Gt?(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=ze.Text,this.sectionStart=this.index+1):e===Nt.Dash?this.state=ze.BeforeComment:this.state=ze.InSpecialComment}stateDeclarationSequence(e){this.sequenceIndex===this.currentSequence.length?(this.state=ze.InDeclaration,this.stateInDeclaration(e)):(e|32)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:e===Nt.Gt?(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=ze.Text,this.sectionStart=this.index+1):this.state=ze.InSpecialComment}stateInDeclaration(e){(e===Nt.Gt||this.fastForwardTo(Nt.Gt))&&(this.cbs.ondeclaration(this.sectionStart,this.index),this.state=ze.Text,this.sectionStart=this.index+1)}stateInProcessingInstruction(e){e===Nt.Questionmark?this.sequenceIndex=1:e===Nt.Gt&&this.sequenceIndex===1?(this.cbs.onprocessinginstruction(this.sectionStart,this.index-1),this.sequenceIndex=0,this.state=ze.Text,this.sectionStart=this.index+1):this.sequenceIndex=Number(this.fastForwardTo(Nt.Questionmark))}stateBeforeComment(e){e===Nt.Dash?(this.state=ze.InCommentLike,this.currentSequence=rn.CommentEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):this.xmlMode?this.state=ze.InDeclaration:e===Nt.Gt?(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=ze.Text,this.sectionStart=this.index+1):this.state=ze.InSpecialComment}stateInSpecialComment(e){(e===Nt.Gt||this.fastForwardTo(Nt.Gt))&&(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=ze.Text,this.sectionStart=this.index+1)}startEntity(){this.baseState=this.state,this.state=ze.InEntity,this.entityStart=this.index,this.entityDecoder.startEntity(this.xmlMode?ec.Strict:this.baseState===ze.Text||this.baseState===ze.InSpecialTag?ec.Legacy:ec.Attribute)}stateInEntity(){const e=this.index-this.offset,n=this.entityDecoder.write(this.buffer,e);if(n>=0)this.state=this.baseState,n===0&&(this.index-=1);else{if(e<this.buffer.length&&this.buffer.charCodeAt(e)===Nt.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===ze.Text||this.state===ze.InPlainText||this.state===ze.InSpecialTag&&this.sequenceIndex===0?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):(this.state===ze.InAttributeValueDq||this.state===ze.InAttributeValueSq||this.state===ze.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 e=this.buffer.charCodeAt(this.index-this.offset);switch(this.state){case ze.Text:{this.stateText(e);break}case ze.InPlainText:{this.index=this.buffer.length+this.offset-1;break}case ze.SpecialStartSequence:{this.stateSpecialStartSequence(e);break}case ze.InSpecialTag:{this.stateInSpecialTag(e);break}case ze.CDATASequence:{this.stateCDATASequence(e);break}case ze.DeclarationSequence:{this.stateDeclarationSequence(e);break}case ze.InAttributeValueDq:{this.stateInAttributeValueDoubleQuotes(e);break}case ze.InAttributeName:{this.stateInAttributeName(e);break}case ze.InCommentLike:{this.stateInCommentLike(e);break}case ze.InSpecialComment:{this.stateInSpecialComment(e);break}case ze.BeforeAttributeName:{this.stateBeforeAttributeName(e);break}case ze.InTagName:{this.stateInTagName(e);break}case ze.InClosingTagName:{this.stateInClosingTagName(e);break}case ze.BeforeTagName:{this.stateBeforeTagName(e);break}case ze.AfterAttributeName:{this.stateAfterAttributeName(e);break}case ze.InAttributeValueSq:{this.stateInAttributeValueSingleQuotes(e);break}case ze.BeforeAttributeValue:{this.stateBeforeAttributeValue(e);break}case ze.BeforeClosingTagName:{this.stateBeforeClosingTagName(e);break}case ze.AfterClosingTagName:{this.stateAfterClosingTagName(e);break}case ze.InAttributeValueNq:{this.stateInAttributeValueNoQuotes(e);break}case ze.InSelfClosingTag:{this.stateInSelfClosingTag(e);break}case ze.InDeclaration:{this.stateInDeclaration(e);break}case ze.BeforeDeclaration:{this.stateBeforeDeclaration(e);break}case ze.BeforeComment:{this.stateBeforeComment(e);break}case ze.InProcessingInstruction:{this.stateInProcessingInstruction(e);break}case ze.InEntity:{this.stateInEntity();break}}this.index++}this.cleanup()}finish(){this.state===ze.InEntity&&(this.entityDecoder.end(),this.state=this.baseState),this.handleTrailingData(),this.cbs.onend()}handleTrailingCommentLikeData(e){if(this.state!==ze.InCommentLike)return!1;if(this.currentSequence===rn.CdataEnd)if(this.xmlMode)this.sectionStart<e&&this.cbs.oncdata(this.sectionStart,e,0);else{const n=this.sectionStart-rn.Cdata.length-1;this.cbs.oncomment(n,e,0)}else{const n=this.xmlMode?0:Math.min(this.sequenceIndex,rn.CommentEnd.length-1);this.cbs.oncomment(this.sectionStart,e,n)}return!0}handleTrailingMarkupDeclaration(e){if(this.xmlMode)switch(this.state){case ze.InSpecialComment:case ze.BeforeComment:case ze.CDATASequence:case ze.DeclarationSequence:case ze.InDeclaration:return this.cbs.ontext(this.sectionStart,e),!0;default:return!1}switch(this.state){case ze.BeforeDeclaration:case ze.InSpecialComment:case ze.BeforeComment:case ze.CDATASequence:return this.cbs.oncomment(this.sectionStart,e,0),!0;case ze.DeclarationSequence:return this.sequenceIndex!==rn.Doctype.length&&this.cbs.oncomment(this.sectionStart,e,0),!0;case ze.InDeclaration:return!0;default:return!1}}handleTrailingData(){const e=this.buffer.length+this.offset;if(!(this.handleTrailingCommentLikeData(e)||this.handleTrailingMarkupDeclaration(e))&&!(this.sectionStart>=e))switch(this.state){case ze.InTagName:case ze.BeforeAttributeName:case ze.BeforeAttributeValue:case ze.AfterAttributeName:case ze.InAttributeName:case ze.InAttributeValueSq:case ze.InAttributeValueDq:case ze.InAttributeValueNq:case ze.InClosingTagName:break;default:this.cbs.ontext(this.sectionStart,e)}}emitCodePoint(e,n){this.baseState!==ze.Text&&this.baseState!==ze.InSpecialTag?(this.sectionStart<this.entityStart&&this.cbs.onattribdata(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+n,this.index=this.sectionStart-1,this.cbs.onattribentity(e)):(this.sectionStart<this.entityStart&&this.cbs.ontext(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+n,this.index=this.sectionStart-1,this.cbs.ontextentity(e,this.sectionStart))}}const{fromCodePoint:z6}=String,Dp=new Set(["input","option","optgroup","select","button","datalist","textarea"]),or=new Set(["p"]),Np=new Set(["h1","h2","h3","h4","h5","h6","p"]),H6=new Set(["thead","tbody"]),q6=new Set(["dd","dt"]),Q6=new Set(["rt","rp"]),K1e=new Map([["tr",new Set(["tr","th","td"])],["th",new Set(["th"])],["td",new Set(["thead","th","td"])],["body",new Set(["head","link","script"])],["a",new Set(["a"])],["li",new Set(["li"])],["p",or],["h1",Np],["h2",Np],["h3",Np],["h4",Np],["h5",Np],["h6",Np],["select",Dp],["input",Dp],["output",Dp],["button",Dp],["datalist",Dp],["textarea",Dp],["option",new Set(["option"])],["optgroup",new Set(["optgroup","option"])],["dd",q6],["dt",q6],["address",or],["article",or],["aside",or],["blockquote",or],["details",or],["div",or],["dl",or],["fieldset",or],["figcaption",or],["figure",or],["footer",or],["form",or],["header",or],["hr",or],["main",or],["nav",or],["ol",or],["pre",or],["section",or],["table",or],["ul",or],["rt",Q6],["rp",Q6],["tbody",H6],["tfoot",H6]]),Y6="doctype",Z1e=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]),J1e=new Set(["math","svg"]),W6=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"]),U6=new Map([["altglyph","altGlyph"],["altglyphdef","altGlyphDef"],["altglyphitem","altGlyphItem"],["animatecolor","animateColor"],["animatemotion","animateMotion"],["animatetransform","animateTransform"],["clippath","clipPath"],["feblend","feBlend"],["fecolormatrix","feColorMatrix"],["fecomponenttransfer","feComponentTransfer"],["fecomposite","feComposite"],["feconvolvematrix","feConvolveMatrix"],["fediffuselighting","feDiffuseLighting"],["fedisplacementmap","feDisplacementMap"],["fedistantlight","feDistantLight"],["fedropshadow","feDropShadow"],["feflood","feFlood"],["fefunca","feFuncA"],["fefuncb","feFuncB"],["fefuncg","feFuncG"],["fefuncr","feFuncR"],["fegaussianblur","feGaussianBlur"],["feimage","feImage"],["femerge","feMerge"],["femergenode","feMergeNode"],["femorphology","feMorphology"],["feoffset","feOffset"],["fepointlight","fePointLight"],["fespecularlighting","feSpecularLighting"],["fespotlight","feSpotLight"],["fetile","feTile"],["feturbulence","feTurbulence"],["foreignobject","foreignObject"],["glyphref","glyphRef"],["lineargradient","linearGradient"],["radialgradient","radialGradient"],["textpath","textPath"]]);var Jc;(function(t){t[t.None=0]="None",t[t.Svg=1]="Svg",t[t.MathML=2]="MathML"})(Jc||(Jc={}));const ewe=/\s|\//;class PD{constructor(e,n={}){Ke(this,"options");Ke(this,"startIndex",0);Ke(this,"endIndex",0);Ke(this,"openTagStart",0);Ke(this,"tagname","");Ke(this,"attribname","");Ke(this,"attribvalue","");Ke(this,"attribs",null);Ke(this,"stack",[]);Ke(this,"foreignContext");Ke(this,"cbs");Ke(this,"lowerCaseTagNames");Ke(this,"lowerCaseAttributeNames");Ke(this,"recognizeSelfClosing");Ke(this,"htmlMode");Ke(this,"tokenizer");Ke(this,"buffers",[]);Ke(this,"bufferOffset",0);Ke(this,"writeIndex",0);Ke(this,"ended",!1);var i,r;this.options=n,this.cbs=e??{},this.htmlMode=!this.options.xmlMode,this.lowerCaseTagNames=n.lowerCaseTags??this.htmlMode,this.lowerCaseAttributeNames=n.lowerCaseAttributeNames??this.htmlMode,this.recognizeSelfClosing=n.recognizeSelfClosing??!this.htmlMode,this.tokenizer=new(n.Tokenizer??MU)(this.options,this),this.foreignContext=[Jc.None],(r=(i=this.cbs).onparserinit)==null||r.call(i,this)}ontext(e,n){var r,s;const i=this.getSlice(e,n);this.endIndex=n-1,(s=(r=this.cbs).ontext)==null||s.call(r,i),this.startIndex=n}ontextentity(e,n){var i,r;this.endIndex=n-1,(r=(i=this.cbs).ontext)==null||r.call(i,z6(e)),this.startIndex=n}isInForeignContext(){return this.foreignContext[0]!==Jc.None}isVoidElement(e){return this.htmlMode&&Z1e.has(e)}readTagName(e,n){const i=this.lowerCaseTagNames?this.getSlice(e,n).toLowerCase():this.getSlice(e,n);if(!(this.lowerCaseTagNames&&this.htmlMode))return i;if(this.foreignContext[0]===Jc.Svg)return U6.get(i)??i;if(this.foreignContext.length>1){const r=U6.get(i);if(r!==void 0&&this.stack.includes(r))return r}return this.isInForeignContext()?i:i==="image"?"img":i}onopentagname(e,n){this.endIndex=n,this.emitOpenTag(this.readTagName(e,n))}emitOpenTag(e){var i,r;if(this.openTagStart=this.startIndex,this.tagname=e,this.htmlMode&&e==="form"&&this.stack.includes("form")){this.tagname="";return}const n=this.htmlMode&&K1e.get(e);if(n)for(;this.stack.length>0&&n.has(this.stack[0]);)this.popElement(!0);this.isVoidElement(e)||(this.stack.unshift(e),this.htmlMode&&(e==="svg"?this.foreignContext.unshift(Jc.Svg):e==="math"?this.foreignContext.unshift(Jc.MathML):W6.has(e)&&this.foreignContext.unshift(Jc.None))),(r=(i=this.cbs).onopentagname)==null||r.call(i,e),this.cbs.onopentag&&(this.attribs={})}endOpenTag(e){var n,i;this.startIndex=this.openTagStart,this.attribs&&((i=(n=this.cbs).onopentag)==null||i.call(n,this.tagname,this.attribs,e),this.attribs=null),this.cbs.onclosetag&&this.isVoidElement(this.tagname)&&this.cbs.onclosetag(this.tagname,!0),this.tagname=""}onopentagend(e){this.endIndex=e,this.endOpenTag(!1),this.startIndex=e+1}onclosetag(e,n){var r,s,a,l,u,d;this.endIndex=n;const i=this.readTagName(e,n);if(this.isVoidElement(i))this.htmlMode&&i==="br"&&((s=(r=this.cbs).onopentagname)==null||s.call(r,"br"),(l=(a=this.cbs).onopentag)==null||l.call(a,"br",{},!0),(d=(u=this.cbs).onclosetag)==null||d.call(u,"br",!1));else{const f=this.stack.indexOf(i);if(f!==-1){for(let p=0;p<f;p++)this.popElement(!0);this.popElement(!1)}else this.htmlMode&&i==="p"&&(this.emitOpenTag("p"),this.closeCurrentTag(!0))}this.startIndex=n+1}onselfclosingtag(e){this.endIndex=e,this.recognizeSelfClosing||this.isInForeignContext()?(this.closeCurrentTag(!1),this.startIndex=e+1):this.onopentagend(e)}popElement(e){var i,r;const n=this.stack.shift();this.htmlMode&&(J1e.has(n)||W6.has(n))&&this.foreignContext.shift(),(r=(i=this.cbs).onclosetag)==null||r.call(i,n,e)}closeCurrentTag(e){const n=this.tagname;this.endOpenTag(e),this.stack[0]===n&&this.popElement(!e)}onattribname(e,n){this.startIndex=e;const i=this.getSlice(e,n);this.attribname=this.lowerCaseAttributeNames?i.toLowerCase():i}onattribdata(e,n){this.attribvalue+=this.getSlice(e,n)}onattribentity(e){this.attribvalue+=z6(e)}onattribend(e,n){var i,r;this.endIndex=n,(r=(i=this.cbs).onattribute)==null||r.call(i,this.attribname,this.attribvalue,e===sl.Double?'"':e===sl.Single?"'":e===sl.NoValue?void 0:null),this.attribs&&!Object.hasOwn(this.attribs,this.attribname)&&(this.attribs[this.attribname]=this.attribvalue),this.attribvalue=""}getInstructionName(e){const n=e.search(ewe);let i=n<0?e:e.substr(0,n);return this.lowerCaseTagNames&&(i=i.toLowerCase()),i}ondeclaration(e,n){this.endIndex=n;const i=this.getSlice(e,n);if(this.cbs.onprocessinginstruction){const r=this.htmlMode?this.lowerCaseTagNames?Y6:i.slice(0,Y6.length):this.getInstructionName(i);this.cbs.onprocessinginstruction(`!${r}`,`!${i}`)}this.startIndex=n+1}onprocessinginstruction(e,n){this.endIndex=n;const i=this.getSlice(e,n);if(this.cbs.onprocessinginstruction){const r=this.getInstructionName(i);this.cbs.onprocessinginstruction(`?${r}`,`?${i}`)}this.startIndex=n+1}oncomment(e,n,i){var r,s,a,l;this.endIndex=n,(s=(r=this.cbs).oncomment)==null||s.call(r,this.getSlice(e,n-i)),(l=(a=this.cbs).oncommentend)==null||l.call(a),this.startIndex=n+1}oncdata(e,n,i){var s,a,l,u,d,f,p,m,v,y,b,A;this.endIndex=n;const r=this.getSlice(e,n-i);!this.htmlMode||this.options.recognizeCDATA?((a=(s=this.cbs).oncdatastart)==null||a.call(s),(u=(l=this.cbs).ontext)==null||u.call(l,r),(f=(d=this.cbs).oncdataend)==null||f.call(d)):this.isInForeignContext()?(m=(p=this.cbs).ontext)==null||m.call(p,r):((y=(v=this.cbs).oncomment)==null||y.call(v,`[CDATA[${r}]]`),(A=(b=this.cbs).oncommentend)==null||A.call(b)),this.startIndex=n+1}onend(){var e,n;if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(let i=0;i<this.stack.length;i++)this.cbs.onclosetag(this.stack[i],!0)}(n=(e=this.cbs).onend)==null||n.call(e)}reset(){var e,n,i,r;(n=(e=this.cbs).onreset)==null||n.call(e),this.tokenizer.reset(),this.tagname="",this.attribname="",this.attribvalue="",this.attribs=null,this.stack.length=0,this.startIndex=0,this.endIndex=0,(r=(i=this.cbs).onparserinit)==null||r.call(i,this),this.buffers.length=0,this.foreignContext.length=0,this.foreignContext.unshift(Jc.None),this.bufferOffset=0,this.writeIndex=0,this.ended=!1}parseComplete(e){this.reset(),this.end(e)}getSlice(e,n){if(e===n)return"";for(;e-this.bufferOffset>=this.buffers[0].length;)this.shiftBuffer();let i=this.buffers[0].slice(e-this.bufferOffset,n-this.bufferOffset);for(;n-this.bufferOffset>this.buffers[0].length;)this.shiftBuffer(),i+=this.buffers[0].slice(0,n-this.bufferOffset);return i}shiftBuffer(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()}write(e){var n,i;if(this.ended){(i=(n=this.cbs).onerror)==null||i.call(n,new Error(".write() after done!"));return}this.buffers.push(e),this.tokenizer.running&&(this.tokenizer.write(e),this.writeIndex++)}end(e){var n,i;if(this.ended){(i=(n=this.cbs).onerror)==null||i.call(n,new Error(".end() after done!"));return}e&&this.write(e),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()}}var Hn;(function(t){t.Root="root",t.Text="text",t.Directive="directive",t.Comment="comment",t.Script="script",t.Style="style",t.Tag="tag",t.CDATA="cdata",t.Doctype="doctype"})(Hn||(Hn={}));function RU(t){return t.type===Hn.Tag||t.type===Hn.Script||t.type===Hn.Style}const DU=Hn.Root,NU=Hn.Text,IU=Hn.Directive,BU=Hn.Comment,LU=Hn.Script,PU=Hn.Style,FU=Hn.Tag,$U=Hn.CDATA,twe=Hn.Doctype,nwe=Object.freeze(Object.defineProperty({__proto__:null,CDATA:$U,Comment:BU,Directive:IU,Doctype:twe,get ElementType(){return Hn},Root:DU,Script:LU,Style:PU,Tag:FU,Text:NU,isTag:RU},Symbol.toStringTag,{value:"Module"}));let zU=class{constructor(){Ke(this,"parent",null);Ke(this,"prev",null);Ke(this,"next",null);Ke(this,"startIndex",null);Ke(this,"endIndex",null)}get parentNode(){return this.parent}set parentNode(e){this.parent=e}get previousSibling(){return this.prev}set previousSibling(e){this.prev=e}get nextSibling(){return this.next}set nextSibling(e){this.next=e}cloneNode(e=!1){return UU(this,e)}};class FD extends zU{constructor(n){super();Ke(this,"data");this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n}}class yE extends FD{constructor(){super(...arguments);Ke(this,"type",Hn.Text)}get nodeType(){return 3}}class HU extends FD{constructor(){super(...arguments);Ke(this,"type",Hn.Comment)}get nodeType(){return 8}}class qU extends FD{constructor(n,i){super(i);Ke(this,"type",Hn.Directive);Ke(this,"name");Ke(this,"x-name");Ke(this,"x-publicId");Ke(this,"x-systemId");this.name=n}get nodeType(){return 1}}class $D extends zU{constructor(n){super();Ke(this,"children");this.children=n}get firstChild(){return this.children[0]??null}get lastChild(){return this.children.length>0?this.children[this.children.length-1]:null}get childNodes(){return this.children}set childNodes(n){this.children=n}}class QU extends $D{constructor(){super(...arguments);Ke(this,"type",Hn.CDATA)}get nodeType(){return 4}}let xE=class extends $D{constructor(){super(...arguments);Ke(this,"type",Hn.Root)}get nodeType(){return 9}},YU=class extends $D{constructor(n,i,r=[],s=n==="script"?Hn.Script:n==="style"?Hn.Style:Hn.Tag){super(r);Ke(this,"name");Ke(this,"attribs");Ke(this,"type");Ke(this,"namespace");Ke(this,"x-attribsNamespace");Ke(this,"x-attribsPrefix");this.name=n,this.attribs=i,this.type=s}get nodeType(){return 1}get tagName(){return this.name}set tagName(n){this.name=n}get attributes(){return Object.keys(this.attribs).map(n=>{var i,r;return{name:n,value:this.attribs[n],namespace:(i=this["x-attribsNamespace"])==null?void 0:i[n],prefix:(r=this["x-attribsPrefix"])==null?void 0:r[n]}})}};function Ea(t){return RU(t)}function zD(t){return t.type===Hn.CDATA}function rg(t){return t.type===Hn.Text}function WU(t){return t.type===Hn.Comment}function iwe(t){return t.type===Hn.Directive}function rwe(t){return t.type===Hn.Root}function pc(t){return Object.hasOwn(t,"children")}function UU(t,e=!1){let n;if(rg(t))n=new yE(t.data);else if(WU(t))n=new HU(t.data);else if(Ea(t)){const i=e?pT(t.children):[],r=new YU(t.name,{...t.attribs},i);for(const s of i)s.parent=r;t.namespace!=null&&(r.namespace=t.namespace),t["x-attribsNamespace"]&&(r["x-attribsNamespace"]={...t["x-attribsNamespace"]}),t["x-attribsPrefix"]&&(r["x-attribsPrefix"]={...t["x-attribsPrefix"]}),n=r}else if(zD(t)){const i=e?pT(t.children):[],r=new QU(i);for(const s of i)s.parent=r;n=r}else if(rwe(t)){const i=e?pT(t.children):[],r=new xE(i);for(const s of i)s.parent=r;t["x-mode"]&&(r["x-mode"]=t["x-mode"]),n=r}else if(iwe(t)){const i=new qU(t.name,t.data);t["x-name"]!=null&&(i["x-name"]=t["x-name"],i["x-publicId"]=t["x-publicId"],i["x-systemId"]=t["x-systemId"]),n=i}else throw new Error(`Not implemented yet: ${t.type}`);return n.startIndex=t.startIndex,n.endIndex=t.endIndex,t.sourceCodeLocation!=null&&(n.sourceCodeLocation=t.sourceCodeLocation),n}function pT(t){const e=t.map(n=>UU(n,!0));for(let n=1;n<e.length;n++)e[n].prev=e[n-1],e[n-1].next=e[n];return e}const V6={withStartIndices:!1,withEndIndices:!1,xmlMode:!1};class bw{constructor(e,n,i){Ke(this,"dom",[]);Ke(this,"root",new xE(this.dom));Ke(this,"callback");Ke(this,"options");Ke(this,"elementCB");Ke(this,"done",!1);Ke(this,"tagStack",[this.root]);Ke(this,"lastNode",null);Ke(this,"parser",null);typeof n=="function"&&(i=n,n=V6),typeof e=="object"&&(n=e,e=void 0),this.callback=e??null,this.options=n??V6,this.elementCB=i??null}onparserinit(e){this.parser=e}onreset(){this.dom=[],this.root=new xE(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null}onend(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))}onerror(e){this.handleCallback(e)}onclosetag(){this.lastNode=null;const e=this.tagStack.pop();this.options.withEndIndices&&this.parser&&(e.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(e)}onopentag(e,n){const i=this.options.xmlMode?Hn.Tag:void 0,r=new YU(e,n,void 0,i);this.addNode(r),this.tagStack.push(r)}ontext(e){const{lastNode:n}=this;if(n&&n.type===Hn.Text)n.data+=e,this.options.withEndIndices&&this.parser&&(n.endIndex=this.parser.endIndex);else{const i=new yE(e);this.addNode(i),this.lastNode=i}}oncomment(e){if(this.lastNode&&this.lastNode.type===Hn.Comment){this.lastNode.data+=e;return}const n=new HU(e);this.addNode(n),this.lastNode=n}oncommentend(){this.lastNode=null}oncdatastart(){const e=new yE(""),n=new QU([e]);this.addNode(n),e.parent=n,this.lastNode=e}oncdataend(){this.lastNode=null}onprocessinginstruction(e,n){const i=new qU(e,n);this.addNode(i)}handleCallback(e){if(typeof this.callback=="function")this.callback(e,this.dom);else if(e)throw e}addNode(e){const n=this.tagStack[this.tagStack.length-1],i=n.children[n.children.length-1];this.options.withStartIndices&&this.parser&&(e.startIndex=this.parser.startIndex),this.options.withEndIndices&&this.parser&&(e.endIndex=this.parser.endIndex),n.children.push(e),i&&(e.prev=i,i.next=e),e.parent=n,this.lastNode=null}}function cx(t,e,n=!0,i=Number.POSITIVE_INFINITY){return VU(t,Array.isArray(e)?e:[e],n,i)}function VU(t,e,n,i){const r=[],s=[Array.isArray(e)?e:[e]],a=[0];for(;;){if(a[0]>=s[0].length){if(a.length===1)return r;s.shift(),a.shift();continue}const l=s[0][a[0]++];if(t(l)&&(r.push(l),--i<=0))return r;n&&pc(l)&&l.children.length>0&&(a.unshift(0),s.unshift(l.children))}}function HD(t,e,n=!0){const i=Array.isArray(e)?e:[e];for(const r of i){if(Ea(r)&&t(r))return r;if(n&&pc(r)&&r.children.length>0){const s=HD(t,r.children,!0);if(s)return s}}return null}function GU(t,e){return(Array.isArray(e)?e:[e]).some(n=>Ea(n)&&t(n)||pc(n)&&GU(t,n.children))}function swe(t,e){const n=[],i=[Array.isArray(e)?e:[e]],r=[0];for(;;){if(r[0]>=i[0].length){if(i.length===1)return n;i.shift(),r.shift();continue}const s=i[0][r[0]++];Ea(s)&&t(s)&&n.push(s),pc(s)&&s.children.length>0&&(r.unshift(0),i.unshift(s.children))}}const Aw={tag_name(t){return typeof t=="function"?e=>Ea(e)&&t(e.name):t==="*"?Ea:e=>Ea(e)&&e.name===t},tag_type(t){return typeof t=="function"?e=>t(e.type):e=>e.type===t},tag_contains(t){return typeof t=="function"?e=>rg(e)&&t(e.data):e=>rg(e)&&e.data===t}};function qD(t,e){return typeof e=="function"?n=>Ea(n)&&e(n.attribs[t]):n=>Ea(n)&&n.attribs[t]===e}function owe(t,e){return n=>t(n)||e(n)}function XU(t){const e=Object.keys(t).map(n=>{const i=t[n];return Object.hasOwn(Aw,n)?Aw[n](i):qD(n,i)});return e.length===0?null:e.reduce(owe)}function awe(t,e){const n=XU(t);return n?n(e):!0}function lwe(t,e,n,i=Number.POSITIVE_INFINITY){const r=XU(t);return r?cx(r,e,n,i):[]}function cwe(t,e,n=!0){return Array.isArray(e)||(e=[e]),HD(qD("id",t),e,n)}function Rg(t,e,n=!0,i=Number.POSITIVE_INFINITY){return cx(Aw.tag_name(t),e,n,i)}function uwe(t,e,n=!0,i=Number.POSITIVE_INFINITY){return cx(qD("class",t),e,n,i)}function hwe(t,e,n=!0,i=Number.POSITIVE_INFINITY){return cx(Aw.tag_type(t),e,n,i)}const dwe=new Map([[34,"&quot;"],[38,"&amp;"],[39,"&apos;"],[60,"&lt;"],[62,"&gt;"]]),fwe=typeof String.prototype.codePointAt=="function"?(t,e)=>t.codePointAt(e):(t,e)=>(t.charCodeAt(e)&64512)===55296?(t.charCodeAt(e)-55296)*1024+t.charCodeAt(e+1)-56320+65536:t.charCodeAt(e),pwe=1342177476;function KU(t){let e,n=0;const{length:i}=t;for(let r=0;r<i;r++){const s=t.charCodeAt(r);if(s<128&&((pwe>>>s&1)===0||s>=64||s<32))continue;if(e===void 0?e=t.substring(0,r):n!==r&&(e+=t.substring(n,r)),s<64){e+=dwe.get(s),n=r+1;continue}const a=fwe(t,r);e+=`&#x${a.toString(16)};`,a!==s&&r++,n=r+1}return e===void 0?t:(n<i&&(e+=t.substr(n)),e)}function ZU(t,e){return function(i){let r,s=0,a="";for(;r=t.exec(i);)s!==r.index&&(a+=i.substring(s,r.index)),a+=e.get(r[0].charCodeAt(0)),s=r.index+1;return a+i.substring(s)}}const mwe=ZU(/["&\u00A0]/g,new Map([[34,"&quot;"],[38,"&amp;"],[160,"&nbsp;"]])),gwe=ZU(/[&<>\u00A0]/g,new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[160,"&nbsp;"]])),vwe=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".split(" ").map(t=>[t.toLowerCase(),t])),ywe=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".split(" ").map(t=>[t.toLowerCase(),t])),xwe=new Set("style script xmp iframe noembed noframes plaintext noscript".split(" ")),bwe=new Set("area base basefont br col command embed frame hr img input isindex keygen link meta param source track wbr".split(" ")),Awe=new Set(["svg","math"]),wwe=new Set("mi mo mn ms mtext annotation-xml foreignObject desc title".split(" "));function Swe(t,e={}){const n="length"in t?t:[t],i=e.xmlMode??!1;let r="";for(let s=0;s<n.length;s++)r+=eV(n[s],e,i);return r}function JU(t,e,n){let i="";for(let r=0;r<t.length;r++)i+=eV(t[r],e,n);return i}function eV(t,e,n){switch(t.type){case DU:return JU(t.children,e,n);case IU:return`<${t.data}>`;case BU:return`<!--${t.data}-->`;case $U:return`<![CDATA[${t.children[0].data}]]>`;case LU:case PU:case FU:return jwe(t,e,n);case NU:{const i=t,r=i.data||"";return(e.encodeEntities??e.decodeEntities)!==!1&&!(!n&&i.parent&&xwe.has(i.parent.name))?n||e.encodeEntities!=="utf8"?KU(r):gwe(r):r}}}function jwe(t,e,n){n==="foreign"&&(t.name=vwe.get(t.name)??t.name,t.parent&&wwe.has(t.parent.name)&&(n=!1)),!n&&Awe.has(t.name)&&(n="foreign");const{name:i,children:r}=t,s=!n&&bwe.has(i);let a=`<${i}${_we(t.attribs,e,n)}`;return r.length===0&&(n?e.selfClosingTags!==!1:e.selfClosingTags&&s)?a+=n?"/>":" />":(a+=">",r.length>0&&(a+=JU(r,e,n)),s||(a+=`</${i}>`)),a}function Cwe(t){return t.replaceAll('"',"&quot;")}function _we(t,e,n){if(!t)return"";const i=(e.encodeEntities??e.decodeEntities)===!1?Cwe:n||e.encodeEntities!=="utf8"?KU:mwe,r=n==="foreign",s=!!(e.emptyAttrs??n);let a="";for(const l in t){if(!Object.hasOwn(t,l))continue;const u=t[l],d=r?ywe.get(l)??l:l;a+=!s&&(u==null||u==="")?` ${d}`:` ${d}="${i(u==null?"":String(u))}"`}return a}function tV(t,e){return Swe(t,e)}function kwe(t,e){return pc(t)?t.children.map(n=>tV(n,e)).join(""):""}function s1(t){return Array.isArray(t)?t.map(s1).join(""):Ea(t)?t.name==="br"?`
`:s1(t.children):zD(t)?s1(t.children):rg(t)?t.data:""}function ww(t){return Array.isArray(t)?t.map(ww).join(""):pc(t)&&!WU(t)?ww(t.children):rg(t)?t.data:""}function bE(t){return Array.isArray(t)?t.map(bE).join(""):pc(t)&&(t.type===Hn.Tag||zD(t))?bE(t.children):rg(t)?t.data:""}function QD(t){const e=Sw(Rwe,t);return e?e.name==="feed"?Twe(e):Owe(e):null}function Twe(t){var s;const e=t.children,n={type:"atom",items:Rg("entry",e).map(a=>{var m;const{children:l}=a,u={media:nV(l)};xo(u,"id","id",l),xo(u,"title","title",l);const d=(m=Sw("link",l))==null?void 0:m.attribs.href;d&&(u.link=d);const f=qh("summary",l)||qh("content",l);f&&(u.description=f);const p=qh("updated",l);return p&&(u.pubDate=new Date(p)),u})};xo(n,"id","id",e),xo(n,"title","title",e);const i=(s=Sw("link",e))==null?void 0:s.attribs.href;i&&(n.link=i),xo(n,"description","subtitle",e);const r=qh("updated",e);return r&&(n.updated=new Date(r)),xo(n,"author","email",e,!0),n}function Owe(t){var r;const e=((r=Sw("channel",t.children))==null?void 0:r.children)??[],n={type:t.name.substr(0,3),id:"",items:Rg("item",t.children).map(s=>{const{children:a}=s,l={media:nV(a)};xo(l,"id","guid",a),xo(l,"title","title",a),xo(l,"link","link",a),xo(l,"description","description",a);const u=qh("pubDate",a)||qh("dc:date",a);return u&&(l.pubDate=new Date(u)),l})};xo(n,"title","title",e),xo(n,"link","link",e),xo(n,"description","description",e);const i=qh("lastBuildDate",e);return i&&(n.updated=new Date(i)),xo(n,"author","managingEditor",e,!0),n}const Ewe=["url","type","lang"],Mwe=["fileSize","bitrate","framerate","samplingrate","channels","duration","height","width"];function nV(t){return Rg("media:content",t).map(e=>{const{attribs:n}=e,i={medium:n.medium,isDefault:!!n.isDefault};for(const r of Ewe)n[r]&&(i[r]=n[r]);for(const r of Mwe)n[r]&&(i[r]=Number.parseInt(n[r],10));return n.expression&&(i.expression=n.expression),i})}function Sw(t,e){return Rg(t,e,!0,1)[0]}function qh(t,e,n=!1){return ww(Rg(t,e,n,1)).trim()}function xo(t,e,n,i,r=!1){const s=qh(n,i,r);s&&(t[e]=s)}function Rwe(t){return t==="rss"||t==="feed"||t==="rdf:RDF"}function Dwe(t){let e=t.length;for(;--e>=0;){const n=t[e];if(e>0&&t.lastIndexOf(n,e-1)>=0){t.splice(e,1);continue}for(let i=n.parent;i;i=i.parent)if(t.includes(i)){t.splice(e,1);break}}return t}var Sa;(function(t){t[t.DISCONNECTED=1]="DISCONNECTED",t[t.PRECEDING=2]="PRECEDING",t[t.FOLLOWING=4]="FOLLOWING",t[t.CONTAINS=8]="CONTAINS",t[t.CONTAINED_BY=16]="CONTAINED_BY"})(Sa||(Sa={}));function iV(t,e){const n=[],i=[];if(t===e)return 0;let r=pc(t)?t:t.parent;for(;r;)n.unshift(r),r=r.parent;for(r=pc(e)?e:e.parent;r;)i.unshift(r),r=r.parent;const s=Math.min(n.length,i.length);let a=0;for(;a<s&&n[a]===i[a];)a++;if(a===0)return Sa.DISCONNECTED;const l=n[a-1],u=l.children,d=n[a],f=i[a];return u.indexOf(d)>u.indexOf(f)?l===e?Sa.FOLLOWING|Sa.CONTAINED_BY:Sa.FOLLOWING:l===t?Sa.PRECEDING|Sa.CONTAINS:Sa.PRECEDING}function Nwe(t){return t=t.filter((e,n,i)=>!i.includes(e,n+1)),t.sort((e,n)=>{const i=iV(e,n);return i&Sa.PRECEDING?-1:i&Sa.FOLLOWING?1:0}),t}function ux(t){if(t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t.parent){const e=t.parent.children,n=e.lastIndexOf(t);n!==-1&&e.splice(n,1)}t.next=null,t.prev=null,t.parent=null}function Iwe(t,e){if(e.prev=t.prev,e.prev&&(e.prev.next=e),e.next=t.next,e.next&&(e.next.prev=e),e.parent=t.parent,e.parent){const{children:n}=e.parent,i=n.lastIndexOf(t);if(i===-1)return;n[i]=e,t.parent=null}}function Bwe(t,e){if(ux(e),e.next=null,e.parent=t,t.children.push(e)>1){const n=t.children[t.children.length-2];n.next=e,e.prev=n}else e.prev=null}function Lwe(t,e){ux(e);const{parent:n}=t,i=t.next;if(e.next=i,e.prev=t,t.next=e,e.parent=n,i){if(i.prev=e,n){const r=n.children;r.splice(r.lastIndexOf(i),0,e)}}else n&&n.children.push(e)}function Pwe(t,e){if(ux(e),e.parent=t,e.prev=null,t.children.unshift(e)===1)e.next=null;else{const n=t.children[1];n.prev=e,e.next=n}}function Fwe(t,e){ux(e);const{parent:n}=t;if(n){const i=n.children;i.splice(i.indexOf(t),0,e)}t.prev&&(t.prev.next=e),e.parent=n,e.prev=t.prev,e.next=t,t.prev=e}function rV(t){return pc(t)?t.children:[]}function sV(t){return t.parent||null}function $we(t){const e=sV(t);if(e!=null)return rV(e);const n=[t];let{prev:i,next:r}=t;for(;i!=null;)n.unshift(i),{prev:i}=i;for(;r!=null;)n.push(r),{next:r}=r;return n}function zwe(t,e){const{attribs:n}=t;return n==null?void 0:n[e]}function Hwe(t,e){const{attribs:n}=t;return n!=null&&Object.hasOwn(n,e)&&n[e]!=null}function qwe(t){return t.name}function Qwe(t){let{next:e}=t;for(;e!==null&&!Ea(e);)({next:e}=e);return e}function Ywe(t){let{prev:e}=t;for(;e!==null&&!Ea(e);)({prev:e}=e);return e}const Wwe=Object.freeze(Object.defineProperty({__proto__:null,get DocumentPosition(){return Sa},append:Lwe,appendChild:Bwe,compareDocumentPosition:iV,existsOne:GU,filter:cx,find:VU,findAll:swe,findOne:HD,getAttributeValue:zwe,getChildren:rV,getElementById:cwe,getElements:lwe,getElementsByClassName:uwe,getElementsByTagName:Rg,getElementsByTagType:hwe,getFeed:QD,getInnerHTML:kwe,getName:qwe,getOuterHTML:tV,getParent:sV,getSiblings:$we,getText:s1,hasAttrib:Hwe,innerText:bE,nextElementSibling:Qwe,prepend:Fwe,prependChild:Pwe,prevElementSibling:Ywe,removeElement:ux,removeSubsets:Dwe,replaceElement:Iwe,testElement:awe,textContent:ww,uniqueSort:Nwe},Symbol.toStringTag,{value:"Module"}));function oV(t,e){const n=new bw(void 0,e);return new PD(n,e).end(t),n.root}function Uwe(t,e,n){const i=new bw(r=>t(r,i.root),e,n);return new PD(i,e)}const Vwe={xmlMode:!0};function Gwe(t,e=Vwe){return QD(oV(t,e).children)}const Xwe=Object.freeze(Object.defineProperty({__proto__:null,DefaultHandler:bw,DomHandler:bw,DomUtils:Wwe,ElementType:nwe,Parser:PD,get QuoteType(){return sl},Tokenizer:MU,createDocumentStream:Uwe,getFeed:QD,parseDocument:oV,parseFeed:Gwe},Symbol.toStringTag,{value:"Module"})),Kwe=zE(Xwe);var mT,G6;function Zwe(){return G6||(G6=1,mT=t=>{if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}),mT}var pA={},X6;function Jwe(){if(X6)return pA;X6=1,Object.defineProperty(pA,"__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 i,r;return t(n)===!1?!1:(i=n.constructor,i===void 0?!0:(r=i.prototype,!(t(r)===!1||r.hasOwnProperty("isPrototypeOf")===!1)))}return pA.isPlainObject=e,pA}var gT,K6;function eSe(){if(K6)return gT;K6=1;var t=function(S){return e(S)&&!n(S)};function e(w){return!!w&&typeof w=="object"}function n(w){var S=Object.prototype.toString.call(w);return S==="[object RegExp]"||S==="[object Date]"||s(w)}var i=typeof Symbol=="function"&&Symbol.for,r=i?Symbol.for("react.element"):60103;function s(w){return w.$$typeof===r}function a(w){return Array.isArray(w)?[]:{}}function l(w,S){return S.clone!==!1&&S.isMergeableObject(w)?b(a(w),w,S):w}function u(w,S,j){return w.concat(S).map(function(C){return l(C,j)})}function d(w,S){if(!S.customMerge)return b;var j=S.customMerge(w);return typeof j=="function"?j:b}function f(w){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(w).filter(function(S){return Object.propertyIsEnumerable.call(w,S)}):[]}function p(w){return Object.keys(w).concat(f(w))}function m(w,S){try{return S in w}catch{return!1}}function v(w,S){return m(w,S)&&!(Object.hasOwnProperty.call(w,S)&&Object.propertyIsEnumerable.call(w,S))}function y(w,S,j){var C={};return j.isMergeableObject(w)&&p(w).forEach(function(k){C[k]=l(w[k],j)}),p(S).forEach(function(k){v(w,k)||(m(w,k)&&j.isMergeableObject(S[k])?C[k]=d(k,j)(w[k],S[k],j):C[k]=l(S[k],j))}),C}function b(w,S,j){j=j||{},j.arrayMerge=j.arrayMerge||u,j.isMergeableObject=j.isMergeableObject||t,j.cloneUnlessOtherwiseSpecified=l;var C=Array.isArray(S),k=Array.isArray(w),E=C===k;return E?C?j.arrayMerge(w,S,j):y(w,S,j):l(S,j)}b.all=function(S,j){if(!Array.isArray(S))throw new Error("first argument should be an array");return S.reduce(function(C,k){return b(C,k,j)},{})};var A=b;return gT=A,gT}var o1={exports:{}},tSe=o1.exports,Z6;function nSe(){return Z6||(Z6=1,(function(t){(function(e,n){t.exports?t.exports=n():e.parseSrcset=n()})(tSe,function(){return function(e){function n(C){return C===" "||C==="	"||C===`
`||C==="\f"||C==="\r"}function i(C){var k,E=C.exec(e.substring(A));if(E)return k=E[0],A+=k.length,k}for(var r=e.length,s=/^[ \t\n\r\u000c]+/,a=/^[, \t\n\r\u000c]+/,l=/^[^ \t\n\r\u000c]+/,u=/[,]+$/,d=/^\d+$/,f=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/,p,m,v,y,b,A=0,w=[];;){if(i(a),A>=r)return w;p=i(l),m=[],p.slice(-1)===","?(p=p.replace(u,""),j()):S()}function S(){for(i(s),v="",y="in descriptor";;){if(b=e.charAt(A),y==="in descriptor")if(n(b))v&&(m.push(v),v="",y="after descriptor");else if(b===","){A+=1,v&&m.push(v),j();return}else if(b==="(")v=v+b,y="in parens";else if(b===""){v&&m.push(v),j();return}else v=v+b;else if(y==="in parens")if(b===")")v=v+b,y="in descriptor";else if(b===""){m.push(v),j();return}else v=v+b;else if(y==="after descriptor"&&!n(b))if(b===""){j();return}else y="in descriptor",A-=1;A+=1}}function j(){var C=!1,k,E,M,R,D={},F,I,Q,G,L;for(R=0;R<m.length;R++)F=m[R],I=F[F.length-1],Q=F.substring(0,F.length-1),G=parseInt(Q,10),L=parseFloat(Q),d.test(Q)&&I==="w"?((k||E)&&(C=!0),G===0?C=!0:k=G):f.test(Q)&&I==="x"?((k||E||M)&&(C=!0),L<0?C=!0:E=L):d.test(Q)&&I==="h"?((M||E)&&(C=!0),G===0?C=!0:M=G):C=!0;C?console&&console.log&&console.log("Invalid srcset descriptor found in '"+e+"' at '"+F+"'."):(D.url=p,k&&(D.w=k),E&&(D.d=E),M&&(D.h=M),w.push(D))}}})})(o1)),o1.exports}var mA={exports:{}},J6;function iSe(){if(J6)return mA.exports;J6=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 mA.exports=e(),mA.exports.createColors=e,mA.exports}const rSe={},sSe=Object.freeze(Object.defineProperty({__proto__:null,default:rSe},Symbol.toStringTag,{value:"Module"})),fl=zE(sSe);var vT,e5;function YD(){if(e5)return vT;e5=1;let t=iSe(),e=fl;class n extends Error{constructor(r,s,a,l,u,d){super(r),this.name="CssSyntaxError",this.reason=r,u&&(this.file=u),l&&(this.source=l),d&&(this.plugin=d),typeof s<"u"&&typeof a<"u"&&(typeof s=="number"?(this.line=s,this.column=a):(this.line=s.line,this.column=s.column,this.endLine=a.line,this.endColumn=a.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(r){if(!this.source)return"";let s=this.source;r==null&&(r=t.isColorSupported);let a=v=>v,l=v=>v,u=v=>v;if(r){let{bold:v,gray:y,red:b}=t.createColors(!0);l=A=>v(b(A)),a=A=>y(A),e&&(u=A=>e(A))}let d=s.split(/\r?\n/),f=Math.max(this.line-3,0),p=Math.min(this.line+2,d.length),m=String(p).length;return d.slice(f,p).map((v,y)=>{let b=f+1+y,A=" "+(" "+b).slice(-m)+" | ";if(b===this.line){if(v.length>160){let S=20,j=Math.max(0,this.column-S),C=Math.max(this.column+S,this.endColumn+S),k=v.slice(j,C),E=a(A.replace(/\d/g," "))+v.slice(0,Math.min(this.column-1,S-1)).replace(/[^\t]/g," ");return l(">")+a(A)+u(k)+`
 `+E+l("^")}let w=a(A.replace(/\d/g," "))+v.slice(0,this.column-1).replace(/[^\t]/g," ");return l(">")+a(A)+u(v)+`
 `+w+l("^")}return" "+a(A)+u(v)}).join(`
`)}toString(){let r=this.showSourceCode();return r&&(r=`

`+r+`
`),this.name+": "+this.message+r}}return vT=n,n.default=n,vT}var yT,t5;function aV(){if(t5)return yT;t5=1;const t=/(<)(\/?style\b)/gi,e=/(<)(!--)/g,n=/[\t\n\f\r "#'()/;[\\\]{}]/;function i(f){return typeof f!="string"||!f.includes("<")?f:f.replace(t,"\\3c $2").replace(e,"\\3c $2")}const r={after:`
`,beforeClose:`
`,beforeComment:`
`,beforeDecl:`
`,beforeOpen:" ",beforeRule:`
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:"    ",semicolon:!1};function s(f){return f[0].toUpperCase()+f.slice(1)}function a(f,p){let m="@"+p.name,v=p.params?f.rawValue(p,"params"):"",y=p.raws.afterName;return typeof y>"u"?y=v?" ":"":y===""&&v&&!n.test(v[0])&&(y=" "),m+y+v}function l(f,p,m){let v=m.nodes,y=v.length-1;for(;y>0&&v[y].type==="comment";)y-=1;let b=f.raw(m,"semicolon"),A=m.type==="document";for(let w=v.length-1;w>=0;w--){let S=v[w],j=y!==w||b;!j&&w<v.length-1&&(S.type==="atrule"&&!S.nodes||S.type==="decl"&&S.prop.startsWith("--"))&&(j=!0),p.push({document:A,node:S,semicolon:j})}}function u(f,p,m,v){let y=f.raw(m,"between","beforeOpen");f.builder(i(v+y)+"{",m,"start");let b=m.nodes&&m.nodes.length,A=()=>{let w=b?f.raw(m,"after"):f.raw(m,"after","emptyBody");w&&f.builder(i(w)),f.builder("}",m,"end"),m.type==="rule"&&m.raws.ownSemicolon&&f.builder(i(m.raws.ownSemicolon),m,"end")};b?(p.push(A),l(f,p,m)):A()}class d{constructor(p){this.builder=p}atrule(p,m){let v=a(this,p);if(p.nodes)this.block(p,v);else{let y=(p.raws.between||"")+(m?";":"");this.builder(i(v+y),p)}}beforeAfter(p,m){let v;p.type==="decl"?v=this.raw(p,null,"beforeDecl"):p.type==="comment"?v=this.raw(p,null,"beforeComment"):m==="before"?v=this.raw(p,null,"beforeRule"):v=this.raw(p,null,"beforeClose");let y=p.parent,b=0;for(;y&&y.type!=="root";)b+=1,y=y.parent;if(v.includes(`
`)){let A=this.raw(p,null,"indent");if(A.length)for(let w=0;w<b;w++)v+=A}return v}block(p,m){let v=this.raw(p,"between","beforeOpen");this.builder(i(m+v)+"{",p,"start");let y;p.nodes&&p.nodes.length?(this.body(p),y=this.raw(p,"after")):y=this.raw(p,"after","emptyBody"),y&&this.builder(i(y)),this.builder("}",p,"end")}body(p){let m=d.prototype,v=["atrule","block","body","rule","stringify"].every(b=>this[b]===m[b]),y=[];for(l(this,y,p);y.length>0;){let b=y.pop();if(typeof b=="function"){b();continue}let A=b.node,w=this.raw(A,"before");w&&this.builder(b.document?w:i(w)),v&&A.type==="rule"?u(this,y,A,this.rawValue(A,"selector")):v&&A.type==="atrule"&&A.nodes?u(this,y,A,a(this,A)):this.stringify(A,b.semicolon)}}comment(p){let m=this.raw(p,"left","commentLeft"),v=this.raw(p,"right","commentRight");this.builder(i("/*"+m+p.text+v+"*/"),p)}decl(p,m){let v=p.raws,y=this.raw(p,"between","colon"),b=p.prop+y+this.rawValue(p,"value");p.important&&(b+=v.important||" !important"),m&&(b+=";"),this.builder(i(b),p)}document(p){this.body(p)}raw(p,m,v){let y;if(v||(v=m),m&&(y=p.raws[m],typeof y<"u"))return y;let b=p.parent;if(v==="before"&&(!b||b.type==="root"&&b.first===p||b&&b.type==="document"))return"";if(!b)return r[v];let A=p.root(),w=A.rawCache||(A.rawCache={});if(typeof w[v]<"u")return w[v];if(v==="before"||v==="after")return this.beforeAfter(p,v);{let S="raw"+s(v);this[S]?y=this[S](A,p):A.walk(j=>{if(y=j.raws[m],typeof y<"u")return!1})}return typeof y>"u"&&(y=r[v]),w[v]=y,y}rawBeforeClose(p){let m;return p.walk(v=>{if(v.nodes&&v.nodes.length>0&&typeof v.raws.after<"u")return m=v.raws.after,m.includes(`
`)&&(m=m.replace(/[^\n]+$/,"")),!1}),m&&(m=m.replace(/\S/g,"")),m}rawBeforeComment(p,m){let v;return p.walkComments(y=>{if(typeof y.raws.before<"u")return v=y.raws.before,v.includes(`
`)&&(v=v.replace(/[^\n]+$/,"")),!1}),typeof v>"u"?v=this.raw(m,null,"beforeDecl"):v&&(v=v.replace(/\S/g,"")),v}rawBeforeDecl(p,m){let v;return p.walkDecls(y=>{if(typeof y.raws.before<"u")return v=y.raws.before,v.includes(`
`)&&(v=v.replace(/[^\n]+$/,"")),!1}),typeof v>"u"?v=this.raw(m,null,"beforeRule"):v&&(v=v.replace(/\S/g,"")),v}rawBeforeOpen(p){let m;return p.walk(v=>{if(v.type!=="decl"&&(m=v.raws.between,typeof m<"u"))return!1}),m}rawBeforeRule(p){let m;return p.walk(v=>{if(v.nodes&&(v.parent!==p||p.first!==v)&&typeof v.raws.before<"u")return m=v.raws.before,m.includes(`
`)&&(m=m.replace(/[^\n]+$/,"")),!1}),m&&(m=m.replace(/\S/g,"")),m}rawColon(p){let m;return p.walkDecls(v=>{if(typeof v.raws.between<"u")return m=v.raws.between.replace(/[^\s:]/g,""),!1}),m}rawEmptyBody(p){let m;return p.walk(v=>{if(v.nodes&&v.nodes.length===0&&(m=v.raws.after,typeof m<"u"))return!1}),m}rawIndent(p){if(p.raws.indent)return p.raws.indent;let m;return p.walk(v=>{let y=v.parent;if(y&&y!==p&&y.parent&&y.parent===p&&typeof v.raws.before<"u"){let b=v.raws.before.split(`
`);return m=b[b.length-1],m=m.replace(/\S/g,""),!1}}),m}rawSemicolon(p){let m;return p.walk(v=>{if(v.nodes&&v.nodes.length&&v.last.type==="decl"&&(m=v.raws.semicolon,typeof m<"u"))return!1}),m}rawValue(p,m){let v=p[m],y=p.raws[m];return y&&y.value===v?y.raw:v}root(p){if(this.body(p),p.raws.after){let m=p.raws.after,v=p.parent&&p.parent.type==="document";this.builder(v?m:i(m))}}rule(p){this.block(p,this.rawValue(p,"selector")),p.raws.ownSemicolon&&this.builder(i(p.raws.ownSemicolon),p,"end")}stringify(p,m){if(!this[p.type])throw new Error("Unknown AST node type "+p.type+". Maybe you need to change PostCSS stringifier.");this[p.type](p,m)}}return yT=d,d.default=d,yT}var xT,n5;function wj(){if(n5)return xT;n5=1;let t=aV();function e(n,i){new t(i).stringify(n)}return xT=e,e.default=e,xT}var gA={},i5;function Sj(){return i5||(i5=1,gA.isClean=Symbol("isClean"),gA.my=Symbol("my")),gA}var bT,r5;function jj(){if(r5)return bT;r5=1;let t=YD(),e=aV(),n=wj(),{isClean:i,my:r}=Sj();function s(u,d){let f=new u.constructor,p=[[u,f,d]];for(;p.length>0;){let[m,v,y]=p.pop();for(let b in m){if(!Object.prototype.hasOwnProperty.call(m,b)||b==="proxyCache")continue;let A=m[b],w=typeof A;if(b==="parent"&&w==="object")y&&(v[b]=y);else if(b==="source")v[b]=A;else if(Array.isArray(A)){let S=[];v[b]=S;for(let j of A){let C=new j.constructor;S.push(C),p.push([j,C,v])}}else{if(w==="object"&&A!==null){let S=new A.constructor;p.push([A,S,void 0]),A=S}v[b]=A}}}return f}function a(u,d){if(d&&typeof d.offset<"u")return d.offset;let f=1,p=1,m=0;for(let v=0;v<u.length;v++){if(p===d.line&&f===d.column){m=v;break}u[v]===`
`?(f=1,p+=1):f+=1}return m}class l{get proxyOf(){return this}constructor(d={}){this.raws={},this[i]=!1,this[r]=!0;for(let f of Object.keys(d))if(f!=="__proto__")if(f==="nodes"){this.nodes=[];for(let p of d[f])typeof p.clone=="function"&&p.parent?this.append(p.clone()):this.append(p)}else this[f]=d[f]}addToError(d){if(d.postcssNode=this,d.stack&&this.source&&/\n\s{4}at /.test(d.stack)){let f=this.source;d.stack=d.stack.replace(/\n\s{4}at /,`$&${f.input.from}:${f.start.line}:${f.start.column}$&`)}return d}after(d){return this.parent.insertAfter(this,d),this}assign(d={}){for(let f in d)this[f]=d[f];return this}before(d){return this.parent.insertBefore(this,d),this}cleanRaws(d){delete this.raws.before,delete this.raws.after,d||delete this.raws.between}clone(d={}){let f=s(this);for(let p in d)f[p]=d[p];return f}cloneAfter(d={}){let f=this.clone(d);return this.parent.insertAfter(this,f),f}cloneBefore(d={}){let f=this.clone(d);return this.parent.insertBefore(this,f),f}error(d,f={}){if(this.source){let{end:p,start:m}=this.rangeBy(f);return this.source.input.error(d,{column:m.column,line:m.line},{column:p.column,line:p.line},f)}return new t(d)}getProxyProcessor(){return{get(d,f){return f==="proxyOf"?d:f==="root"?()=>d.root().toProxy():d[f]},set(d,f,p){return d[f]===p||(d[f]=p,(f==="prop"||f==="value"||f==="name"||f==="params"||f==="important"||f==="text")&&d.markDirty()),!0}}}markClean(){this[i]=!0}markDirty(){if(this[i]){this[i]=!1;let d=this;for(;d=d.parent;)d[i]=!1}}next(){if(!this.parent)return;let d=this.parent.index(this);return this.parent.nodes[d+1]}positionBy(d={}){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:a(f,this.source.start)};if(d.index)p=this.positionInside(d.index);else if(d.word){let v=f.slice(a(f,this.source.start),a(f,this.source.end)).indexOf(d.word);v!==-1&&(p=this.positionInside(v))}return p}positionInside(d){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=a(m,this.source.start),y=v+d;for(let b=v;b<y;b++)m[b]===`
`?(f=1,p+=1):f+=1;return{column:f,line:p,offset:y}}prev(){if(!this.parent)return;let d=this.parent.index(this);return this.parent.nodes[d-1]}rangeBy(d={}){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:a(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:a(f,this.source.end)+1}:{column:p.column+1,line:p.line,offset:p.offset+1};if(d.word){let y=f.slice(a(f,this.source.start),a(f,this.source.end)).indexOf(d.word);y!==-1&&(p=this.positionInside(y),m=this.positionInside(y+d.word.length))}else d.start?p={column:d.start.column,line:d.start.line,offset:a(f,d.start)}:typeof d.index=="number"&&(p=this.positionInside(d.index)),d.end?m={column:d.end.column,line:d.end.line,offset:a(f,d.end)}:typeof d.endIndex=="number"?m=this.positionInside(d.endIndex):typeof d.index=="number"&&(m=this.positionInside(d.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(d,f){return new e().raw(this,d,f)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...d){if(this.parent){let f=this,p=!1;for(let m of d)m===this?p=!0:p?(this.parent.insertAfter(f,m),f=m):this.parent.insertBefore(f,m);p||this.remove()}return this}root(){let d=this;for(;d.parent&&d.parent.type!=="document";)d=d.parent;return d}toJSON(d,f){let p=f==null;f=f||new Map;let m=[],v=[[this,m,0]];for(let b=0;b<v.length;b++){let[A,w,S]=v[b],j={};w[S]=j;for(let C in A){if(!Object.prototype.hasOwnProperty.call(A,C)||C==="parent"||C==="proxyCache")continue;let k=A[C];if(Array.isArray(k)){let E=[];j[C]=E;for(let M=0;M<k.length;M++){let R=k[M];typeof R=="object"&&R.toJSON?R.toJSON===l.prototype.toJSON?v.push([R,E,M]):E[M]=R.toJSON(null,f):E[M]=R}}else if(typeof k=="object"&&k.toJSON)k.toJSON===l.prototype.toJSON?v.push([k,j,C]):j[C]=k.toJSON(null,f);else if(C==="source"){if(k==null)continue;let E=f.get(k.input);E==null&&(E=f.size,f.set(k.input,E)),j[C]={end:k.end,inputId:E,start:k.start}}else j[C]=k}}let y=m[0];return p&&(y.inputs=[...f.keys()].map(b=>b.toJSON())),y}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(d=n){d.stringify&&(d=d.stringify);let f="";return d(this,p=>{f+=p}),f}warn(d,f,p={}){let m={node:this};for(let v in p)m[v]=p[v];return d.warn(f,m)}}return bT=l,l.default=l,bT}var AT,s5;function Cj(){if(s5)return AT;s5=1;let t=jj();class e extends t{constructor(i){super(i),this.type="comment"}}return AT=e,e.default=e,AT}var wT,o5;function _j(){if(o5)return wT;o5=1;let t=jj();class e extends t{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(i){i&&typeof i.value<"u"&&typeof i.value!="string"&&(i={...i,value:String(i.value)}),super(i),this.type="decl"}}return wT=e,e.default=e,wT}var ST,a5;function Ad(){if(a5)return ST;a5=1;let t=Cj(),e=_j(),n=jj(),{isClean:i,my:r}=Sj(),s,a,l,u;function d(m){let v=m.slice();for(;v.length>0;){let y=v.pop();if(delete y.source,y.nodes){y.nodes=y.nodes.slice();for(let b of y.nodes)v.push(b)}}return m.slice()}function f(m){let v=[m];for(;v.length>0;){let y=v.pop();if(y[i]=!1,y.proxyOf.nodes)for(let b of y.proxyOf.nodes)v.push(b)}}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 b=this.normalize(y,this.last);for(let A of b)this.proxyOf.nodes.push(A)}return this.markDirty(),this}cleanRaws(v){let y=[this];for(;y.length>0;){let b=y.pop();if(b!==this&&b.cleanRaws!==p.prototype.cleanRaws){b.cleanRaws(v);continue}if(n.prototype.cleanRaws.call(b,v),b.nodes)for(let A of b.nodes)y.push(A)}}each(v){if(!this.proxyOf.nodes)return;let y=this.getIterator(),b,A;for(;this.indexes[y]<this.proxyOf.nodes.length&&(b=this.indexes[y],A=v(this.proxyOf.nodes[b],b),A!==!1);)this.indexes[y]+=1;return delete this.indexes[y],A}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")?(...b)=>v[y](...b.map(A=>typeof A=="function"?(w,S)=>A(w.toProxy(),S):A)):y==="every"||y==="some"?b=>v[y]((A,...w)=>b(A.toProxy(),...w)):y==="root"?()=>v.root().toProxy():y==="nodes"?v.nodes.map(b=>b.toProxy()):y==="first"||y==="last"?v[y].toProxy():v[y]:v[y]},set(v,y,b){return v[y]===b||(v[y]=b,(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 b=this.index(v),A=this.normalize(y,this.proxyOf.nodes[b]).reverse();b=this.index(v);for(let S of A)this.proxyOf.nodes.splice(b+1,0,S);let w;for(let S in this.indexes)w=this.indexes[S],b<w&&(this.indexes[S]=w+A.length);return this.markDirty(),this}insertBefore(v,y){let b=this.index(v),A=b===0?"prepend":!1,w=this.normalize(y,this.proxyOf.nodes[b],A).reverse();b=this.index(v);for(let j of w)this.proxyOf.nodes.splice(b,0,j);let S;for(let j in this.indexes)S=this.indexes[j],b<=S&&(this.indexes[j]=S+w.length);return this.markDirty(),this}normalize(v,y){if(typeof v=="string")v=d(a(v).nodes);else if(typeof v>"u")v=[];else if(Array.isArray(v)){v=v.slice(0);for(let A of v)A.parent&&A.parent.removeChild(A,"ignore")}else if(v.type==="root"&&this.type!=="document"){v=v.nodes.slice(0);for(let A of v)A.parent&&A.parent.removeChild(A,"ignore")}else if(v.type)v=[v];else if(v.prop){if(typeof v.value>"u")throw new Error("Value field is missed in node creation");typeof v.value!="string"&&(v.value=String(v.value)),v=[new e(v)]}else if(v.selector||v.selectors)v=[new u(v)];else if(v.name)v=[new s(v)];else if(v.text)v=[new t(v)];else throw new Error("Unknown node type in node creation");return v.map(A=>(A[r]||p.rebuild(A),A=A.proxyOf,A.parent&&A.parent.removeChild(A),A[i]&&f(A),A.raws||(A.raws={}),typeof A.raws.before>"u"&&y&&typeof y.raws.before<"u"&&(A.raws.before=y.raws.before.replace(/\S/g,"")),A.parent=this.proxyOf,A))}prepend(...v){v=v.reverse();for(let y of v){let b=this.normalize(y,this.first,"prepend").reverse();for(let A of b)this.proxyOf.nodes.unshift(A);for(let A in this.indexes)this.indexes[A]=this.indexes[A]+b.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 b in this.indexes)y=this.indexes[b],y>=v&&(this.indexes[b]=y-1);return this.markDirty(),this}replaceValues(v,y,b){return b||(b=y,y={}),this.walkDecls(A=>{y.props&&!y.props.includes(A.prop)||y.fast&&!A.value.includes(y.fast)||(A.value=A.value.replace(v,b))}),this.markDirty(),this}some(v){return this.nodes.some(v)}walk(v){if(!this.proxyOf.nodes)return;let y=[{iterator:this.getIterator(),node:this.proxyOf}];for(;y.length>0;){let{iterator:b,node:A}=y[y.length-1],w=A.indexes[b];if(w>=A.proxyOf.nodes.length){delete A.indexes[b],y.pop();let C=y[y.length-1];C&&(C.node.indexes[C.iterator]+=1);continue}let S=A.proxyOf.nodes[w],j;try{j=v(S,w)}catch(C){throw S.addToError(C)}if(j===!1){for(let C of y)delete C.node.indexes[C.iterator];return!1}S.walk&&S.proxyOf.nodes?y.push({iterator:S.getIterator(),node:S}):A.indexes[b]+=1}}walkAtRules(v,y){return y?v instanceof RegExp?this.walk((b,A)=>{if(b.type==="atrule"&&v.test(b.name))return y(b,A)}):this.walk((b,A)=>{if(b.type==="atrule"&&b.name===v)return y(b,A)}):(y=v,this.walk((b,A)=>{if(b.type==="atrule")return y(b,A)}))}walkComments(v){return this.walk((y,b)=>{if(y.type==="comment")return v(y,b)})}walkDecls(v,y){return y?v instanceof RegExp?this.walk((b,A)=>{if(b.type==="decl"&&v.test(b.prop))return y(b,A)}):this.walk((b,A)=>{if(b.type==="decl"&&b.prop===v)return y(b,A)}):(y=v,this.walk((b,A)=>{if(b.type==="decl")return y(b,A)}))}walkRules(v,y){return y?v instanceof RegExp?this.walk((b,A)=>{if(b.type==="rule"&&v.test(b.selector))return y(b,A)}):this.walk((b,A)=>{if(b.type==="rule"&&b.selector===v)return y(b,A)}):(y=v,this.walk((b,A)=>{if(b.type==="rule")return y(b,A)}))}}return p.registerParse=m=>{a=m},p.registerRule=m=>{u=m},p.registerAtRule=m=>{s=m},p.registerRoot=m=>{l=m},ST=p,p.default=p,p.rebuild=m=>{let v=[m];for(;v.length>0;){let y=v.pop();if(y.type==="atrule"?Object.setPrototypeOf(y,s.prototype):y.type==="rule"?Object.setPrototypeOf(y,u.prototype):y.type==="decl"?Object.setPrototypeOf(y,e.prototype):y.type==="comment"?Object.setPrototypeOf(y,t.prototype):y.type==="root"&&Object.setPrototypeOf(y,l.prototype),y[r]=!0,y.nodes)for(let b of y.nodes)v.push(b)}},ST}var jT,l5;function WD(){if(l5)return jT;l5=1;let t=Ad();class e extends t{constructor(i){super(i),this.type="atrule"}append(...i){return this.proxyOf.nodes||(this.nodes=[]),super.append(...i)}prepend(...i){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...i)}}return jT=e,e.default=e,t.registerAtRule(e),jT}var CT,c5;function UD(){if(c5)return CT;c5=1;let t=Ad(),e,n;class i extends t{constructor(s){super({type:"document",...s}),this.nodes||(this.nodes=[])}toResult(s={}){return new e(new n,this,s).stringify()}}return i.registerLazyResult=r=>{e=r},i.registerProcessor=r=>{n=r},CT=i,i.default=i,CT}var _T,u5;function oSe(){if(u5)return _T;u5=1;let t="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return _T={nanoid:(i=21)=>{let r="",s=i|0;for(;s-- >0;)r+=t[Math.random()*64|0];return r},customAlphabet:(i,r=21)=>(s=r)=>{let a="",l=s|0;for(;l-- >0;)a+=i[Math.random()*i.length|0];return a}},_T}var kT,h5;function lV(){if(h5)return kT;h5=1;let{existsSync:t,readFileSync:e}=fl,{dirname:n,isAbsolute:i,join:r,relative:s,sep:a}=fl,{SourceMapConsumer:l,SourceMapGenerator:u}=fl;function d(p){return Buffer?Buffer.from(p,"base64").toString():window.atob(p)}class f{constructor(m,v){if(v.map===!1)return;v.unsafeMap&&(this.unsafeMap=!0),this.loadAnnotation(m),this.inline=this.startWith(this.annotation,"data:");let y=v.map?v.map.prev:void 0,b=this.loadMap(v.from,y);!this.mapFile&&v.from&&(this.mapFile=v.from),this.mapFile&&(this.root=n(this.mapFile)),b&&(this.text=b)}consumer(){return this.consumerCache||(this.consumerCache=new l(this.json||this.text)),this.consumerCache}decodeInline(m){let v=/^data:application\/json;charset=utf-?8;base64,/,y=/^data:application\/json;base64,/,b=/^data:application\/json;charset=utf-?8,/,A=/^data:application\/json,/,w=m.match(b)||m.match(A);if(w)return decodeURIComponent(m.substr(w[0].length));let S=m.match(v)||m.match(y);if(S)return d(m.substr(S[0].length));let j=m.slice(22);throw j=j.slice(0,j.indexOf(",")),new Error("Unsupported source map encoding "+j)}getAnnotationURL(m){return m.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(m){return typeof m!="object"?!1:typeof m.mappings=="string"||typeof m._mappings=="string"||Array.isArray(m.sections)}loadAnnotation(m){let v=m.match(/\/\*\s*# sourceMappingURL=/g);if(!v)return;let y=m.lastIndexOf(v.pop()),b=m.indexOf("*/",y);y>-1&&b>-1&&(this.annotation=this.getAnnotationURL(m.substring(y,b)))}loadFile(m,v,y){if(!y&&!this.unsafeMap){if(!/\.map$/i.test(m)||!v)return;let b=s(n(v),m);if(b===".."||b.startsWith(".."+a)||i(b))return}if(this.root=n(m),t(m))return this.mapFile=m,e(m,"utf-8").toString().trim()}loadMap(m,v){if(v===!1)return!1;if(v){if(typeof v=="string")return v;if(typeof v=="function"){let y=v(m);if(y){let b=this.loadFile(y,m,!0);if(!b)throw new Error("Unable to load previous source map: "+y.toString());return b}}else{if(v instanceof l)return u.fromSourceMap(v).toString();if(v instanceof u)return v.toString();if(this.isMap(v))return JSON.stringify(v);throw new Error("Unsupported previous source map format: "+v.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let y=this.annotation;m&&(y=r(n(m),y));let b=this.loadFile(y,m,!1);if(b)try{this.json=JSON.parse(b.replace(/^\)]}'[^\n]*\n/,""))}catch{return}return b}}}startWith(m,v){return m?m.substr(0,v.length)===v:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return kT=f,f.default=f,kT}var TT,d5;function kj(){if(d5)return TT;d5=1;let{nanoid:t}=oSe(),{isAbsolute:e,resolve:n}=fl,{SourceMapConsumer:i,SourceMapGenerator:r}=fl,{fileURLToPath:s,pathToFileURL:a}=fl,l=YD(),u=lV(),d=fl,f=Symbol("lineToIndexCache"),p=!!(i&&r),m=!!(n&&e);function v(b){if(b[f])return b[f];let A=b.css.split(`
`),w=new Array(A.length),S=0;for(let j=0,C=A.length;j<C;j++)w[j]=S,S+=A[j].length+1;return b[f]=w,w}class y{get from(){return this.file||this.id}constructor(A,w={}){if(A===null||typeof A>"u"||typeof A=="object"&&!A.toString)throw new Error(`PostCSS received ${A} instead of CSS string`);if(this.css=A.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 S=new u(this.css,w);if(S.text){this.map=S;let j=S.consumer().file;!this.file&&j&&(this.file=this.mapResolve(j))}}this.file||(this.id="<input css "+t(6)+">"),this.map&&(this.map.file=this.from)}error(A,w,S,j={}){let C,k,E,M,R;if(w&&typeof w=="object"){let F=w,I=S;if(typeof F.offset=="number"){M=F.offset;let Q=this.fromOffset(M);w=Q.line,S=Q.col}else w=F.line,S=F.column,M=this.fromLineAndColumn(w,S);if(typeof I.offset=="number"){E=I.offset;let Q=this.fromOffset(E);k=Q.line,C=Q.col}else k=I.line,C=I.column,E=this.fromLineAndColumn(I.line,I.column)}else if(S)M=this.fromLineAndColumn(w,S);else{M=w;let F=this.fromOffset(M);w=F.line,S=F.col}let D=this.origin(w,S,k,C);return D?R=new l(A,D.endLine===void 0?D.line:{column:D.column,line:D.line},D.endLine===void 0?D.column:{column:D.endColumn,line:D.endLine},D.source,D.file,j.plugin):R=new l(A,k===void 0?w:{column:S,line:w},k===void 0?S:{column:C,line:k},this.css,this.file,j.plugin),R.input={column:S,endColumn:C,endLine:k,endOffset:E,line:w,offset:M,source:this.css},this.file&&(a&&(R.input.url=a(this.file).toString()),R.input.file=this.file),R}fromLineAndColumn(A,w){return v(this)[A-1]+w-1}fromOffset(A){let w=v(this),S=w[w.length-1],j=0;if(A>=S)j=w.length-1;else{let C=w.length-2,k;for(;j<C;)if(k=j+(C-j>>1),A<w[k])C=k-1;else if(A>=w[k+1])j=k+1;else{j=k;break}}return{col:A-w[j]+1,line:j+1}}mapResolve(A){return/^\w+:\/\//.test(A)?A:n(this.map.consumer().sourceRoot||this.map.root||".",A)}origin(A,w,S,j){if(!this.map)return!1;let C=this.map.consumer(),k=C.originalPositionFor({column:w-1,line:A});if(!k.source)return!1;let E;if(typeof S=="number"){let F=C.originalPositionFor({column:j-1,line:S});F.source&&(E=F)}let M;e(k.source)?M=a(k.source):M=new URL(k.source,this.map.consumer().sourceRoot||a(this.map.mapFile));let R={column:k.column+1,endColumn:E&&E.column+1,endLine:E&&E.line,line:k.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 D=C.sourceContentFor(k.source);return D&&(R.source=D),R}toJSON(){let A={};for(let w of["hasBOM","css","file","id"])this[w]!=null&&(A[w]=this[w]);return this.map&&(A.map={...this.map},A.map.consumerCache&&(A.map.consumerCache=void 0)),A}}return TT=y,y.default=y,d&&d.registerInput&&d.registerInput(y),TT}var OT,f5;function hx(){if(f5)return OT;f5=1;let t=Ad(),e,n;class i extends t{constructor(s){super(s),this.type="root",this.nodes||(this.nodes=[])}normalize(s,a,l){let u=new Set;for(let f of Array.isArray(s)?s:[s])f&&typeof f=="object"&&!f.parent&&f.raws&&typeof f.raws.before<"u"&&u.add(f.raws);let d=super.normalize(s);if(a){if(l==="prepend")this.nodes.length>1?a.raws.before=this.nodes[1].raws.before:delete a.raws.before;else if(this.first!==a)for(let f of d)u.has(f.raws)||(f.raws.before=a.raws.before)}return d}removeChild(s,a){let l=this.index(s);return!a&&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 i.registerLazyResult=r=>{e=r},i.registerProcessor=r=>{n=r},OT=i,i.default=i,t.registerRoot(i),OT}var ET,p5;function cV(){if(p5)return ET;p5=1;let t={comma(e){return t.split(e,[","],!0)},space(e){let n=[" ",`
`,"	"];return t.split(e,n)},split(e,n,i){let r=[],s="",a=!1,l=0,u=!1,d="",f=!1;for(let p of e)f?f=!1:p==="\\"?f=!0:u?p===d&&(u=!1):p==='"'||p==="'"?(u=!0,d=p):p==="("?l+=1:p===")"?l>0&&(l-=1):l===0&&n.includes(p)&&(a=!0),a?(s!==""&&r.push(s.trim()),s="",a=!1):s+=p;return(i||s!=="")&&r.push(s.trim()),r}};return ET=t,t.default=t,ET}var MT,m5;function VD(){if(m5)return MT;m5=1;let t=Ad(),e=cV();class n extends t{get selectors(){return e.comma(this.selector)}set selectors(r){let s=this.selector?this.selector.match(/,\s*/):null,a=s?s[0]:","+this.raw("between","beforeOpen");this.selector=r.join(a)}constructor(r){super(r),this.type="rule",this.nodes||(this.nodes=[])}}return MT=n,n.default=n,t.registerRule(n),MT}var RT,g5;function aSe(){if(g5)return RT;g5=1;let t=WD(),e=Cj(),n=_j(),i=kj(),r=lV(),s=hx(),a=VD();function l(f,p){return f.inputs?f.inputs.map(m=>{let v={...m,__proto__:i.prototype};return v.map&&(v.map={...v.map,__proto__:r.prototype}),v}):p}function u(f,p,m){let v={...f};if(delete v.inputs,delete v.nodes,v.source){let{inputId:b,...A}=v.source;v.source=A,b!=null&&(v.source.input=p[b])}let y;if(v.type==="root")y=new s(v);else if(v.type==="decl")y=new n(v);else if(v.type==="rule")y=new a(v);else if(v.type==="comment")y=new e(v);else if(v.type==="atrule")y=new t(v);else throw new Error("Unknown node type: "+f.type);if(m){y.nodes=m;for(let b of m)b.parent=y}return y}function d(f,p){if(Array.isArray(f))return f.map(y=>d(y));let m,v=[{childIndex:0,children:[],inputs:l(f,p),json:f}];for(;v.length>0;){let y=v[v.length-1],b=y.json.nodes;if(b&&y.childIndex<b.length){let w=b[y.childIndex];y.childIndex+=1,v.push({childIndex:0,children:[],inputs:l(w,y.inputs),json:w});continue}v.pop();let A=u(y.json,y.inputs,b?y.children:void 0);v.length>0?v[v.length-1].children.push(A):m=A}return m}return RT=d,d.default=d,RT}var DT,v5;function uV(){if(v5)return DT;v5=1;let{dirname:t,relative:e,resolve:n,sep:i}=fl,{SourceMapConsumer:r,SourceMapGenerator:s}=fl,{pathToFileURL:a}=fl,l=kj(),u=!!(r&&s),d=!!(t&&n&&e&&i);class f{constructor(m,v,y,b){this.stringify=m,this.mapOpts=y.map||{},this.root=v,this.opts=y,this.css=b,this.originalCSS=b,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),b;this.mapOpts.sourcesContent===!1?(b=new r(m.text),b.sourcesContent&&(b.sourcesContent=null)):b=m.consumer(),this.map.applySourceMap(b,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(),d&&u&&this.isMap())return this.generateMap();{let m="";return this.stringify(this.root,v=>{m+=v}),[m]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let m=this.previous()[0].consumer();m.file=this.outputFile(),this.map=s.fromSourceMap(m,{ignoreInvalidMapping:!0})}else this.map=new s({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new s({file:this.outputFile(),ignoreInvalidMapping:!0});let m=1,v=1,y="<no source>",b={generated:{column:0,line:0},original:{column:0,line:0},source:""},A,w;this.stringify(this.root,(S,j,C)=>{if(this.css+=S,j&&C!=="end"&&(b.generated.line=m,b.generated.column=v-1,j.source&&j.source.start?(b.source=this.sourcePath(j),b.original.line=j.source.start.line,b.original.column=j.source.start.column-1,this.map.addMapping(b)):(b.source=y,b.original.line=1,b.original.column=0,this.map.addMapping(b))),w=S.match(/\n/g),w?(m+=w.length,A=S.lastIndexOf(`
`),v=S.length-A):v+=S.length,j&&C!=="start"){let k=j.parent||{raws:{}};(!(j.type==="decl"||j.type==="atrule"&&!j.nodes)||j!==k.last||k.raws.semicolon)&&(j.source&&j.source.end?(b.source=this.sourcePath(j),b.original.line=j.source.end.line,b.original.column=j.source.end.column-1,b.generated.line=m,b.generated.column=v-2,this.map.addMapping(b)):(b.source=y,b.original.line=1,b.original.column=0,b.generated.line=m,b.generated.column=v-1,this.map.addMapping(b)))}})}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 b=e(y,m);return this.memoizedPaths.set(m,b),b}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 b=this.usesFileUrls?this.toFileUrl(y):this.toUrl(this.path(y));this.map.setSourceContent(b,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(a){let y=a(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;i==="\\"&&(m=m.replace(/\\/g,"/"));let y=encodeURI(m).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(m,y),y}}return DT=f,DT}var NT,y5;function lSe(){if(y5)return NT;y5=1;const t=39,e=34,n=92,i=47,r=10,s=32,a=12,l=9,u=13,d=91,f=93,p=40,m=41,v=123,y=125,b=59,A=42,w=58,S=64,j=/[\t\n\f\r "#'()/;[\\\]{}]/g,C=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,k=/.[\r\n"'(/\\]/,E=/[\da-f]/i;return NT=function(R,D={}){let F=R.css.valueOf(),I=D.ignoreErrors,Q,G,L,q,N,P,Y,K,W,z,U=F.length,V=0,J=[],ee=[],ce=-1;function he(){return V}function Oe(ie){throw R.error("Unclosed "+ie,V)}function Te(){return ee.length===0&&V>=U}function Re(ie){if(ee.length)return ee.pop();if(V>=U)return;let je=ie?ie.ignoreUnclosed:!1;switch(Q=F.charCodeAt(V),Q){case r:case s:case l:case u:case a:{q=V;do q+=1,Q=F.charCodeAt(q);while(Q===s||Q===r||Q===l||Q===u||Q===a);P=["space",F.slice(V,q)],V=q-1;break}case d:case f:case v:case y:case w:case b:case m:{let se=String.fromCharCode(Q);P=[se,se,V];break}case p:{if(z=J.length?J.pop()[1]:"",W=F.charCodeAt(V+1),z==="url"&&W!==t&&W!==e&&W!==s&&W!==r&&W!==l&&W!==a&&W!==u){q=V;do{if(Y=!1,q=F.indexOf(")",q+1),q===-1)if(I||je){q=V;break}else Oe("bracket");for(K=q;F.charCodeAt(K-1)===n;)K-=1,Y=!Y}while(Y);P=["brackets",F.slice(V,q+1),V,q],V=q}else V<=ce?P=["(","(",V]:(q=F.indexOf(")",V+1),G=F.slice(V,q+1),q===-1||k.test(G)?(ce=q===-1?U:q,P=["(","(",V]):(P=["brackets",G,V,q],V=q));break}case t:case e:{N=Q===t?"'":'"',q=V;do{if(Y=!1,q=F.indexOf(N,q+1),q===-1)if(I||je){q=V+1;break}else Oe("string");for(K=q;F.charCodeAt(K-1)===n;)K-=1,Y=!Y}while(Y);P=["string",F.slice(V,q+1),V,q],V=q;break}case S:{j.lastIndex=V+1,j.test(F),j.lastIndex===0?q=F.length-1:q=j.lastIndex-2,P=["at-word",F.slice(V,q+1),V,q],V=q;break}case n:{for(q=V,L=!0;F.charCodeAt(q+1)===n;)q+=1,L=!L;if(Q=F.charCodeAt(q+1),L&&Q!==i&&Q!==s&&Q!==r&&Q!==l&&Q!==u&&Q!==a&&(q+=1,E.test(F.charAt(q)))){for(;E.test(F.charAt(q+1));)q+=1;F.charCodeAt(q+1)===s&&(q+=1)}P=["word",F.slice(V,q+1),V,q],V=q;break}default:{Q===i&&F.charCodeAt(V+1)===A?(q=F.indexOf("*/",V+2)+1,q===0&&(I||je?q=F.length:Oe("comment")),P=["comment",F.slice(V,q+1),V,q],V=q):(C.lastIndex=V+1,C.test(F),C.lastIndex===0?q=F.length-1:q=C.lastIndex-2,P=["word",F.slice(V,q+1),V,q],J.push(P),V=q);break}}return V++,P}function qe(ie){ee.push(ie)}return{back:qe,endOfFile:Te,nextToken:Re,position:he}},NT}var IT,x5;function cSe(){if(x5)return IT;x5=1;let t=WD(),e=Cj(),n=_j(),i=hx(),r=VD(),s=lSe();const a={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 u(f,p,m){let v="";for(let y=p;y<m;y++)v+=f[y][1];return v}class d{constructor(p){this.input=p,this.root=new i,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,b,A=!1,w=!1,S=[],j=[];for(;!this.tokenizer.endOfFile();){if(p=this.tokenizer.nextToken(),v=p[0],v==="("||v==="["?j.push(v==="("?")":"]"):v==="{"&&j.length>0?j.push("}"):v===j[j.length-1]&&j.pop(),j.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(S.length>0){for(b=S.length-1,y=S[b];y&&y[0]==="space";)y=S[--b];y&&(m.source.end=this.getPosition(y[3]||y[2]),m.source.end.offset++)}this.end(p);break}else S.push(p);else S.push(p);if(this.tokenizer.endOfFile()){A=!0;break}}m.raws.between=this.spacesAndCommentsFromEnd(S),S.length?(m.raws.afterName=this.spacesAndCommentsFromStart(S),this.raw(m,"params",S),A&&(p=S[S.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 b=m-1;b>=0&&(y=p[b],!(y[0]!=="space"&&(v+=1,v===2)));b--);throw this.input.error("Missed semicolon",y[0]==="word"?y[3]+1:y[2])}colon(p){let m=0,v,y,b;for(let[A,w]of p.entries()){if(y=w,b=y[0],b==="("&&(m+=1),b===")"&&(m-=1),m===0&&b===":")if(!v)this.doubleColon(y);else{if(v[0]==="word"&&v[1]==="progid")continue;return A}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 b=0;for(;p[b][0]!=="word";)b===p.length-1&&this.unknownWord([p[b]]),b++;v.raws.before+=u(p,0,b),v.source.start=this.getPosition(p[b][2]);let A=b;for(;b<p.length;){let E=p[b][0];if(E===":"||E==="space"||E==="comment")break;b++}v.prop=u(p,A,b);let w=b,S;for(;b<p.length&&(S=p[b],b++,S[0]!==":");)S[0]==="word"&&/\w/.test(S[1])&&this.unknownWord([S]);v.raws.between=u(p,w,b),(v.prop[0]==="_"||v.prop[0]==="*")&&(v.raws.before+=v.prop[0],v.prop=v.prop.slice(1));let j=b;for(;b<p.length;){let E=p[b][0];if(E!=="space"&&E!=="comment")break;b++}let C=p.slice(j,b);p=p.slice(b),this.precheckMissedSemicolon(p);for(let E=p.length-1;E>=0;E--){if(S=p[E],S[1].toLowerCase()==="!important"){v.important=!0;let M=this.stringFrom(p,E);M=this.spacesFromEnd(p)+M,M!==" !important"&&(v.raws.important=M);break}else if(S[1].toLowerCase()==="important"){let M=p.slice(0),R="";for(let D=E;D>0;D--){let F=M[D][0];if(R.trim().startsWith("!")&&F!=="space")break;R=M.pop()[1]+R}R.trim().startsWith("!")&&(v.important=!0,v.raws.important=R,p=M)}if(S[0]!=="space"&&S[0]!=="comment")break}p.some(E=>E[0]!=="space"&&E[0]!=="comment")&&(v.raws.between+=C.map(E=>E[1]).join(""),C=[]),this.raw(v,"value",C.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 r;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,b=null,A=[],w=p[1].startsWith("--"),S=[],j=p;for(;j;){if(v=j[0],S.push(j),v==="("||v==="[")b||(b=j),A.push(v==="("?")":"]");else if(w&&y&&v==="{")b||(b=j),A.push("}");else if(A.length===0)if(v===";")if(y){this.decl(S,w);return}else break;else if(v==="{"){this.rule(S);return}else if(v==="}"){this.tokenizer.back(S.pop()),m=!0;break}else v===":"&&(y=!0);else v===A[A.length-1]&&(A.pop(),A.length===0&&(b=null));j=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(m=!0),A.length>0&&this.unclosedBracket(b),m&&y){if(!w)for(;S.length&&(j=S[S.length-1][0],!(j!=="space"&&j!=="comment"));)this.tokenizer.back(S.pop());this.decl(S,w)}else this.unknownWord(S)}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 b,A,w=v.length,S="",j=!0,C,k;for(let E=0;E<w;E+=1)b=v[E],A=b[0],A==="space"&&E===w-1&&!y?j=!1:A==="comment"?(k=v[E-1]?v[E-1][0]:"empty",C=v[E+1]?v[E+1][0]:"empty",!a[k]&&!a[C]?S.slice(-1)===","?j=!1:S+=b[1]:j=!1):S+=b[1];if(!j){let E=v.reduce((M,R)=>M+R[1],"");p.raws[m]={raw:E,value:S}}p[m]=S}rule(p){p.pop();let m=new r;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 IT=d,IT}var BT,b5;function GD(){if(b5)return BT;b5=1;let t=Ad(),e=kj(),n=cSe();function i(r,s){let a=new e(r,s),l=new n(a);try{l.parse()}catch(u){throw u}return l.root}return BT=i,i.default=i,t.registerParse(i),BT}var LT,A5;function hV(){if(A5)return LT;A5=1;let t=Ad(),{my:e}=Sj();class n{constructor(r,s={}){if(this.type="warning",this.text=r,s.node&&s.node.source){s.node[e]||t.rebuild(s.node);let a=s.node.rangeBy(s);this.line=a.start.line,this.column=a.start.column,this.endLine=a.end.line,this.endColumn=a.end.column}for(let a in s)this[a]=s[a]}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 LT=n,n.default=n,LT}var PT,w5;function XD(){if(w5)return PT;w5=1;let t=hV();class e{get content(){return this.css}constructor(i,r,s){this.processor=i,this.messages=[],this.root=r,this.opts=s,this.css="",this.map=void 0}toString(){return this.css}warn(i,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let s=new t(i,r);return this.messages.push(s),s}warnings(){return this.messages.filter(i=>i.type==="warning")}}return PT=e,e.default=e,PT}var FT,S5;function dV(){if(S5)return FT;S5=1;let t=Ad(),e=UD(),n=uV(),i=GD(),r=XD(),s=hx(),a=wj(),{isClean:l,my:u}=Sj();const d={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(j){return typeof j=="object"&&typeof j.then=="function"}function y(j){let C=!1,k=d[j.type];return j.type==="decl"?C=j.prop.toLowerCase():j.type==="atrule"&&(C=j.name.toLowerCase()),C&&j.append?[k,k+"-"+C,m,k+"Exit",k+"Exit-"+C]:C?[k,k+"-"+C,k+"Exit",k+"Exit-"+C]:j.append?[k,m,k+"Exit"]:[k,k+"Exit"]}function b(j){let C;return j.type==="document"?C=["Document",m,"DocumentExit"]:j.type==="root"?C=["Root",m,"RootExit"]:C=y(j),{eventIndex:0,events:C,iterator:0,node:j,visitorIndex:0,visitors:[]}}function A(j){let C=[j];for(;C.length>0;){let k=C.pop();if(k[l]=!1,k.nodes)for(let E of k.nodes)C.push(E)}return j}let w={};class S{get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}constructor(C,k,E){this.stringified=!1,this.processed=!1;let M;if(typeof k=="object"&&k!==null&&(k.type==="root"||k.type==="document"))M=A(k);else if(k instanceof S||k instanceof r)M=A(k.root),k.map&&(typeof E.map>"u"&&(E.map={}),E.map.inline||(E.map.inline=!1),E.map.prev=k.map);else{let R=i;E.syntax&&(R=E.syntax.parse),E.parser&&(R=E.parser),R.parse&&(R=R.parse);try{M=R(k,E)}catch(D){this.processed=!0,this.error=D}M&&!M[u]&&t.rebuild(M)}this.result=new r(C,M,E),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(C){return this.async().catch(C)}finally(C){return this.async().then(C,C)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(C,k){let E=this.result.lastPlugin;try{k&&k.addToError(C),this.error=C,C.name==="CssSyntaxError"&&!C.plugin?(C.plugin=E.postcssPlugin,C.setMessage()):E.postcssVersion}catch(M){console&&console.error&&console.error(M)}return C}prepareVisitors(){this.listeners={};let C=(k,E,M)=>{this.listeners[E]||(this.listeners[E]=[]),this.listeners[E].push([k,M])};for(let k of this.plugins)if(typeof k=="object")for(let E in k){if(!f[E]&&/^[A-Z]/.test(E))throw new Error(`Unknown event ${E} in ${k.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!p[E])if(typeof k[E]=="object")for(let M in k[E])M==="*"?C(k,E,k[E][M]):C(k,E+"-"+M.toLowerCase(),k[E][M]);else typeof k[E]=="function"&&C(k,E,k[E])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let C=0;C<this.plugins.length;C++){let k=this.plugins[C],E=this.runOnRoot(k);if(v(E))try{await E}catch(M){throw this.handleError(M)}}if(this.prepareVisitors(),this.hasListener){let C=this.result.root;for(;!C[l];){C[l]=!0;let k=[b(C)];for(;k.length>0;){let E=this.visitTick(k);if(v(E))try{await E}catch(M){let R=k[k.length-1].node;throw this.handleError(M,R)}}}if(this.listeners.OnceExit)for(let[k,E]of this.listeners.OnceExit){this.result.lastPlugin=k;try{if(C.type==="document"){let M=C.nodes.map(R=>E(R,this.helpers));await Promise.all(M)}else await E(C,this.helpers)}catch(M){throw this.handleError(M)}}}return this.processed=!0,this.stringify()}runOnRoot(C){this.result.lastPlugin=C;try{if(typeof C=="object"&&C.Once){if(this.result.root.type==="document"){let k=this.result.root.nodes.map(E=>C.Once(E,this.helpers));return v(k[0])?Promise.all(k):k}return C.Once(this.result.root,this.helpers)}else if(typeof C=="function")return C(this.result.root,this.result)}catch(k){throw this.handleError(k)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let C=this.result.opts,k=a;C.syntax&&(k=C.syntax.stringify),C.stringifier&&(k=C.stringifier),k.stringify&&(k=k.stringify);let E=this.result.root.source;if(C.map===void 0&&!(E&&E.input&&E.input.map)){let D="";return k(this.result.root,F=>{D+=F}),this.result.css=D,this.result}let R=new n(k,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 C of this.plugins){let k=this.runOnRoot(C);if(v(k))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let C=this.result.root;for(;!C[l];)C[l]=!0,this.walkSync(C);if(this.listeners.OnceExit)if(C.type==="document")for(let k of C.nodes)this.visitSync(this.listeners.OnceExit,k);else this.visitSync(this.listeners.OnceExit,C)}return this.result}then(C,k){return this.async().then(C,k)}toString(){return this.css}visitSync(C,k){for(let[E,M]of C){this.result.lastPlugin=E;let R;try{R=M(k,this.helpers)}catch(D){throw this.handleError(D,k.proxyOf)}if(k.type!=="root"&&k.type!=="document"&&!k.parent)return!0;if(v(R))throw this.getAsyncError()}}visitTick(C){let k=C[C.length-1],{node:E,visitors:M}=k;if(E.type!=="root"&&E.type!=="document"&&!E.parent){C.pop();return}if(M.length>0&&k.visitorIndex<M.length){let[D,F]=M[k.visitorIndex];k.visitorIndex+=1,k.visitorIndex===M.length&&(k.visitors=[],k.visitorIndex=0),this.result.lastPlugin=D;try{return F(E.toProxy(),this.helpers)}catch(I){throw this.handleError(I,E)}}if(k.iterator!==0){let D=k.iterator,F;for(;F=E.nodes[E.indexes[D]];)if(E.indexes[D]+=1,!F[l]){F[l]=!0,C.push(b(F));return}k.iterator=0,delete E.indexes[D]}let R=k.events;for(;k.eventIndex<R.length;){let D=R[k.eventIndex];if(k.eventIndex+=1,D===m){E.nodes&&E.nodes.length&&(E[l]=!0,k.iterator=E.getIterator());return}else if(this.listeners[D]){k.visitors=this.listeners[D];return}}C.pop()}walkSync(C){C[l]=!0;let k=[{eventIndex:0,events:y(C),iterator:0,node:C}];for(;k.length>0;){let E=k[k.length-1],M=E.node;if(E.iterator!==0){let R=E.iterator,D,F=!1;for(;D=M.nodes[M.indexes[R]];)if(M.indexes[R]+=1,!D[l]){D[l]=!0,k.push({eventIndex:0,events:y(D),iterator:0,node:D}),F=!0;break}if(F)continue;E.iterator=0,delete M.indexes[R]}if(E.eventIndex<E.events.length){let R=E.events[E.eventIndex];if(E.eventIndex+=1,R===m)M.nodes&&M.nodes.length&&(E.iterator=M.getIterator());else{let D=this.listeners[R];D&&this.visitSync(D,M.toProxy())&&k.pop()}continue}k.pop()}}warnings(){return this.sync().warnings()}}return S.registerPostcss=j=>{w=j},FT=S,S.default=S,s.registerLazyResult(S),e.registerLazyResult(S),FT}var $T,j5;function uSe(){if(j5)return $T;j5=1;let t=uV(),e=GD(),n=XD(),i=wj();class r{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 a,l=e;try{a=l(this._css,this._opts)}catch(u){this.error=u}if(this.error)throw this.error;return this._root=a,a}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(a,l,u){l=l.toString(),this.stringified=!1,this._processor=a,this._css=l,this._opts=u,this._map=void 0;let d=i;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(d,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(a){return this.async().catch(a)}finally(a){return this.async().then(a,a)}sync(){if(this.error)throw this.error;return this.result}then(a,l){return this.async().then(a,l)}toString(){return this._css}warnings(){return[]}}return $T=r,r.default=r,$T}var zT,C5;function hSe(){if(C5)return zT;C5=1;let t=UD(),e=dV(),n=uSe(),i=hx();class r{constructor(a=[]){this.version="8.5.23",this.plugins=this.normalize(a)}normalize(a){let l=[];for(let u of a)if(u.postcss===!0?u=u():u.postcss&&(u=u.postcss),typeof u=="object"&&Array.isArray(u.plugins))l=l.concat(u.plugins);else if(typeof u=="object"&&u.postcssPlugin)l.push(u);else if(typeof u=="function")l.push(u);else if(!(typeof u=="object"&&(u.parse||u.stringify)))throw new Error(u+" is not a PostCSS plugin");return l}process(a,l={}){return!this.plugins.length&&!l.parser&&!l.stringifier&&!l.syntax?new n(this,a,l):new e(this,a,l)}use(a){return this.plugins=this.plugins.concat(this.normalize([a])),this}}return zT=r,r.default=r,i.registerProcessor(r),t.registerProcessor(r),zT}var HT,_5;function dSe(){if(_5)return HT;_5=1;var t={};let e=WD(),n=Cj(),i=Ad(),r=YD(),s=_j(),a=UD(),l=aSe(),u=kj(),d=dV(),f=cV(),p=jj(),m=GD(),v=hSe(),y=XD(),b=hx(),A=VD(),w=wj(),S=hV();function j(...C){return C.length===1&&Array.isArray(C[0])&&(C=C[0]),new v(C)}return j.plugin=function(k,E){let M=!1;function R(...F){console&&console.warn&&!M&&(M=!0,console.warn(k+`: postcss.plugin was deprecated. Migration guide:
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),t.LANG&&t.LANG.startsWith("cn")&&console.warn(k+`: 里面 postcss.plugin 被弃用. 迁移指南:
https://www.w3ctech.com/topic/2226`));let I=E(...F);return I.postcssPlugin=k,I.postcssVersion=new v().version,I}let D;return Object.defineProperty(R,"postcss",{get(){return D||(D=R()),D}}),R.process=function(F,I,Q){return j([R(Q)]).process(F,I)},R},j.stringify=w,j.parse=m,j.fromJSON=l,j.list=f,j.comment=C=>new n(C),j.atRule=C=>new e(C),j.decl=C=>new s(C),j.rule=C=>new A(C),j.root=C=>new b(C),j.document=C=>new a(C),j.CssSyntaxError=r,j.Declaration=s,j.Container=i,j.Processor=v,j.Document=a,j.Comment=n,j.Warning=S,j.AtRule=e,j.Result=y,j.Input=u,j.Rule=A,j.Root=b,j.Node=p,d.registerPostcss(j),HT=j,j.default=j,HT}var vA={exports:{}},k5;function fSe(){if(k5)return vA.exports;k5=1;const t=Qq();function e(i){for(i=i.replace(/[\x00-\x20]+/g,"");;){const r=i.indexOf("<!--");if(r===-1)break;const s=i.indexOf("-->",r+4);if(s===-1)break;i=i.substring(0,r)+i.substring(s+3)}return i}function n(i,r){r=r||{};const s=r.allowedSchemes||["http","https","ftp","mailto","tel","sms"],a=r.allowProtocolRelative!==!1;if(typeof i!="string")return!1;i=e(i);const l=i.match(/^([a-zA-Z][a-zA-Z0-9.\-+]*):/);if(!l)return i.match(/^[/\\]{2}/)?!a:!1;const u=l[1].toLowerCase();return s.indexOf(u)===-1}return vA.exports=function(i){const r={};return r.options=i||{},r.filterTag=r.options.filterTag||function(s){return s=s.trim(),s.toLowerCase()},r.string=function(s,a){return typeof s!="string"&&(typeof s=="number"||typeof s=="boolean"?s+="":s=""),s=s.trim(),a!==void 0&&s===""&&(s=a),s},r.strings=function(s){return Array.isArray(s)?s.map(function(a){return r.string(a)}):[]},r.integer=function(s,a,l,u){if(a===void 0&&(a=0),typeof s=="number")s=Math.floor(s);else try{s=parseInt(s,10),isNaN(s)&&(s=a)}catch{s=a}return typeof l=="number"&&s<l&&(s=l),typeof u=="number"&&s>u&&(s=u),s},r.padInteger=function(s,a){let l=s+"";for(;l.length<a;)l="0"+l;return l},r.float=function(s,a,l,u){if(a===void 0&&(a=0),typeof s!="number")try{s=parseFloat(s,10),isNaN(s)&&(s=a)}catch{s=a}return typeof l=="number"&&s<l&&(s=l),typeof u=="number"&&s>u&&(s=u),s},r.naughtyHref=n,r.url=function(s,a,l){if(s=r.string(s,a),s===a)return s;if(s=e(s),n(s)||(s=u(s),s===null))return a;return s;function u(d){return d.match(/^(((https?|ftp):\/\/)|((mailto|tel|sms):)|#|([^/.]+)?\/|[^/.]+$)/)?d:d.match(/^[^/.]+\.[^/.]+/)?(l?"https://":"http://")+d:null}},r.select=function(s,a,l){if(s=r.string(s),!a||!a.length)return l;let u;return typeof a[0]=="object"?(u=a.find(function(d){return d.value===null||d.value===void 0?!1:d.value.toString()===s}),u!=null?u.value:l):(u=a.find(function(d){return d==null?!1:d.toString()===s}),u!==void 0?u:l)},r.boolean=function(s,a){return s===!0?!0:s===!1?!1:(s=r.string(s,a),s===a?s===void 0?!1:s:(s=s.toLowerCase().charAt(0),s===""||s==="n"||s==="0"||s==="f"?!1:s==="t"||s==="y"||s==="1"))},r.addBooleanFilterToCriteria=function(s,a,l,u){u===void 0&&(u=null);let d=typeof s=="object"&&s!==null?s[a]:s;d=d===void 0?u:d,d=r.booleanOrNull(d),d===null||(d?l[a]=!0:l[a]={$ne:!0})},r.booleanOrNull=function(s,a){return s===!0||s===!1||s===null?s:(s=r.string(s,a),s===a?a===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:a))},r.date=function(s,a,l){let u;function d(){return a===void 0&&(a=t().format("YYYY-MM-DD")),a}if(typeof s=="string"){if(s.match(/\//)){if(u=s.split("/"),u.length===2)return(l||new Date).getFullYear()+"-"+r.padInteger(u[0],2)+"-"+r.padInteger(u[1],2);if(u.length===3){if(u[2]<100){const f=l||new Date,p=f.getFullYear()%100,m=f.getFullYear()-p;let v=parseInt(u[2])+m;v-f.getFullYear()>50&&(v-=100),u[2]=v}return r.padInteger(u[2],4)+"-"+r.padInteger(u[0],2)+"-"+r.padInteger(u[1],2)}else return d()}else if(s.match(/-/))return u=s.split("-"),u.length===2?(l||new Date).getFullYear()+"-"+r.padInteger(u[0],2)+"-"+r.padInteger(u[1],2):u.length===3?r.padInteger(u[0],4)+"-"+r.padInteger(u[1],2)+"-"+r.padInteger(u[2],2):d()}try{return s===null||(s=l||new Date(s),isNaN(s.getTime()))?d():s.getFullYear()+"-"+r.padInteger(s.getMonth()+1,2)+"-"+r.padInteger(s.getDate(),2)}catch{return d()}},r.formatDate=function(s){return t(s).format("YYYY-MM-DD")},r.time=function(s,a){s=r.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 u=parseInt(l[1],10);const d=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),u===12&&p==="a"?u-=12:u===12&&p==="p"||p==="p"&&(u+=12),(u===24||u==="24")&&(u=0),r.padInteger(u,2)+":"+r.padInteger(d,2)+":"+r.padInteger(f,2)}else return a!==void 0?a:t().format("HH:mm")},r.formatTime=function(s){return t(s).format("HH:mm:ss")},r.tags=function(s,a){return typeof s=="string"&&(s=s.split(/,\s*/)),Array.isArray(s)?s.map(f=>r.string(f)).map(a||r.filterTag).filter(f=>f.length>0):[]},r.idRegExp=r.options.idRegExp||/^[A-Za-z0-9_]+$/,r.id=function(s,a){const l=r.string(s,a);return l===a||l.match(r.idRegExp)?l:a},r.ids=function(s){return Array.isArray(s)?s.filter(function(l){return r.id(l)!==void 0}):[]},r},vA.exports.naughtyHref=n,vA.exports}var qT,T5;function pSe(){if(T5)return qT;T5=1;const t=Kwe,e=Zwe(),{isPlainObject:n}=Jwe(),i=eSe(),r=nSe(),{parse:s}=dSe(),{naughtyHref:a}=fSe(),l=["img","audio","video","picture","svg","object","map","iframe","embed"],u=["script","style"];function d(w,S){w&&Object.keys(w).forEach(function(j){S(w[j],j)})}function f(w,S){return{}.hasOwnProperty.call(w,S)}function p(w,S){const j=[];return d(w,function(C){S(C)&&j.push(C)}),j}function m(w){for(const S in w)if(f(w,S))return!1;return!0}function v(w){return w.map(function(S){if(!S.url)throw new Error("URL missing");return S.url+(S.w?` ${S.w}w`:"")+(S.h?` ${S.h}h`:"")+(S.d?` ${S.d}x`:"")}).join(", ")}qT=b;const y=/^[^\0\t\n\f\r /<=>]+$/;function b(w,S,j){if(w==null)return"";typeof w=="number"&&(w=w.toString());let C="",k="";function E(ie,je){const se=this;this.tag=ie,this.attribs=je||{},this.tagPosition=C.length,this.text="",this.openingTagLength=0,this.mediaChildren=[],this.updateParentNodeText=function(){if(P.length){const be=P[P.length-1];be.text+=se.text}},this.updateParentNodeMediaChildren=function(){P.length&&l.includes(this.tag)&&P[P.length-1].mediaChildren.push(this.tag)}}S=Object.assign({},b.defaults,S),S.parser=Object.assign({},A,S.parser);const M=function(ie){return S.allowedTags===!1||(S.allowedTags||[]).indexOf(ie)>-1};u.forEach(function(ie){M(ie)&&!S.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=S.nonTextTags||["script","style","textarea","option","xmp"];let D,F;S.allowedAttributes&&(D={},F={},d(S.allowedAttributes,function(ie,je){D[je]=[];const se=[];ie.forEach(function(be){typeof be=="string"&&be.indexOf("*")>=0?se.push(e(be).replace(/\\\*/g,".*")):D[je].push(be)}),se.length&&(F[je]=new RegExp("^("+se.join("|")+")$"))}));const I={},Q={},G={};d(S.allowedClasses,function(ie,je){if(D&&(f(D,je)||(D[je]=[]),D[je].push("class")),I[je]=ie,Array.isArray(ie)){const se=[];I[je]=[],G[je]=[],ie.forEach(function(be){typeof be=="string"&&be.indexOf("*")>=0?se.push(e(be).replace(/\\\*/g,".*")):be instanceof RegExp?G[je].push(be):I[je].push(be)}),se.length&&(Q[je]=new RegExp("^("+se.join("|")+")$"))}});const L={};let q;d(S.transformTags,function(ie,je){let se;typeof ie=="function"?se=ie:typeof ie=="string"&&(se=b.simpleTransform(ie)),je==="*"?q=se:L[je]=se});let N,P,Y,K,W,z,U=!1;J();const V=new t.Parser({onopentag:function(ie,je){if(S.onOpenTag&&S.onOpenTag(ie,je),S.enforceHtmlBoundary&&ie==="html"&&J(),W){z++;return}const se=new E(ie,je);P.push(se);let be=!1;const Be=!!se.text;let Ce;if(f(L,ie)&&(Ce=L[ie](ie,je),se.attribs=je=Ce.attribs,Ce.text!==void 0&&(se.innerText=Ce.text),ie!==Ce.tagName&&(se.name=ie=Ce.tagName,K[N]=Ce.tagName)),q&&(Ce=q(ie,je),se.attribs=je=Ce.attribs,ie!==Ce.tagName&&(se.name=ie=Ce.tagName,K[N]=Ce.tagName)),(!M(ie)||S.disallowedTagsMode==="recursiveEscape"&&!m(Y)||S.nestingLimit!=null&&N>=S.nestingLimit)&&(be=!0,Y[N]=!0,(S.disallowedTagsMode==="discard"||S.disallowedTagsMode==="completelyDiscard")&&R.indexOf(ie)!==-1&&(W=!0,z=1)),N++,be){if(S.disallowedTagsMode==="discard"||S.disallowedTagsMode==="completelyDiscard"){if(se.innerText&&!Be){const Ye=ee(se.innerText);S.textFilter?C+=S.textFilter(Ye,ie):C+=Ye,U=!0}return}k=C,C=""}if(C+="<"+ie,ie==="script"&&(S.allowedScriptHostnames||S.allowedScriptDomains)&&(se.innerText=""),be&&(S.disallowedTagsMode==="escape"||S.disallowedTagsMode==="recursiveEscape")&&S.preserveEscapedAttributes?d(je,function(Ye,Ge){C+=" "+Ge+'="'+ee(Ye||"",!0)+'"'}):(!D||f(D,ie)||D["*"])&&d(je,function(Ye,Ge){if(!y.test(Ge)){delete se.attribs[Ge];return}if(Ye===""&&!S.allowedEmptyAttributes.includes(Ge)&&(S.nonBooleanAttributes.includes(Ge)||S.nonBooleanAttributes.includes("*"))){delete se.attribs[Ge];return}let dt=!1;if(!D||f(D,ie)&&D[ie].indexOf(Ge)!==-1||D["*"]&&D["*"].indexOf(Ge)!==-1||f(F,ie)&&F[ie].test(Ge)||F["*"]&&F["*"].test(Ge))dt=!0;else if(D&&D[ie]){for(const nt of D[ie])if(n(nt)&&nt.name&&nt.name===Ge){dt=!0;let Ee="";if(nt.multiple===!0){const Qe=Ye.split(" ");for(const Xe of Qe)nt.values.indexOf(Xe)!==-1&&(Ee===""?Ee=Xe:Ee+=" "+Xe)}else nt.values.indexOf(Ye)>=0&&(Ee=Ye);Ye=Ee}}if(dt){if(S.allowedSchemesAppliedToAttributes.indexOf(Ge)!==-1&&ce(ie,Ye)){delete se.attribs[Ge];return}if(ie==="script"&&Ge==="src"){let nt=!0;try{const Ee=he(Ye);if(S.allowedScriptHostnames||S.allowedScriptDomains){const Qe=(S.allowedScriptHostnames||[]).find(function(Ze){return Ze===Ee.url.hostname}),Xe=(S.allowedScriptDomains||[]).find(function(Ze){return Ee.url.hostname===Ze||Ee.url.hostname.endsWith(`.${Ze}`)});nt=Qe||Xe}}catch{nt=!1}if(!nt){delete se.attribs[Ge];return}}if(ie==="iframe"&&Ge==="src"){let nt=!0;try{const Ee=he(Ye);if(Ee.isRelativeUrl)nt=f(S,"allowIframeRelativeUrls")?S.allowIframeRelativeUrls:!S.allowedIframeHostnames&&!S.allowedIframeDomains;else if(S.allowedIframeHostnames||S.allowedIframeDomains){const Qe=(S.allowedIframeHostnames||[]).find(function(Ze){return Ze===Ee.url.hostname}),Xe=(S.allowedIframeDomains||[]).find(function(Ze){return Ee.url.hostname===Ze||Ee.url.hostname.endsWith(`.${Ze}`)});nt=Qe||Xe}}catch{nt=!1}if(!nt){delete se.attribs[Ge];return}}if(Ge==="srcset"||Ge==="imagesrcset")try{let nt=r(Ye);if(nt.forEach(function(Ee){ce(Ge,Ee.url)&&(Ee.evil=!0)}),nt=p(nt,function(Ee){return!Ee.evil}),nt.length)Ye=v(p(nt,function(Ee){return!Ee.evil})),se.attribs[Ge]=Ye;else{delete se.attribs[Ge];return}}catch{delete se.attribs[Ge];return}if(Ge==="class"){const nt=I[ie],Ee=I["*"],Qe=Q[ie],Xe=G[ie],Ze=G["*"],vt=Q["*"],pn=[Qe,vt].concat(Xe,Ze).filter(function(mn){return mn});if(nt&&Ee?Ye=qe(Ye,i(nt,Ee),pn):Ye=qe(Ye,nt||Ee,pn),!Ye.length){delete se.attribs[Ge];return}}if(Ge==="style"){if(S.parseStyleAttributes)try{const nt=s(ie+" {"+Ye+"}",{map:!1}),Ee=Oe(nt,S.allowedStyles);if(Ye=Te(Ee),Ye.length===0){delete se.attribs[Ge];return}}catch{typeof window<"u"&&console.warn('Failed to parse "'+ie+" {"+Ye+`}", 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(S.allowedStyles)throw new Error("allowedStyles option cannot be used together with parseStyleAttributes: false.")}C+=" "+Ge,Ye&&Ye.length?C+='="'+ee(Ye,!0)+'"':S.allowedEmptyAttributes.includes(Ge)&&(C+='=""')}else delete se.attribs[Ge]}),S.selfClosing.indexOf(ie)!==-1)C+=" />";else if(C+=">",se.innerText&&!Be){const Ye=ee(se.innerText);S.textFilter?C+=S.textFilter(Ye,ie):C+=Ye,U=!0}be&&(C=k+ee(C),k=""),se.openingTagLength=C.length-se.tagPosition},ontext:function(ie){if(W)return;const je=P[P.length-1];let se;if(je&&(se=je.tag,ie=je.innerText!==void 0?je.innerText:ie),S.disallowedTagsMode==="completelyDiscard"&&!M(se))ie="";else if(se&&M(se)&&(S.disallowedTagsMode==="discard"||S.disallowedTagsMode==="completelyDiscard")&&(se==="script"||se==="style"))C+=ie;else if(se&&M(se)&&(S.disallowedTagsMode==="discard"||S.disallowedTagsMode==="completelyDiscard")&&(se==="textarea"||se==="xmp"))se==="xmp"?C+=ie.replace(/</g,"&lt;").replace(/>/g,"&gt;"):C+=ee(ie,!1);else if(!U){const be=ee(ie,!1);S.textFilter?C+=S.textFilter(be,se):C+=be}if(P.length){const be=P[P.length-1];be.text+=ie}},onclosetag:function(ie,je){if(S.onCloseTag&&S.onCloseTag(ie,je),W)if(z--,!z)W=!1;else return;const se=P.pop();if(!se)return;if(se.tag!==ie){P.push(se);return}W=S.enforceHtmlBoundary?ie==="html":!1,N--;const be=Y[N];if(be){if(delete Y[N],S.disallowedTagsMode==="discard"||S.disallowedTagsMode==="completelyDiscard"){se.updateParentNodeText();return}k=C,C=""}if(K[N]&&(ie=K[N],delete K[N]),S.exclusiveFilter){const Be=S.exclusiveFilter(se);if(Be==="excludeTag"){be&&(C=k,k=""),C=C.substring(0,se.tagPosition)+C.substring(se.tagPosition+se.openingTagLength);return}else if(Be){C=C.substring(0,se.tagPosition);return}}if(se.updateParentNodeMediaChildren(),se.updateParentNodeText(),S.selfClosing.indexOf(ie)!==-1||je&&!M(ie)&&["escape","recursiveEscape"].indexOf(S.disallowedTagsMode)>=0){be&&(C=k,k="");return}C+="</"+ie+">",be&&(C=k+ee(C),k=""),U=!1}},S.parser);if(V.write(w),V.end(),S.disallowedTagsMode==="escape"||S.disallowedTagsMode==="recursiveEscape"){const ie=V.endIndex;if(ie!=null&&ie>=0&&ie<w.length){const je=w.substring(ie);C+=ee(je)}else(ie==null||ie<0)&&w.length>0&&C===""&&(C=ee(w))}return C;function J(){C="",N=0,P=[],Y={},K={},W=!1,z=0}function ee(ie,je){return typeof ie!="string"&&(ie=ie+""),S.parser.decodeEntities&&(ie=ie.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),je&&(ie=ie.replace(/"/g,"&quot;"))),ie=ie.replace(/&(?![a-zA-Z0-9#]{1,20};)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),je&&(ie=ie.replace(/"/g,"&quot;")),ie}function ce(ie,je){const se=f(S.allowedSchemesByTag,ie)?S.allowedSchemesByTag[ie]:S.allowedSchemes||[];return a(je,{allowedSchemes:se,allowProtocolRelative:S.allowProtocolRelative})}function he(ie){if(ie=ie.replace(/^(\w+:)?\s*[\\/]\s*[\\/]/,"$1//"),ie.startsWith("relative:"))throw new Error("relative: exploit attempt");let je="relative://relative-site";for(let Be=0;Be<100;Be++)je+=`/${Be}`;const se=new URL(ie,je);return{isRelativeUrl:se&&se.hostname==="relative-site"&&se.protocol==="relative:",url:se}}function Oe(ie,je){if(!je)return ie;const se=ie.nodes[0];let be;return je[se.selector]&&je["*"]?be=i(je[se.selector],je["*"]):be=je[se.selector]||je["*"],be&&(ie.nodes[0].nodes=se.nodes.reduce(Re(be),[])),ie}function Te(ie){return ie.nodes[0].nodes.reduce(function(je,se){return je.push(`${se.prop}:${se.value}${se.important?" !important":""}`),je},[]).join(";")}function Re(ie){return function(je,se){return f(ie,se.prop)&&ie[se.prop].some(function(Be){return Be.test(se.value)})&&je.push(se),je}}function qe(ie,je,se){return je?(ie=ie.split(/\s+/),ie.filter(function(be){return je.indexOf(be)!==-1||se.some(function(Be){return Be.test(be)})}).join(" ")):ie}}const A={decodeEntities:!0};return b.defaults={allowedTags:["address","article","aside","footer","header","h1","h2","h3","h4","h5","h6","hgroup","main","nav","section","blockquote","dd","div","dl","dt","figcaption","figure","hr","li","menu","ol","p","pre","ul","a","abbr","b","bdi","bdo","br","cite","code","data","dfn","em","i","kbd","mark","q","rb","rp","rt","rtc","ruby","s","samp","small","span","strong","sub","sup","time","u","var","wbr","caption","col","colgroup","table","tbody","td","tfoot","th","thead","tr"],nonBooleanAttributes:["abbr","accept","accept-charset","accesskey","action","allow","alt","as","autocapitalize","autocomplete","blocking","charset","cite","class","color","cols","colspan","content","contenteditable","coords","crossorigin","data","datetime","decoding","dir","dirname","download","draggable","enctype","enterkeyhint","fetchpriority","for","form","formaction","formenctype","formmethod","formtarget","headers","height","hidden","high","href","hreflang","http-equiv","id","imagesizes","imagesrcset","inputmode","integrity","is","itemid","itemprop","itemref","itemtype","kind","label","lang","list","loading","low","max","maxlength","media","method","min","minlength","name","nonce","optimum","pattern","ping","placeholder","popover","popovertarget","popovertargetaction","poster","preload","referrerpolicy","rel","rows","rowspan","sandbox","scope","shape","size","sizes","slot","span","spellcheck","src","srcdoc","srclang","srcset","start","step","style","tabindex","target","title","translate","type","usemap","value","width","wrap","onauxclick","onafterprint","onbeforematch","onbeforeprint","onbeforeunload","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onformdata","onhashchange","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onlanguagechange","onload","onloadeddata","onloadedmetadata","onloadstart","onmessage","onmessageerror","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onoffline","ononline","onpagehide","onpageshow","onpaste","onpause","onplay","onplaying","onpopstate","onprogress","onratechange","onreset","onresize","onrejectionhandled","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onslotchange","onstalled","onstorage","onsubmit","onsuspend","ontimeupdate","ontoggle","onunhandledrejection","onunload","onvolumechange","onwaiting","onwheel"],disallowedTagsMode:"discard",allowedAttributes:{a:["href","name","target"],img:["src","srcset","alt","title","width","height","loading"]},allowedEmptyAttributes:["alt"],selfClosing:["img","br","hr","area","base","basefont","input","link","meta","col"],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},b.simpleTransform=function(w,S,j){return j=j===void 0?!0:j,S=S||{},function(C,k){let E;if(j)for(E in S)k[E]=S[E];else k=S;return{tagName:w,attribs:k}}},qT}var mSe=pSe();const gSe=Al(mSe);var St=(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))(St||{}),sn=(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))(sn||{});const vSe=["==","!=",">","<",">=","<="],ySe=["and","or","unless"];var Li=(t=>(t.oneToOne="one-to-one",t.manyToOne="many-to-one",t.oneToMany="one-to-many",t.manyToMany="many-to-many",t))(Li||{}),ue=(t=>(t.none="none",t.vector="vector",t.scalar="scalar",t.matrix="matrix",t.string="string",t))(ue||{}),Ta=(t=>(t.equal="=",t.notEqual="!=",t.matchRegexp="=~",t.matchNotRegexp="!~",t))(Ta||{});const Kh=t=>t.replace(/([\\"])/g,"\\$1"),KD=t=>vSe.includes(t),AE=t=>ySe.includes(t),O5={[sn.add]:3,[sn.sub]:3,[sn.mul]:2,[sn.div]:2,[sn.mod]:2,[sn.pow]:1,[sn.eql]:4,[sn.neq]:4,[sn.gtr]:4,[sn.lss]:4,[sn.gte]:4,[sn.lte]:4,[sn.trimLower]:4,[sn.trimUpper]:4,[sn.and]:5,[sn.or]:6,[sn.unless]:5,[sn.atan2]:2},jw=(t,e)=>e.type!==St.binaryExpr||O5[t]>O5[e.op]?e:{type:St.parenExpr,expr:e},xSe=t=>{switch(t.type){case St.aggregation:return t.param===null?[t.expr]:[t.param,t.expr];case St.subquery:return[t.expr];case St.parenExpr:return[t.expr];case St.call:return t.args;case St.matrixSelector:case St.vectorSelector:case St.numberLiteral:case St.stringLiteral:return[];case St.placeholder:return t.children;case St.unaryExpr:return[t.expr];case St.binaryExpr:return[t.lhs,t.rhs];default:throw new Error("unsupported node type")}},Kp=t=>{switch(t.type){case St.aggregation:return ue.vector;case St.binaryExpr:{const e=[Kp(t.lhs),Kp(t.rhs)];return e.includes(null)?null:e.includes(ue.vector)?ue.vector:ue.scalar}case St.call:return t.func.returnType;case St.matrixSelector:return ue.matrix;case St.numberLiteral:return ue.scalar;case St.parenExpr:return Kp(t.expr);case St.placeholder:return null;case St.stringLiteral:return ue.string;case St.subquery:return ue.matrix;case St.unaryExpr:return Kp(t.expr);case St.vectorSelector:return ue.vector;default:throw new Error("invalid node type")}},bSe=["topk","bottomk","quantile","count_values","limitk","limit_ratio"];ue.scalar,ue.string,ue.matrix,ue.vector;ue.none+"",ue.string+"",ue.scalar+"",ue.vector+"",ue.matrix+"";const ASe=/^[a-zA-Z_:][a-zA-Z0-9_:]*$/,wSe=/^[a-zA-Z_][a-zA-Z0-9_]*$/,Tj=t=>t!==""&&!ASe.test(t),SSe=t=>!wSe.test(t),vs=t=>t.replace(/([\\"])/g,"\\$1"),hd=t=>SSe(t)?`"${vs(t)}"`:t,ol=t=>{if(t.type==="numberLiteral")return t.duration?Gn(parseFloat(t.val)*1e3):t.val;const{op:e,lhs:n,rhs:i,wrapped:r}=t;let s;return e==="step"||e==="range"?s=`${e}()`:e==="min_of"||e==="max_of"?s=`${e}(${n?ol(n):""},${i?ol(i):""})`:n!==null&&i!==null?s=`${ol(n)} ${e} ${ol(i)}`:s=`${e}${i?ol(i):""}`,r?`(${s})`:s},yA=t=>t.map(e=>hd(e)).join(", "),fV=(t,e,n,i)=>`${t!==null?` @ ${(t/1e3).toFixed(3)}`:e!==null?` @ ${e}()`:""}${i?` offset ${ol(i)}`:n===0?"":n>0?` offset ${Gn(n)}`:` offset -${Gn(-n)}`}`,E5=t=>{var l;const e=t.matchers.filter(u=>!(u.name==="__name__"&&u.type===Ta.equal)).map(u=>`${hd(u.name)}${u.type}"${vs(u.value)}"`),n=t.name||((l=t.matchers.find(u=>u.name==="__name__"&&u.type===Ta.equal))==null?void 0:l.value)||"",i=Tj(n);i&&e.unshift(`"${vs(n)}"`);let r="";t.type===St.matrixSelector&&(t.rangeExpr?r=`[${ol(t.rangeExpr)}]`:r=`[${Gn(t.range)}]`);const s=t.anchored?" anchored":t.smoothed?" smoothed":"",a=fV(t.timestamp,t.startOrEnd,t.offset,t.offsetExpr);return`${i?"":n}${e.length>0?`{${e.join(",")}}`:""}${r}${s}${a}`},gs=(t,e=0,n=!1,i=!0)=>{const r=n?`
`:"",s=n?`
`:" ",a=e+2,l=n?" ".repeat(e):"",u=i?l:"";switch(t.type){case St.aggregation:return`${u}${t.op}${t.without?` without(${yA(t.grouping)}) `:t.grouping.length>0?` by(${yA(t.grouping)}) `:""}(${r}${bSe.includes(t.op)&&t.param!==null?`${gs(t.param,a,n)},${s}`:""}${gs(t.expr,a,n)}${r}${l})`;case St.subquery:return`${u}${gs(t.expr,e,n)}[${t.rangeExpr?ol(t.rangeExpr):Gn(t.range)}:${t.stepExpr?ol(t.stepExpr):t.step!==0?Gn(t.step):""}]${fV(t.timestamp,t.startOrEnd,t.offset,t.offsetExpr)}`;case St.parenExpr:return`${u}(${r}${gs(t.expr,a,n)}${r}${l})`;case St.call:{const d=t.args.length>0?r:"";return`${u}${t.func.name}(${d}${t.args.map(f=>gs(f,a,n)).join(","+s)}${d}${t.args.length>0?l:""})`}case St.matrixSelector:return`${u}${E5(t)}`;case St.vectorSelector:return`${u}${E5(t)}`;case St.numberLiteral:return`${u}${t.val}`;case St.stringLiteral:return`${u}"${vs(t.val)}"`;case St.unaryExpr:return`${u}${t.op}${gs(t.expr,e,n,!1)}`;case St.binaryExpr:{let d="",f="",p="";const m=t.matching;if(m!==null){(m.labels.length>0||m.on||m.card===Li.manyToOne||m.card===Li.oneToMany)&&(d=` ${m.on?"on":"ignoring"}(${yA(m.labels)})`),(m.card===Li.manyToOne||m.card===Li.oneToMany)&&(f=` group_${m.card===Li.manyToOne?"left":"right"}(${yA(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`${gs(jw(t.op,t.lhs),a,n)}${s}${l}${t.op}${t.bool?" bool":""}${d}${f}${p}${s}${gs(jw(t.op,t.rhs),a,n)}`}case St.placeholder:return`${u}…${t.children.length>0?`(${r}${t.children.map(d=>gs(d,a,n)).join(","+s)}${r}${l})`:""}`;default:throw new Error("unsupported node type")}},Pr=t=>{if(t.type==="numberLiteral")return t.duration?o.jsx("span",{className:"promql-duration",children:Gn(parseFloat(t.val)*1e3)}):o.jsx("span",{className:"promql-number",children:t.val});const{op:e,lhs:n,rhs:i,wrapped:r}=t;let s;return e==="step"||e==="range"?s=o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"promql-keyword",children:e}),o.jsx("span",{className:"promql-paren",children:"("}),o.jsx("span",{className:"promql-paren",children:")"})]}):e==="min_of"||e==="max_of"?s=o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"promql-keyword",children:e}),o.jsx("span",{className:"promql-paren",children:"("}),n&&Pr(n),n&&i&&o.jsx(o.Fragment,{children:", "}),i&&Pr(i),o.jsx("span",{className:"promql-paren",children:")"})]}):n!==null&&i!==null?s=o.jsxs(o.Fragment,{children:[Pr(n)," ",o.jsx("span",{className:"promql-operator",children:e})," ",Pr(i)]}):s=o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"promql-operator",children:e}),i&&Pr(i)]}),r?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"promql-paren",children:"("}),s,o.jsx("span",{className:"promql-paren",children:")"})]}):s},wo=t=>t.map((e,n)=>o.jsxs("span",{children:[n!==0&&", ",o.jsx("span",{className:"promql-code promql-label-name",children:hd(e)})]},n)),pV=(t,e,n,i)=>o.jsxs(o.Fragment,{children:[t!==null?o.jsxs(o.Fragment,{children:[" ",o.jsx("span",{className:"promql-operator",children:"@"})," ",o.jsx("span",{className:"promql-number",children:(t/1e3).toFixed(3)})]}):e!==null?o.jsxs(o.Fragment,{children:[" ",o.jsx("span",{className:"promql-operator",children:"@"})," ",o.jsx("span",{className:"promql-keyword",children:e}),o.jsx("span",{className:"promql-paren",children:"("}),o.jsx("span",{className:"promql-paren",children:")"})]}):o.jsx(o.Fragment,{}),i?o.jsxs(o.Fragment,{children:[" ",o.jsx("span",{className:"promql-keyword",children:"offset"})," ",Pr(i)]}):n===0?o.jsx(o.Fragment,{}):n>0?o.jsxs(o.Fragment,{children:[" ",o.jsx("span",{className:"promql-keyword",children:"offset"})," ",o.jsx("span",{className:"promql-duration",children:Gn(n)})]}):o.jsxs(o.Fragment,{children:[" ",o.jsx("span",{className:"promql-keyword",children:"offset"})," ",o.jsxs("span",{className:"promql-duration",children:["-",Gn(-n)]})]})]}),M5=t=>{var r;const e=[],n=t.name||((r=t.matchers.find(s=>s.name==="__name__"&&s.type===Ta.equal))==null?void 0:r.value)||"",i=Tj(n);return i&&e.push(o.jsx("span",{children:o.jsxs("span",{className:"promql-string",children:['"',vs(n),'"']})},"__name__")),e.push(...t.matchers.filter(s=>!(s.name==="__name__"&&s.type===Ta.equal)).map((s,a)=>o.jsxs("span",{children:[(a!==0||i)&&",",o.jsx("span",{className:"promql-label-name",children:hd(s.name)}),s.type,o.jsxs("span",{className:"promql-string",children:['"',vs(s.value),'"']})]},a))),o.jsxs(o.Fragment,{children:[!i&&o.jsx("span",{className:"promql-metric-name",children:n}),e.length>0&&o.jsxs(o.Fragment,{children:["{",o.jsx("span",{className:"promql-metric-name",children:e}),"}"]}),t.type===St.matrixSelector&&o.jsxs(o.Fragment,{children:["[",t.rangeExpr?Pr(t.rangeExpr):o.jsx("span",{className:"promql-duration",children:Gn(t.range)}),"]"]}),t.anchored&&o.jsxs(o.Fragment,{children:[" ",o.jsx("span",{className:"promql-keyword",children:"anchored"})]}),t.smoothed&&o.jsxs(o.Fragment,{children:[" ",o.jsx("span",{className:"promql-keyword",children:"smoothed"})]}),pV(t.timestamp,t.startOrEnd,t.offset,t.offsetExpr)]})},QT=o.jsx("span",{className:"promql-ellipsis",children:"…"}),jSe=(t,e,n)=>{if(n===0)return QT;const i=n===void 0?void 0:n-1;switch(t.type){case St.aggregation:return o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"promql-keyword",children:t.op}),t.without?o.jsxs(o.Fragment,{children:[" ",o.jsx("span",{className:"promql-keyword",children:"without"}),o.jsx("span",{className:"promql-paren",children:"("}),wo(t.grouping),o.jsx("span",{className:"promql-paren",children:")"})," "]}):t.grouping.length>0&&o.jsxs(o.Fragment,{children:[" ",o.jsx("span",{className:"promql-keyword",children:"by"}),o.jsx("span",{className:"promql-paren",children:"("}),wo(t.grouping),o.jsx("span",{className:"promql-paren",children:")"})," "]}),e&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"promql-paren",children:"("}),t.param!==null&&o.jsxs(o.Fragment,{children:[Ya(t.param,e,i),", "]}),Ya(t.expr,e,i),o.jsx("span",{className:"promql-paren",children:")"})]})]});case St.subquery:return o.jsxs(o.Fragment,{children:[e&&Ya(t.expr,e,i),"[",t.rangeExpr?Pr(t.rangeExpr):o.jsx("span",{className:"promql-duration",children:Gn(t.range)}),":",t.stepExpr?Pr(t.stepExpr):t.step!==0&&o.jsx("span",{className:"promql-duration",children:Gn(t.step)}),"]",pV(t.timestamp,t.startOrEnd,t.offset,t.offsetExpr)]});case St.parenExpr:return o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"promql-paren",children:"("}),e&&Ya(t.expr,e,i),o.jsx("span",{className:"promql-paren",children:")"})]});case St.call:{const r=i===void 0||i>0?t.args.map((s,a)=>o.jsxs("span",{children:[a!==0&&", ",Ya(s,e)]},a)):t.args.length>0?QT:"";return o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"promql-keyword",children:t.func.name}),e&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"promql-paren",children:"("}),r,o.jsx("span",{className:"promql-paren",children:")"})]})]})}case St.matrixSelector:return M5(t);case St.vectorSelector:return M5(t);case St.numberLiteral:return o.jsx("span",{className:"promql-number",children:t.val});case St.stringLiteral:return o.jsxs("span",{className:"promql-string",children:['"',vs(t.val),'"']});case St.unaryExpr:return o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"promql-operator",children:t.op}),e&&Ya(t.expr,e,i)]});case St.binaryExpr:{let r=o.jsx(o.Fragment,{}),s=o.jsx(o.Fragment,{}),a=o.jsx(o.Fragment,{});const l=t.matching;if(l!==null){(l.labels.length>0||l.on||l.card===Li.manyToOne||l.card===Li.oneToMany)&&(r=o.jsxs(o.Fragment,{children:[" ",o.jsx("span",{className:"promql-keyword",children:l.on?"on":"ignoring"}),o.jsx("span",{className:"promql-paren",children:"("}),wo(l.labels),o.jsx("span",{className:"promql-paren",children:")"})]})),(l.card===Li.manyToOne||l.card===Li.oneToMany)&&(s=o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"promql-keyword",children:[" ","group_",l.card===Li.manyToOne?"left":"right"]}),o.jsx("span",{className:"promql-paren",children:"("}),wo(l.include),o.jsx("span",{className:"promql-paren",children:")"})]}));const u=l.fillValues.lhs,d=l.fillValues.rhs;(u!==null||d!==null)&&(u===d?a=o.jsxs(o.Fragment,{children:[" ",o.jsx("span",{className:"promql-keyword",children:"fill"}),o.jsx("span",{className:"promql-paren",children:"("}),o.jsx("span",{className:"promql-number",children:u}),o.jsx("span",{className:"promql-paren",children:")"})]}):a=o.jsxs(o.Fragment,{children:[u!==null&&o.jsxs(o.Fragment,{children:[" ",o.jsx("span",{className:"promql-keyword",children:"fill_left"}),o.jsx("span",{className:"promql-paren",children:"("}),o.jsx("span",{className:"promql-number",children:u}),o.jsx("span",{className:"promql-paren",children:")"})]}),d!==null&&o.jsxs(o.Fragment,{children:[" ",o.jsx("span",{className:"promql-keyword",children:"fill_right"}),o.jsx("span",{className:"promql-paren",children:"("}),o.jsx("span",{className:"promql-number",children:d}),o.jsx("span",{className:"promql-paren",children:")"})]})]}))}return o.jsxs(o.Fragment,{children:[e&&Ya(jw(t.op,t.lhs),e,i)," ",["atan2","and","or","unless"].includes(t.op)?o.jsx("span",{className:"promql-keyword",children:t.op}):o.jsx("span",{className:"promql-operator",children:t.op}),t.bool&&o.jsxs(o.Fragment,{children:[" ",o.jsx("span",{className:"promql-keyword",children:"bool"})]}),r,s,a," ",e&&Ya(jw(t.op,t.rhs),e,i)]})}case St.placeholder:return QT;default:throw new Error("unsupported node type")}},Ya=(t,e,n)=>o.jsx("span",{className:"promql-code",children:jSe(t,e,n)}),CSe="_labelValue_1cwwq_1",_Se="_promqlPill_1cwwq_13",YT={labelValue:CSe,promqlPill:_Se},Xs={width:ge(16),height:ge(16)},L0={width:ge(14),height:ge(14)},al={width:Ps(17),height:Ps(17)},Au={width:"70%",height:"70%"},Gf={width:Ps(16),height:Ps(16)},iv={width:Ps(20),height:Ps(20)},kSe={width:Ps(17.5),height:Ps(17.5)},Cw={width:Ps(16),height:Ps(16)};ge(20),ge(20);const TSe=({metricName:t,insertText:e,hideLabelsExplorer:n})=>{const[i,r]=T.useState([]),[s,a]=T.useState([]),[l,u]=T.useState(null),[d,f]=T.useState(!0),p=k=>{a(s.filter(E=>E.name!==k))},m=()=>{if(l===null)throw new Error("tried to add null label matcher");a([...s,l]),u(null)},v=k=>o.jsx(tc,{size:"md",withRemoveButton:!0,onRemove:()=>{p(k.name)},className:YT.promqlPill,children:o.jsxs("span",{className:"promql-code",children:[o.jsx("span",{className:"promql-label-name",children:k.name}),k.type,o.jsxs("span",{className:"promql-string",children:['"',Kh(k.value),'"']})]})},k.name),y={type:St.vectorSelector,name:t,matchers:s,offset:0,offsetExpr:null,timestamp:null,startOrEnd:null,anchored:!1,smoothed:!1},{data:b,error:A,isLoading:w}=ud({path:"/series",params:{"match[]":gs(y)}}),[S,j,C]=T.useMemo(()=>{const k={},E={},M={};b!==void 0&&(b.data.forEach(D=>{Object.entries(D).forEach(([F,I])=>{F!=="__name__"&&(F in M?I in M[F]?M[F][I]++:M[F][I]=1:M[F]={[I]:1})})}),Object.entries(M).forEach(([D,F])=>{k[D]=Object.keys(F).length,E[D]=Object.entries(F).sort(([,I],[,Q])=>Q-I).map(([I,Q])=>({value:I,count:Q}))}));const R=Object.entries(k).sort((D,F)=>d?F[1]-D[1]:0);return[b==null?void 0:b.data.length,R,E]},[b,d]);return A?o.jsxs(Pt,{color:"red",title:"Error querying series",icon:o.jsx(Fr,{}),children:[o.jsx("strong",{children:"Error:"})," ",A.message]}):o.jsxs(Mn,{fz:"sm",children:[o.jsxs(Mn,{style:{overflow:"auto"},children:[o.jsxs(pt,{align:"center",mt:"lg",wrap:"nowrap",children:[o.jsx(xe,{w:70,fw:700,style:{flexShrink:0},children:"Selector:"}),o.jsx(tc.Group,{children:o.jsx(tc,{size:"md",className:YT.promqlPill,children:o.jsx("span",{style:{wordBreak:"break-word",whiteSpace:"pre"},children:Ya(y,!1)})})}),o.jsxs(pt,{wrap:"nowrap",children:[o.jsx(Lr,{variant:"light",size:"xs",onClick:()=>e(gs(y)),leftSection:o.jsx(T9,{style:iv}),title:"Insert selector at cursor and close explorer",children:"Insert"}),o.jsx(Ny,{value:gs(y),children:({copied:k,copy:E})=>o.jsx(Lr,{variant:"light",size:"xs",leftSection:k?o.jsx(Ym,{style:iv}):o.jsx(Yy,{style:iv}),onClick:E,title:"Copy selector to clipboard",children:"Copy"})})]})]}),o.jsxs(pt,{align:"center",children:[o.jsx(xe,{w:70,fw:700,style:{flexShrink:0},children:"Filters:"}),s.length>0?o.jsx(tc.Group,{children:s.map(k=>v(k))}):o.jsx(o.Fragment,{children:"No label filters"})]}),o.jsxs(pt,{style:{display:"flex",alignItems:"center",marginBottom:25},children:[o.jsx(xe,{w:70,fw:700,style:{flexShrink:0},children:"Results:"}),o.jsx(o.Fragment,{children:S!==void 0?`${S} series`:"loading..."})]})]}),o.jsxs(pt,{justify:"space-between",children:[o.jsx(xe,{children:o.jsx(Lr,{variant:"light",size:"xs",onClick:n,leftSection:o.jsx(mse,{style:iv}),children:"Back to all metrics"})}),o.jsx(Sg,{w:"fit-content",size:"xs",value:d?"cardinality":"alphabetic",onChange:k=>f(k==="cardinality"),data:[{label:"By cardinality",value:"cardinality"},{label:"Alphabetic",value:"alphabetic"}]})]}),w?o.jsx(xe,{mt:"lg",children:Array.from(Array(10),(k,E)=>o.jsx(ta,{height:40,mb:15,width:"100%"},E))}):o.jsxs(le,{fz:"sm",children:[o.jsx(le.Thead,{children:o.jsxs(le.Tr,{children:[o.jsx(le.Th,{children:"Label"}),o.jsx(le.Th,{children:"Values"})]})}),o.jsx(le.Tbody,{children:j.map(([k,E])=>o.jsxs(le.Tr,{children:[o.jsx(le.Td,{w:"50%",children:o.jsx("form",{onSubmit:M=>{M.preventDefault()},children:o.jsxs(pt,{justify:"space-between",align:"baseline",children:[o.jsx("span",{className:"promql-code promql-label-name",children:k}),s.some(M=>M.name===k)?v(s.find(M=>M.name===k)):(l==null?void 0:l.name)===k?o.jsxs(pt,{wrap:"nowrap",gap:"xs",children:[o.jsx(jg,{size:"xs",w:50,style:{width:"auto"},value:l.type,data:Object.values(Ta).map(M=>({value:M,label:M})),onChange:(M,R)=>u({...l,type:R.value})}),o.jsx($M,{value:l.value,size:"xs",placeholder:"label value",onChange:M=>u({...l,value:M}),data:C[k].map(M=>M.value),autoFocus:!0}),o.jsx(Lr,{variant:"secondary",size:"xs",onClick:()=>m(),style:{flexShrink:0},children:"Apply"}),o.jsx(Lr,{variant:"light",w:40,size:"xs",onClick:()=>u(null),title:"Cancel",style:{flexShrink:0},children:o.jsx($oe,{style:{width:ge(18),height:ge(18)}})})]}):o.jsx(Lr,{variant:"light",size:"xs",mr:"xs",onClick:()=>u({name:k,type:Ta.equal,value:""}),children:"Filter..."})]})})}),o.jsxs(le.Td,{w:"50%",children:[o.jsxs(ft,{fw:700,fz:"sm",my:"xs",children:[E," value",E>1&&"s"]}),o.jsxs(Un,{size:"sm",listStyleType:"none",children:[(i.includes(k)?C[k]:C[k].slice(0,5)).map(({value:M,count:R})=>o.jsxs(Un.Item,{children:[o.jsxs("span",{className:`${YT.labelValue} promql-code promql-string`,onClick:()=>{a([...s.filter(D=>D.name!==k),{name:k,type:Ta.equal,value:M}]),u(null)},title:"Click to filter by value",children:['"',Kh(M),'"']})," ","(",R," series)"]},M)),i.includes(k)?o.jsx(Un.Item,{my:"xs",children:o.jsx(Zi,{size:"sm",href:"#",onClick:M=>{M.preventDefault(),r(i.filter(R=>R!=k))},children:"Hide full values"})}):C[k].length>5&&o.jsx(Un.Item,{my:"xs",children:o.jsxs(Zi,{size:"sm",href:"#",onClick:M=>{M.preventDefault(),r([...i,k])},children:["Show ",C[k].length-5," more values..."]})})]})]})]},k))})]})]})},OSe="_typeLabel_u9odf_1",ESe="_helpLabel_u9odf_5",R5={typeLabel:OSe,helpLabel:ESe};/*! *****************************************************************************
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 wE=function(t,e){return wE=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)i.hasOwnProperty(r)&&(n[r]=i[r])},wE(t,e)};function MSe(t,e){wE(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var xv=function(){return xv=Object.assign||function(e){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},xv.apply(this,arguments)};function RSe(t,e,n,i){var r,s=!1,a=0;function l(){r&&clearTimeout(r)}function u(){l(),s=!0}typeof e!="boolean"&&(i=n,n=e,e=void 0);function d(){var f=this,p=Date.now()-a,m=arguments;if(s)return;function v(){a=Date.now(),n.apply(f,m)}function y(){r=void 0}i&&!r&&v(),l(),i===void 0&&p>t?v():e!==!0&&(r=setTimeout(i?y:v,i===void 0?t-p:t))}return d.cancel=u,d}var gm={Pixel:"Pixel",Percent:"Percent"},D5={unit:gm.Percent,value:.8};function N5(t){return typeof t=="number"?{unit:gm.Percent,value:t*100}:typeof t=="string"?t.match(/^(\d*(\.\d+)?)px$/)?{unit:gm.Pixel,value:parseFloat(t)}:t.match(/^(\d*(\.\d+)?)%$/)?{unit:gm.Percent,value:parseFloat(t)}:(console.warn('scrollThreshold format is invalid. Valid formats: "120px", "50%"...'),D5):(console.warn("scrollThreshold should be string or number"),D5)}var DSe=(function(t){MSe(e,t);function e(n){var i=t.call(this,n)||this;return i.lastScrollTop=0,i.actionTriggered=!1,i.startY=0,i.currentY=0,i.dragging=!1,i.maxPullDownDistance=0,i.getScrollableTarget=function(){return i.props.scrollableTarget instanceof HTMLElement?i.props.scrollableTarget:typeof i.props.scrollableTarget=="string"?document.getElementById(i.props.scrollableTarget):(i.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)},i.onStart=function(r){i.lastScrollTop||(i.dragging=!0,r instanceof MouseEvent?i.startY=r.pageY:r instanceof TouchEvent&&(i.startY=r.touches[0].pageY),i.currentY=i.startY,i._infScroll&&(i._infScroll.style.willChange="transform",i._infScroll.style.transition="transform 0.2s cubic-bezier(0,0,0.31,1)"))},i.onMove=function(r){i.dragging&&(r instanceof MouseEvent?i.currentY=r.pageY:r instanceof TouchEvent&&(i.currentY=r.touches[0].pageY),!(i.currentY<i.startY)&&(i.currentY-i.startY>=Number(i.props.pullDownToRefreshThreshold)&&i.setState({pullToRefreshThresholdBreached:!0}),!(i.currentY-i.startY>i.maxPullDownDistance*1.5)&&i._infScroll&&(i._infScroll.style.overflow="visible",i._infScroll.style.transform="translate3d(0px, "+(i.currentY-i.startY)+"px, 0px)")))},i.onEnd=function(){i.startY=0,i.currentY=0,i.dragging=!1,i.state.pullToRefreshThresholdBreached&&(i.props.refreshFunction&&i.props.refreshFunction(),i.setState({pullToRefreshThresholdBreached:!1})),requestAnimationFrame(function(){i._infScroll&&(i._infScroll.style.overflow="auto",i._infScroll.style.transform="none",i._infScroll.style.willChange="unset")})},i.onScrollListener=function(r){typeof i.props.onScroll=="function"&&setTimeout(function(){return i.props.onScroll&&i.props.onScroll(r)},0);var s=i.props.height||i._scrollableNode?r.target:document.documentElement.scrollTop?document.documentElement:document.body;if(!i.actionTriggered){var a=i.props.inverse?i.isElementAtTop(s,i.props.scrollThreshold):i.isElementAtBottom(s,i.props.scrollThreshold);a&&i.props.hasMore&&(i.actionTriggered=!0,i.setState({showLoader:!0}),i.props.next&&i.props.next()),i.lastScrollTop=s.scrollTop}},i.state={showLoader:!1,pullToRefreshThresholdBreached:!1,prevDataLength:n.dataLength},i.throttledOnScrollListener=RSe(150,i.onScrollListener).bind(i),i.onStart=i.onStart.bind(i),i.onMove=i.onMove.bind(i),i.onEnd=i.onEnd.bind(i),i}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,i){var r=n.dataLength!==i.prevDataLength;return r?xv(xv({},i),{prevDataLength:n.dataLength}):null},e.prototype.isElementAtTop=function(n,i){i===void 0&&(i=.8);var r=n===document.body||n===document.documentElement?window.screen.availHeight:n.clientHeight,s=N5(i);return s.unit===gm.Pixel?n.scrollTop<=s.value+r-n.scrollHeight+1:n.scrollTop<=s.value/100+r-n.scrollHeight+1},e.prototype.isElementAtBottom=function(n,i){i===void 0&&(i=.8);var r=n===document.body||n===document.documentElement?window.screen.availHeight:n.clientHeight,s=N5(i);return s.unit===gm.Pixel?n.scrollTop+r>=n.scrollHeight-s.value:n.scrollTop+r>=s.value/100*n.scrollHeight},e.prototype.render=function(){var n=this,i=xv({height:this.props.height||"auto",overflow:"auto",WebkitOverflowScrolling:"touch"},this.props.style),r=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 Vn.createElement("div",{style:s,className:"infinite-scroll-component__outerdiv"},Vn.createElement("div",{className:"infinite-scroll-component "+(this.props.className||""),ref:function(a){return n._infScroll=a},style:i},this.props.pullDownToRefresh&&Vn.createElement("div",{style:{position:"relative"},ref:function(a){return n._pullDown=a}},Vn.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&&!r&&this.props.hasMore&&this.props.loader,this.state.showLoader&&this.props.hasMore&&this.props.loader,!this.props.hasMore&&this.props.endMessage))},e})(T.Component);const P0=50,sg=({allItems:t,child:e})=>{const[n,i]=T.useState(t.slice(0,50)),[r,s]=T.useState(P0),[a,l]=T.useState(t.length>P0),u=e;T.useEffect(()=>{i(t.slice(0,P0)),l(t.length>P0)},[t]);const d=()=>{if(n.length===t.length)l(!1);else{const f=r+P0;s(f),i(t.slice(0,f))}};return o.jsx(DSe,{next:d,hasMore:a,loader:o.jsx("h4",{children:"loading..."}),dataLength:n.length,height:n.length>25?"75vh":"",children:o.jsx(u,{items:n})})},NSe=new TU({pre:'<b style="color: rgb(0, 102, 191)">',post:"</b>",shouldSort:!0}),ISe={allowedTags:["b"],allowedAttributes:{b:["style"]}},BSe=(t,e)=>NSe.filter(t.replace(/ /g,""),e,{pre:'<b style="color: rgb(0, 102, 191)">',post:"</b>"}),LSe=({metricNames:t,insertText:e,close:n})=>{const{data:i}=br({path:"/metadata"}),[r,s]=T.useState(null),[a,l]=T.useState(""),[u]=xy(a,250),d=T.useMemo(()=>u===""?t.map(p=>({original:p,rendered:p})):BSe(u,t),[u,t]),f=p=>i.data[p]??i.data[p.replace(/(_count|_sum|_bucket|_total)$/,"")]??[{help:"unknown",type:"unknown",unit:"unknown"}];return r!==null?o.jsx(TSe,{metricName:r,insertText:p=>{e(p),n()},hideLabelsExplorer:()=>s(null)}):o.jsxs(Mn,{children:[o.jsx(yc,{title:"Filter by text",placeholder:"Enter text to filter metric names by...",value:a,onChange:p=>l(p.target.value),autoFocus:!0}),o.jsx(sg,{allItems:d,child:({items:p})=>o.jsxs(le,{children:[o.jsx(le.Thead,{children:o.jsxs(le.Tr,{children:[o.jsx(le.Th,{children:"Metric"}),o.jsx(le.Th,{children:"Type"}),o.jsx(le.Th,{children:"Help"})]})}),o.jsx(le.Tbody,{children:p.map(m=>o.jsxs(le.Tr,{children:[o.jsx(le.Td,{children:o.jsxs(pt,{justify:"space-between",wrap:"nowrap",children:[u===""?m.original:o.jsx("div",{dangerouslySetInnerHTML:{__html:gSe(m.rendered,ISe)}}),o.jsxs(pt,{gap:"xs",children:[o.jsx(mi,{size:"sm",color:"gray",variant:"light",title:"Explore metric",onClick:()=>{s(m.original)},children:o.jsx(Hoe,{style:{width:"70%",height:"70%"},stroke:1.5})}),o.jsx(mi,{size:"sm",color:"gray",variant:"light",title:"Insert at cursor and close explorer",onClick:()=>{e(m.original),n()},children:o.jsx(T9,{style:{width:"70%",height:"70%"},stroke:1.5})}),o.jsx(Ny,{value:m.original,children:({copied:v,copy:y})=>o.jsx(mi,{size:"sm",color:"gray",variant:"light",title:"Copy to clipboard",onClick:y,children:v?o.jsx(Ym,{style:{width:"70%",height:"70%"},stroke:1.5}):o.jsx(Yy,{style:{width:"70%",height:"70%"},stroke:1.5})})})]})]})}),o.jsx(le.Td,{px:"lg",children:f(m.original).map((v,y)=>o.jsxs(Vn.Fragment,{children:[o.jsx("span",{className:R5.typeLabel,children:v.type}),o.jsx("br",{})]},y))}),o.jsx(le.Td,{children:f(m.original).map((v,y)=>o.jsxs(Vn.Fragment,{children:[o.jsx("span",{className:R5.helpLabel,children:v.help}),o.jsx("br",{})]},y))})]},m.original))})]})})]})};class PSe extends T.Component{constructor(){super(...arguments);Ke(this,"state",{error:null})}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,i){console.error("Uncaught error:",n,i)}render(){return this.state.error!==null?o.jsxs(Pt,{color:"red",title:this.props.title||"Error querying page data",icon:o.jsx(Fr,{}),maw:500,mx:"auto",mt:"lg",children:[o.jsx("strong",{children:"Error:"})," ",this.state.error.message]}):this.props.children}}const Hf=t=>{const e=Ia();return o.jsx(PSe,{title:t.title,children:t.children},e.pathname)};class FSe{constructor(e,n){Ke(this,"complete");Ke(this,"queryHistory");this.complete=e,this.queryHistory=n}promQL(e){return Promise.resolve(this.complete.promQL(e)).then(n=>{const{state:i,pos:r}=e,s=Hr(i).resolve(r,-1),a=n!=null?n.from:s.from;if(a!==0)return n;const l={from:a,to:r,options:this.queryHistory.map(u=>({label:u.length<80?u:u.slice(0,76).concat("..."),detail:"past query",apply:u,info:u.length<80?void 0:u})),validFor:/^[a-zA-Z0-9_:]+$/};return n!==null&&(l.options=l.options.concat(n.options)),l})}}const I5=new wW,$Se=({initialExpr:t,metricNames:e,executeQuery:n,duplicatePanel:i,removePanel:r,treeShown:s,setShowTree:a})=>{const l=Lw(),{queryHistory:u}=bc(M=>M.queryPage),{pathPrefix:d,enableAutocomplete:f,enableSyntaxHighlighting:p,enableLinter:m,enableQueryHistory:v}=xr(),[y,b]=T.useState(t);T.useEffect(()=>{b(t)},[t]);const{data:A,error:w,isFetching:S,refetch:j}=ud({path:"/format_query",params:{query:y},enabled:!1});T.useEffect(()=>{if(w){ml.show({color:"red",title:"Error formatting query",message:w.message});return}A&&(b(A.data),ml.show({title:"Expression formatted",message:"Expression formatted successfully!"}))},[A,w]);const C=T.useRef(null),[k,E]=T.useState(!1);return T.useEffect(()=>{I5.activateCompletion(f).activateLinter(m).setComplete({completeStrategy:new FSe(rE({remote:{url:d,cache:{initialMetricList:e}}}),v?u:[])})},[d,e,f,m,v,u]),o.jsxs(pt,{align:"flex-start",wrap:"nowrap",gap:"xs",children:[o.jsx(Fs,{leftSection:S?o.jsx(Ra,{size:"xs",color:"gray.5"}):o.jsx(Doe,{}),rightSection:o.jsxs(Fn,{shadow:"md",width:200,children:[o.jsx(Fn.Target,{children:o.jsx(mi,{size:"lg",variant:"transparent",color:"gray","aria-label":"Show query options",children:o.jsx(Vse,{style:Gf})})}),o.jsxs(Fn.Dropdown,{children:[o.jsx(Fn.Label,{children:"Query options"}),o.jsx(Fn.Item,{leftSection:o.jsx(yd,{style:L0}),onClick:()=>E(!0),children:"Explore metrics"}),o.jsx(Fn.Item,{leftSection:o.jsx(dse,{style:L0}),onClick:()=>j(),disabled:S||y===""||y===(A==null?void 0:A.data),children:"Format expression"}),o.jsxs(Fn.Item,{leftSection:o.jsx(bse,{style:L0}),onClick:()=>a(!s),children:[s?"Hide":"Show"," tree view"]}),o.jsx(Fn.Item,{leftSection:o.jsx(Yy,{style:L0}),onClick:()=>i(y),children:"Duplicate query"}),o.jsx(Fn.Item,{color:"red",leftSection:o.jsx(EO,{style:L0}),onClick:r,children:"Remove query"})]})]}),component:BD,className:p1e.input,basicSetup:!1,value:y,onChange:b,autoFocus:!0,ref:C,extensions:[mU,wY(),_W(),kn.allowMultipleSelections.of(!0),NY(),WY(),JY(),rW(),lU(),ut.lineWrapping,Gh.of([...nW,...rU,...EW,...SD,...vW]),SY("Enter expression (press Shift+Enter for newlines)"),p?gj(l==="light"?vU:yU):[],I5.asExtension(),l==="light"?gU:d1e,Gh.of([{key:"Escape",run:M=>(M.contentDOM.blur(),!1)}]),Mu.highest(Gh.of([{key:"Enter",run:()=>(n(y),!0)},{key:"Shift-Enter",run:uE}]))],multiline:!0}),o.jsx(Lr,{variant:"primary",onClick:()=>n(y),style:{flexShrink:0},children:"Execute"}),o.jsx(ra,{size:"95%",opened:k,onClose:()=>E(!1),title:"Explore metrics",children:o.jsx(Hf,{title:"Error showing metrics",children:o.jsx(T.Suspense,{fallback:o.jsx(xe,{mt:"lg",children:Array.from(Array(20),(M,R)=>o.jsx(ta,{height:30,mb:15,width:"100%"},R))}),children:o.jsx(LSe,{metricNames:e,insertText:M=>{if(C.current&&C.current.view){const R=C.current.view;R.dispatch(R.state.update({changes:{from:R.state.selection.ranges[0].from,to:R.state.selection.ranges[0].to,insert:M}}))}},close:()=>E(!1)})})},location.pathname)})]})},zSe="_chartWrapper_apsqz_1",HSe="_uplotChart_apsqz_7",mV={chartWrapper:zSe,uplotChart:HSe};var a1={exports:{}};const qSe=!0,qr="u-",QSe="uplot",YSe=qr+"hz",WSe=qr+"vt",USe=qr+"title",VSe=qr+"wrap",GSe=qr+"under",XSe=qr+"over",KSe=qr+"axis",rf=qr+"off",ZSe=qr+"select",JSe=qr+"cursor-x",eje=qr+"cursor-y",tje=qr+"cursor-pt",nje=qr+"legend",ije=qr+"live",rje=qr+"inline",sje=qr+"series",oje=qr+"marker",B5=qr+"label",aje=qr+"value",rv="width",sv="height",F0="top",L5="bottom",Ip="left",WT="right",ZD="#000",P5=ZD+"0",UT="mousemove",F5="mousedown",VT="mouseup",$5="mouseenter",z5="mouseleave",H5="dblclick",lje="resize",cje="scroll",q5="change",_w="dppxchange",JD="--",Dg=typeof window<"u",SE=Dg?document:null,vm=Dg?window:null,uje=Dg?navigator:null;let Wn,xA;function jE(){let t=devicePixelRatio;Wn!=t&&(Wn=t,xA&&_E(q5,xA,jE),xA=matchMedia(`(min-resolution: ${Wn-.001}dppx) and (max-resolution: ${Wn+.001}dppx)`),Df(q5,xA,jE),vm.dispatchEvent(new CustomEvent(_w)))}function $o(t,e){if(e!=null){let n=t.classList;!n.contains(e)&&n.add(e)}}function CE(t,e){let n=t.classList;n.contains(e)&&n.remove(e)}function Bi(t,e,n){t.style[e]=n+"px"}function Qa(t,e,n,i){let r=SE.createElement(t);return e!=null&&$o(r,e),n!=null&&n.insertBefore(r,i),r}function xa(t,e){return Qa("div",t,e)}const Q5=new WeakMap;function zl(t,e,n,i,r){let s="translate("+e+"px,"+n+"px)",a=Q5.get(t);s!=a&&(t.style.transform=s,Q5.set(t,s),e<0||n<0||e>i||n>r?$o(t,rf):CE(t,rf))}const Y5=new WeakMap;function W5(t,e,n){let i=e+n,r=Y5.get(t);i!=r&&(Y5.set(t,i),t.style.background=e,t.style.borderColor=n)}const U5=new WeakMap;function V5(t,e,n,i){let r=e+""+n,s=U5.get(t);r!=s&&(U5.set(t,r),t.style.height=n+"px",t.style.width=e+"px",t.style.marginLeft=i?-e/2+"px":0,t.style.marginTop=i?-n/2+"px":0)}const eN={passive:!0},hje={...eN,capture:!0};function Df(t,e,n,i){e.addEventListener(t,n,i?hje:eN)}function _E(t,e,n,i){e.removeEventListener(t,n,eN)}Dg&&jE();function tl(t,e,n,i){let r;n=n||0,i=i||e.length-1;let s=i<=2147483647;for(;i-n>1;)r=s?n+i>>1:ea((n+i)/2),e[r]<t?n=r:i=r;return t-e[n]<=e[i]-t?n:i}function gV(t){return(n,i,r)=>{let s=-1,a=-1;for(let l=i;l<=r;l++)if(t(n[l])){s=l;break}for(let l=r;l>=i;l--)if(t(n[l])){a=l;break}return[s,a]}}const vV=t=>t!=null,yV=t=>t!=null&&t>0,Oj=gV(vV),dje=gV(yV);function fje(t,e,n,i=0,r=!1){let s=r?dje:Oj,a=r?yV:vV;[e,n]=s(t,e,n);let l=t[e],u=t[e];if(e>-1)if(i==1)l=t[e],u=t[n];else if(i==-1)l=t[n],u=t[e];else for(let d=e;d<=n;d++){let f=t[d];a(f)&&(f<l?l=f:f>u&&(u=f))}return[l??xi,u??-xi]}function Ej(t,e,n,i){let r=K5(t),s=K5(e);t==e&&(r==-1?(t*=n,e/=n):(t/=n,e*=n));let a=n==10?fu:xV,l=r==1?ea:ja,u=s==1?ja:ea,d=l(a(Ir(t))),f=u(a(Ir(e))),p=og(n,d),m=og(n,f);return n==10&&(d<0&&(p=bi(p,-d)),f<0&&(m=bi(m,-f))),i||n==2?(t=p*r,e=m*s):(t=SV(t,p),e=Mj(e,m)),[t,e]}function tN(t,e,n,i){let r=Ej(t,e,n,i);return t==0&&(r[0]=0),e==0&&(r[1]=0),r}const nN=.1,G5={mode:3,pad:nN},bv={pad:0,soft:null,mode:0},pje={min:bv,max:bv};function kw(t,e,n,i){return Rj(n)?X5(t,e,n):(bv.pad=n,bv.soft=i?0:null,bv.mode=i?3:0,X5(t,e,pje))}function $n(t,e){return t??e}function mje(t,e,n){for(e=$n(e,0),n=$n(n,t.length-1);e<=n;){if(t[e]!=null)return!0;e++}return!1}function X5(t,e,n){let i=n.min,r=n.max,s=$n(i.pad,0),a=$n(r.pad,0),l=$n(i.hard,-xi),u=$n(r.hard,xi),d=$n(i.soft,xi),f=$n(r.soft,-xi),p=$n(i.mode,0),m=$n(r.mode,0),v=e-t,y=fu(v),b=Zs(Ir(t),Ir(e)),A=fu(b),w=Ir(A-y);(v<1e-24||w>10)&&(v=0,(t==0||e==0)&&(v=1e-24,p==2&&d!=xi&&(s=0),m==2&&f!=-xi&&(a=0)));let S=v||b||1e3,j=fu(S),C=og(10,ea(j)),k=S*(v==0?t==0?.1:1:s),E=bi(SV(t-k,C/10),24),M=t>=d&&(p==1||p==3&&E<=d||p==2&&E>=d)?d:xi,R=Zs(l,E<M&&t>=M?M:ll(M,E)),D=S*(v==0?e==0?.1:1:a),F=bi(Mj(e+D,C/10),24),I=e<=f&&(m==1||m==3&&F>=f||m==2&&F<=f)?f:-xi,Q=ll(u,F>I&&e<=I?I:Zs(I,F));return R==Q&&R==0&&(Q=100),[R,Q]}const gje=new Intl.NumberFormat(Dg?uje.language:"en-US"),iN=t=>gje.format(t),oa=Math,l1=oa.PI,Ir=oa.abs,ea=oa.floor,Nr=oa.round,ja=oa.ceil,ll=oa.min,Zs=oa.max,og=oa.pow,K5=oa.sign,fu=oa.log10,xV=oa.log2,vje=(t,e=1)=>oa.sinh(t)*e,GT=(t,e=1)=>oa.asinh(t/e),xi=1/0;function Z5(t){return(fu((t^t>>31)-(t>>31))|0)+1}function kE(t,e,n){return ll(Zs(t,e),n)}function bV(t){return typeof t=="function"}function _n(t){return bV(t)?t:()=>t}const yje=()=>{},AV=t=>t,wV=(t,e)=>e,xje=t=>null,J5=t=>!0,eF=(t,e)=>t==e,bje=/\.\d*?(?=9{6,}|0{6,})/gm,qf=t=>{if(CV(t)||dd.has(t))return t;const e=`${t}`,n=e.match(bje);if(n==null)return t;let i=n[0].length-1;if(e.indexOf("e-")!=-1){let[r,s]=e.split("e");return+`${qf(r)}e${s}`}return bi(t,i)};function Kd(t,e){return qf(bi(qf(t/e))*e)}function Mj(t,e){return qf(ja(qf(t/e))*e)}function SV(t,e){return qf(ea(qf(t/e))*e)}function bi(t,e=0){if(CV(t))return t;let n=10**e,i=t*n*(1+Number.EPSILON);return Nr(i)/n}const dd=new Map;function jV(t){return((""+t).split(".")[1]||"").length}function ay(t,e,n,i){let r=[],s=i.map(jV);for(let a=e;a<n;a++){let l=Ir(a),u=bi(og(t,a),l);for(let d=0;d<i.length;d++){let f=t==10?+`${i[d]}e${a}`:i[d]*u,p=(a>=0?0:l)+(a>=s[d]?0:s[d]),m=t==10?f:bi(f,p);r.push(m),dd.set(m,p)}}return r}const Av={},rN=[],ag=[null,null],_h=Array.isArray,CV=Number.isInteger,Aje=t=>t===void 0;function tF(t){return typeof t=="string"}function Rj(t){let e=!1;if(t!=null){let n=t.constructor;e=n==null||n==Object}return e}function wje(t){return t!=null&&typeof t=="object"}const Sje=Object.getPrototypeOf(Uint8Array),_V="__proto__";function lg(t,e=Rj){let n;if(_h(t)){let i=t.find(r=>r!=null);if(_h(i)||e(i)){n=Array(t.length);for(let r=0;r<t.length;r++)n[r]=lg(t[r],e)}else n=t.slice()}else if(t instanceof Sje)n=t.slice();else if(e(t)){n={};for(let i in t)i!=_V&&(n[i]=lg(t[i],e))}else n=t;return n}function Er(t){let e=arguments;for(let n=1;n<e.length;n++){let i=e[n];for(let r in i)r!=_V&&(Rj(t[r])?Er(t[r],lg(i[r])):t[r]=lg(i[r]))}return t}const jje=0,Cje=1,_je=2;function kje(t,e,n){for(let i=0,r,s=-1;i<e.length;i++){let a=e[i];if(a>s){for(r=a-1;r>=0&&t[r]==null;)t[r--]=null;for(r=a+1;r<n&&t[r]==null;)t[s=r++]=null}}}function Tje(t,e){if(Mje(t)){let a=t[0].slice();for(let l=1;l<t.length;l++)a.push(...t[l].slice(1));return Rje(a[0])||(a=Eje(a)),a}let n=new Set;for(let a=0;a<t.length;a++){let u=t[a][0],d=u.length;for(let f=0;f<d;f++)n.add(u[f])}let i=[Array.from(n).sort((a,l)=>a-l)],r=i[0].length,s=new Map;for(let a=0;a<r;a++)s.set(i[0][a],a);for(let a=0;a<t.length;a++){let l=t[a],u=l[0];for(let d=1;d<l.length;d++){let f=l[d],p=Array(r).fill(void 0),m=e?e[a][d]:Cje,v=[];for(let y=0;y<f.length;y++){let b=f[y],A=s.get(u[y]);b===null?m!=jje&&(p[A]=b,m==_je&&v.push(A)):p[A]=b}kje(p,v,r),i.push(p)}}return i}const Oje=typeof queueMicrotask>"u"?t=>Promise.resolve().then(t):queueMicrotask;function Eje(t){let e=t[0],n=e.length,i=Array(n);for(let s=0;s<i.length;s++)i[s]=s;i.sort((s,a)=>e[s]-e[a]);let r=[];for(let s=0;s<t.length;s++){let a=t[s],l=Array(n);for(let u=0;u<n;u++)l[u]=a[i[u]];r.push(l)}return r}function Mje(t){let e=t[0][0],n=e.length;for(let i=1;i<t.length;i++){let r=t[i][0];if(r.length!=n)return!1;if(r!=e){for(let s=0;s<n;s++)if(r[s]!=e[s])return!1}}return!0}function Rje(t,e=100){const n=t.length;if(n<=1)return!0;let i=0,r=n-1;for(;i<=r&&t[i]==null;)i++;for(;r>=i&&t[r]==null;)r--;if(r<=i)return!0;const s=Zs(1,ea((r-i+1)/e));for(let a=t[i],l=i+s;l<=r;l+=s){const u=t[l];if(u!=null){if(u<=a)return!1;a=u}}return!0}const kV=["January","February","March","April","May","June","July","August","September","October","November","December"],TV=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function OV(t){return t.slice(0,3)}const Dje=TV.map(OV),Nje=kV.map(OV),Ije={MMMM:kV,MMM:Nje,WWWW:TV,WWW:Dje};function $0(t){return(t<10?"0":"")+t}function Bje(t){return(t<10?"00":t<100?"0":"")+t}const Lje={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=>$0(t.getMonth()+1),M:t=>t.getMonth()+1,DD:t=>$0(t.getDate()),D:t=>t.getDate(),WWWW:(t,e)=>e.WWWW[t.getDay()],WWW:(t,e)=>e.WWW[t.getDay()],HH:t=>$0(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=>$0(t.getMinutes()),m:t=>t.getMinutes(),ss:t=>$0(t.getSeconds()),s:t=>t.getSeconds(),fff:t=>Bje(t.getMilliseconds())};function sN(t,e){e=e||Ije;let n=[],i=/\{([a-z]+)\}|[^{]+/gi,r;for(;r=i.exec(t);)n.push(r[0][0]=="{"?Lje[r[1]]:r[0]);return s=>{let a="";for(let l=0;l<n.length;l++)a+=typeof n[l]=="string"?n[l]:n[l](s,e);return a}}const Pje=new Intl.DateTimeFormat().resolvedOptions().timeZone;function Fje(t,e){let n;return e=="UTC"||e=="Etc/UTC"?n=new Date(+t+t.getTimezoneOffset()*6e4):e==Pje?n=t:(n=new Date(t.toLocaleString("en-US",{timeZone:e})),n.setMilliseconds(t.getMilliseconds())),n}const EV=t=>t%1==0,Tw=[1,2,2.5,5],$je=ay(10,-32,0,Tw),MV=ay(10,0,32,Tw),zje=MV.filter(EV),Zd=$je.concat(MV),oN=`
`,RV="{YYYY}",nF=oN+RV,DV="{M}/{D}",ov=oN+DV,bA=ov+"/{YY}",NV="{aa}",Hje="{h}:{mm}",Qp=Hje+NV,iF=oN+Qp,rF=":{ss}",Zn=null;function IV(t){let e=t*1e3,n=e*60,i=n*60,r=i*24,s=r*30,a=r*365,u=(t==1?ay(10,0,3,Tw).filter(EV):ay(10,-3,0,Tw)).concat([e,e*5,e*10,e*15,e*30,n,n*5,n*10,n*15,n*30,i,i*2,i*3,i*4,i*6,i*8,i*12,r,r*2,r*3,r*4,r*5,r*6,r*7,r*8,r*9,r*10,r*15,s,s*2,s*3,s*4,s*6,a,a*2,a*5,a*10,a*25,a*50,a*100]);const d=[[a,RV,Zn,Zn,Zn,Zn,Zn,Zn,1],[r*28,"{MMM}",nF,Zn,Zn,Zn,Zn,Zn,1],[r,DV,nF,Zn,Zn,Zn,Zn,Zn,1],[i,"{h}"+NV,bA,Zn,ov,Zn,Zn,Zn,1],[n,Qp,bA,Zn,ov,Zn,Zn,Zn,1],[e,rF,bA+" "+Qp,Zn,ov+" "+Qp,Zn,iF,Zn,1],[t,rF+".{fff}",bA+" "+Qp,Zn,ov+" "+Qp,Zn,iF,Zn,1]];function f(p){return(m,v,y,b,A,w)=>{let S=[],j=A>=a,C=A>=s&&A<a,k=p(y),E=bi(k*t,3),M=XT(k.getFullYear(),j?0:k.getMonth(),C||j?1:k.getDate()),R=bi(M*t,3);if(C||j){let D=C?A/s:0,F=j?A/a:0,I=E==R?E:bi(XT(M.getFullYear()+F,M.getMonth()+D,1)*t,3),Q=new Date(Nr(I/t)),G=Q.getFullYear(),L=Q.getMonth();for(let q=0;I<=b;q++){let N=XT(G+F*q,L+D*q,1),P=N-p(bi(N*t,3));I=bi((+N+P)*t,3),I<=b&&S.push(I)}}else{let D=A>=r?r:A,F=ea(y)-ea(E),I=R+F+Mj(E-R,D);S.push(I);let Q=p(I),G=Q.getHours()+Q.getMinutes()/n+Q.getSeconds()/i,L=A/i,q=m.axes[v]._space,N=w/q;for(;I=bi(I+A,t==1?0:3),!(I>b);)if(L>1){let P=ea(bi(G+L,6))%24,W=p(I).getHours()-P;W>1&&(W=-1),I-=W*i,G=(G+L)%24;let z=S[S.length-1];bi((I-z)/A,3)*N>=.7&&S.push(I)}else S.push(I)}return S}}return[u,d,f]}const[qje,Qje,Yje]=IV(1),[Wje,Uje,Vje]=IV(.001);ay(2,-53,53,[1]);function sF(t,e){return t.map(n=>n.map((i,r)=>r==0||r==8||i==null?i:e(r==1||n[8]==0?i:n[1]+i)))}function oF(t,e){return(n,i,r,s,a)=>{let l=e.find(y=>a>=y[0])||e[e.length-1],u,d,f,p,m,v;return i.map(y=>{let b=t(y),A=b.getFullYear(),w=b.getMonth(),S=b.getDate(),j=b.getHours(),C=b.getMinutes(),k=b.getSeconds(),E=A!=u&&l[2]||w!=d&&l[3]||S!=f&&l[4]||j!=p&&l[5]||C!=m&&l[6]||k!=v&&l[7]||l[1];return u=A,d=w,f=S,p=j,m=C,v=k,E(b)})}}function Gje(t,e){let n=sN(e);return(i,r,s,a,l)=>r.map(u=>n(t(u)))}function XT(t,e,n){return new Date(t,e,n)}function aF(t,e){return e(t)}const Xje="{YYYY}-{MM}-{DD} {h}:{mm}{aa}";function lF(t,e){return(n,i,r,s)=>s==null?JD:e(t(i))}function Kje(t,e){let n=t.series[e];return n.width?n.stroke(t,e):n.points.width?n.points.stroke(t,e):null}function Zje(t,e){return t.series[e].fill(t,e)}const Jje={show:!0,live:!0,isolate:!1,mount:yje,markers:{show:!0,width:2,stroke:Kje,fill:Zje,dash:"solid"},idx:null,idxs:null,values:[]};function eCe(t,e){let n=t.cursor.points,i=xa(),r=n.size(t,e);Bi(i,rv,r),Bi(i,sv,r);let s=r/-2;Bi(i,"marginLeft",s),Bi(i,"marginTop",s);let a=n.width(t,e,r);return a&&Bi(i,"borderWidth",a),i}function tCe(t,e){let n=t.series[e].points;return n._fill||n._stroke}function nCe(t,e){let n=t.series[e].points;return n._stroke||n._fill}function iCe(t,e){return t.series[e].points.size}const KT=[0,0];function rCe(t,e,n){return KT[0]=e,KT[1]=n,KT}function AA(t,e,n,i=!0){return r=>{r.button==0&&(!i||r.target==e)&&n(r)}}function ZT(t,e,n,i=!0){return r=>{(!i||r.target==e)&&n(r)}}const sCe={show:!0,x:!0,y:!0,lock:!1,move:rCe,points:{one:!1,show:eCe,size:iCe,width:0,stroke:nCe,fill:tCe},bind:{mousedown:AA,mouseup:AA,click:AA,dblclick:AA,mousemove:ZT,mouseleave:ZT,mouseenter:ZT},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,i,r)=>i-r,prox:-1,bias:0},hover:{skip:[void 0],prox:null,bias:0},left:-10,top:-10,idx:null,dataIdx:null,idxs:null,event:null},BV={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},aN=Er({},BV,{filter:wV}),LV=Er({},aN,{size:10}),PV=Er({},BV,{show:!1}),lN='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"',FV="bold "+lN,$V=1.5,cF={show:!0,scale:"x",stroke:ZD,space:50,gap:5,alignTo:1,size:50,labelGap:0,labelSize:30,labelFont:FV,side:2,grid:aN,ticks:LV,border:PV,font:lN,lineGap:$V,rotate:0},oCe="Value",aCe="Time",uF={show:!0,scale:"x",auto:!1,sorted:1,min:xi,max:-xi,idxs:[]};function lCe(t,e,n,i,r){return e.map(s=>s==null?"":iN(s))}function cCe(t,e,n,i,r,s,a){let l=[],u=dd.get(r)||0;n=a?n:bi(Mj(n,r),u);for(let d=n;d<=i;d=bi(d+r,u))l.push(Object.is(d,-0)?0:d);return l}function TE(t,e,n,i,r,s,a){const l=[],u=t.scales[t.axes[e].scale].log,d=u==10?fu:xV,f=ea(d(n));r=og(u,f),u==10&&(r=Zd[tl(r,Zd)]);let p=n,m=r*u;u==10&&(m=Zd[tl(m,Zd)]);do l.push(p),p=p+r,u==10&&!dd.has(p)&&(p=bi(p,dd.get(r))),p>=m&&(r=p,m=r*u,u==10&&(m=Zd[tl(m,Zd)]));while(p<=i);return l}function uCe(t,e,n,i,r,s,a){let u=t.scales[t.axes[e].scale].asinh,d=i>u?TE(t,e,Zs(u,n),i,r):[u],f=i>=0&&n<=0?[0]:[];return(n<-u?TE(t,e,Zs(u,-i),-n,r):[u]).reverse().map(m=>-m).concat(f,d)}const zV=/./,hCe=/[12357]/,dCe=/[125]/,hF=/1/,OE=(t,e,n,i)=>t.map((r,s)=>e==4&&r==0||s%i==0&&n.test(r.toExponential()[r<0?1:0])?r:null);function fCe(t,e,n,i,r){let s=t.axes[n],a=s.scale,l=t.scales[a],u=t.valToPos,d=s._space,f=u(10,a),p=u(9,a)-f>=d?zV:u(7,a)-f>=d?hCe:u(5,a)-f>=d?dCe:hF;if(p==hF){let m=Ir(u(1,a)-f);if(m<d)return OE(e.slice().reverse(),l.distr,p,ja(d/m)).reverse()}return OE(e,l.distr,p,1)}function pCe(t,e,n,i,r){let s=t.axes[n],a=s.scale,l=s._space,u=t.valToPos,d=Ir(u(1,a)-u(2,a));return d<l?OE(e.slice().reverse(),3,zV,ja(l/d)).reverse():e}function mCe(t,e,n,i){return i==null?JD:e==null?"":iN(e)}const dF={show:!0,scale:"y",stroke:ZD,space:30,gap:5,alignTo:1,size:50,labelGap:0,labelSize:30,labelFont:FV,side:3,grid:aN,ticks:LV,border:PV,font:lN,lineGap:$V,rotate:0};function gCe(t,e){let n=3+(t||1)*2;return bi(n*e,3)}function vCe(t,e){let{scale:n,idxs:i}=t.series[0],r=t._data[0],s=t.valToPos(r[i[0]],n,!0),a=t.valToPos(r[i[1]],n,!0),l=Ir(a-s),u=t.series[e],d=l/(u.points.space*Wn);return i[1]-i[0]<=d}const fF={scale:null,auto:!0,sorted:0,min:xi,max:-xi},HV=(t,e,n,i,r)=>r,pF={show:!0,auto:!0,sorted:0,gaps:HV,alpha:1,facets:[Er({},fF,{scale:"x"}),Er({},fF,{scale:"y"})]},mF={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:HV,alpha:1,points:{show:vCe,filter:null},values:null,min:xi,max:-xi,idxs:[],path:null,clip:null};function yCe(t,e,n,i,r){return n/10}const qV={time:qSe,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},xCe=Er({},qV,{time:!1,ori:1}),gF={};function QV(t,e){let n=gF[t];return n||(n={key:t,plots:[],sub(i){n.plots.push(i)},unsub(i){n.plots=n.plots.filter(r=>r!=i)},pub(i,r,s,a,l,u,d){for(let f=0;f<n.plots.length;f++)n.plots[f]!=r&&n.plots[f].pub(i,r,s,a,l,u,d)}},t!=null&&(gF[t]=n)),n}const cg=1,EE=2;function Xf(t,e,n){const i=t.mode,r=t.series[e],s=i==2?t._data[e]:t._data,a=t.scales,l=t.bbox;let u=s[0],d=i==2?s[1]:s[e],f=i==2?a[r.facets[0].scale]:a[t.series[0].scale],p=i==2?a[r.facets[1].scale]:a[r.scale],m=l.left,v=l.top,y=l.width,b=l.height,A=t.valToPosH,w=t.valToPosV;return f.ori==0?n(r,u,d,f,p,A,w,m,v,y,b,Nj,Ng,Bj,WV,VV):n(r,u,d,f,p,w,A,v,m,b,y,Ij,Ig,hN,UV,GV)}function cN(t,e){let n=0,i=0,r=$n(t.bands,rN);for(let s=0;s<r.length;s++){let a=r[s];a.series[0]==e?n=a.dir:a.series[1]==e&&(a.dir==1?i|=1:i|=2)}return[n,i==1?-1:i==2?1:i==3?2:0]}function bCe(t,e,n,i,r){let s=t.mode,a=t.series[e],l=s==2?a.facets[1].scale:a.scale,u=t.scales[l];return r==-1?u.min:r==1?u.max:u.distr==3?u.dir==1?u.min:u.max:0}function pu(t,e,n,i,r,s){return Xf(t,e,(a,l,u,d,f,p,m,v,y,b,A)=>{let w=a.pxRound;const S=d.dir*(d.ori==0?1:-1),j=d.ori==0?Ng:Ig;let C,k;S==1?(C=n,k=i):(C=i,k=n);let E=w(p(l[C],d,b,v)),M=w(m(u[C],f,A,y)),R=w(p(l[k],d,b,v)),D=w(m(s==1?f.max:f.min,f,A,y)),F=new Path2D(r);return j(F,R,D),j(F,E,D),j(F,E,M),F})}function Dj(t,e,n,i,r,s){let a=null;if(t.length>0){a=new Path2D;const l=e==0?Bj:hN;let u=n;for(let p=0;p<t.length;p++){let m=t[p];if(m[1]>m[0]){let v=m[0]-u;v>0&&l(a,u,i,v,i+s),u=m[1]}}let d=n+r-u,f=10;d>0&&l(a,u,i-f/2,d,i+s+f)}return a}function ACe(t,e,n){let i=t[t.length-1];i&&i[0]==e?i[1]=n:t.push([e,n])}function uN(t,e,n,i,r,s,a){let l=[],u=t.length;for(let d=r==1?n:i;d>=n&&d<=i;d+=r)if(e[d]===null){let p=d,m=d;if(r==1)for(;++d<=i&&e[d]===null;)m=d;else for(;--d>=n&&e[d]===null;)m=d;let v=s(t[p]),y=m==p?v:s(t[m]),b=p-r;v=a<=0&&b>=0&&b<u?s(t[b]):v;let w=m+r;y=a>=0&&w>=0&&w<u?s(t[w]):y,y>=v&&l.push([v,y])}return l}function vF(t){return t==0?AV:t==1?Nr:e=>Kd(e,t)}function YV(t){let e=t==0?Nj:Ij,n=t==0?(r,s,a,l,u,d)=>{r.arcTo(s,a,l,u,d)}:(r,s,a,l,u,d)=>{r.arcTo(a,s,u,l,d)},i=t==0?(r,s,a,l,u)=>{r.rect(s,a,l,u)}:(r,s,a,l,u)=>{r.rect(a,s,u,l)};return(r,s,a,l,u,d=0,f=0)=>{d==0&&f==0?i(r,s,a,l,u):(d=ll(d,l/2,u/2),f=ll(f,l/2,u/2),e(r,s+d,a),n(r,s+l,a,s+l,a+u,d),n(r,s+l,a+u,s,a+u,f),n(r,s,a+u,s,a,f),n(r,s,a,s+l,a,d),r.closePath())}}const Nj=(t,e,n)=>{t.moveTo(e,n)},Ij=(t,e,n)=>{t.moveTo(n,e)},Ng=(t,e,n)=>{t.lineTo(e,n)},Ig=(t,e,n)=>{t.lineTo(n,e)},Bj=YV(0),hN=YV(1),WV=(t,e,n,i,r,s)=>{t.arc(e,n,i,r,s)},UV=(t,e,n,i,r,s)=>{t.arc(n,e,i,r,s)},VV=(t,e,n,i,r,s,a)=>{t.bezierCurveTo(e,n,i,r,s,a)},GV=(t,e,n,i,r,s,a)=>{t.bezierCurveTo(n,e,r,i,a,s)};function XV(t){return(e,n,i,r,s)=>Xf(e,n,(a,l,u,d,f,p,m,v,y,b,A)=>{let{pxRound:w,points:S}=a,j,C;d.ori==0?(j=Nj,C=WV):(j=Ij,C=UV);const k=bi(S.width*Wn,3);let E=(S.size-S.width)/2*Wn,M=bi(E*2,3),R=new Path2D,D=new Path2D,{left:F,top:I,width:Q,height:G}=e.bbox;Bj(D,F-M,I-M,Q+M*2,G+M*2);const L=q=>{if(u[q]!=null){let N=w(p(l[q],d,b,v)),P=w(m(u[q],f,A,y));j(R,N+E,P),C(R,N,P,E,0,l1*2)}};if(s)s.forEach(L);else for(let q=i;q<=r;q++)L(q);return{stroke:k>0?R:null,fill:R,clip:D,flags:cg|EE}})}function KV(t){return(e,n,i,r,s,a)=>{i!=r&&(s!=i&&a!=i&&t(e,n,i),s!=r&&a!=r&&t(e,n,r),t(e,n,a))}}const wCe=KV(Ng),SCe=KV(Ig);function ZV(t){const e=$n(t==null?void 0:t.alignGaps,0);return(n,i,r,s)=>Xf(n,i,(a,l,u,d,f,p,m,v,y,b,A)=>{[r,s]=Oj(u,r,s);let w=a.pxRound,S=G=>w(p(G,d,b,v)),j=G=>w(m(G,f,A,y)),C,k;d.ori==0?(C=Ng,k=wCe):(C=Ig,k=SCe);const E=d.dir*(d.ori==0?1:-1),M={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:cg},R=M.stroke;let D=!1;if(s-r>=b*4){let G=V=>n.posToVal(V,d.key,!0),L=null,q=null,N,P,Y,K=S(l[E==1?r:s]),W=S(l[r]),z=S(l[s]),U=G(E==1?W+1:z-1);for(let V=E==1?r:s;V>=r&&V<=s;V+=E){let J=l[V],ce=(E==1?J<U:J>U)?K:S(J),he=u[V];ce==K?he!=null?(P=he,L==null?(C(R,ce,j(P)),N=L=q=P):P<L?L=P:P>q&&(q=P)):he===null&&(D=!0):(L!=null&&k(R,K,j(L),j(q),j(N),j(P)),he!=null?(P=he,C(R,ce,j(P)),L=q=N=P):(L=q=null,he===null&&(D=!0)),K=ce,U=G(K+E))}L!=null&&L!=q&&Y!=K&&k(R,K,j(L),j(q),j(N),j(P))}else for(let G=E==1?r:s;G>=r&&G<=s;G+=E){let L=u[G];L===null?D=!0:L!=null&&C(R,S(l[G]),j(L))}let[I,Q]=cN(n,i);if(a.fill!=null||I!=0){let G=M.fill=new Path2D(R),L=a.fillTo(n,i,a.min,a.max,I),q=j(L),N=S(l[r]),P=S(l[s]);E==-1&&([P,N]=[N,P]),C(G,P,q),C(G,N,q)}if(!a.spanGaps){let G=[];D&&G.push(...uN(l,u,r,s,E,S,e)),M.gaps=G=a.gaps(n,i,r,s,G),M.clip=Dj(G,d.ori,v,y,b,A)}return Q!=0&&(M.band=Q==2?[pu(n,i,r,s,R,-1),pu(n,i,r,s,R,1)]:pu(n,i,r,s,R,Q)),M})}function jCe(t){const e=$n(t.align,1),n=$n(t.ascDesc,!1),i=$n(t.alignGaps,0),r=$n(t.extend,!1);return(s,a,l,u)=>Xf(s,a,(d,f,p,m,v,y,b,A,w,S,j)=>{[l,u]=Oj(p,l,u);let C=d.pxRound,{left:k,width:E}=s.bbox,M=W=>C(y(W,m,S,A)),R=W=>C(b(W,v,j,w)),D=m.ori==0?Ng:Ig;const F={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:cg},I=F.stroke,Q=m.dir*(m.ori==0?1:-1);let G=R(p[Q==1?l:u]),L=M(f[Q==1?l:u]),q=L,N=L;r&&e==-1&&(N=k,D(I,N,G)),D(I,L,G);for(let W=Q==1?l:u;W>=l&&W<=u;W+=Q){let z=p[W];if(z==null)continue;let U=M(f[W]),V=R(z);e==1?D(I,U,G):D(I,q,V),D(I,U,V),G=V,q=U}let P=q;r&&e==1&&(P=k+E,D(I,P,G));let[Y,K]=cN(s,a);if(d.fill!=null||Y!=0){let W=F.fill=new Path2D(I),z=d.fillTo(s,a,d.min,d.max,Y),U=R(z);D(W,P,U),D(W,N,U)}if(!d.spanGaps){let W=[];W.push(...uN(f,p,l,u,Q,M,i));let z=d.width*Wn/2,U=n||e==1?z:-z,V=n||e==-1?-z:z;W.forEach(J=>{J[0]+=U,J[1]+=V}),F.gaps=W=d.gaps(s,a,l,u,W),F.clip=Dj(W,m.ori,A,w,S,j)}return K!=0&&(F.band=K==2?[pu(s,a,l,u,I,-1),pu(s,a,l,u,I,1)]:pu(s,a,l,u,I,K)),F})}function yF(t,e,n,i,r,s,a=xi){if(t.length>1){let l=null;for(let u=0,d=1/0;u<t.length;u++)if(e[u]!==void 0){if(l!=null){let f=Ir(t[u]-t[l]);f<d&&(d=f,a=Ir(n(t[u],i,r,s)-n(t[l],i,r,s)))}l=u}}return a}function CCe(t){t=t||Av;const e=$n(t.size,[.6,xi,1]),n=t.align||0,i=t.gap||0;let r=t.radius;r=r==null?[0,0]:typeof r=="number"?[r,0]:r;const s=_n(r),a=1-e[0],l=$n(e[1],xi),u=$n(e[2],1),d=$n(t.disp,Av),f=$n(t.each,v=>{}),{fill:p,stroke:m}=d;return(v,y,b,A)=>Xf(v,y,(w,S,j,C,k,E,M,R,D,F,I)=>{let Q=w.pxRound,G=n,L=i*Wn,q=l*Wn,N=u*Wn,P,Y;C.ori==0?[P,Y]=s(v,y):[Y,P]=s(v,y);const K=C.dir*(C.ori==0?1:-1);let W=C.ori==0?Bj:hN,z=C.ori==0?f:(Qe,Xe,Ze,vt,pn,mn,un)=>{f(Qe,Xe,Ze,pn,vt,un,mn)},U=$n(v.bands,rN).find(Qe=>Qe.series[0]==y),V=U!=null?U.dir:0,J=w.fillTo(v,y,w.min,w.max,V),ee=Q(M(J,k,I,D)),ce,he,Oe,Te=F,Re=Q(w.width*Wn),qe=!1,ie=null,je=null,se=null,be=null;p!=null&&(Re==0||m!=null)&&(qe=!0,ie=p.values(v,y,b,A),je=new Map,new Set(ie).forEach(Qe=>{Qe!=null&&je.set(Qe,new Path2D)}),Re>0&&(se=m.values(v,y,b,A),be=new Map,new Set(se).forEach(Qe=>{Qe!=null&&be.set(Qe,new Path2D)})));let{x0:Be,size:Ce}=d;if(Be!=null&&Ce!=null){G=1,S=Be.values(v,y,b,A),Be.unit==2&&(S=S.map(Ze=>v.posToVal(R+Ze*F,C.key,!0)));let Qe=Ce.values(v,y,b,A);Ce.unit==2?he=Qe[0]*F:he=E(Qe[0],C,F,R)-E(0,C,F,R),Te=yF(S,j,E,C,F,R,Te),Oe=Te-he+L}else Te=yF(S,j,E,C,F,R,Te),Oe=Te*a+L,he=Te-Oe;Oe<1&&(Oe=0),Re>=he/2&&(Re=0),Oe<5&&(Q=AV);let Ve=Oe>0,st=Te-Oe-(Ve?Re:0);he=Q(kE(st,N,q)),ce=(G==0?he/2:G==K?0:he)-G*K*((G==0?L/2:0)+(Ve?Re/2:0));const Ye={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:0},Ge=qe?null:new Path2D;let dt=null;if(U!=null)dt=v.data[U.series[1]];else{let{y0:Qe,y1:Xe}=d;Qe!=null&&Xe!=null&&(j=Xe.values(v,y,b,A),dt=Qe.values(v,y,b,A))}let nt=P*he,Ee=Y*he;for(let Qe=K==1?b:A;Qe>=b&&Qe<=A;Qe+=K){let Xe=j[Qe];if(Xe==null)continue;if(dt!=null){let zt=dt[Qe]??0;if(Xe-zt==0)continue;ee=M(zt,k,I,D)}let Ze=C.distr!=2||d!=null?S[Qe]:Qe,vt=E(Ze,C,F,R),pn=M($n(Xe,J),k,I,D),mn=Q(vt-ce),un=Q(Zs(pn,ee)),Qt=Q(ll(pn,ee)),ct=un-Qt;if(Xe!=null){let zt=Xe<0?Ee:nt,on=Xe<0?nt:Ee;qe?(Re>0&&se[Qe]!=null&&W(be.get(se[Qe]),mn,Qt+ea(Re/2),he,Zs(0,ct-Re),zt,on),ie[Qe]!=null&&W(je.get(ie[Qe]),mn,Qt+ea(Re/2),he,Zs(0,ct-Re),zt,on)):W(Ge,mn,Qt+ea(Re/2),he,Zs(0,ct-Re),zt,on),z(v,y,Qe,mn-Re/2,Qt,he+Re,ct)}}return Re>0?Ye.stroke=qe?be:Ge:qe||(Ye._fill=w.width==0?w._fill:w._stroke??w._fill,Ye.width=0),Ye.fill=qe?je:Ge,Ye})}function _Ce(t,e){const n=$n(e==null?void 0:e.alignGaps,0);return(i,r,s,a)=>Xf(i,r,(l,u,d,f,p,m,v,y,b,A,w)=>{[s,a]=Oj(d,s,a);let S=l.pxRound,j=P=>S(m(P,f,A,y)),C=P=>S(v(P,p,w,b)),k,E,M;f.ori==0?(k=Nj,M=Ng,E=VV):(k=Ij,M=Ig,E=GV);const R=f.dir*(f.ori==0?1:-1);let D=j(u[R==1?s:a]),F=D,I=[],Q=[];for(let P=R==1?s:a;P>=s&&P<=a;P+=R)if(d[P]!=null){let K=u[P],W=j(K);I.push(F=W),Q.push(C(d[P]))}const G={stroke:t(I,Q,k,M,E,S),fill:null,clip:null,band:null,gaps:null,flags:cg},L=G.stroke;let[q,N]=cN(i,r);if(l.fill!=null||q!=0){let P=G.fill=new Path2D(L),Y=l.fillTo(i,r,l.min,l.max,q),K=C(Y);M(P,F,K),M(P,D,K)}if(!l.spanGaps){let P=[];P.push(...uN(u,d,s,a,R,j,n)),G.gaps=P=l.gaps(i,r,s,a,P),G.clip=Dj(P,f.ori,y,b,A,w)}return N!=0&&(G.band=N==2?[pu(i,r,s,a,L,-1),pu(i,r,s,a,L,1)]:pu(i,r,s,a,L,N)),G})}function kCe(t){return _Ce(TCe,t)}function TCe(t,e,n,i,r,s){const a=t.length;if(a<2)return null;const l=new Path2D;if(n(l,t[0],e[0]),a==2)i(l,t[1],e[1]);else{let u=Array(a),d=Array(a-1),f=Array(a-1),p=Array(a-1);for(let m=0;m<a-1;m++)f[m]=e[m+1]-e[m],p[m]=t[m+1]-t[m],d[m]=f[m]/p[m];u[0]=d[0];for(let m=1;m<a-1;m++)d[m]===0||d[m-1]===0||d[m-1]>0!=d[m]>0?u[m]=0:(u[m]=3*(p[m-1]+p[m])/((2*p[m]+p[m-1])/d[m-1]+(p[m]+2*p[m-1])/d[m]),isFinite(u[m])||(u[m]=0));u[a-1]=d[a-2];for(let m=0;m<a-1;m++)r(l,t[m]+p[m]/3,e[m]+u[m]*p[m]/3,t[m+1]-p[m]/3,e[m+1]-u[m+1]*p[m]/3,t[m+1],e[m+1])}return l}const ME=new Set;function xF(){for(let t of ME)t.syncRect(!0)}Dg&&(Df(lje,vm,xF),Df(cje,vm,xF,!0),Df(_w,vm,()=>{$r.pxRatio=Wn}));const OCe=ZV(),ECe=XV();function bF(t,e,n,i){return(i?[t[0],t[1]].concat(t.slice(2)):[t[0]].concat(t.slice(1))).map((s,a)=>RE(s,a,e,n))}function MCe(t,e){return t.map((n,i)=>i==0?{}:Er({},e,n))}function RE(t,e,n,i){return Er({},e==0?n:i,t)}function JV(t,e,n){return e==null?ag:[e,n]}const RCe=JV;function DCe(t,e,n){return e==null?ag:kw(e,n,nN,!0)}function eG(t,e,n,i){return e==null?ag:Ej(e,n,t.scales[i].log,!1)}const NCe=eG;function tG(t,e,n,i){return e==null?ag:tN(e,n,t.scales[i].log,!1)}const ICe=tG;function BCe(t,e,n,i,r){let s=Zs(Z5(t),Z5(e)),a=e-t,l=tl(r/i*a,n);do{let u=n[l],d=i*u/a;if(d>=r&&s+(u<5?dd.get(u):0)<=17)return[u,d]}while(++l<n.length);return[0,0]}function AF(t){let e,n;return t=t.replace(/(\d+)px/,(i,r)=>(e=Nr((n=+r)*Wn))+"px"),[t,e,n]}function LCe(t){t.show&&[t.font,t.labelFont].forEach(e=>{let n=bi(e[2]*Wn,1);e[0]=e[0].replace(/[0-9.]+px/,n+"px"),e[1]=n})}function $r(t,e,n){const i={mode:$n(t.mode,1)},r=i.mode;function s(H,X,te,ne){let de=X.valToPct(H);return ne+te*(X.dir==-1?1-de:de)}function a(H,X,te,ne){let de=X.valToPct(H);return ne+te*(X.dir==-1?de:1-de)}function l(H,X,te,ne){return X.ori==0?s(H,X,te,ne):a(H,X,te,ne)}i.valToPosH=s,i.valToPosV=a;let u=!1;i.status=0;const d=i.root=xa(QSe);if(t.id!=null&&(d.id=t.id),$o(d,t.class),t.title){let H=xa(USe,d);H.textContent=t.title}const f=Qa("canvas"),p=i.ctx=f.getContext("2d"),m=xa(VSe,d);Df("click",m,H=>{H.target===y&&(Xn!=zs||ni!=Ml)&&Bn.click(i,H)},!0);const v=i.under=xa(GSe,m);m.appendChild(f);const y=i.over=xa(XSe,m);t=lg(t);const b=+$n(t.pxAlign,1),A=vF(b);(t.plugins||[]).forEach(H=>{H.opts&&(t=H.opts(i,t)||t)});const w=t.ms||.001,S=i.series=r==1?bF(t.series||[],uF,mF,!1):MCe(t.series||[null],pF),j=i.axes=bF(t.axes||[],cF,dF,!0),C=i.scales={},k=i.bands=t.bands||[];k.forEach(H=>{H.fill=_n(H.fill||null),H.dir=$n(H.dir,-1)});const E=r==2?S[1].facets[0].scale:S[0].scale,M={axes:Ol,series:Lg},R=(t.drawOrder||["axes","series"]).map(H=>M[H]);function D(H){const X=H.distr==3?te=>fu(te>0?te:H.clamp(i,te,H.min,H.max,H.key)):H.distr==4?te=>GT(te,H.asinh):H.distr==100?te=>H.fwd(te):te=>te;return te=>{let ne=X(te),{_min:de,_max:Ae}=H,$e=Ae-de;return(ne-de)/$e}}function F(H){let X=C[H];if(X==null){let te=(t.scales||Av)[H]||Av;if(te.from!=null){F(te.from);let ne=Er({},C[te.from],te,{key:H});ne.valToPct=D(ne),C[H]=ne}else{X=C[H]=Er({},H==E?qV:xCe,te),X.key=H;let ne=X.time,de=X.range,Ae=_h(de);if((H!=E||r==2&&!ne)&&(Ae&&(de[0]==null||de[1]==null)&&(de={min:de[0]==null?G5:{mode:1,hard:de[0],soft:de[0]},max:de[1]==null?G5:{mode:1,hard:de[1],soft:de[1]}},Ae=!1),!Ae&&Rj(de))){let $e=de;de=(Je,ot,yt)=>ot==null?ag:kw(ot,yt,$e)}X.range=_n(de||(ne?RCe:H==E?X.distr==3?NCe:X.distr==4?ICe:JV:X.distr==3?eG:X.distr==4?tG:DCe)),X.auto=_n(Ae?!1:X.auto),X.clamp=_n(X.clamp||yCe),X._min=X._max=null,X.valToPct=D(X)}}}F("x"),F("y"),r==1&&S.forEach(H=>{F(H.scale)}),j.forEach(H=>{F(H.scale)});for(let H in t.scales)F(H);const I=C[E],Q=I.distr;let G,L;I.ori==0?($o(d,YSe),G=s,L=a):($o(d,WSe),G=a,L=s);const q={};for(let H in C){let X=C[H];(X.min!=null||X.max!=null)&&(q[H]={min:X.min,max:X.max},X.min=X.max=null)}const N=t.tzDate||(H=>new Date(Nr(H/w))),P=t.fmtDate||sN,Y=w==1?Yje(N):Vje(N),K=oF(N,sF(w==1?Qje:Uje,P)),W=lF(N,aF(Xje,P)),z=[],U=i.legend=Er({},Jje,t.legend),V=i.cursor=Er({},sCe,{drag:{y:r==2}},t.cursor),J=U.show,ee=V.show,ce=U.markers;U.idxs=z,ce.width=_n(ce.width),ce.dash=_n(ce.dash),ce.stroke=_n(ce.stroke),ce.fill=_n(ce.fill);let he,Oe,Te,Re=[],qe=[],ie,je=!1,se={};if(U.live){const H=S[1]?S[1].values:null;je=H!=null,ie=je?H(i,1,0):{_:0};for(let X in ie)se[X]=JD}if(J)if(he=Qa("table",nje,d),Te=Qa("tbody",null,he),U.mount(i,he),je){Oe=Qa("thead",null,he,Te);let H=Qa("tr",null,Oe);Qa("th",null,H);for(var be in ie)Qa("th",B5,H).textContent=be}else $o(he,rje),U.live&&$o(he,ije);const Be={show:!0},Ce={show:!1};function Ve(H,X){if(X==0&&(je||!U.live||r==2))return ag;let te=[],ne=Qa("tr",sje,Te,Te.childNodes[X]);$o(ne,H.class),H.show||$o(ne,rf);let de=Qa("th",null,ne);if(ce.show){let Je=xa(oje,de);if(X>0){let ot=ce.width(i,X);ot&&(Je.style.border=ot+"px "+ce.dash(i,X)+" "+ce.stroke(i,X)),Je.style.background=ce.fill(i,X)}}let Ae=xa(B5,de);H.label instanceof HTMLElement?Ae.appendChild(H.label):Ae.textContent=H.label,X>0&&(ce.show||(Ae.style.color=H.width>0?ce.stroke(i,X):ce.fill(i,X)),Ye("click",de,Je=>{if(V._lock)return;Kt(Je);let ot=S.indexOf(H);if((Je.ctrlKey||Je.metaKey)!=U.isolate){let yt=S.some((At,jt)=>jt>0&&jt!=ot&&At.show);S.forEach((At,jt)=>{jt>0&&Hs(jt,yt?jt==ot?Be:Ce:Be,!0,nr.setSeries)})}else Hs(ot,{show:!H.show},!0,nr.setSeries)},!1),ht&&Ye($5,de,Je=>{V._lock||(Kt(Je),Hs(S.indexOf(H),Hu,!0,nr.setSeries))},!1));for(var $e in ie){let Je=Qa("td",aje,ne);Je.textContent="--",te.push(Je)}return[ne,te]}const st=new Map;function Ye(H,X,te,ne=!0){const de=st.get(X)||{},Ae=V.bind[H](i,X,te,ne);Ae&&(Df(H,X,de[H]=Ae),st.set(X,de))}function Ge(H,X,te){const ne=st.get(X)||{};for(let de in ne)(H==null||de==H)&&(_E(de,X,ne[de]),delete ne[de]);H==null&&st.delete(X)}let dt=0,nt=0,Ee=0,Qe=0,Xe=0,Ze=0,vt=Xe,pn=Ze,mn=Ee,un=Qe,Qt=0,ct=0,zt=0,on=0;i.bbox={};let Lt=!1,It=!1,$t=!1,dn=!1,ji=!1,tn=!1;function an(H,X,te){(te||H!=i.width||X!=i.height)&&gn(H,X),ks(!1),$t=!0,It=!0,Wt()}function gn(H,X){i.width=dt=Ee=H,i.height=nt=Qe=X,Xe=Ze=0,Ne(),Ut();let te=i.bbox;Qt=te.left=Kd(Xe*Wn,.5),ct=te.top=Kd(Ze*Wn,.5),zt=te.width=Kd(Ee*Wn,.5),on=te.height=Kd(Qe*Wn,.5)}const re=3;function ve(){let H=!1,X=0;for(;!H;){X++;let te=tr(X),ne=qn(X);H=X==re||te&&ne,H||(gn(i.width,i.height),It=!0)}}function pe({width:H,height:X}){an(H,X)}i.setSize=pe;function Ne(){let H=!1,X=!1,te=!1,ne=!1;j.forEach((de,Ae)=>{if(de.show&&de._show){let{side:$e,_size:Je}=de,ot=$e%2,yt=de.label!=null?de.labelSize:0,At=Je+yt;At>0&&(ot?(Ee-=At,$e==3?(Xe+=At,ne=!0):te=!0):(Qe-=At,$e==0?(Ze+=At,H=!0):X=!0))}}),js[0]=H,js[1]=te,js[2]=X,js[3]=ne,Ee-=Eo[1]+Eo[3],Xe+=Eo[3],Qe-=Eo[2]+Eo[0],Ze+=Eo[0]}function Ut(){let H=Xe+Ee,X=Ze+Qe,te=Xe,ne=Ze;function de(Ae,$e){switch(Ae){case 1:return H+=$e,H-$e;case 2:return X+=$e,X-$e;case 3:return te-=$e,te+$e;case 0:return ne-=$e,ne+$e}}j.forEach((Ae,$e)=>{if(Ae.show&&Ae._show){let Je=Ae.side;Ae._pos=de(Je,Ae._size),Ae.label!=null&&(Ae._lpos=de(Je,Ae.labelSize))}})}if(V.dataIdx==null){let H=V.hover,X=H.skip=new Set(H.skip??[]);X.add(void 0);let te=H.prox=_n(H.prox),ne=H.bias??(H.bias=0);V.dataIdx=(de,Ae,$e,Je)=>{if(Ae==0)return $e;let ot=$e,yt=te(de,Ae,$e,Je)??xi,At=yt>=0&&yt<xi,jt=I.ori==0?Ee:Qe,Vt=V.left,In=e[0],Gt=e[Ae];if(X.has(Gt[$e])){ot=null;let nn=null,qt=null,Dt;if(ne==0||ne==-1)for(Dt=$e;nn==null&&Dt-- >0;)X.has(Gt[Dt])||(nn=Dt);if(ne==0||ne==1)for(Dt=$e;qt==null&&Dt++<Gt.length;)X.has(Gt[Dt])||(qt=Dt);if(nn!=null||qt!=null)if(At){let ci=nn==null?-1/0:G(In[nn],I,jt,0),Ri=qt==null?1/0:G(In[qt],I,jt,0),ir=Vt-ci,Kn=Ri-Vt;ir<=Kn?ir<=yt&&(ot=nn):Kn<=yt&&(ot=qt)}else ot=qt==null?nn:nn==null?qt:$e-nn<=qt-$e?nn:qt}else At&&Ir(Vt-G(In[$e],I,jt,0))>yt&&(ot=null);return ot}}const Kt=H=>{V.event=H};V.idxs=z,V._lock=!1;let it=V.points;it.show=_n(it.show),it.size=_n(it.size),it.stroke=_n(it.stroke),it.width=_n(it.width),it.fill=_n(it.fill);const rt=i.focus=Er({},t.focus||{alpha:.3},V.focus),ht=rt.prox>=0,Et=ht&&it.one;let Tt=[],Ct=[],vn=[];function gi(H,X){let te=it.show(i,X);if(te instanceof HTMLElement)return $o(te,tje),$o(te,H.class),zl(te,-10,-10,Ee,Qe),y.insertBefore(te,Tt[X]),te}function er(H,X){if(r==1||X>0){let te=r==1&&C[H.scale].time,ne=H.value;H.value=te?tF(ne)?lF(N,aF(ne,P)):ne||W:ne||mCe,H.label=H.label||(te?aCe:oCe)}if(Et||X>0){H.width=H.width==null?1:H.width,H.paths=H.paths||OCe||xje,H.fillTo=_n(H.fillTo||bCe),H.pxAlign=+$n(H.pxAlign,b),H.pxRound=vF(H.pxAlign),H.stroke=_n(H.stroke||null),H.fill=_n(H.fill||null),H._stroke=H._fill=H._paths=H._focus=null;let te=gCe(Zs(1,H.width),1),ne=H.points=Er({},{size:te,width:Zs(1,te*.2),stroke:H.stroke,space:te*2,paths:ECe,_stroke:null,_fill:null},H.points);ne.show=_n(ne.show),ne.filter=_n(ne.filter),ne.fill=_n(ne.fill),ne.stroke=_n(ne.stroke),ne.paths=_n(ne.paths),ne.pxAlign=H.pxAlign}if(J){let te=Ve(H,X);Re.splice(X,0,te[0]),qe.splice(X,0,te[1]),U.values.push(null)}if(ee){z.splice(X,0,null);let te=null;Et?X==0&&(te=gi(H,X)):X>0&&(te=gi(H,X)),Tt.splice(X,0,te),Ct.splice(X,0,0),vn.splice(X,0,0)}fr("addSeries",X)}function li(H,X){X=X??S.length,H=r==1?RE(H,X,uF,mF):RE(H,X,{},pF),S.splice(X,0,H),er(S[X],X)}i.addSeries=li;function Qr(H){if(S.splice(H,1),J){U.values.splice(H,1),qe.splice(H,1);let X=Re.splice(H,1)[0];Ge(null,X.firstChild),X.remove()}ee&&(z.splice(H,1),Tt.splice(H,1)[0].remove(),Ct.splice(H,1),vn.splice(H,1)),fr("delSeries",H)}i.delSeries=Qr;const js=[!1,!1,!1,!1];function wd(H,X){if(H._show=H.show,H.show){let te=H.side%2,ne=C[H.scale];ne==null&&(H.scale=te?S[1].scale:E,ne=C[H.scale]);let de=ne.time;H.size=_n(H.size),H.space=_n(H.space),H.rotate=_n(H.rotate),_h(H.incrs)&&H.incrs.forEach($e=>{!dd.has($e)&&dd.set($e,jV($e))}),H.incrs=_n(H.incrs||(ne.distr==2?zje:de?w==1?qje:Wje:Zd)),H.splits=_n(H.splits||(de&&ne.distr==1?Y:ne.distr==3?TE:ne.distr==4?uCe:cCe)),H.stroke=_n(H.stroke),H.grid.stroke=_n(H.grid.stroke),H.ticks.stroke=_n(H.ticks.stroke),H.border.stroke=_n(H.border.stroke);let Ae=H.values;H.values=_h(Ae)&&!_h(Ae[0])?_n(Ae):de?_h(Ae)?oF(N,sF(Ae,P)):tF(Ae)?Gje(N,Ae):Ae||K:Ae||lCe,H.filter=_n(H.filter||(ne.distr>=3&&ne.log==10?fCe:ne.distr==3&&ne.log==2?pCe:wV)),H.font=AF(H.font),H.labelFont=AF(H.labelFont),H._size=H.size(i,null,X,0),H._space=H._rotate=H._incrs=H._found=H._splits=H._values=null,H._size>0&&(js[X]=!0,H._el=xa(KSe,m))}}function Tl(H,X,te,ne){let[de,Ae,$e,Je]=te,ot=X%2,yt=0;return ot==0&&(Je||Ae)&&(yt=X==0&&!de||X==2&&!$e?Nr(cF.size/3):0),ot==1&&(de||$e)&&(yt=X==1&&!Ae||X==3&&!Je?Nr(dF.size/2):0),yt}const jc=i.padding=(t.padding||[Tl,Tl,Tl,Tl]).map(H=>_n($n(H,Tl))),Eo=i._padding=jc.map((H,X)=>H(i,X,js,0));let Ei,$i=null,Rn=null;const ro=r==1?S[0].idxs:null;let wr=null,so=!1;function Wi(H,X){if(e=H??[],i.data=i._data=e,r==2){Ei=0;for(let te=1;te<S.length;te++)Ei+=e[te][0].length}else{e.length==0&&(i.data=i._data=e=[[]]),wr=e[0],Ei=wr.length;let te=e;if(Q==2){te=e.slice();let ne=te[0]=Array(Ei);for(let de=0;de<Ei;de++)ne[de]=de}i._data=e=te}if(ks(!0),fr("setData"),Q==2&&($t=!0),X!==!1){let te=I;te.auto(i,so)?Du():oo(E,te.min,te.max),dn=dn||V.left>=0,tn=!0,Wt()}}i.setData=Wi;function Du(){so=!0;let H,X;r==1&&(Ei>0?($i=ro[0]=0,Rn=ro[1]=Ei-1,H=e[0][$i],X=e[0][Rn],Q==2?(H=$i,X=Rn):H==X&&(Q==3?[H,X]=Ej(H,H,I.log,!1):Q==4?[H,X]=tN(H,H,I.log,!1):I.time?X=H+Nr(86400/w):[H,X]=kw(H,X,nN,!0))):($i=ro[0]=H=null,Rn=ro[1]=X=null)),oo(E,H,X)}let aa,Cs,tt,Rt,ln,Nn,Mi,Sr,os,ei;function ti(H,X,te,ne,de,Ae){H??(H=P5),te??(te=rN),ne??(ne="butt"),de??(de=P5),Ae??(Ae="round"),H!=aa&&(p.strokeStyle=aa=H),de!=Cs&&(p.fillStyle=Cs=de),X!=tt&&(p.lineWidth=tt=X),Ae!=ln&&(p.lineJoin=ln=Ae),ne!=Nn&&(p.lineCap=Nn=ne),te!=Rt&&p.setLineDash(Rt=te)}function _s(H,X,te,ne){X!=Cs&&(p.fillStyle=Cs=X),H!=Mi&&(p.font=Mi=H),te!=Sr&&(p.textAlign=Sr=te),ne!=os&&(p.textBaseline=os=ne)}function Nu(H,X,te,ne,de=0){if(ne.length>0&&H.auto(i,so)&&(X==null||X.min==null)){let Ae=$n($i,0),$e=$n(Rn,ne.length-1),Je=te.min==null?fje(ne,Ae,$e,de,H.distr==3):[te.min,te.max];H.min=ll(H.min,te.min=Je[0]),H.max=Zs(H.max,te.max=Je[1])}}const Cc={min:null,max:null};function Sd(){for(let ne in C){let de=C[ne];q[ne]==null&&(de.min==null||q[E]!=null&&de.auto(i,so))&&(q[ne]=Cc)}for(let ne in C){let de=C[ne];q[ne]==null&&de.from!=null&&q[de.from]!=null&&(q[ne]=Cc)}q[E]!=null&&ks(!0);let H={};for(let ne in q){let de=q[ne];if(de!=null){let Ae=H[ne]=lg(C[ne],wje);if(de.min!=null)Er(Ae,de);else if(ne!=E||r==2)if(Ei==0&&Ae.from==null){let $e=Ae.range(i,null,null,ne);Ae.min=$e[0],Ae.max=$e[1]}else Ae.min=xi,Ae.max=-xi}}if(Ei>0){S.forEach((ne,de)=>{if(r==1){let Ae=ne.scale,$e=q[Ae];if($e==null)return;let Je=H[Ae];if(de==0){let ot=Je.range(i,Je.min,Je.max,Ae);Je.min=ot[0],Je.max=ot[1],$i=tl(Je.min,e[0]),Rn=tl(Je.max,e[0]),Rn-$i>1&&(e[0][$i]<Je.min&&$i++,e[0][Rn]>Je.max&&Rn--),ne.min=wr[$i],ne.max=wr[Rn]}else ne.show&&ne.auto&&Nu(Je,$e,ne,e[de],ne.sorted);ne.idxs[0]=$i,ne.idxs[1]=Rn}else if(de>0&&ne.show&&ne.auto){let[Ae,$e]=ne.facets,Je=Ae.scale,ot=$e.scale,[yt,At]=e[de],jt=H[Je],Vt=H[ot];jt!=null&&Nu(jt,q[Je],Ae,yt,Ae.sorted),Vt!=null&&Nu(Vt,q[ot],$e,At,$e.sorted),ne.min=$e.min,ne.max=$e.max}});for(let ne in H){let de=H[ne],Ae=q[ne];if(de.from==null&&(Ae==null||Ae.min==null)){let $e=de.range(i,de.min==xi?null:de.min,de.max==-xi?null:de.max,ne);de.min=$e[0],de.max=$e[1]}}}for(let ne in H){let de=H[ne];if(de.from!=null){let Ae=H[de.from];if(Ae.min==null)de.min=de.max=null;else{let $e=de.range(i,Ae.min,Ae.max,ne);de.min=$e[0],de.max=$e[1]}}}let X={},te=!1;for(let ne in H){let de=H[ne],Ae=C[ne];if(Ae.min!=de.min||Ae.max!=de.max){Ae.min=de.min,Ae.max=de.max;let $e=Ae.distr;Ae._min=$e==3?fu(Ae.min):$e==4?GT(Ae.min,Ae.asinh):$e==100?Ae.fwd(Ae.min):Ae.min,Ae._max=$e==3?fu(Ae.max):$e==4?GT(Ae.max,Ae.asinh):$e==100?Ae.fwd(Ae.max):Ae.max,X[ne]=te=!0}}if(te){S.forEach((ne,de)=>{r==2?de>0&&X.y&&(ne._paths=null):X[ne.scale]&&(ne._paths=null)});for(let ne in X)$t=!0,fr("setScale",ne);ee&&V.left>=0&&(dn=tn=!0)}for(let ne in q)q[ne]=null}function Iu(H){let X=kE($i-1,0,Ei-1),te=kE(Rn+1,0,Ei-1);for(;H[X]==null&&X>0;)X--;for(;H[te]==null&&te<Ei-1;)te++;return[X,te]}function Lg(){if(Ei>0){let H=S.some(X=>X._focus)&&ei!=rt.alpha;H&&(p.globalAlpha=ei=rt.alpha),S.forEach((X,te)=>{if(te>0&&X.show&&(as(te,!1),as(te,!0),X._paths==null)){let ne=ei;ei!=X.alpha&&(p.globalAlpha=ei=X.alpha);let de=r==2?[0,e[te][0].length-1]:Iu(e[te]);X._paths=X.paths(i,te,de[0],de[1]),ei!=ne&&(p.globalAlpha=ei=ne)}}),S.forEach((X,te)=>{if(te>0&&X.show){let ne=ei;ei!=X.alpha&&(p.globalAlpha=ei=X.alpha),X._paths!=null&&Bu(te,!1);{let de=X._paths!=null?X._paths.gaps:null,Ae=X.points.show(i,te,$i,Rn,de),$e=X.points.filter(i,te,Ae,de);(Ae||$e)&&(X.points._paths=X.points.paths(i,te,$i,Rn,$e),Bu(te,!0))}ei!=ne&&(p.globalAlpha=ei=ne),fr("drawSeries",te)}}),H&&(p.globalAlpha=ei=1)}}function as(H,X){let te=X?S[H].points:S[H];te._stroke=te.stroke(i,H),te._fill=te.fill(i,H)}function Bu(H,X){let te=X?S[H].points:S[H],{stroke:ne,fill:de,clip:Ae,flags:$e,_stroke:Je=te._stroke,_fill:ot=te._fill,_width:yt=te.width}=te._paths;yt=bi(yt*Wn,3);let At=null,jt=yt%2/2;X&&ot==null&&(ot=yt>0?"#fff":Je);let Vt=te.pxAlign==1&&jt>0;if(Vt&&p.translate(jt,jt),!X){let In=Qt-yt/2,Gt=ct-yt/2,nn=zt+yt,qt=on+yt;At=new Path2D,At.rect(In,Gt,nn,qt)}X?dr(Je,yt,te.dash,te.cap,ot,ne,de,$e,Ae):_c(H,Je,yt,te.dash,te.cap,ot,ne,de,$e,At,Ae),Vt&&p.translate(-jt,-jt)}function _c(H,X,te,ne,de,Ae,$e,Je,ot,yt,At){let jt=!1;ot!=0&&k.forEach((Vt,In)=>{if(Vt.series[0]==H){let Gt=S[Vt.series[1]],nn=e[Vt.series[1]],qt=(Gt._paths||Av).band;_h(qt)&&(qt=Vt.dir==1?qt[0]:qt[1]);let Dt,ci=null;Gt.show&&qt&&mje(nn,$i,Rn)?(ci=Vt.fill(i,In)||Ae,Dt=Gt._paths.clip):qt=null,dr(X,te,ne,de,ci,$e,Je,ot,yt,At,Dt,qt),jt=!0}}),jt||dr(X,te,ne,de,Ae,$e,Je,ot,yt,At)}const kc=cg|EE;function dr(H,X,te,ne,de,Ae,$e,Je,ot,yt,At,jt){ti(H,X,te,ne,de),(ot||yt||jt)&&(p.save(),ot&&p.clip(ot),yt&&p.clip(yt)),jt?(Je&kc)==kc?(p.clip(jt),At&&p.clip(At),La(de,$e),Tc(H,Ae,X)):Je&EE?(La(de,$e),p.clip(jt),Tc(H,Ae,X)):Je&cg&&(p.save(),p.clip(jt),At&&p.clip(At),La(de,$e),p.restore(),Tc(H,Ae,X)):(La(de,$e),Tc(H,Ae,X)),(ot||yt||jt)&&p.restore()}function Tc(H,X,te){te>0&&(X instanceof Map?X.forEach((ne,de)=>{p.strokeStyle=aa=de,p.stroke(ne)}):X!=null&&H&&p.stroke(X))}function La(H,X){X instanceof Map?X.forEach((te,ne)=>{p.fillStyle=Cs=ne,p.fill(te)}):X!=null&&H&&p.fill(X)}function Ht(H,X,te,ne){let de=j[H],Ae;if(ne<=0)Ae=[0,0];else{let $e=de._space=de.space(i,H,X,te,ne),Je=de._incrs=de.incrs(i,H,X,te,ne,$e);Ae=BCe(X,te,Je,ne,$e)}return de._found=Ae}function Lu(H,X,te,ne,de,Ae,$e,Je,ot,yt){let At=$e%2/2;b==1&&p.translate(At,At),ti(Je,$e,ot,yt,Je),p.beginPath();let jt,Vt,In,Gt,nn=de+(ne==0||ne==3?-Ae:Ae);te==0?(Vt=de,Gt=nn):(jt=de,In=nn);for(let qt=0;qt<H.length;qt++)X[qt]!=null&&(te==0?jt=In=H[qt]:Vt=Gt=H[qt],p.moveTo(jt,Vt),p.lineTo(In,Gt));p.stroke(),b==1&&p.translate(-At,-At)}function tr(H){let X=!0;return j.forEach((te,ne)=>{if(!te.show)return;let de=C[te.scale];if(de.min==null){te._show&&(X=!1,te._show=!1,ks(!1));return}else te._show||(X=!1,te._show=!0,ks(!1));let Ae=te.side,$e=Ae%2,{min:Je,max:ot}=de,[yt,At]=Ht(ne,Je,ot,$e==0?Ee:Qe);if(At==0)return;let jt=de.distr==2,Vt=te._splits=te.splits(i,ne,Je,ot,yt,At,jt),In=de.distr==2?Vt.map(Dt=>wr[Dt]):Vt,Gt=de.distr==2?wr[Vt[1]]-wr[Vt[0]]:yt,nn=te._values=te.values(i,te.filter(i,In,ne,At,Gt),ne,At,Gt);te._rotate=Ae==2?te.rotate(i,nn,ne,At):0;let qt=te._size;te._size=ja(te.size(i,nn,ne,H)),qt!=null&&te._size!=qt&&(X=!1)}),X}function qn(H){let X=!0;return jc.forEach((te,ne)=>{let de=te(i,ne,js,H);de!=Eo[ne]&&(X=!1),Eo[ne]=de}),X}function Ol(){for(let H=0;H<j.length;H++){let X=j[H];if(!X.show||!X._show)continue;let te=X.side,ne=te%2,de,Ae,$e=X.stroke(i,H),Je=te==0||te==3?-1:1,[ot,yt]=X._found;if(X.label!=null){let Ur=X.labelGap*Je,Rs=Nr((X._lpos+Ur)*Wn);_s(X.labelFont[0],$e,"center",te==2?F0:L5),p.save(),ne==1?(de=Ae=0,p.translate(Rs,Nr(ct+on/2)),p.rotate((te==3?-l1:l1)/2)):(de=Nr(Qt+zt/2),Ae=Rs);let Dl=bV(X.label)?X.label(i,H,ot,yt):X.label;p.fillText(Dl,de,Ae),p.restore()}if(yt==0)continue;let At=C[X.scale],jt=ne==0?zt:on,Vt=ne==0?Qt:ct,In=X._splits,Gt=At.distr==2?In.map(Ur=>wr[Ur]):In,nn=At.distr==2?wr[In[1]]-wr[In[0]]:ot,qt=X.ticks,Dt=X.border,ci=qt.show?qt.size:0,Ri=Nr(ci*Wn),ir=Nr((X.alignTo==2?X._size-ci-X.gap:X.gap)*Wn),Kn=X._rotate*-l1/180,ii=A(X._pos*Wn),ls=(Ri+ir)*Je,pr=ii+ls;Ae=ne==0?pr:0,de=ne==1?pr:0;let Es=X.font[0],ao=X.align==1?Ip:X.align==2?WT:Kn>0?Ip:Kn<0?WT:ne==0?"center":te==3?WT:Ip,Yr=Kn||ne==1?"middle":te==2?F0:L5;_s(Es,$e,ao,Yr);let jr=X.font[1]*X.lineGap,Ms=In.map(Ur=>A(l(Ur,At,jt,Vt))),lo=X._values;for(let Ur=0;Ur<lo.length;Ur++){let Rs=lo[Ur];if(Rs!=null){ne==0?de=Ms[Ur]:Ae=Ms[Ur],Rs=""+Rs;let Dl=Rs.indexOf(`
`)==-1?[Rs]:Rs.split(/\n/gm);for(let cs=0;cs<Dl.length;cs++){let _x=Dl[cs];Kn?(p.save(),p.translate(de,Ae+cs*jr),p.rotate(Kn),p.fillText(_x,0,0),p.restore()):p.fillText(_x,de,Ae+cs*jr)}}}qt.show&&Lu(Ms,qt.filter(i,Gt,H,yt,nn),ne,te,ii,Ri,bi(qt.width*Wn,3),qt.stroke(i,H),qt.dash,qt.cap);let Wr=X.grid;Wr.show&&Lu(Ms,Wr.filter(i,Gt,H,yt,nn),ne,ne==0?2:1,ne==0?ct:Qt,ne==0?on:zt,bi(Wr.width*Wn,3),Wr.stroke(i,H),Wr.dash,Wr.cap),Dt.show&&Lu([ii],[1],ne==0?1:0,ne==0?1:2,ne==1?ct:Qt,ne==1?on:zt,bi(Dt.width*Wn,3),Dt.stroke(i,H),Dt.dash,Dt.cap)}fr("drawAxes")}function ks(H){S.forEach((X,te)=>{te>0&&(X._paths=null,H&&(r==1?(X.min=null,X.max=null):X.facets.forEach(ne=>{ne.min=null,ne.max=null})))})}let El=!1,la=!1,at=[];function kt(){la=!1;for(let H=0;H<at.length;H++)fr(...at[H]);at.length=0}function Wt(){El||(Oje(Ci),El=!0)}function yn(H,X=!1){El=!0,la=X,H(i),Ci(),X&&at.length>0&&queueMicrotask(kt)}i.batch=yn;function Ci(){if(Lt&&(Sd(),Lt=!1),$t&&(ve(),$t=!1),It){if(Bi(v,Ip,Xe),Bi(v,F0,Ze),Bi(v,rv,Ee),Bi(v,sv,Qe),Bi(y,Ip,Xe),Bi(y,F0,Ze),Bi(y,rv,Ee),Bi(y,sv,Qe),Bi(m,rv,dt),Bi(m,sv,nt),f.width=Nr(dt*Wn),f.height=Nr(nt*Wn),j.forEach(({_el:H,_show:X,_size:te,_pos:ne,side:de})=>{if(H!=null)if(X){let Ae=de===3||de===0?te:0,$e=de%2==1;Bi(H,$e?"left":"top",ne-Ae),Bi(H,$e?"width":"height",te),Bi(H,$e?"top":"left",$e?Ze:Xe),Bi(H,$e?"height":"width",$e?Qe:Ee),CE(H,rf)}else $o(H,rf)}),aa=Cs=tt=ln=Nn=Mi=Sr=os=Rt=null,ei=1,kd(!0),Xe!=vt||Ze!=pn||Ee!=mn||Qe!=un){ks(!1);let H=Ee/mn,X=Qe/un;if(ee&&!dn&&V.left>=0){V.left*=H,V.top*=X,ca&&zl(ca,Nr(V.left),0,Ee,Qe),Os&&zl(Os,0,Nr(V.top),Ee,Qe);for(let te=0;te<Tt.length;te++){let ne=Tt[te];ne!=null&&(Ct[te]*=H,vn[te]*=X,zl(ne,ja(Ct[te]),ja(vn[te]),Ee,Qe))}}if(Qn.show&&!ji&&Qn.left>=0&&Qn.width>0){Qn.left*=H,Qn.width*=H,Qn.top*=X,Qn.height*=X;for(let te in qg)Bi($u,te,Qn[te])}vt=Xe,pn=Ze,mn=Ee,un=Qe}fr("setSize"),It=!1}dt>0&&nt>0&&(p.clearRect(0,0,f.width,f.height),fr("drawClear"),R.forEach(H=>H()),fr("draw")),Qn.show&&ji&&(zu(Qn),ji=!1),ee&&dn&&(Mc(null,!0,!1),dn=!1),U.show&&U.live&&tn&&(zg(),tn=!1),u||(u=!0,i.status=1,fr("ready")),so=!1,El=!1}i.redraw=(H,X)=>{$t=X||!1,H!==!1?oo(E,I.min,I.max):Wt()};function Ts(H,X){let te=C[H];if(te.from==null){if(Ei==0){let ne=te.range(i,X.min,X.max,H);X.min=ne[0],X.max=ne[1]}if(X.min>X.max){let ne=X.min;X.min=X.max,X.max=ne}if(Ei>1&&X.min!=null&&X.max!=null&&X.max-X.min<1e-16)return;H==E&&te.distr==2&&Ei>0&&(X.min=tl(X.min,e[0]),X.max=tl(X.max,e[0]),X.min==X.max&&X.max++),q[H]=X,Lt=!0,Wt()}}i.setScale=Ts;let Oc,Pu,ca,Os,Kf,Fu,zs,Ml,jd,Pg,Xn,ni,Pa=!1;const Bn=V.drag;let _i=Bn.x,Ui=Bn.y;ee&&(V.x&&(Oc=xa(JSe,y)),V.y&&(Pu=xa(eje,y)),I.ori==0?(ca=Oc,Os=Pu):(ca=Pu,Os=Oc),Xn=V.left,ni=V.top);const Qn=i.select=Er({show:!0,over:!0,left:0,width:0,top:0,height:0},t.select),$u=Qn.show?xa(ZSe,Qn.over?y:v):null;function zu(H,X){if(Qn.show){for(let te in H)Qn[te]=H[te],te in qg&&Bi($u,te,H[te]);X!==!1&&fr("setSelect")}}i.setSelect=zu;function Fg(H){if(S[H].show)J&&CE(Re[H],rf);else if(J&&$o(Re[H],rf),ee){let te=Et?Tt[0]:Tt[H];te!=null&&zl(te,-10,-10,Ee,Qe)}}function oo(H,X,te){Ts(H,{min:X,max:te})}function Hs(H,X,te,ne){X.focus!=null&&Yj(H),X.show!=null&&S.forEach((de,Ae)=>{Ae>0&&(H==Ae||H==null)&&(de.show=X.show,Fg(Ae),r==2?(oo(de.facets[0].scale,null,null),oo(de.facets[1].scale,null,null)):oo(de.scale,null,null),Wt())}),te!==!1&&fr("setSeries",H,X),ne&&Qu("setSeries",i,H,X)}i.setSeries=Hs;function mx(H,X){Er(k[H],X)}function Hj(H,X){H.fill=_n(H.fill||null),H.dir=$n(H.dir,-1),X=X??k.length,k.splice(X,0,H)}function qj(H){H==null?k.length=0:k.splice(H,1)}i.addBand=Hj,i.setBand=mx,i.delBand=qj;function Qj(H,X){S[H].alpha=X,ee&&Tt[H]!=null&&(Tt[H].style.opacity=X),J&&Re[H]&&(Re[H].style.opacity=X)}let Mo,Rl,Ec;const Hu={focus:!0};function Yj(H){if(H!=Ec){let X=H==null,te=rt.alpha!=1;S.forEach((ne,de)=>{if(r==1||de>0){let Ae=X||de==0||de==H;ne._focus=X?null:Ae,te&&Qj(de,Ae?1:rt.alpha)}}),Ec=H,te&&Wt()}}J&&ht&&Ye(z5,he,H=>{V._lock||(Kt(H),Ec!=null&&Hs(null,Hu,!0,nr.setSeries))});function ua(H,X,te){let ne=C[X];te&&(H=H/Wn-(ne.ori==1?Ze:Xe));let de=Ee;ne.ori==1&&(de=Qe,H=de-H),ne.dir==-1&&(H=de-H);let Ae=ne._min,$e=ne._max,Je=H/de,ot=Ae+($e-Ae)*Je,yt=ne.distr;return yt==3?og(10,ot):yt==4?vje(ot,ne.asinh):yt==100?ne.bwd(ot):ot}function gx(H,X){let te=ua(H,E,X);return tl(te,e[0],$i,Rn)}i.valToIdx=H=>tl(H,e[0]),i.posToIdx=gx,i.posToVal=ua,i.valToPos=(H,X,te)=>C[X].ori==0?s(H,C[X],te?zt:Ee,te?Qt:0):a(H,C[X],te?on:Qe,te?ct:0),i.setCursor=(H,X,te)=>{Xn=H.left,ni=H.top,Mc(null,X,te)};function vx(H,X){Bi($u,Ip,Qn.left=H),Bi($u,rv,Qn.width=X)}function yx(H,X){Bi($u,F0,Qn.top=H),Bi($u,sv,Qn.height=X)}let Cd=I.ori==0?vx:yx,_d=I.ori==1?vx:yx;function $g(){if(J&&U.live)for(let H=r==2?1:0;H<S.length;H++){if(H==0&&je)continue;let X=U.values[H],te=0;for(let ne in X)qe[H][te++].firstChild.nodeValue=X[ne]}}function zg(H,X){if(H!=null&&(H.idxs?H.idxs.forEach((te,ne)=>{z[ne]=te}):Aje(H.idx)||z.fill(H.idx),U.idx=z[0]),J&&U.live){for(let te=0;te<S.length;te++)(te>0||r==1&&!je)&&Wj(te,z[te]);$g()}tn=!1,X!==!1&&fr("setLegend")}i.setLegend=zg;function Wj(H,X){let te=S[H],ne=H==0&&Q==2?wr:e[H],de;je?de=te.values(i,H,X)??se:(de=te.value(i,X==null?null:ne[X],H,X),de=de==null?se:{_:de}),U.values[H]=de}function Mc(H,X,te){jd=Xn,Pg=ni,[Xn,ni]=V.move(i,Xn,ni),V.left=Xn,V.top=ni,ee&&(ca&&zl(ca,Nr(Xn),0,Ee,Qe),Os&&zl(Os,0,Nr(ni),Ee,Qe));let ne,de=$i>Rn;Mo=xi,Rl=null;let Ae=I.ori==0?Ee:Qe,$e=I.ori==1?Ee:Qe;if(Xn<0||Ei==0||de){ne=V.idx=null;for(let Je=0;Je<S.length;Je++){let ot=Tt[Je];ot!=null&&zl(ot,-10,-10,Ee,Qe)}ht&&Hs(null,Hu,!0,H==null&&nr.setSeries),U.live&&(z.fill(ne),tn=!0)}else{let Je,ot,yt;r==1&&(Je=I.ori==0?Xn:ni,ot=ua(Je,E),ne=V.idx=tl(ot,e[0],$i,Rn),yt=G(e[0][ne],I,Ae,0));let At=-10,jt=-10,Vt=0,In=0,Gt=!0,nn="",qt="";for(let Dt=r==2?1:0;Dt<S.length;Dt++){let ci=S[Dt],Ri=z[Dt],ir=Ri==null?null:r==1?e[Dt][Ri]:e[Dt][1][Ri],Kn=V.dataIdx(i,Dt,ne,ot),ii=Kn==null?null:r==1?e[Dt][Kn]:e[Dt][1][Kn];if(tn=tn||ii!=ir||Kn!=Ri,z[Dt]=Kn,Dt>0&&ci.show){let ls=Kn==null?-10:Kn==ne?yt:G(r==1?e[0][Kn]:e[Dt][0][Kn],I,Ae,0),pr=ii==null?-10:L(ii,r==1?C[ci.scale]:C[ci.facets[1].scale],$e,0);if(ht&&ii!=null){let Es=I.ori==1?Xn:ni,ao=Ir(rt.dist(i,Dt,Kn,pr,Es));if(ao<Mo){let Yr=rt.bias;if(Yr!=0){let jr=ua(Es,ci.scale),Ms=ii>=0?1:-1,lo=jr>=0?1:-1;lo==Ms&&(lo==1?Yr==1?ii>=jr:ii<=jr:Yr==1?ii<=jr:ii>=jr)&&(Mo=ao,Rl=Dt)}else Mo=ao,Rl=Dt}}if(tn||Et){let Es,ao;I.ori==0?(Es=ls,ao=pr):(Es=pr,ao=ls);let Yr,jr,Ms,lo,Wr,Ur,Rs=!0,Dl=it.bbox;if(Dl!=null){Rs=!1;let cs=Dl(i,Dt);Ms=cs.left,lo=cs.top,Yr=cs.width,jr=cs.height}else Ms=Es,lo=ao,Yr=jr=it.size(i,Dt);if(Ur=it.fill(i,Dt),Wr=it.stroke(i,Dt),Et)Dt==Rl&&Mo<=rt.prox&&(At=Ms,jt=lo,Vt=Yr,In=jr,Gt=Rs,nn=Ur,qt=Wr);else{let cs=Tt[Dt];cs!=null&&(Ct[Dt]=Ms,vn[Dt]=lo,V5(cs,Yr,jr,Rs),W5(cs,Ur,Wr),zl(cs,ja(Ms),ja(lo),Ee,Qe))}}}}if(Et){let Dt=rt.prox,ci=Ec==null?Mo<=Dt:Mo>Dt||Rl!=Ec;if(tn||ci){let Ri=Tt[0];Ri!=null&&(Ct[0]=At,vn[0]=jt,V5(Ri,Vt,In,Gt),W5(Ri,nn,qt),zl(Ri,ja(At),ja(jt),Ee,Qe))}}}if(Qn.show&&Pa)if(H!=null){let[Je,ot]=nr.scales,[yt,At]=nr.match,[jt,Vt]=H.cursor.sync.scales,In=H.cursor.drag;if(_i=In._x,Ui=In._y,_i||Ui){let{left:Gt,top:nn,width:qt,height:Dt}=H.select,ci=H.scales[jt].ori,Ri=H.posToVal,ir,Kn,ii,ls,pr,Es=Je!=null&&yt(Je,jt),ao=ot!=null&&At(ot,Vt);Es&&_i?(ci==0?(ir=Gt,Kn=qt):(ir=nn,Kn=Dt),ii=C[Je],ls=G(Ri(ir,jt),ii,Ae,0),pr=G(Ri(ir+Kn,jt),ii,Ae,0),Cd(ll(ls,pr),Ir(pr-ls))):Cd(0,Ae),ao&&Ui?(ci==1?(ir=Gt,Kn=qt):(ir=nn,Kn=Dt),ii=C[ot],ls=L(Ri(ir,Vt),ii,$e,0),pr=L(Ri(ir+Kn,Vt),ii,$e,0),_d(ll(ls,pr),Ir(pr-ls))):_d(0,$e)}else Qg()}else{let Je=Ir(jd-Kf),ot=Ir(Pg-Fu);if(I.ori==1){let Vt=Je;Je=ot,ot=Vt}_i=Bn.x&&Je>=Bn.dist,Ui=Bn.y&&ot>=Bn.dist;let yt=Bn.uni;yt!=null?_i&&Ui&&(_i=Je>=yt,Ui=ot>=yt,!_i&&!Ui&&(ot>Je?Ui=!0:_i=!0)):Bn.x&&Bn.y&&(_i||Ui)&&(_i=Ui=!0);let At,jt;_i&&(I.ori==0?(At=zs,jt=Xn):(At=Ml,jt=ni),Cd(ll(At,jt),Ir(jt-At)),Ui||_d(0,$e)),Ui&&(I.ori==1?(At=zs,jt=Xn):(At=Ml,jt=ni),_d(ll(At,jt),Ir(jt-At)),_i||Cd(0,Ae)),!_i&&!Ui&&(Cd(0,0),_d(0,0))}if(Bn._x=_i,Bn._y=Ui,H==null){if(te){if(jx!=null){let[Je,ot]=nr.scales;nr.values[0]=Je!=null?ua(I.ori==0?Xn:ni,Je):null,nr.values[1]=ot!=null?ua(I.ori==1?Xn:ni,ot):null}Qu(UT,i,Xn,ni,Ee,Qe,ne)}if(ht){let Je=te&&nr.setSeries,ot=rt.prox;Ec==null?Mo<=ot&&Hs(Rl,Hu,!0,Je):Mo>ot?Hs(null,Hu,!0,Je):Rl!=Ec&&Hs(Rl,Hu,!0,Je)}}tn&&(U.idx=ne,zg()),X!==!1&&fr("setCursor")}let Fa=null;Object.defineProperty(i,"rect",{get(){return Fa==null&&kd(!1),Fa}});function kd(H=!1){H?Fa=null:(Fa=y.getBoundingClientRect(),fr("syncRect",Fa))}function xx(H,X,te,ne,de,Ae,$e){V._lock||Pa&&H!=null&&H.movementX==0&&H.movementY==0||(Hg(H,X,te,ne,de,Ae,$e,!1,H!=null),H!=null?Mc(null,!0,!0):Mc(X,!0,!1))}function Hg(H,X,te,ne,de,Ae,$e,Je,ot){if(Fa==null&&kd(!1),Kt(H),H!=null)te=H.clientX-Fa.left,ne=H.clientY-Fa.top;else{if(te<0||ne<0){Xn=-10,ni=-10;return}let[yt,At]=nr.scales,jt=X.cursor.sync,[Vt,In]=jt.values,[Gt,nn]=jt.scales,[qt,Dt]=nr.match,ci=X.axes[0].side%2==1,Ri=I.ori==0?Ee:Qe,ir=I.ori==1?Ee:Qe,Kn=ci?Ae:de,ii=ci?de:Ae,ls=ci?ne:te,pr=ci?te:ne;if(Gt!=null?te=qt(yt,Gt)?l(Vt,C[yt],Ri,0):-10:te=Ri*(ls/Kn),nn!=null?ne=Dt(At,nn)?l(In,C[At],ir,0):-10:ne=ir*(pr/ii),I.ori==1){let Es=te;te=ne,ne=Es}}ot&&(X==null||X.cursor.event.type==UT)&&((te<=1||te>=Ee-1)&&(te=Kd(te,Ee)),(ne<=1||ne>=Qe-1)&&(ne=Kd(ne,Qe))),Je?(Kf=te,Fu=ne,[zs,Ml]=V.move(i,te,ne)):(Xn=te,ni=ne)}const qg={width:0,height:0,left:0,top:0};function Qg(){zu(qg,!1)}let bx,Ax,wx,Sx;function Zf(H,X,te,ne,de,Ae,$e){Pa=!0,_i=Ui=Bn._x=Bn._y=!1,Hg(H,X,te,ne,de,Ae,$e,!0,!1),H!=null&&(Ye(VT,SE,qu,!1),Qu(F5,i,zs,Ml,Ee,Qe,null));let{left:Je,top:ot,width:yt,height:At}=Qn;bx=Je,Ax=ot,wx=yt,Sx=At}function qu(H,X,te,ne,de,Ae,$e){Pa=Bn._x=Bn._y=!1,Hg(H,X,te,ne,de,Ae,$e,!1,!0);let{left:Je,top:ot,width:yt,height:At}=Qn,jt=yt>0||At>0,Vt=bx!=Je||Ax!=ot||wx!=yt||Sx!=At;if(jt&&Vt&&zu(Qn),Bn.setScale&&jt&&Vt){let In=Je,Gt=yt,nn=ot,qt=At;if(I.ori==1&&(In=ot,Gt=At,nn=Je,qt=yt),_i&&oo(E,ua(In,E),ua(In+Gt,E)),Ui)for(let Dt in C){let ci=C[Dt];Dt!=E&&ci.from==null&&ci.min!=xi&&oo(Dt,ua(nn+qt,Dt),ua(nn,Dt))}Qg()}else V.lock&&(V._lock=!V._lock,Mc(X,!0,H!=null));H!=null&&(Ge(VT,SE),Qu(VT,i,Xn,ni,Ee,Qe,null))}function Uj(H,X,te,ne,de,Ae,$e){if(V._lock)return;Kt(H);let Je=Pa;if(Pa){let ot=!0,yt=!0,At=10,jt,Vt;I.ori==0?(jt=_i,Vt=Ui):(jt=Ui,Vt=_i),jt&&Vt&&(ot=Xn<=At||Xn>=Ee-At,yt=ni<=At||ni>=Qe-At),jt&&ot&&(Xn=Xn<zs?0:Ee),Vt&&yt&&(ni=ni<Ml?0:Qe),Mc(null,!0,!0),Pa=!1}Xn=-10,ni=-10,z.fill(null),Mc(null,!0,!0),Je&&(Pa=Je)}function Yg(H,X,te,ne,de,Ae,$e){V._lock||(Kt(H),Du(),Qg(),H!=null&&Qu(H5,i,Xn,ni,Ee,Qe,null))}function Wg(){j.forEach(LCe),an(i.width,i.height,!0)}Df(_w,vm,Wg);const Rc={};Rc.mousedown=Zf,Rc.mousemove=xx,Rc.mouseup=qu,Rc.dblclick=Yg,Rc.setSeries=(H,X,te,ne)=>{let de=nr.match[2];te=de(i,X,te),te!=-1&&Hs(te,ne,!0,!1)},ee&&(Ye(F5,y,Zf),Ye(UT,y,xx),Ye($5,y,H=>{Kt(H),kd(!1)}),Ye(z5,y,Uj),Ye(H5,y,Yg),ME.add(i),i.syncRect=kd);const Td=i.hooks=t.hooks||{};function fr(H,X,te){la?at.push([H,X,te]):H in Td&&Td[H].forEach(ne=>{ne.call(null,i,X,te)})}(t.plugins||[]).forEach(H=>{for(let X in H.hooks)Td[X]=(Td[X]||[]).concat(H.hooks[X])});const Dc=(H,X,te)=>te,nr=Er({key:null,setSeries:!1,filters:{pub:J5,sub:J5},scales:[E,S[1]?S[1].scale:null],match:[eF,eF,Dc],values:[null,null]},V.sync);nr.match.length==2&&nr.match.push(Dc),V.sync=nr;const jx=nr.key,Ug=QV(jx);function Qu(H,X,te,ne,de,Ae,$e){nr.filters.pub(H,X,te,ne,de,Ae,$e)&&Ug.pub(H,X,te,ne,de,Ae,$e)}Ug.sub(i);function Cx(H,X,te,ne,de,Ae,$e){nr.filters.sub(H,X,te,ne,de,Ae,$e)&&Rc[H](null,X,te,ne,de,Ae,$e)}i.pub=Cx;function Od(){Ug.unsub(i),ME.delete(i),st.clear(),_E(_w,vm,Wg),d.remove(),he==null||he.remove(),fr("destroy")}i.destroy=Od;function Nc(){fr("init",t,e),Wi(e||t.data,!1),q[E]?Ts(E,q[E]):Du(),ji=Qn.show&&(Qn.width>0||Qn.height>0),dn=tn=!0,an(t.width,t.height)}return S.forEach(er),j.forEach(wd),n?n instanceof HTMLElement?(n.appendChild(d),Nc()):n(i,Nc):Nc(),i}$r.assign=Er;$r.fmtNum=iN;$r.rangeNum=kw;$r.rangeLog=Ej;$r.rangeAsinh=tN;$r.orient=Xf;$r.pxRatio=Wn;$r.join=Tje;$r.fmtDate=sN,$r.tzDate=Fje;$r.sync=QV;{$r.addGap=ACe,$r.clipGaps=Dj;let t=$r.paths={points:XV};t.linear=ZV,t.stepped=jCe,t.bars=CCe,t.spline=kCe}const PCe=Object.freeze(Object.defineProperty({__proto__:null,default:$r},Symbol.toStringTag,{value:"Module"})),FCe=zE(PCe);var $Ce=a1.exports,wF;function zCe(){return wF||(wF=1,(function(t,e){(function(i,r){t.exports=r(gy(),FCe)})($Ce,(n,i)=>(()=>{var r={"./common/index.ts":((u,d,f)=>{f.r(d),f.d(d,{dataMatch:()=>v,optionsUpdateState:()=>m});var p=function(y,b){var A={};for(var w in y)Object.prototype.hasOwnProperty.call(y,w)&&b.indexOf(w)<0&&(A[w]=y[w]);if(y!=null&&typeof Object.getOwnPropertySymbols=="function")for(var S=0,w=Object.getOwnPropertySymbols(y);S<w.length;S++)b.indexOf(w[S])<0&&Object.prototype.propertyIsEnumerable.call(y,w[S])&&(A[w[S]]=y[w[S]]);return A};Object.is||Object.defineProperty(Object,"is",{value:function(b,A){return b===A&&(b!==0||1/b===1/A)||b!==b&&A!==A}});var m=function(b,A){var w=b.width,S=b.height,j=p(b,["width","height"]),C=A.width,k=A.height,E=p(A,["width","height"]),M="keep";if((S!==k||w!==C)&&(M="update"),Object.keys(j).length!==Object.keys(E).length)return"create";for(var R=0,D=Object.keys(j);R<D.length;R++){var F=D[R];if(!Object.is(j[F],E[F])){M="create";break}}return M},v=function(b,A){return b.length!==A.length?!1:b.every(function(w,S){var j=A[S];return w.length!==j.length?!1:w.every(function(C,k){return C===j[k]})})}}),react:(u=>{u.exports=n}),uplot:(u=>{u.exports=i})},s={};function a(u){var d=s[u];if(d!==void 0)return d.exports;var f=s[u]={exports:{}};return r[u](f,f.exports,a),f.exports}a.n=u=>{var d=u&&u.__esModule?()=>u.default:()=>u;return a.d(d,{a:d}),d},a.d=(u,d)=>{for(var f in d)a.o(d,f)&&!a.o(u,f)&&Object.defineProperty(u,f,{enumerable:!0,get:d[f]})},a.o=(u,d)=>Object.prototype.hasOwnProperty.call(u,d),a.r=u=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(u,"__esModule",{value:!0})};var l={};return(()=>{/*!*******************************!*\
  !*** ./react/uplot-react.tsx ***!
  \*******************************/a.r(l),a.d(l,{default:()=>v});var u=a("react"),d=a.n(u),f=a("uplot"),p=a.n(f),m=a("./common/index.ts");function v(y){var b=y.options,A=y.data,w=y.target,S=y.onDelete,j=y.onCreate,C=y.resetScales,k=C===void 0?!0:C,E=y.className,M=(0,u.useRef)(null),R=(0,u.useRef)(null),D=(0,u.useRef)(b),F=(0,u.useRef)(w),I=(0,u.useRef)(A),Q=(0,u.useRef)(j),G=(0,u.useRef)(S);(0,u.useEffect)(function(){Q.current=j,G.current=S});var L=(0,u.useCallback)(function(N){var P;N&&((P=G.current)===null||P===void 0||P.call(G,N),N.destroy(),M.current=null)},[]),q=(0,u.useCallback)(function(){var N,P=new(p())(D.current,I.current,F.current||R.current);M.current=P,(N=Q.current)===null||N===void 0||N.call(Q,P)},[]);return(0,u.useEffect)(function(){return q(),function(){L(M.current)}},[q,L]),(0,u.useEffect)(function(){if(D.current!==b){var N=(0,m.optionsUpdateState)(D.current,b);D.current=b,!M.current||N==="create"?(L(M.current),q()):N==="update"&&M.current.setSize({width:b.width,height:b.height})}},[b,q,L]),(0,u.useEffect)(function(){I.current!==A&&(M.current?(0,m.dataMatch)(I.current,A)||(k?M.current.setData(A,!0):(M.current.setData(A,!1),M.current.redraw())):(I.current=A,q()),I.current=A)},[A,k,q]),(0,u.useEffect)(function(){return F.current!==w&&(F.current=w,q()),function(){return L(M.current)}},[w,q,L]),w?null:d().createElement("div",{ref:R,className:E})}})(),l=l.default,l})())})(a1)),a1.exports}var HCe=zCe();const qCe=Al(HCe),nG=t=>t===null?"scalar":Tj(t.__name__||"")?`{"${Kh(t.__name__)}",${Object.entries(t).filter(([e])=>e!=="__name__").map(([e,n])=>`${hd(e)}="${Kh(n)}"`).join(", ")}}`:`${t.__name__||""}{${Object.entries(t).filter(([e])=>e!=="__name__").map(([e,n])=>`${hd(e)}="${Kh(n)}"`).join(", ")}}`,SF=(t,e)=>{const n=jF[t%jF.length];return e?n:E8(n,.4)},jF=["#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"],JT=(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")},CF=8,_F=t=>new Set(t).size!==t.length,QCe=t=>{const e=t.map(n=>JT(n));if(!_F(e))return e;for(let n=3;n<=CF;n++){const i=t.map(r=>JT(r,n));if(!_F(i))return i}return t.map(n=>JT(n,CF))},c1=t=>{const e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};return String(t).replace(/[&<>"'/]/g,function(n){return e[n]})},YCe=t=>`
            <div class="labels">
              ${Object.keys(t).length===0?'<div class="no-labels">no labels</div>':""}
              ${t.__name__?`<div><strong>${c1(t.__name__)}</strong></div>`:""}
              ${Object.keys(t).filter(e=>e!=="__name__").map(e=>`<div><strong>${c1(e)}</strong>: ${c1(t[e])}</div>`).join("")}
            </div>`,WCe=(t,e)=>{let n,i=null;const r=document.createElement("div");return r.className="u-tooltip",r.style.display="none",{hooks:{init:s=>{n=s.over,n.addEventListener("mouseenter",()=>{r.style.display="block"}),n.addEventListener("mouseleave",()=>{r.style.display="none"}),document.body.appendChild(r)},destroy:()=>{r.remove()},setSeries:(s,a,l)=>{i=a},setCursor:s=>{const{left:a,top:l,idx:u}=s.cursor;if(u==null||a===null||a===void 0||l===null||l===void 0||i===null)return;const d=s.data[0][u],f=e[i][u],p=s.series[i],m=p.labels;if(typeof p.stroke!="function")throw new Error("series.stroke is not a function");const v=p.stroke(s,i),y=n.getBoundingClientRect(),b=a+y.left,A=l+y.top;r.innerHTML=`
            <div class="date">${Tf(d,t)}</div>
            <div class="series-value">
              <span class="detail-swatch" style="background-color: ${v}"></span>
              <span>${m.__name__?c1(m.__name__)+": ":" "}<strong>${f}</strong></span>
            </div>
            ${YCe(m)}
          `.trimEnd(),f$({getBoundingClientRect(){return{width:0,height:0,x:b,y:A,left:b,right:b,top:A,bottom:A}}},r,{placement:"right-start",middleware:[u$(5),d$(),h$()]}).then(({x:S,y:j})=>{Object.assign(r.style,{top:`${j}px`,left:`${S}px`})})}}}},UCe=(t,e,n,i)=>{const r=t.axes[n];if(i>1)return r._size;let s=r.ticks.size+r.gap;const a=(e??[]).reduce((l,u)=>u.length>l.length?u:l,"");return a!=""&&(t.ctx.font=r.font[0],s+=t.ctx.measureText(a).width/devicePixelRatio),Math.ceil(s)},VCe=(t,e,n,i)=>{const r=[],s=t.series[e];if(!n&&i&&i.length){const[a,l]=s.idxs,u=t.data[0],d=t.data[e],f=Math.round(t.valToPos(u[a],"x",!0)),p=Math.round(t.valToPos(u[l],"x",!0));i[0][0]===f&&r.push(a);for(let m=0;m<i.length;m++){const v=i[m],y=i[m+1];if(y&&v[1]===y[0]){let b=t.posToIdx(v[1],!0);if(d[b]==null)for(let A=1;A<100;A++){if(d[b+A]!=null){b+=A;break}if(d[b-A]!=null){b-=A;break}}r.push(b)}}i[i.length-1][1]===p&&r.push(l)}return r.length?r:null},GCe=(t,e,n,i,r,s,a)=>({width:e-30,height:550,cursor:{focus:{prox:1e3},drag:{x:!0,setScale:!1}},tzDate:i?void 0:l=>$r.tzDate(new Date(l*1e3),"Etc/UTC"),plugins:[WCe(i,t)],legend:{show:!0,live:!1,isolate:!0,markers:{fill:(l,u)=>SF(u-1,s)}},drawOrder:["series","axes"],focus:{alpha:1},scales:r!==null?{y:{range:(l,u,d)=>{const f=$r.rangeNum(r,d,.1,!0);return[r,f[1]]}}}:void 0,axes:[{space:80,labelSize:20,stroke:s?"#333":"#eee",ticks:{stroke:s?"#00000010":"#ffffff20"},grid:{show:!0,stroke:s?"#00000010":"#ffffff20",width:2,dash:[]},values:[[3600*24*365,"{YYYY}",null,null,null,null,null,null,1],[3600*24*28,"{MMM}",`
{YYYY}`,null,null,null,null,null,1],[3600*24,"{MMM} {D}",`
{YYYY}`,null,null,null,null,null,1],[3600,"{HH}:{mm}",`
{MMM} {D} '{YY}`,null,`
{MMM} {D}`,null,null,null,1],[60,"{HH}:{mm}",`
{MMM} {D} '{YY}`,null,`
{MMM} {D}`,null,null,null,1],[1,"{HH}:{mm}:{ss}",`
{MMM} {D} '{YY}`,null,`
{MMM} {D}`,null,null,null,1],[.001,"{HH}:{mm}:{ss}.{fff}",`
{MMM} {D} '{YY}`,null,`
{MMM} {D}`,null,null,null,1]]},{values:(l,u)=>QCe(u),ticks:{stroke:s?"#00000010":"#ffffff20"},grid:{show:!0,stroke:s?"#00000010":"#ffffff20",width:2,dash:[]},labelGap:8,labelSize:28,stroke:s?"#333":"#eee",size:UCe}],series:[{},...n.map((l,u)=>({points:{filter:VCe},label:nG(l.metric),width:1.5,labels:l.metric,stroke:SF(u,s)}))],hooks:{setSelect:[l=>{const u=l.posToVal(l.select.left,"x"),d=Math.max(l.posToVal(l.select.left+l.select.width,"x"),u+1);a(u,d)}]}}),kF=t=>{const e=parseFloat(t);return isNaN(e)?null:e},XCe=(t,e,n,i)=>{const r=[];for(let a=e;a<=n;a+=i)r.push(a);const s=t.map(({values:a,histograms:l})=>{const u=[];let d=0,f=0;for(let p=e;p<=n;p+=i){const m=a&&a[d],v=l&&l[f];m&&a.length>d&&m[0]<p+i/100?(u.push(kF(m[1])),d++):v&&l.length>f&&v[0]<p+i/100?(u.push(kF(v[1].sum)),f++):u.push(null)}return u});return[r,...s]};function TF(t,e){const n=[];let i=[];const r=t[0].length,s=Array(r);for(let a=0;a<r;a++)s[a]=0;for(let a=1;a<t.length;a++)n.push(e(a)?t[a]:t[a].map((l,u)=>s[u]+=+(l||0)));for(let a=1;a<t.length;a++)e(a)||i.push({series:[t.findIndex((l,u)=>u>a&&!e(u)),a]});return i=i.filter(a=>a.series[1]>-1),{data:[t[0]].concat(n),bands:i}}function KCe(t,e){const n=TF(e,i=>!1);return t.bands=n.bands,t.cursor=t.cursor||{},t.cursor.dataIdx=(i,r,s,a)=>e[r][s]==null?null:s,t.series.forEach(i=>{i.points=i.points||{},i.stroke&&(i.fill=E8(i.stroke,.6)),i.points.filter=(r,s,a,l)=>{if(a){const u=[];return e[s].forEach((d,f)=>{d!=null&&u.push(f)}),u}return null}}),t.scales=t.scales||{},t.scales.y={range:(i,r,s)=>[0,$r.rangeNum(0,s,.1,!0)[1]]},t.hooks=t.hooks||{},t.hooks.setSeries=t.hooks.setSeries||[],t.hooks.setSeries.push((i,r,s)=>{if(s.show!=null){const a=TF(e,l=>!i.series[l].show);i.delBand(null),a.bands.forEach(l=>i.addBand(l)),i.setData(a.data)}}),{opts:t,data:n.data}}const ZCe=({data:t,range:{startTime:e,endTime:n,resolution:i},width:r,displayMode:s,yAxisMin:a,onSelectRange:l})=>{const[u,d]=T.useState(null),[f,p]=T.useState(null),{useLocalTime:m}=xr(),v=Lw();if(T.useEffect(()=>{if(r===0)return;const y=XCe(t,e,n,i),b=GCe(y,r,t,m,a,v==="light",l);s===Gm.Stacked?p(KCe(b,y).data):p(y),d(b)},[r,t,s,e,n,i,m,v,l,a]),!(u===null||f===null))return o.jsxs(o.Fragment,{children:[o.jsx(qCe,{options:u,data:f,className:mV.uplotChart}),o.jsxs(ft,{fz:"xs",c:"dimmed",ml:40,mt:-25,mb:"lg",children:["Click: show single series,"," ",navigator.userAgent.includes("Mac")?"⌘":"Ctrl"," + click: hide single series"]})]})},JCe=({expr:t,node:e,endTime:n,range:i,resolution:r,showExemplars:s,displayMode:a,yAxisMin:l,retriggerIdx:u,onSelectRange:d})=>{const{ref:f,width:p}=PK(),[m,v]=T.useState(!0),{showQueryWarnings:y,showQueryInfoNotices:b}=xr(),A=e===null?t:gs(e.type===St.matrixSelector?{type:St.vectorSelector,name:e.name,matchers:e.matchers,offset:e.offset,offsetExpr:e.offsetExpr,timestamp:e.timestamp,startOrEnd:e.startOrEnd,anchored:e.anchored,smoothed:e.smoothed}:e),w=(n!==null?n:Date.now())/1e3,S=w-i/1e3,j=HA(r,i)/1e3,{data:C,error:k,isFetching:E,isLoading:M,refetch:R}=ud({key:[T.useId()],path:"/query_range",params:{query:A,step:j.toString(),start:S.toString(),end:w.toString()},enabled:A!==""}),[D,F]=T.useState(null),I=(G,L)=>o.jsxs(o.Fragment,{children:[y&&(G==null?void 0:G.map((q,N)=>o.jsx(Pt,{color:"red",title:"Query warning",icon:o.jsx(Fr,{}),children:q},N))),b&&(L==null?void 0:L.map((q,N)=>o.jsx(Pt,{color:"yellow",title:"Query notice",icon:o.jsx(oi,{}),children:q},N)))]});if(T.useEffect(()=>{C!==void 0&&F({data:C,range:{startTime:S,endTime:w,resolution:j}})},[C]),T.useEffect(()=>{A!==""&&R()},[u,R,A,n,i,r]),T.useEffect(()=>{D!==null&&m&&v(!1)},[D,m,v]),M)return o.jsx(xe,{children:Array.from(Array(5),(G,L)=>o.jsx(ta,{height:30,mb:15},L))});if(k)return o.jsx(Pt,{color:"red",title:"Error executing query",icon:o.jsx(Fr,{}),children:k.message});if(D===null)return o.jsx(Pt,{variant:"transparent",children:"No data queried yet"});const{result:Q}=D.data.data;return Q.length===0?o.jsxs(Mn,{children:[o.jsx(Pt,{title:"Empty query result",icon:o.jsx(oi,{}),children:"This query returned no data."}),I(D.data.warnings)]}):o.jsxs(Mn,{children:[e!==null&&e.type===St.matrixSelector&&o.jsxs(Pt,{color:"orange",title:"Graphing modified expression",icon:o.jsx(Fr,{}),children:[o.jsx("strong",{children:"Note:"})," Range vector selectors can't be graphed, so graphing the equivalent instant vector selector instead."]}),I(D.data.warnings,D.data.infos),o.jsxs(xe,{pos:"relative",ref:f,className:mV.chartWrapper,children:[o.jsx(hS,{visible:E,zIndex:1e3,h:570,overlayProps:{radius:"sm",blur:.5},loaderProps:{type:"dots",color:"gray.6"}}),o.jsx(ZCe,{data:D.data.data.result,range:D.range,width:p,showExemplars:s,displayMode:a,yAxisMin:l,onSelectRange:d})]})]})},e_e=({resolution:t,range:e,onChangeResolution:n})=>{const[i,r]=T.useState(Gn(HA(t,e))),s=a=>{const l=DR(a);t.type==="custom"&&l===t.step||(l===null?r(Gn(HA(t,e))):n({type:"custom",step:l}))};return o.jsxs(o.Fragment,{children:[o.jsx(jg,{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:(a,l)=>{if(["low","medium","high"].includes(l.value)){n({type:"auto",density:l.value});return}if(l.value==="custom"){const d=HA(t,e);n({type:"custom",step:d}),r(Gn(d));return}const u=parseInt(l.value);if(!isNaN(u))n({type:"fixed",step:u});else throw new Error("Invalid resolution value")}}),t.type==="custom"&&o.jsx(yc,{placeholder:"Resolution",value:i,onChange:a=>r(a.currentTarget.value),onBlur:()=>s(i),onKeyDown:a=>a.key==="Enter"&&s(i),"aria-label":"Range",style:{width:`calc(44px + ${i.length+3}ch)`}})]})};var u1={exports:{}},t_e=u1.exports,OF;function n_e(){return OF||(OF=1,(function(t,e){(function(n,i){t.exports=i()})(t_e,(function(){var n={year:0,month:1,day:2,hour:3,minute:4,second:5},i={};return function(r,s,a){var l,u=function(m,v,y){y===void 0&&(y={});var b=new Date(m),A=(function(w,S){S===void 0&&(S={});var j=S.timeZoneName||"short",C=w+"|"+j,k=i[C];return k||(k=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:j}),i[C]=k),k})(v,y);return A.formatToParts(b)},d=function(m,v){for(var y=u(m,v),b=[],A=0;A<y.length;A+=1){var w=y[A],S=w.type,j=w.value,C=n[S];C>=0&&(b[C]=parseInt(j,10))}var k=b[3],E=k===24?0:k,M=b[0]+"-"+b[1]+"-"+b[2]+" "+E+":"+b[4]+":"+b[5]+":000",R=+m;return(a.utc(M).valueOf()-(R-=R%1e3))/6e4},f=s.prototype;f.tz=function(m,v){m===void 0&&(m=l);var y,b=this.utcOffset(),A=this.toDate(),w=A.toLocaleString("en-US",{timeZone:m}),S=Math.round((A-new Date(w))/1e3/60),j=15*-Math.round(A.getTimezoneOffset()/15)-S;if(!Number(j))y=this.utcOffset(0,v);else if(y=a(w,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(j,!0),v){var C=y.utcOffset();y=y.add(b-C,"minute")}return y.$x.$timezone=m,y},f.offsetName=function(m){var v=this.$x.$timezone||a.tz.guess(),y=u(this.valueOf(),v,{timeZoneName:m}).find((function(b){return b.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=a(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return p.call(y,m,v).tz(this.$x.$timezone,!0)},a.tz=function(m,v,y){var b=y&&v,A=y||v||l,w=d(+a(),A);if(typeof m!="string")return a(m).tz(A);var S=(function(E,M,R){var D=E-60*M*1e3,F=d(D,R);if(M===F)return[D,M];var I=d(D-=60*(F-M)*1e3,R);return F===I?[D,F]:[E-60*Math.min(F,I)*1e3,Math.max(F,I)]})(a.utc(m,b).valueOf(),w,A),j=S[0],C=S[1],k=a(j).utcOffset(C);return k.$x.$timezone=A,k},a.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},a.tz.setDefault=function(m){l=m}}}))})(u1)),u1.exports}var i_e=n_e();const iG=Al(i_e),r_e="_metricName_13uqi_1",s_e="_labelPair_13uqi_4",o_e="_labelName_13uqi_14",a_e="_labelValue_13uqi_18",z0={metricName:r_e,labelPair:s_e,labelName:o_e,labelValue:a_e},l_e=t=>{"clipboard"in navigator?navigator.clipboard.writeText(t).then(()=>ml.show({title:"Copied matcher!",message:`Label matcher ${t} copied to clipboard`})).catch(()=>ml.show({color:"red",title:"Failed to copy matcher!",message:"Label matcher could not be copied to clipboard."})):ml.show({color:"red",title:"Failed to copy matcher!",message:"Clipboard API is not supported in this context (most likely due to non-HTTPS origin)."})},ym=({labels:t,format:e})=>{const n=()=>{const i=t&&Tj(t.__name__||""),r=[];let s=!0;i&&(r.push(o.jsx("span",{children:o.jsxs("span",{className:z0.labelValue,children:['"',Kh(t.__name__),'"']})},"__name__")),s=!1);for(const a in t)a!=="__name__"&&(r.push(o.jsxs("span",{children:[!s&&", ",o.jsxs("span",{className:z0.labelPair,onDoubleClick:l=>l_e(l.currentTarget.innerText),title:"Double click to copy label matcher",children:[o.jsx("span",{className:z0.labelName,children:hd(a)}),"=",o.jsxs("span",{className:z0.labelValue,children:['"',Kh(t[a]),'"']})]})]},a)),s&&(s=!1));return o.jsxs("span",{children:[!i&&o.jsx("span",{className:z0.metricName,children:t?t.__name__:""}),"{",r,"}"]})};return t===null?o.jsx(o.Fragment,{children:"scalar"}):e?n():o.jsx(o.Fragment,{children:nG(t)})},c_e="_tableWrapper_n77eh_1",u_e="_numberCell_n77eh_7",wA={tableWrapper:c_e,numberCell:u_e};function h_e(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 d_e(t){if(!t||t.length===0)return 0;for(let e=0;e<t.length;e++){const n=parseFloat(t[e][2]),i=parseFloat(t[e][1]);if(i>0)return i;if(i<0&&n>0||e===t.length-1&&n>0)return n}return 0}function f_e(t){if(!t||t.length===0)return 0;for(let e=0;e<t.length;e++){const n=parseFloat(t[e][2]),i=parseFloat(t[e][1]),r=e>0?parseFloat(t[e-1][2]):0;if(n>=0)return e===0?i<0?i:0:r}return console.log("findmaxneg returning: ",t[t.length-1][2]),parseFloat(t[t.length-1][2])}function p_e(t,e,n,i,r,s,a,l,u){return t==="linear"?(0-e)/(n-e)*100+"%":r===0?"0%":i===0?"100%":s===-1?a/l*100+"%":(a+.5*u)/l>0?(a+.5*u)/l*100+"%":"0%"}function m_e(t){const e=parseFloat(t.slice(0,-1));return 5<e&&e<95}function g_e(t){for(let e=0;e<t.length;e++){const n=parseFloat(t[e][1]),i=parseFloat(t[e][2]);if(n<=0&&i>=0)return e}return-1}const v_e=t=>t===3||t===1?"[":"(",y_e=t=>t===3||t===0?"]":")",rG=([t,e,n,i])=>`${v_e(t)}${e} -> ${n}${y_e(t)}`,x_e="_histogramYWrapper_4ql1n_1",b_e="_histogramYLabels_4ql1n_10",A_e="_histogramYLabel_4ql1n_10",w_e="_histogramXWrapper_4ql1n_22",S_e="_histogramXLabels_4ql1n_29",j_e="_histogramXLabel_4ql1n_29",C_e="_histogramContainer_4ql1n_40",__e="_histogramAxes_4ql1n_46",k_e="_histogramYGrid_4ql1n_55",T_e="_histogramYTick_4ql1n_61",O_e="_histogramXGrid_4ql1n_69",E_e="_histogramXTick_4ql1n_76",M_e="_histogramBucketSlot_4ql1n_84",R_e="_histogramBucket_4ql1n_84",Kr={histogramYWrapper:x_e,histogramYLabels:b_e,histogramYLabel:A_e,histogramXWrapper:w_e,histogramXLabels:S_e,histogramXLabel:j_e,histogramContainer:C_e,histogramAxes:__e,histogramYGrid:k_e,histogramYTick:T_e,histogramXGrid:O_e,histogramXTick:E_e,histogramBucketSlot:M_e,histogramBucket:R_e},D_e=({index:t,histogram:e,scale:n})=>{const{buckets:i}=e;if(!i||i.length===0)return o.jsx("div",{children:"No data"});const r=Intl.NumberFormat("en",{notation:"compact"}),s=[];for(const I of i){const Q=parseFloat(I[1]),G=parseFloat(I[2]),L=parseFloat(I[3]),q=G-Q;if(q===0){s.push(0);continue}s.push(L/q)}const a=Math.max(...s),l=i[0],u=i[i.length-1],d=parseFloat(u[2]),f=parseFloat(l[1]),p=Math.max(...i.map(I=>parseFloat(I[3]))),m=h_e(u,i),v=d>0?d:0,y=d_e(i),b=f_e(i),A=parseFloat(l[1])<0?parseFloat(l[1]):0,w=A!==0?-Math.log(Math.abs(A)):0,S=b!==0?-Math.log(Math.abs(b)):0,j=y!==0?Math.log(y):0,C=v!==0?Math.log(v):0,k=S-w,E=C-j,M=k+m+E,R=g_e(i),D=p_e(n,f,d,y,b,R,k,M,m),F=m_e(D);return o.jsxs("div",{className:Kr.histogramYWrapper,children:[o.jsxs("div",{className:Kr.histogramYLabels,children:[[1,.75,.5,.25].map(I=>o.jsx("div",{className:Kr.histogramYLabel,children:n==="linear"?"":r.format(p*I)},I)),o.jsx("div",{className:Kr.histogramYLabel,style:{height:0},children:"0"},0)]}),o.jsxs("div",{className:Kr.histogramXWrapper,children:[o.jsxs("div",{className:Kr.histogramContainer,children:[[0,.25,.5,.75,1].map(I=>o.jsxs(Vn.Fragment,{children:[o.jsx("div",{className:Kr.histogramYGrid,style:{bottom:I*100+"%"}}),o.jsx("div",{className:Kr.histogramYTick,style:{bottom:I*100+"%"}}),o.jsx("div",{className:Kr.histogramXGrid,style:{left:I*100+"%"}})]},I)),o.jsx("div",{className:Kr.histogramXTick,style:{left:"0%"}}),o.jsx("div",{className:Kr.histogramXTick,style:{left:D}}),o.jsx("div",{className:Kr.histogramXGrid,style:{left:D}}),o.jsx("div",{className:Kr.histogramXTick,style:{left:"100%"}}),o.jsx(N_e,{buckets:i,scale:n,rangeMin:f,rangeMax:d,index:t,fds:s,fdMax:a,countMax:p,defaultExpBucketWidth:m,minPositive:y,maxNegative:b,startPositive:j,startNegative:w,xWidthNegative:k,xWidthTotal:M}),o.jsx("div",{className:Kr.histogramAxes})]}),o.jsx("div",{className:Kr.histogramXLabels,children:o.jsx("div",{className:Kr.histogramXLabel,children:o.jsxs(Vn.Fragment,{children:[o.jsx("div",{style:{position:"absolute",left:0},children:r.format(f)}),f<0&&F&&o.jsx("div",{style:{position:"absolute",left:D},children:"0"}),o.jsx("div",{style:{position:"absolute",right:0},children:r.format(d)})]})})})]})]})},N_e=({buckets:t,scale:e,rangeMin:n,rangeMax:i,index:r,fds:s,fdMax:a,countMax:l,defaultExpBucketWidth:u,minPositive:d,maxNegative:f,startPositive:p,startNegative:m,xWidthNegative:v,xWidthTotal:y})=>o.jsx(Vn.Fragment,{children:t.map((b,A)=>{const w=parseFloat(b[1]),S=parseFloat(b[2]),j=parseFloat(b[3]),C=`bucket-${r}-${A}-${Math.ceil(parseFloat(b[3])*100)}`,k=Math.abs(Math.log(Math.abs(S))-Math.log(Math.abs(w))),E=k===0?u:k;let M="",R="",D="";switch(e){case"linear":{M=(S-w)/(i-n)*100+"%",R=(w-n)/(i-n)*100+"%",w===0&&S===0&&(R="0%",M="0%"),D=s[A]/a*100+"%";break}case"exponential":{let F=0;(d===0||f===0)&&(F=u),M=E/(y-F)*100+"%",w<0?R=-(Math.log(Math.abs(w))+m)/(y-F)*100+"%":R=(Math.log(w)-p+u+v-F)/(y-F)*100+"%",w<0&&S>0&&(R=v/y*100+"%"),w===0&&S===0&&(R="0%",M="0%"),D=j/l*100+"%";break}default:throw new Error("Invalid scale")}return o.jsx(Gi,{label:`range: ${rG(b)}`,children:o.jsx("div",{id:C,className:Kr.histogramBucketSlot,style:{left:R,width:M},children:o.jsx("div",{id:C,className:Kr.histogramBucket,style:{height:D}})})},A)})});De.extend(iG);const EF=1e3,Ow=1e4,MF=(t,e)=>e&&t.length>Ow?t.slice(0,Ow):t,I_e=({data:t,limitResults:e,setLimitResults:n})=>{const[i,r]=T.useState("exponential"),{useLocalTime:s}=xr(),{result:a,resultType:l}=t,u=a.length<=EF;return o.jsxs(Mn,{gap:"lg",mt:0,children:[e&&["vector","matrix"].includes(l)&&a.length>Ow&&o.jsxs(Pt,{color:"orange",icon:o.jsx(Fr,{}),title:"Showing limited results",children:["Fetched ",t.result.length," metrics, only displaying first"," ",Ow," for performance reasons.",o.jsx(Zi,{ml:"md",fz:"1em",onClick:()=>n(!1),children:"Show all results"})]}),!u&&o.jsxs(Pt,{title:"Formatting turned off",icon:o.jsx(oi,{}),children:["Showing more than ",EF," series, turning off label formatting to improve rendering performance."]}),o.jsx(xe,{pos:"relative",className:wA.tableWrapper,children:o.jsx(le,{fz:"xs",children:o.jsx(le.Tbody,{children:l==="vector"?MF(a,e).map((d,f)=>o.jsxs(le.Tr,{children:[o.jsx(le.Td,{children:o.jsx(ym,{labels:d.metric,format:u})}),o.jsxs(le.Td,{className:wA.numberCell,children:[d.value&&d.value[1],d.histogram&&o.jsxs(Mn,{children:[o.jsx(D_e,{histogram:d.histogram[1],index:f,scale:i}),o.jsxs(pt,{justify:"space-between",align:"center",p:10,children:[o.jsxs(pt,{align:"center",gap:"1rem",children:[o.jsxs("span",{children:[o.jsx("strong",{children:"Count:"})," ",d.histogram[1].count]}),o.jsxs("span",{children:[o.jsx("strong",{children:"Sum:"})," ",d.histogram[1].sum]})]}),o.jsxs(pt,{align:"center",gap:"1rem",children:[o.jsx("span",{children:"x-axis scale:"}),o.jsx(Sg,{size:"xs",value:i,onChange:r,data:["exponential","linear"]})]})]}),B_e(d.histogram[1])]})]})]},f)):l==="matrix"?MF(a,e).map((d,f)=>o.jsxs(le.Tr,{children:[o.jsx(le.Td,{children:o.jsx(ym,{labels:d.metric,format:u})}),o.jsx(le.Td,{className:wA.numberCell,children:d.values&&d.values.map((p,m)=>o.jsxs("div",{children:[p[1]," ",o.jsxs(ft,{span:!0,c:"gray.7",size:"1em",title:Tf(p[0],s),children:["@ ",p[0]]})]},m))})]},f)):l==="scalar"?o.jsxs(le.Tr,{children:[o.jsx(le.Td,{children:"Scalar value"}),o.jsx(le.Td,{className:wA.numberCell,children:a[1]})]}):l==="string"?o.jsxs(le.Tr,{children:[o.jsx(le.Td,{children:"String value"}),o.jsx(le.Td,{children:a[1]})]}):o.jsx(Pt,{color:"red",title:"Invalid query response",icon:o.jsx(Fr,{}),children:"Invalid result value type"})})})})]})},B_e=t=>{var e;return o.jsx(le,{withTableBorder:!0,fz:"xs",children:o.jsxs(le.Tbody,{style:{display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[o.jsxs(le.Tr,{style:{display:"flex",flexDirection:"row",justifyContent:"space-between"},children:[o.jsx(le.Th,{children:"Bucket range"}),o.jsx(le.Th,{children:"Count"})]}),o.jsx(Co,{w:"100%",h:265,children:(e=t.buckets)==null?void 0:e.map((n,i)=>o.jsxs(le.Tr,{children:[o.jsx(le.Td,{style:{textAlign:"left"},children:rG(n)}),o.jsx(le.Td,{children:n[3]})]},i))})]})})},RF=t=>o.jsx(le,{withRowBorders:!1,children:o.jsx(le.Tbody,{children:Object.entries(t).map(([e,n])=>o.jsxs(le.Tr,{children:[o.jsx(le.Td,{pl:0,py:3,c:"dimmed",children:e}),o.jsx(le.Td,{pr:0,py:3,ta:"right",children:n})]},e))})}),L_e=({numResults:t,responseTime:e,stats:n})=>o.jsx(Gi,{label:o.jsxs(xe,{p:"xs",children:[o.jsx(ft,{mb:"xs",children:"Timing stats (s):"}),RF(n.timings),o.jsx(ft,{mt:"sm",mb:"xs",children:"Sample stats:"}),RF(n.samples)]}),children:o.jsxs(ft,{size:"xs",c:"gray",children:["Load time: ",e,"ms   Result series: ",t]})});De.extend(iG);const P_e=({panelIdx:t,retriggerIdx:e,expr:n})=>{var w,S;const[i,r]=T.useState(0),[s,a]=T.useState(!0),{visualizer:l}=bc(j=>j.queryPage.panels[t]),u=Tu(),{showQueryWarnings:d,showQueryInfoNotices:f}=xr(),{endTime:p,range:m}=l,{data:v,error:y,isFetching:b,refetch:A}=ud({key:[T.useId()],path:"/query",params:{query:n,time:`${(p!==null?p:Date.now())/1e3}`,stats:"true"},enabled:n!=="",recordResponseTime:r});return T.useEffect(()=>{n!==""&&A()},[e,A,n,p]),T.useLayoutEffect(()=>{a(!0)},[v,b]),o.jsxs(Mn,{gap:"lg",mt:"sm",children:[o.jsxs(pt,{justify:"space-between",children:[o.jsx(E7,{time:p,range:m,description:"Evaluation time",onChangeTime:j=>u(gh({idx:t,visualizer:{...l,endTime:j}}))}),!b&&v!==void 0&&o.jsx(L_e,{numResults:v.data.result.length,responseTime:i,stats:v.data.stats})]}),b?o.jsx(xe,{children:Array.from(Array(5),(j,C)=>o.jsx(ta,{height:30,mb:15},C))}):y!==null?o.jsx(Pt,{color:"red",title:"Error executing query",icon:o.jsx(Fr,{}),children:y.message}):v===void 0?o.jsx(Pt,{variant:"transparent",children:"No data queried yet"}):o.jsxs(o.Fragment,{children:[v.data.result.length===0&&o.jsx(Pt,{title:"Empty query result",icon:o.jsx(oi,{}),children:"This query returned no data."}),d&&((w=v.warnings)==null?void 0:w.map((j,C)=>o.jsx(Pt,{color:"red",title:"Query warning",icon:o.jsx(Fr,{}),children:j},C))),f&&((S=v.infos)==null?void 0:S.map((j,C)=>o.jsx(Pt,{color:"yellow",title:"Query notice",icon:o.jsx(oi,{}),children:j},C))),o.jsx(I_e,{data:v.data,limitResults:s,setLimitResults:a})]})]})},F_e="_nodeText_1076s_1",$_e="_nodeTextSelected_1076s_10",z_e="_nodeTextError_1076s_27",H_e="_errorText_1076s_34",SA={nodeText:F_e,nodeTextSelected:$_e,nodeTextError:z_e,errorText:H_e},q_e={abs:{argTypes:[ue.vector],returnType:ue.vector},absent:{argTypes:[ue.vector],returnType:ue.vector},absent_over_time:{argTypes:[ue.matrix],returnType:ue.vector},acos:{argTypes:[ue.vector],returnType:ue.vector},acosh:{argTypes:[ue.vector],returnType:ue.vector},asin:{argTypes:[ue.vector],returnType:ue.vector},asinh:{argTypes:[ue.vector],returnType:ue.vector},atan:{argTypes:[ue.vector],returnType:ue.vector},atanh:{argTypes:[ue.vector],returnType:ue.vector},avg_over_time:{argTypes:[ue.matrix],returnType:ue.vector},ceil:{argTypes:[ue.vector],returnType:ue.vector},changes:{argTypes:[ue.matrix],returnType:ue.vector},clamp:{argTypes:[ue.vector,ue.scalar,ue.scalar],returnType:ue.vector},clamp_max:{argTypes:[ue.vector,ue.scalar],returnType:ue.vector},clamp_min:{argTypes:[ue.vector,ue.scalar],returnType:ue.vector},cos:{argTypes:[ue.vector],returnType:ue.vector},cosh:{argTypes:[ue.vector],returnType:ue.vector},count_over_time:{argTypes:[ue.matrix],returnType:ue.vector},day_of_month:{argTypes:[ue.vector],returnType:ue.vector},day_of_week:{argTypes:[ue.vector],returnType:ue.vector},day_of_year:{argTypes:[ue.vector],returnType:ue.vector},days_in_month:{argTypes:[ue.vector],returnType:ue.vector},deg:{argTypes:[ue.vector],returnType:ue.vector},delta:{argTypes:[ue.matrix],returnType:ue.vector},deriv:{argTypes:[ue.matrix],returnType:ue.vector},double_exponential_smoothing:{argTypes:[ue.matrix,ue.scalar,ue.scalar],returnType:ue.vector},end:{returnType:ue.scalar},exp:{argTypes:[ue.vector],returnType:ue.vector},first_over_time:{argTypes:[ue.matrix],returnType:ue.vector},floor:{argTypes:[ue.vector],returnType:ue.vector},histogram_avg:{argTypes:[ue.vector],returnType:ue.vector},histogram_count:{argTypes:[ue.vector],returnType:ue.vector},histogram_fraction:{argTypes:[ue.scalar,ue.scalar,ue.vector],returnType:ue.vector},histogram_quantile:{argTypes:[ue.scalar,ue.vector],returnType:ue.vector},histogram_quantiles:{argTypes:[ue.vector,ue.string,ue.scalar,ue.scalar],returnType:ue.vector},histogram_stddev:{argTypes:[ue.vector],returnType:ue.vector},histogram_stdvar:{argTypes:[ue.vector],returnType:ue.vector},histogram_sum:{argTypes:[ue.vector],returnType:ue.vector},hour:{argTypes:[ue.vector],returnType:ue.vector},idelta:{argTypes:[ue.matrix],returnType:ue.vector},increase:{argTypes:[ue.matrix],returnType:ue.vector},info:{argTypes:[ue.vector,ue.vector],returnType:ue.vector},irate:{argTypes:[ue.matrix],returnType:ue.vector},label_join:{argTypes:[ue.vector,ue.string,ue.string,ue.string],returnType:ue.vector},label_replace:{argTypes:[ue.vector,ue.string,ue.string,ue.string,ue.string],returnType:ue.vector},last_over_time:{name:"last_over_time",argTypes:[ue.matrix],variadic:0,returnType:ue.vector},ln:{argTypes:[ue.vector],returnType:ue.vector},log10:{argTypes:[ue.vector],returnType:ue.vector},log2:{argTypes:[ue.vector],returnType:ue.vector},mad_over_time:{argTypes:[ue.matrix],returnType:ue.vector},max_of:{argTypes:[ue.scalar,ue.scalar],returnType:ue.scalar},max_over_time:{argTypes:[ue.matrix],returnType:ue.vector},min_of:{argTypes:[ue.scalar,ue.scalar],returnType:ue.scalar},min_over_time:{argTypes:[ue.matrix],returnType:ue.vector},minute:{argTypes:[ue.vector],returnType:ue.vector},month:{argTypes:[ue.vector],returnType:ue.vector},pi:{returnType:ue.scalar},predict_linear:{argTypes:[ue.matrix,ue.scalar],returnType:ue.vector},present_over_time:{argTypes:[ue.matrix],returnType:ue.vector},quantile_over_time:{argTypes:[ue.scalar,ue.matrix],returnType:ue.vector},rad:{argTypes:[ue.vector],returnType:ue.vector},range:{returnType:ue.scalar},rate:{argTypes:[ue.matrix],returnType:ue.vector},resets:{argTypes:[ue.matrix],returnType:ue.vector},round:{argTypes:[ue.vector,ue.scalar],returnType:ue.vector},scalar:{argTypes:[ue.vector],returnType:ue.scalar},sgn:{argTypes:[ue.vector],returnType:ue.vector},sin:{argTypes:[ue.vector],returnType:ue.vector},sinh:{argTypes:[ue.vector],returnType:ue.vector},sort:{argTypes:[ue.vector],returnType:ue.vector},sort_by_label:{argTypes:[ue.vector,ue.string],returnType:ue.vector},sort_by_label_desc:{argTypes:[ue.vector,ue.string],returnType:ue.vector},sort_desc:{argTypes:[ue.vector],returnType:ue.vector},sqrt:{argTypes:[ue.vector],returnType:ue.vector},start:{returnType:ue.scalar},start_timestamp:{argTypes:[ue.vector],returnType:ue.vector},stddev_over_time:{argTypes:[ue.matrix],returnType:ue.vector},stdvar_over_time:{argTypes:[ue.matrix],returnType:ue.vector},step:{returnType:ue.scalar},sum_over_time:{argTypes:[ue.matrix],returnType:ue.vector},tan:{argTypes:[ue.vector],returnType:ue.vector},tanh:{argTypes:[ue.vector],returnType:ue.vector},time:{returnType:ue.scalar},timestamp:{argTypes:[ue.vector],returnType:ue.vector},ts_of_first_over_time:{argTypes:[ue.matrix],returnType:ue.vector},ts_of_last_over_time:{argTypes:[ue.matrix],returnType:ue.vector},ts_of_max_over_time:{argTypes:[ue.matrix],returnType:ue.vector},ts_of_min_over_time:{argTypes:[ue.matrix],returnType:ue.vector},vector:{argTypes:[ue.scalar],returnType:ue.vector},year:{argTypes:[ue.vector],returnType:ue.vector}},H0=20,eO=10,DF=10,tO={width:ge(18),height:ge(18)},Q_e=t=>t.includes("error")?"error":t.includes("waiting")?"waiting":t.includes("running")?"running":"success",h1=({node:t,selectedNode:e,setSelectedNode:n,parentEl:i,reportNodeState:r,reverse:s,childIdx:a})=>{const l=zr(),[u,d]=T.useState(null),f=T.useCallback(I=>d(I),[]),[p,m]=T.useState({borderColor:"light-dark(var(--mantine-color-gray-4), var(--mantine-color-dark-3))",borderLeftStyle:"solid",borderLeftWidth:2,width:H0-7,left:-H0+7}),[v,y]=T.useState(0),[b,A]=T.useState({numSeries:0,labelExamples:{},sortedLabelCards:[]});T.useEffect(()=>{i===void 0&&n({id:l,node:t})},[i,n,l,t]),T.useEffect(()=>()=>{n(null)},[n]);const w=xSe(t),[S,j]=T.useState(w.map(()=>"waiting")),C=T.useMemo(()=>Q_e(S),[S]);let k=t;if(k.type===St.matrixSelector){const I={...k};I.anchored=!1,I.smoothed=!1,k={type:St.call,func:q_e.last_over_time,args:[I]}}const{data:E,error:M,isFetching:R}=ud({key:[zr()],path:"/query",params:{query:gs(k)},recordResponseTime:y,enabled:C==="success"});T.useEffect(()=>{C==="error"&&r&&r(a,"error")},[C,r,a]),T.useEffect(()=>{M&&r&&r(a,"error")},[M,r,a]),T.useEffect(()=>{R&&r&&r(a,"running")},[R,r,a]);const D=T.useCallback((I,Q)=>{j(G=>{const L=[...G];return L[I]=Q,L})},[j]);T.useLayoutEffect(()=>{if(i===void 0||i===null||u===null)return;const I=i.getBoundingClientRect(),Q=u.getBoundingClientRect();m(s?G=>({...G,top:"calc(50% - 1px)",bottom:Q.bottom-I.top,borderTopLeftRadius:3,borderTopStyle:"solid",borderBottomLeftRadius:void 0}):G=>({...G,top:I.bottom-Q.top,bottom:"calc(50% - 1px)",borderBottomLeftRadius:3,borderBottomStyle:"solid",borderTopLeftRadius:void 0}))},[i,u,s,f,m]),T.useEffect(()=>{if(!E)return;r&&r(a,"success");let I=0;const Q={},{resultType:G,result:L}=E.data;G==="scalar"||G==="string"?I=1:L&&L.length>0&&(I=L.length,L.forEach(P=>{Object.entries(P.metric).forEach(([Y,K])=>{Y!=="__name__"&&(Q[Y]||(Q[Y]={}),Q[Y][K]=(Q[Y][K]||0)+1)})}));const q={},N={};Object.entries(Q).forEach(([P,Y])=>{q[P]=Object.keys(Y).length,N[P]=Object.entries(Y).sort(([,K],[,W])=>W-K).slice(0,DF).map(([K,W])=>({value:K,count:W}))}),A({numSeries:I,sortedLabelCards:Object.entries(q).sort((P,Y)=>Y[1]-P[1]),labelExamples:N})},[E,r,a]);const F=o.jsxs(pt,{w:"fit-content",gap:"lg",my:"sm",wrap:"nowrap",pos:"relative",align:"center",children:[i!==void 0&&o.jsx(xe,{pos:"absolute",display:"inline-block",style:p}),o.jsx(xe,{ref:f,w:"fit-content",px:10,py:4,style:{borderRadius:4,flexShrink:0},className:Yi(SA.nodeText,{[SA.nodeTextError]:M,[SA.nodeTextSelected]:(e==null?void 0:e.id)===l}),onClick:()=>{(e==null?void 0:e.id)===l?n(null):n({id:l,node:t})},children:Ya(t,!1,1)}),C==="waiting"?o.jsx(pt,{c:"gray",children:o.jsx(vk,{style:tO})}):C==="running"?o.jsx(Ra,{size:14,color:"gray",type:"dots"}):C==="error"?o.jsxs(pt,{c:"orange.7",gap:5,fz:"xs",wrap:"nowrap",children:[o.jsx(vk,{style:tO})," Blocked on child query error"]}):R?o.jsx(Ra,{size:14,color:"gray"}):M?o.jsxs(pt,{gap:5,wrap:"nowrap",style:{flexShrink:0},className:SA.errorText,children:[o.jsx(vk,{style:tO}),o.jsxs(ft,{fz:"xs",children:[o.jsx("strong",{children:"Error executing query:"})," ",M.message]})]}):o.jsxs(pt,{gap:0,wrap:"nowrap",children:[o.jsxs(ft,{c:"dimmed",fz:"xs",style:{whiteSpace:"nowrap"},children:[b.numSeries," result",b.numSeries!==1&&"s","  –  ",v,"ms",b.sortedLabelCards.length>0&&o.jsx(o.Fragment,{children:"  –  "})]}),o.jsxs(pt,{gap:"xs",wrap:"nowrap",children:[b.sortedLabelCards.slice(0,eO).map(([I,Q])=>o.jsx(Gi,{position:"bottom",withArrow:!0,color:"dark.6",label:o.jsx(xe,{p:"xs",children:o.jsxs(Un,{fz:"xs",children:[b.labelExamples[I].map(({value:G,count:L})=>o.jsxs(Un.Item,{py:1,children:[o.jsx(cS,{c:"red.3",bg:"gray.8",children:vs(G)})," ","(",L,"x)"]},G)),Q>DF&&o.jsx("li",{children:"..."})]})}),children:o.jsxs("span",{style:{cursor:"pointer",whiteSpace:"nowrap"},children:[o.jsx(ft,{component:"span",fz:"xs",className:"promql-code promql-label-name",c:"light-dark(var(--mantine-color-green-9), var(--mantine-color-green-6))",children:I}),o.jsxs(ft,{component:"span",fz:"xs",c:"dimmed",children:[": ",Q]})]})},I)),b.sortedLabelCards.length>eO?o.jsxs(ft,{component:"span",c:"dimmed",fz:"xs",style:{whiteSpace:"nowrap"},children:["...",b.sortedLabelCards.length-eO," more..."]}):null]})]})]});return t.type===St.binaryExpr?o.jsxs("div",{children:[o.jsx(xe,{ml:H0,children:o.jsx(h1,{node:w[0],selectedNode:e,setSelectedNode:n,parentEl:u,reverse:!0,childIdx:0,reportNodeState:D})}),F,o.jsx(xe,{ml:H0,children:o.jsx(h1,{node:w[1],selectedNode:e,setSelectedNode:n,parentEl:u,reverse:!1,childIdx:1,reportNodeState:D})})]}):o.jsxs("div",{children:[F,w.map((I,Q)=>o.jsx(xe,{ml:H0,children:o.jsx(h1,{node:I,selectedNode:e,setSelectedNode:n,parentEl:u,reverse:!1,childIdx:Q,reportNodeState:D})},Q))]})},Y_e=({panelIdx:t,selectedNode:e,setSelectedNode:n,closeTreeView:i})=>{const{expr:r}=bc(a=>a.queryPage.panels[t]),{data:s}=br({path:"/parse_query",params:{query:r}});return o.jsxs(Xi,{withBorder:!0,fz:"sm",style:{overflowX:"auto"},pl:"sm",children:[o.jsx(Sl,{"aria-label":"Close tree view",title:"Close tree view",pos:"absolute",top:7,size:"sm",right:7,onClick:i}),o.jsx(h1,{childIdx:0,node:s.data,selectedNode:e,setSelectedNode:n,reverse:!1})]})},W_e={abs:o.jsx(o.Fragment,{children:o.jsxs("p",{children:[o.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:o.jsxs(o.Fragment,{children:[o.jsxs("p",{children:[o.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."]}),o.jsx("p",{children:"This is useful for alerting on when no time series exist for a given metric name and label combination."}),o.jsx("pre",{children:o.jsxs("code",{children:["absent(nonexistent","{",'job="myjob"',"}",") # => ","{",'job="myjob"',"}","absent(nonexistent","{",'job="myjob",instance=~".*"',"}",") # => ","{",'job="myjob"',"}","absent(sum(nonexistent","{",'job="myjob"',"}",")) # => ","{","}"]})}),o.jsxs("p",{children:["In the first two examples, ",o.jsx("code",{children:"absent()"})," tries to be smart about deriving labels of the 1-element output vector from the input vector."]})]}),absent_over_time:o.jsxs(o.Fragment,{children:[o.jsxs("p",{children:[o.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."]}),o.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."}),o.jsx("pre",{children:o.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:]) # => ","{","}"]})}),o.jsxs("p",{children:["In the first two examples, ",o.jsx("code",{children:"absent_over_time()"})," tries to be smart about deriving labels of the 1-element output vector from the input vector."]})]}),acos:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"The trigonometric functions work in radians. They ignore histogram samples in the input vector."}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"acos(v instant-vector)"}),": calculates the arccosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Acos",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"acosh(v instant-vector)"}),": calculates the inverse hyperbolic cosine of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Acosh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"asin(v instant-vector)"}),": calculates the arcsine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Asin",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"asinh(v instant-vector)"}),": calculates the inverse hyperbolic sine of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Asinh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"atan(v instant-vector)"}),": calculates the arctangent of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Atan",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"atanh(v instant-vector)"}),": calculates the inverse hyperbolic tangent of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Atanh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"cos(v instant-vector)"}),": calculates the cosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Cos",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"cosh(v instant-vector)"}),": calculates the hyperbolic cosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Cosh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sin(v instant-vector)"}),": calculates the sine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Sin",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sinh(v instant-vector)"}),": calculates the hyperbolic sine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Sinh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"tan(v instant-vector)"}),": calculates the tangent of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Tan",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"tanh(v instant-vector)"}),": calculates the hyperbolic tangent of all float samples in ",o.jsx("code",{children:"v"})," ","(",o.jsx("a",{href:"https://pkg.go.dev/math#Tanh",children:"special cases"}),")."]})]}),o.jsx("p",{children:"The following are useful for converting between degrees and radians:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"deg(v instant-vector)"}),": converts radians to degrees for all float samples in ",o.jsx("code",{children:"v"}),"."]}),o.jsxs("li",{children:[o.jsx("code",{children:"pi()"}),": returns pi."]}),o.jsxs("li",{children:[o.jsx("code",{children:"rad(v instant-vector)"}),": converts degrees to radians for all float samples in ",o.jsx("code",{children:"v"}),"."]})]})]}),acosh:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"The trigonometric functions work in radians. They ignore histogram samples in the input vector."}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"acos(v instant-vector)"}),": calculates the arccosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Acos",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"acosh(v instant-vector)"}),": calculates the inverse hyperbolic cosine of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Acosh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"asin(v instant-vector)"}),": calculates the arcsine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Asin",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"asinh(v instant-vector)"}),": calculates the inverse hyperbolic sine of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Asinh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"atan(v instant-vector)"}),": calculates the arctangent of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Atan",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"atanh(v instant-vector)"}),": calculates the inverse hyperbolic tangent of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Atanh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"cos(v instant-vector)"}),": calculates the cosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Cos",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"cosh(v instant-vector)"}),": calculates the hyperbolic cosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Cosh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sin(v instant-vector)"}),": calculates the sine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Sin",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sinh(v instant-vector)"}),": calculates the hyperbolic sine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Sinh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"tan(v instant-vector)"}),": calculates the tangent of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Tan",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"tanh(v instant-vector)"}),": calculates the hyperbolic tangent of all float samples in ",o.jsx("code",{children:"v"})," ","(",o.jsx("a",{href:"https://pkg.go.dev/math#Tanh",children:"special cases"}),")."]})]}),o.jsx("p",{children:"The following are useful for converting between degrees and radians:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"deg(v instant-vector)"}),": converts radians to degrees for all float samples in ",o.jsx("code",{children:"v"}),"."]}),o.jsxs("li",{children:[o.jsx("code",{children:"pi()"}),": returns pi."]}),o.jsxs("li",{children:[o.jsx("code",{children:"rad(v instant-vector)"}),": converts degrees to radians for all float samples in ",o.jsx("code",{children:"v"}),"."]})]})]}),asin:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"The trigonometric functions work in radians. They ignore histogram samples in the input vector."}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"acos(v instant-vector)"}),": calculates the arccosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Acos",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"acosh(v instant-vector)"}),": calculates the inverse hyperbolic cosine of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Acosh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"asin(v instant-vector)"}),": calculates the arcsine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Asin",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"asinh(v instant-vector)"}),": calculates the inverse hyperbolic sine of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Asinh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"atan(v instant-vector)"}),": calculates the arctangent of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Atan",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"atanh(v instant-vector)"}),": calculates the inverse hyperbolic tangent of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Atanh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"cos(v instant-vector)"}),": calculates the cosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Cos",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"cosh(v instant-vector)"}),": calculates the hyperbolic cosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Cosh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sin(v instant-vector)"}),": calculates the sine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Sin",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sinh(v instant-vector)"}),": calculates the hyperbolic sine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Sinh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"tan(v instant-vector)"}),": calculates the tangent of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Tan",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"tanh(v instant-vector)"}),": calculates the hyperbolic tangent of all float samples in ",o.jsx("code",{children:"v"})," ","(",o.jsx("a",{href:"https://pkg.go.dev/math#Tanh",children:"special cases"}),")."]})]}),o.jsx("p",{children:"The following are useful for converting between degrees and radians:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"deg(v instant-vector)"}),": converts radians to degrees for all float samples in ",o.jsx("code",{children:"v"}),"."]}),o.jsxs("li",{children:[o.jsx("code",{children:"pi()"}),": returns pi."]}),o.jsxs("li",{children:[o.jsx("code",{children:"rad(v instant-vector)"}),": converts degrees to radians for all float samples in ",o.jsx("code",{children:"v"}),"."]})]})]}),asinh:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"The trigonometric functions work in radians. They ignore histogram samples in the input vector."}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"acos(v instant-vector)"}),": calculates the arccosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Acos",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"acosh(v instant-vector)"}),": calculates the inverse hyperbolic cosine of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Acosh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"asin(v instant-vector)"}),": calculates the arcsine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Asin",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"asinh(v instant-vector)"}),": calculates the inverse hyperbolic sine of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Asinh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"atan(v instant-vector)"}),": calculates the arctangent of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Atan",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"atanh(v instant-vector)"}),": calculates the inverse hyperbolic tangent of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Atanh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"cos(v instant-vector)"}),": calculates the cosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Cos",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"cosh(v instant-vector)"}),": calculates the hyperbolic cosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Cosh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sin(v instant-vector)"}),": calculates the sine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Sin",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sinh(v instant-vector)"}),": calculates the hyperbolic sine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Sinh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"tan(v instant-vector)"}),": calculates the tangent of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Tan",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"tanh(v instant-vector)"}),": calculates the hyperbolic tangent of all float samples in ",o.jsx("code",{children:"v"})," ","(",o.jsx("a",{href:"https://pkg.go.dev/math#Tanh",children:"special cases"}),")."]})]}),o.jsx("p",{children:"The following are useful for converting between degrees and radians:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"deg(v instant-vector)"}),": converts radians to degrees for all float samples in ",o.jsx("code",{children:"v"}),"."]}),o.jsxs("li",{children:[o.jsx("code",{children:"pi()"}),": returns pi."]}),o.jsxs("li",{children:[o.jsx("code",{children:"rad(v instant-vector)"}),": converts degrees to radians for all float samples in ",o.jsx("code",{children:"v"}),"."]})]})]}),atan:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"The trigonometric functions work in radians. They ignore histogram samples in the input vector."}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"acos(v instant-vector)"}),": calculates the arccosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Acos",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"acosh(v instant-vector)"}),": calculates the inverse hyperbolic cosine of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Acosh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"asin(v instant-vector)"}),": calculates the arcsine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Asin",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"asinh(v instant-vector)"}),": calculates the inverse hyperbolic sine of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Asinh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"atan(v instant-vector)"}),": calculates the arctangent of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Atan",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"atanh(v instant-vector)"}),": calculates the inverse hyperbolic tangent of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Atanh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"cos(v instant-vector)"}),": calculates the cosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Cos",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"cosh(v instant-vector)"}),": calculates the hyperbolic cosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Cosh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sin(v instant-vector)"}),": calculates the sine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Sin",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sinh(v instant-vector)"}),": calculates the hyperbolic sine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Sinh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"tan(v instant-vector)"}),": calculates the tangent of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Tan",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"tanh(v instant-vector)"}),": calculates the hyperbolic tangent of all float samples in ",o.jsx("code",{children:"v"})," ","(",o.jsx("a",{href:"https://pkg.go.dev/math#Tanh",children:"special cases"}),")."]})]}),o.jsx("p",{children:"The following are useful for converting between degrees and radians:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"deg(v instant-vector)"}),": converts radians to degrees for all float samples in ",o.jsx("code",{children:"v"}),"."]}),o.jsxs("li",{children:[o.jsx("code",{children:"pi()"}),": returns pi."]}),o.jsxs("li",{children:[o.jsx("code",{children:"rad(v instant-vector)"}),": converts degrees to radians for all float samples in ",o.jsx("code",{children:"v"}),"."]})]})]}),atanh:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"The trigonometric functions work in radians. They ignore histogram samples in the input vector."}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"acos(v instant-vector)"}),": calculates the arccosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Acos",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"acosh(v instant-vector)"}),": calculates the inverse hyperbolic cosine of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Acosh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"asin(v instant-vector)"}),": calculates the arcsine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Asin",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"asinh(v instant-vector)"}),": calculates the inverse hyperbolic sine of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Asinh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"atan(v instant-vector)"}),": calculates the arctangent of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Atan",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"atanh(v instant-vector)"}),": calculates the inverse hyperbolic tangent of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Atanh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"cos(v instant-vector)"}),": calculates the cosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Cos",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"cosh(v instant-vector)"}),": calculates the hyperbolic cosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Cosh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sin(v instant-vector)"}),": calculates the sine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Sin",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sinh(v instant-vector)"}),": calculates the hyperbolic sine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Sinh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"tan(v instant-vector)"}),": calculates the tangent of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Tan",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"tanh(v instant-vector)"}),": calculates the hyperbolic tangent of all float samples in ",o.jsx("code",{children:"v"})," ","(",o.jsx("a",{href:"https://pkg.go.dev/math#Tanh",children:"special cases"}),")."]})]}),o.jsx("p",{children:"The following are useful for converting between degrees and radians:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"deg(v instant-vector)"}),": converts radians to degrees for all float samples in ",o.jsx("code",{children:"v"}),"."]}),o.jsxs("li",{children:[o.jsx("code",{children:"pi()"}),": returns pi."]}),o.jsxs("li",{children:[o.jsx("code",{children:"rad(v instant-vector)"}),": converts degrees to radians for all float samples in ",o.jsx("code",{children:"v"}),"."]})]})]}),avg_over_time:o.jsxs(o.Fragment,{children:[o.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:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"avg_over_time(range-vector)"}),": the average value of all float or histogram samples in the specified interval (see details below)."]}),o.jsxs("li",{children:[o.jsx("code",{children:"min_over_time(range-vector)"}),": the minimum value of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"max_over_time(range-vector)"}),": the maximum value of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sum_over_time(range-vector)"}),": the sum of all float or histogram samples in the specified interval (see details below)."]}),o.jsxs("li",{children:[o.jsx("code",{children:"count_over_time(range-vector)"}),": the count of all samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"quantile_over_time(scalar, range-vector)"}),": the φ-quantile (0 ≤ φ ≤ 1) of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"stddev_over_time(range-vector)"}),": the population standard deviation of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"stdvar_over_time(range-vector)"}),": the population variance of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"last_over_time(range-vector)"}),": the most recent sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"first_over_time(range-vector)"}),": the oldest sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"present_over_time(range-vector)"}),": the value 1 for any series in the specified interval."]})]}),o.jsxs("p",{children:["If the ",o.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),o.jsx("code",{children:"--enable-feature=promql-experimental-functions"})," is set, the following additional functions are available:"]}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"mad_over_time(range-vector)"}),": the median absolute deviation of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.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."]}),o.jsxs("li",{children:[o.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."]}),o.jsxs("li",{children:[o.jsx("code",{children:"ts_of_last_over_time(range-vector)"}),": the timestamp of last sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"ts_of_first_over_time(range-vector)"}),": the timestamp of earliest sample in the specified interval."]})]}),o.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."}),o.jsx("p",{children:"These functions act on histograms in the following way:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"count_over_time"}),", ",o.jsx("code",{children:"first_over_time"}),", ",o.jsx("code",{children:"last_over_time"}),", and",o.jsx("code",{children:"present_over_time()"})," act on float and histogram samples in the same way."]}),o.jsxs("li",{children:[o.jsx("code",{children:"avg_over_time()"})," and ",o.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."]}),o.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."})]}),o.jsxs("p",{children:[o.jsx("code",{children:"first_over_time(m[1m])"})," differs from ",o.jsx("code",{children:"m offset 1m"})," in that the former will select the first sample of ",o.jsx("code",{children:"m"})," ",o.jsx("em",{children:"within"})," the 1m range, where ",o.jsx("code",{children:"m offset 1m"})," will select the most recent sample within the lookback interval ",o.jsx("em",{children:"outside and prior to"})," the 1m offset. This is particularly useful with ",o.jsx("code",{children:"first_over_time(m[step()])"}),"in range queries to ensure that the sample selected is within the range step."]})]}),ceil:o.jsxs(o.Fragment,{children:[o.jsxs("p",{children:[o.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."]}),o.jsxs("ul",{children:[o.jsx("li",{children:o.jsx("code",{children:"ceil(+Inf) = +Inf"})}),o.jsx("li",{children:o.jsx("code",{children:"ceil(±0) = ±0"})}),o.jsx("li",{children:o.jsx("code",{children:"ceil(1.49) = 2.0"})}),o.jsx("li",{children:o.jsx("code",{children:"ceil(1.78) = 2.0"})})]})]}),changes:o.jsx(o.Fragment,{children:o.jsxs("p",{children:["For each input time series, ",o.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:o.jsxs(o.Fragment,{children:[o.jsxs("p",{children:[o.jsx("code",{children:"clamp(v instant-vector, min scalar, max scalar)"})," clamps the values of all float samples in"," ",o.jsx("code",{children:"v"})," to have a lower limit of ",o.jsx("code",{children:"min"})," and an upper limit of",o.jsx("code",{children:"max"}),". Histogram samples in the input vector are ignored silently."]}),o.jsx("p",{children:"Special cases:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:["Return an empty vector if ",o.jsx("code",{children:"min > max"})]}),o.jsxs("li",{children:["Float samples are clamped to ",o.jsx("code",{children:"NaN"})," if ",o.jsx("code",{children:"min"})," or ",o.jsx("code",{children:"max"})," is ",o.jsx("code",{children:"NaN"})]})]})]}),clamp_max:o.jsx(o.Fragment,{children:o.jsxs("p",{children:[o.jsx("code",{children:"clamp_max(v instant-vector, max scalar)"})," clamps the values of all float samples in ",o.jsx("code",{children:"v"})," to have an upper limit of ",o.jsx("code",{children:"max"}),". Histogram samples in the input vector are ignored silently."]})}),clamp_min:o.jsx(o.Fragment,{children:o.jsxs("p",{children:[o.jsx("code",{children:"clamp_min(v instant-vector, min scalar)"})," clamps the values of all float samples in ",o.jsx("code",{children:"v"})," to have a lower limit of ",o.jsx("code",{children:"min"}),". Histogram samples in the input vector are ignored silently."]})}),cos:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"The trigonometric functions work in radians. They ignore histogram samples in the input vector."}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"acos(v instant-vector)"}),": calculates the arccosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Acos",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"acosh(v instant-vector)"}),": calculates the inverse hyperbolic cosine of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Acosh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"asin(v instant-vector)"}),": calculates the arcsine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Asin",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"asinh(v instant-vector)"}),": calculates the inverse hyperbolic sine of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Asinh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"atan(v instant-vector)"}),": calculates the arctangent of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Atan",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"atanh(v instant-vector)"}),": calculates the inverse hyperbolic tangent of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Atanh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"cos(v instant-vector)"}),": calculates the cosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Cos",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"cosh(v instant-vector)"}),": calculates the hyperbolic cosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Cosh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sin(v instant-vector)"}),": calculates the sine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Sin",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sinh(v instant-vector)"}),": calculates the hyperbolic sine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Sinh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"tan(v instant-vector)"}),": calculates the tangent of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Tan",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"tanh(v instant-vector)"}),": calculates the hyperbolic tangent of all float samples in ",o.jsx("code",{children:"v"})," ","(",o.jsx("a",{href:"https://pkg.go.dev/math#Tanh",children:"special cases"}),")."]})]}),o.jsx("p",{children:"The following are useful for converting between degrees and radians:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"deg(v instant-vector)"}),": converts radians to degrees for all float samples in ",o.jsx("code",{children:"v"}),"."]}),o.jsxs("li",{children:[o.jsx("code",{children:"pi()"}),": returns pi."]}),o.jsxs("li",{children:[o.jsx("code",{children:"rad(v instant-vector)"}),": converts degrees to radians for all float samples in ",o.jsx("code",{children:"v"}),"."]})]})]}),cosh:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"The trigonometric functions work in radians. They ignore histogram samples in the input vector."}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"acos(v instant-vector)"}),": calculates the arccosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Acos",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"acosh(v instant-vector)"}),": calculates the inverse hyperbolic cosine of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Acosh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"asin(v instant-vector)"}),": calculates the arcsine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Asin",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"asinh(v instant-vector)"}),": calculates the inverse hyperbolic sine of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Asinh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"atan(v instant-vector)"}),": calculates the arctangent of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Atan",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"atanh(v instant-vector)"}),": calculates the inverse hyperbolic tangent of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Atanh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"cos(v instant-vector)"}),": calculates the cosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Cos",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"cosh(v instant-vector)"}),": calculates the hyperbolic cosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Cosh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sin(v instant-vector)"}),": calculates the sine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Sin",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sinh(v instant-vector)"}),": calculates the hyperbolic sine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Sinh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"tan(v instant-vector)"}),": calculates the tangent of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Tan",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"tanh(v instant-vector)"}),": calculates the hyperbolic tangent of all float samples in ",o.jsx("code",{children:"v"})," ","(",o.jsx("a",{href:"https://pkg.go.dev/math#Tanh",children:"special cases"}),")."]})]}),o.jsx("p",{children:"The following are useful for converting between degrees and radians:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"deg(v instant-vector)"}),": converts radians to degrees for all float samples in ",o.jsx("code",{children:"v"}),"."]}),o.jsxs("li",{children:[o.jsx("code",{children:"pi()"}),": returns pi."]}),o.jsxs("li",{children:[o.jsx("code",{children:"rad(v instant-vector)"}),": converts degrees to radians for all float samples in ",o.jsx("code",{children:"v"}),"."]})]})]}),count_over_time:o.jsxs(o.Fragment,{children:[o.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:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"avg_over_time(range-vector)"}),": the average value of all float or histogram samples in the specified interval (see details below)."]}),o.jsxs("li",{children:[o.jsx("code",{children:"min_over_time(range-vector)"}),": the minimum value of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"max_over_time(range-vector)"}),": the maximum value of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sum_over_time(range-vector)"}),": the sum of all float or histogram samples in the specified interval (see details below)."]}),o.jsxs("li",{children:[o.jsx("code",{children:"count_over_time(range-vector)"}),": the count of all samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"quantile_over_time(scalar, range-vector)"}),": the φ-quantile (0 ≤ φ ≤ 1) of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"stddev_over_time(range-vector)"}),": the population standard deviation of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"stdvar_over_time(range-vector)"}),": the population variance of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"last_over_time(range-vector)"}),": the most recent sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"first_over_time(range-vector)"}),": the oldest sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"present_over_time(range-vector)"}),": the value 1 for any series in the specified interval."]})]}),o.jsxs("p",{children:["If the ",o.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),o.jsx("code",{children:"--enable-feature=promql-experimental-functions"})," is set, the following additional functions are available:"]}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"mad_over_time(range-vector)"}),": the median absolute deviation of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.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."]}),o.jsxs("li",{children:[o.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."]}),o.jsxs("li",{children:[o.jsx("code",{children:"ts_of_last_over_time(range-vector)"}),": the timestamp of last sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"ts_of_first_over_time(range-vector)"}),": the timestamp of earliest sample in the specified interval."]})]}),o.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."}),o.jsx("p",{children:"These functions act on histograms in the following way:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"count_over_time"}),", ",o.jsx("code",{children:"first_over_time"}),", ",o.jsx("code",{children:"last_over_time"}),", and",o.jsx("code",{children:"present_over_time()"})," act on float and histogram samples in the same way."]}),o.jsxs("li",{children:[o.jsx("code",{children:"avg_over_time()"})," and ",o.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."]}),o.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."})]}),o.jsxs("p",{children:[o.jsx("code",{children:"first_over_time(m[1m])"})," differs from ",o.jsx("code",{children:"m offset 1m"})," in that the former will select the first sample of ",o.jsx("code",{children:"m"})," ",o.jsx("em",{children:"within"})," the 1m range, where ",o.jsx("code",{children:"m offset 1m"})," will select the most recent sample within the lookback interval ",o.jsx("em",{children:"outside and prior to"})," the 1m offset. This is particularly useful with ",o.jsx("code",{children:"first_over_time(m[step()])"}),"in range queries to ensure that the sample selected is within the range step."]})]}),day_of_month:o.jsx(o.Fragment,{children:o.jsxs("p",{children:[o.jsx("code",{children:"day_of_month(v=vector(time()) instant-vector)"})," interprets float samples in",o.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:o.jsx(o.Fragment,{children:o.jsxs("p",{children:[o.jsx("code",{children:"day_of_week(v=vector(time()) instant-vector)"})," interprets float samples in ",o.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:o.jsx(o.Fragment,{children:o.jsxs("p",{children:[o.jsx("code",{children:"day_of_year(v=vector(time()) instant-vector)"})," interprets float samples in ",o.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:o.jsx(o.Fragment,{children:o.jsxs("p",{children:[o.jsx("code",{children:"days_in_month(v=vector(time()) instant-vector)"})," interprets float samples in",o.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:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"The trigonometric functions work in radians. They ignore histogram samples in the input vector."}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"acos(v instant-vector)"}),": calculates the arccosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Acos",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"acosh(v instant-vector)"}),": calculates the inverse hyperbolic cosine of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Acosh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"asin(v instant-vector)"}),": calculates the arcsine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Asin",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"asinh(v instant-vector)"}),": calculates the inverse hyperbolic sine of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Asinh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"atan(v instant-vector)"}),": calculates the arctangent of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Atan",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"atanh(v instant-vector)"}),": calculates the inverse hyperbolic tangent of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Atanh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"cos(v instant-vector)"}),": calculates the cosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Cos",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"cosh(v instant-vector)"}),": calculates the hyperbolic cosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Cosh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sin(v instant-vector)"}),": calculates the sine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Sin",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sinh(v instant-vector)"}),": calculates the hyperbolic sine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Sinh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"tan(v instant-vector)"}),": calculates the tangent of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Tan",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"tanh(v instant-vector)"}),": calculates the hyperbolic tangent of all float samples in ",o.jsx("code",{children:"v"})," ","(",o.jsx("a",{href:"https://pkg.go.dev/math#Tanh",children:"special cases"}),")."]})]}),o.jsx("p",{children:"The following are useful for converting between degrees and radians:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"deg(v instant-vector)"}),": converts radians to degrees for all float samples in ",o.jsx("code",{children:"v"}),"."]}),o.jsxs("li",{children:[o.jsx("code",{children:"pi()"}),": returns pi."]}),o.jsxs("li",{children:[o.jsx("code",{children:"rad(v instant-vector)"}),": converts degrees to radians for all float samples in ",o.jsx("code",{children:"v"}),"."]})]})]}),delta:o.jsxs(o.Fragment,{children:[o.jsxs("p",{children:[o.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 ",o.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."]}),o.jsx("p",{children:"The following example expression returns the difference in CPU temperature between now and 2 hours ago:"}),o.jsx("pre",{children:o.jsxs("code",{children:["delta(cpu_temp_celsius","{",'host="zeus"',"}","[2h])"]})}),o.jsxs("p",{children:[o.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 ",o.jsx("code",{children:"v"}),". However, each element in ",o.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."]}),o.jsxs("p",{children:[o.jsx("code",{children:"delta"})," should only be used with gauges (for both floats and histograms)."]})]}),deriv:o.jsxs(o.Fragment,{children:[o.jsxs("p",{children:[o.jsx("code",{children:"deriv(v range-vector)"})," calculates the per-second derivative of each float time series in the range vector ",o.jsx("code",{children:"v"}),", using"," ",o.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 ",o.jsx("code",{children:"+Inf"})," or"," ",o.jsx("code",{children:"-Inf"})," are found in the range vector, the slope and offset value calculated will be ",o.jsx("code",{children:"NaN"}),"."]}),o.jsxs("p",{children:[o.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:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:o.jsxs("strong",{children:["This function has to be enabled via the"," ",o.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),o.jsx("code",{children:"--enable-feature=promql-experimental-functions"}),"."]})}),o.jsxs("p",{children:[o.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 ",o.jsx("code",{children:"v"}),". The lower the smoothing factor ",o.jsx("code",{children:"sf"}),", the more importance is given to old data. The higher the trend factor ",o.jsx("code",{children:"tf"}),", the more trends in the data is considered. Both ",o.jsx("code",{children:"sf"})," and",o.jsx("code",{children:"tf"})," must be between 0 and 1. For additional details, refer to"," ",o.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 ",o.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”."]}),o.jsxs("p",{children:[o.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:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:o.jsxs("strong",{children:["This function has to be enabled via the"," ",o.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),o.jsx("code",{children:"--enable-feature=promql-experimental-functions"}),"."]})}),o.jsxs("p",{children:[o.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:o.jsxs(o.Fragment,{children:[o.jsxs("p",{children:[o.jsx("code",{children:"exp(v instant-vector)"})," calculates the exponential function for all float samples in ",o.jsx("code",{children:"v"}),". Histogram samples are ignored silently. Special cases are:"]}),o.jsxs("ul",{children:[o.jsx("li",{children:o.jsx("code",{children:"Exp(+Inf) = +Inf"})}),o.jsx("li",{children:o.jsx("code",{children:"Exp(NaN) = NaN"})})]})]}),first_over_time:o.jsxs(o.Fragment,{children:[o.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:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"avg_over_time(range-vector)"}),": the average value of all float or histogram samples in the specified interval (see details below)."]}),o.jsxs("li",{children:[o.jsx("code",{children:"min_over_time(range-vector)"}),": the minimum value of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"max_over_time(range-vector)"}),": the maximum value of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sum_over_time(range-vector)"}),": the sum of all float or histogram samples in the specified interval (see details below)."]}),o.jsxs("li",{children:[o.jsx("code",{children:"count_over_time(range-vector)"}),": the count of all samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"quantile_over_time(scalar, range-vector)"}),": the φ-quantile (0 ≤ φ ≤ 1) of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"stddev_over_time(range-vector)"}),": the population standard deviation of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"stdvar_over_time(range-vector)"}),": the population variance of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"last_over_time(range-vector)"}),": the most recent sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"first_over_time(range-vector)"}),": the oldest sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"present_over_time(range-vector)"}),": the value 1 for any series in the specified interval."]})]}),o.jsxs("p",{children:["If the ",o.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),o.jsx("code",{children:"--enable-feature=promql-experimental-functions"})," is set, the following additional functions are available:"]}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"mad_over_time(range-vector)"}),": the median absolute deviation of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.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."]}),o.jsxs("li",{children:[o.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."]}),o.jsxs("li",{children:[o.jsx("code",{children:"ts_of_last_over_time(range-vector)"}),": the timestamp of last sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"ts_of_first_over_time(range-vector)"}),": the timestamp of earliest sample in the specified interval."]})]}),o.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."}),o.jsx("p",{children:"These functions act on histograms in the following way:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"count_over_time"}),", ",o.jsx("code",{children:"first_over_time"}),", ",o.jsx("code",{children:"last_over_time"}),", and",o.jsx("code",{children:"present_over_time()"})," act on float and histogram samples in the same way."]}),o.jsxs("li",{children:[o.jsx("code",{children:"avg_over_time()"})," and ",o.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."]}),o.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."})]}),o.jsxs("p",{children:[o.jsx("code",{children:"first_over_time(m[1m])"})," differs from ",o.jsx("code",{children:"m offset 1m"})," in that the former will select the first sample of ",o.jsx("code",{children:"m"})," ",o.jsx("em",{children:"within"})," the 1m range, where ",o.jsx("code",{children:"m offset 1m"})," will select the most recent sample within the lookback interval ",o.jsx("em",{children:"outside and prior to"})," the 1m offset. This is particularly useful with ",o.jsx("code",{children:"first_over_time(m[step()])"}),"in range queries to ensure that the sample selected is within the range step."]})]}),floor:o.jsxs(o.Fragment,{children:[o.jsxs("p",{children:[o.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."]}),o.jsxs("ul",{children:[o.jsx("li",{children:o.jsx("code",{children:"floor(+Inf) = +Inf"})}),o.jsx("li",{children:o.jsx("code",{children:"floor(±0) = ±0"})}),o.jsx("li",{children:o.jsx("code",{children:"floor(1.49) = 1.0"})}),o.jsx("li",{children:o.jsx("code",{children:"floor(1.78) = 1.0"})})]})]}),histogram_avg:o.jsxs(o.Fragment,{children:[o.jsxs("p",{children:[o.jsx("code",{children:"histogram_avg(v instant-vector)"})," returns the arithmetic average of observed values stored in each native histogram sample in ",o.jsx("code",{children:"v"}),". Float samples are ignored and do not show up in the returned vector."]}),o.jsxs("p",{children:["Use ",o.jsx("code",{children:"histogram_avg"})," as demonstrated below to compute the average request duration over a 5-minute window from a native histogram:"]}),o.jsx("pre",{children:o.jsx("code",{children:"histogram_avg(rate(http_request_duration_seconds[5m]))"})}),o.jsx("p",{children:"Which is equivalent to the following query:"}),o.jsx("pre",{children:o.jsxs("code",{children:[" ","histogram_sum(rate(http_request_duration_seconds[5m])) / histogram_count(rate(http_request_duration_seconds[5m]))"]})})]}),histogram_count:o.jsxs(o.Fragment,{children:[o.jsxs("p",{children:[o.jsx("code",{children:"histogram_count(v instant-vector)"})," returns the count of observations stored in each native histogram sample in ",o.jsx("code",{children:"v"}),". Float samples are ignored and do not show up in the returned vector."]}),o.jsxs("p",{children:["Similarly, ",o.jsx("code",{children:"histogram_sum(v instant-vector)"})," returns the sum of observations stored in each native histogram sample."]}),o.jsxs("p",{children:["Use ",o.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:"]}),o.jsx("pre",{children:o.jsx("code",{children:"histogram_count(rate(http_request_duration_seconds[10m]))"})})]}),histogram_fraction:o.jsxs(o.Fragment,{children:[o.jsxs("p",{children:[o.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"," ",o.jsx("code",{children:"b"}),". Float samples in ",o.jsx("code",{children:"b"})," are considered the counts of observations in each bucket of one or more classic histograms, while native histogram samples in ",o.jsx("code",{children:"b"})," are treated each individually as a separate histogram. This works in the same way as for ",o.jsx("code",{children:"histogram_quantile()"}),". (See there for more details.)"]}),o.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",o.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 ",o.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",o.jsx("a",{href:"https://prometheus.io/docs/practices/histograms/#apdex-score",children:"calculation of the Apdex score"}),"as a typical example."]}),o.jsx("p",{children:"For example, the following expression calculates the fraction of HTTP requests over the last hour that took 200ms or less:"}),o.jsx("pre",{children:o.jsx("code",{children:"histogram_fraction(0, 0.2, rate(http_request_duration_seconds[1h]))"})}),o.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."}),o.jsxs("p",{children:[o.jsx("code",{children:"+Inf"})," and ",o.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 ",o.jsx("code",{children:"-Inf"})," rather than ",o.jsx("code",{children:"0"}),"."]}),o.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."}),o.jsxs("p",{children:["Special case for native histograms with standard exponential buckets:",o.jsx("code",{children:"NaN"})," observations are considered outside of any buckets in this case.",o.jsx("code",{children:"histogram_fraction(-Inf, +Inf, b)"})," effectively returns the fraction of non-",o.jsx("code",{children:"NaN"})," ","observations and may therefore be less than 1."]})]}),histogram_quantile:o.jsxs(o.Fragment,{children:[o.jsxs("p",{children:[o.jsx("code",{children:"histogram_quantile(φ scalar, b instant-vector)"})," calculates the φ-quantile (0 ≤ φ ≤ 1) from a"," ",o.jsx("a",{href:"https://prometheus.io/docs/concepts/metric_types/#histogram",children:"classic histogram"})," or from a native histogram. (See ",o.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.)"]}),o.jsxs("p",{children:["The float samples in ",o.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",o.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"," ",o.jsx("a",{href:"https://prometheus.io/docs/concepts/metric_types/#histogram",children:"histogram metric type"}),"automatically provides time series with the ",o.jsx("code",{children:"_bucket"})," suffix and the appropriate labels."]}),o.jsxs("p",{children:["The (native) histogram samples in ",o.jsx("code",{children:"b"})," are treated each individually as a separate histogram to calculate the quantile from."]}),o.jsxs("p",{children:["As long as no naming collisions arise, ",o.jsx("code",{children:"b"})," may contain a mix of classic and native histograms."]}),o.jsxs("p",{children:["Use the ",o.jsx("code",{children:"rate()"})," function to specify the time window for the quantile calculation."]}),o.jsxs("p",{children:["Example: A histogram metric is called ",o.jsx("code",{children:"http_request_duration_seconds"})," (and therefore the metric name for the buckets of a classic histogram is",o.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",o.jsx("code",{children:"http_request_duration_seconds"})," is a classic histogram:"]}),o.jsx("pre",{children:o.jsx("code",{children:"histogram_quantile(0.9, rate(http_request_duration_seconds_bucket[10m]))"})}),o.jsx("p",{children:"For a native histogram, use the following expression instead:"}),o.jsx("pre",{children:o.jsx("code",{children:"histogram_quantile(0.9, rate(http_request_duration_seconds[10m]))"})}),o.jsxs("p",{children:["The quantile is calculated for each label combination in",o.jsx("code",{children:"http_request_duration_seconds"}),". To aggregate, use the ",o.jsx("code",{children:"sum()"})," aggregator around the"," ",o.jsx("code",{children:"rate()"})," function. Since the ",o.jsx("code",{children:"le"})," label is required by",o.jsx("code",{children:"histogram_quantile()"})," to deal with classic histograms, it has to be included in the ",o.jsx("code",{children:"by"})," ","clause. The following expression aggregates the 90th percentile by ",o.jsx("code",{children:"job"})," for classic histograms:"]}),o.jsx("pre",{children:o.jsx("code",{children:"histogram_quantile(0.9, sum by (job, le) (rate(http_request_duration_seconds_bucket[10m])))"})}),o.jsx("p",{children:"When aggregating native histograms, the expression simplifies to:"}),o.jsx("pre",{children:o.jsx("code",{children:"histogram_quantile(0.9, sum by (job) (rate(http_request_duration_seconds[10m])))"})}),o.jsxs("p",{children:["To aggregate all classic histograms, specify only the ",o.jsx("code",{children:"le"})," label:"]}),o.jsx("pre",{children:o.jsx("code",{children:"histogram_quantile(0.9, sum by (le) (rate(http_request_duration_seconds_bucket[10m])))"})}),o.jsxs("p",{children:["With native histograms, aggregating everything works as usual without any ",o.jsx("code",{children:"by"})," clause:"]}),o.jsx("pre",{children:o.jsx("code",{children:"histogram_quantile(0.9, sum(rate(http_request_duration_seconds[10m])))"})}),o.jsxs("p",{children:["In the (common) case that a quantile value does not coincide with a bucket boundary, the"," ",o.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"," ",o.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 ",o.jsx("em",{children:"exponential interpolation"}),". See the"," ",o.jsx("a",{href:"https://prometheus.io/docs/specs/native_histograms/#interpolation-within-a-bucket",children:"native histogram specification"}),"for more details.)"]}),o.jsxs("p",{children:["If ",o.jsx("code",{children:"b"})," has 0 observations, ",o.jsx("code",{children:"NaN"})," is returned. For φ < 0, ",o.jsx("code",{children:"-Inf"})," is returned. For φ > 1, ",o.jsx("code",{children:"+Inf"})," is returned. For φ = ",o.jsx("code",{children:"NaN"}),", ",o.jsx("code",{children:"NaN"})," is returned."]}),o.jsx("p",{children:"Special cases for classic histograms:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:["If ",o.jsx("code",{children:"b"})," contains fewer than two buckets, ",o.jsx("code",{children:"NaN"})," is returned."]}),o.jsxs("li",{children:["The highest bucket must have an upper bound of ",o.jsx("code",{children:"+Inf"}),". (Otherwise, ",o.jsx("code",{children:"NaN"})," is returned.)"]}),o.jsx("li",{children:"If a quantile is located in the highest bucket, the upper bound of the second highest bucket is returned."}),o.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."})]}),o.jsx("p",{children:"Special cases for native histograms:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:["If a native histogram with standard exponential buckets has ",o.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 ",o.jsx("code",{children:"NaN"}),"observations treated as ",o.jsx("code",{children:"+Inf"}),". This is flagged with an info level annotation."]}),o.jsxs("li",{children:["If a native histogram with standard exponential buckets has ",o.jsx("code",{children:"NaN"}),"observations and the quantile falls above all of the existing exponential buckets, ",o.jsx("code",{children:"NaN"})," is returned. This is flagged with an info level annotation."]}),o.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."}),o.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."})]}),o.jsxs("p",{children:["You can use ",o.jsx("code",{children:"histogram_quantile(0, v instant-vector)"})," to get the estimated minimum value stored in a histogram."]}),o.jsxs("p",{children:["You can use ",o.jsx("code",{children:"histogram_quantile(1, v instant-vector)"})," to get the estimated maximum value stored in a histogram."]}),o.jsx("p",{children:"Buckets of classic histograms are cumulative. Therefore, the following should always be the case:"}),o.jsxs("ul",{children:[o.jsx("li",{children:"The counts in the buckets are monotonically increasing (strictly non-decreasing)."}),o.jsx("li",{children:"A lack of observations between the upper limits of two consecutive buckets results in equal counts in those two buckets."})]}),o.jsxs("p",{children:["However, floating point precision issues (e.g. small discrepancies introduced by computing of buckets with"," ",o.jsx("code",{children:"sum(rate(...))"}),") or invalid data might violate these assumptions. In that case,"," ",o.jsx("code",{children:"histogram_quantile"})," would be unable to return meaningful results. To mitigate the issue,"," ",o.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 ",o.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:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:o.jsxs("strong",{children:["This function has to be enabled via the"," ",o.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),o.jsx("code",{children:"--enable-feature=promql-experimental-functions"}),"."]})}),o.jsxs("p",{children:[o.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"," ",o.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 ",o.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."]}),o.jsx("pre",{children:o.jsxs("code",{children:['histogram_quantiles(sum(rate(foo[1m])), "quantile", 0.9, 0.99) # => ',"{",'quantile="0.9"',"}"," 123","{",'quantile="0.99"',"}"," 128"]})})]}),histogram_stddev:o.jsxs(o.Fragment,{children:[o.jsxs("p",{children:[o.jsx("code",{children:"histogram_stddev(v instant-vector)"})," returns the estimated standard deviation of observations for each native histogram sample in ",o.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."]}),o.jsxs("p",{children:["Similarly, ",o.jsx("code",{children:"histogram_stdvar(v instant-vector)"})," returns the estimated variance of observations for each native histogram sample in ",o.jsx("code",{children:"v"}),"."]})]}),histogram_stdvar:o.jsxs(o.Fragment,{children:[o.jsxs("p",{children:[o.jsx("code",{children:"histogram_stddev(v instant-vector)"})," returns the estimated standard deviation of observations for each native histogram sample in ",o.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."]}),o.jsxs("p",{children:["Similarly, ",o.jsx("code",{children:"histogram_stdvar(v instant-vector)"})," returns the estimated variance of observations for each native histogram sample in ",o.jsx("code",{children:"v"}),"."]})]}),histogram_sum:o.jsxs(o.Fragment,{children:[o.jsxs("p",{children:[o.jsx("code",{children:"histogram_count(v instant-vector)"})," returns the count of observations stored in each native histogram sample in ",o.jsx("code",{children:"v"}),". Float samples are ignored and do not show up in the returned vector."]}),o.jsxs("p",{children:["Similarly, ",o.jsx("code",{children:"histogram_sum(v instant-vector)"})," returns the sum of observations stored in each native histogram sample."]}),o.jsxs("p",{children:["Use ",o.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:"]}),o.jsx("pre",{children:o.jsx("code",{children:"histogram_count(rate(http_request_duration_seconds[10m]))"})})]}),hour:o.jsx(o.Fragment,{children:o.jsxs("p",{children:[o.jsx("code",{children:"hour(v=vector(time()) instant-vector)"})," interprets float samples in ",o.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:o.jsxs(o.Fragment,{children:[o.jsxs("p",{children:[o.jsx("code",{children:"idelta(v range-vector)"})," calculates the difference between the last two samples in the range vector"," ",o.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 ",o.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."]}),o.jsxs("p",{children:[o.jsx("code",{children:"idelta"})," should only be used with gauges (for both floats and histograms)."]})]}),increase:o.jsxs(o.Fragment,{children:[o.jsxs("p",{children:[o.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."]}),o.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:"}),o.jsx("pre",{children:o.jsxs("code",{children:["increase(http_requests_total","{",'job="api-server"',"}","[5m])"]})}),o.jsxs("p",{children:[o.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 ",o.jsx("code",{children:"v"}),". However, each element in ",o.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."]}),o.jsxs("p",{children:[o.jsx("code",{children:"increase"})," should only be used with counters (for both floats and histograms). It is syntactic sugar for ",o.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 ",o.jsx("code",{children:"rate"})," in recording rules so that increases are tracked consistently on a per-second basis."]})]}),info:o.jsxs(o.Fragment,{children:[o.jsxs("p",{children:["_The ",o.jsx("code",{children:"info"})," function is an experiment to improve UX around including labels from"," ",o.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."," ",o.jsx("code",{children:"info"})," has to be enabled via the",o.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"})," ",o.jsx("code",{children:"--enable-feature=promql-experimental-functions"}),"._"]}),o.jsxs("p",{children:[o.jsx("code",{children:"info(v instant-vector, [data-label-selector instant-vector])"})," finds, for each time series in"," ",o.jsx("code",{children:"v"}),", all info series with matching ",o.jsx("em",{children:"identifying"})," labels (more on this later), and adds the union of their ",o.jsx("em",{children:"data"})," (i.e., non-identifying) labels to the time series. The second argument"," ",o.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 (",o.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 ",o.jsx("code",{children:"v"}),"."]}),o.jsxs("p",{children:["If there is no matching info series for a given time series in ",o.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"," ",o.jsx("code",{children:"data-label-selector"}),"contains any matcher that does not match the empty string (e.g.",o.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."," ",o.jsxs("code",{children:["{",'data=~".*"',"}"]}),"), or if no ",o.jsx("code",{children:"data-label-selector"}),"is provided, the time series is returned without enrichment."]}),o.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",o.jsx("em",{children:"data labels"})," (also called non-identifying). (Note that Prometheus’s concept of time series identity always includes ",o.jsx("em",{children:"all"})," the labels. For the sake of the ",o.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 ",o.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 ",o.jsx("code",{children:"info"})," function is that the same info series continues to exist, just with different “data”.)"]}),o.jsx("p",{children:"The conventional approach of adding data labels is sometimes called a “join query”, as illustrated by the following example:"}),o.jsx("pre",{children:o.jsxs("code",{children:[" ","rate(http_server_request_duration_seconds_count[2m]) * on (job, instance) group_left (k8s_cluster_name) target_info"]})}),o.jsxs("p",{children:["The core of the query is the expression ",o.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 (",o.jsx("code",{children:"target_info"}),"), what the identifying labels are (",o.jsx("code",{children:"on (job, instance)"}),"), and which data labels to add (",o.jsx("code",{children:"group_left (k8s_cluster_name)"}),")."]}),o.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 ",o.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 ",o.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 ",o.jsx("code",{children:"target_info"}),"."]}),o.jsxs("p",{children:["The ",o.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 ",o.jsx("code",{children:"info"})," function:"]}),o.jsx("pre",{children:o.jsxs("code",{children:["info( rate(http_server_request_duration_seconds_count[2m]),","{",'k8s_cluster_name=~".+"',"}",")"]})}),o.jsxs("p",{children:["The common case of adding ",o.jsx("em",{children:"all"})," data labels can be achieved by omitting the 2nd argument of the"," ",o.jsx("code",{children:"info"})," function entirely, simplifying the example even more:"]}),o.jsx("pre",{children:o.jsx("code",{children:"info(rate(http_server_request_duration_seconds_count[2m]))"})}),o.jsxs("p",{children:["While ",o.jsx("code",{children:"info"})," normally automatically finds all matching info series, it’s possible to restrict them by providing a ",o.jsx("code",{children:"__name__"})," label matcher, e.g.",o.jsxs("code",{children:["{",'__name__="target_info"',"}"]}),"."]}),o.jsxs("p",{children:["Note that if there are any time series in ",o.jsx("code",{children:"v"})," that match the ",o.jsx("code",{children:"data-label-selector"})," (or the default ",o.jsx("code",{children:"target_info"})," if that argument is not specified), they will be treated as info series and will be returned unchanged."]}),o.jsx("h3",{children:"Limitations"}),o.jsxs("p",{children:["In its current iteration, ",o.jsx("code",{children:"info"})," defaults to considering only info series with the name"," ",o.jsx("code",{children:"target_info"}),". It also assumes that the identifying info series labels are",o.jsx("code",{children:"instance"})," and ",o.jsx("code",{children:"job"}),". ",o.jsx("code",{children:"info"})," does support other info series names however, through",o.jsx("code",{children:"__name__"})," label matchers. E.g., one can explicitly say to consider both",o.jsx("code",{children:"target_info"})," and ",o.jsx("code",{children:"build_info"})," as follows:",o.jsxs("code",{children:["{",'__name__=~"(target|build)_info"',"}"]}),". However, the identifying labels always have to be ",o.jsx("code",{children:"instance"})," and ",o.jsx("code",{children:"job"}),"."]}),o.jsxs("p",{children:["When only negated ",o.jsx("code",{children:"__name__"})," matchers are provided (e.g.",o.jsxs("code",{children:["{",'__name__!="target_info"',"}"]}),"), ",o.jsx("code",{children:"info"})," considers all metrics matching",o.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."]}),o.jsxs("p",{children:["These limitations are partially defeating the purpose of the ",o.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"," ",o.jsx("code",{children:"info"})," function will indeed consider all matching info series and with their appropriate identifying labels."]})]}),irate:o.jsxs(o.Fragment,{children:[o.jsxs("p",{children:[o.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 ",o.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."]}),o.jsxs("p",{children:[o.jsx("code",{children:"irate"})," should only be used with counters (for both floats and histograms)."]}),o.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:"}),o.jsx("pre",{children:o.jsxs("code",{children:["irate(http_requests_total","{",'job="api-server"',"}","[5m])"]})}),o.jsxs("p",{children:[o.jsx("code",{children:"irate"})," should only be used when graphing volatile, fast-moving counters. Use ",o.jsx("code",{children:"rate"})," for alerts and slow-moving counters, as brief changes in the rate can reset the ",o.jsx("code",{children:"FOR"})," clause and graphs consisting entirely of rare spikes are hard to read."]}),o.jsxs("p",{children:["Note that when combining ",o.jsx("code",{children:"irate()"})," with an",o.jsx("a",{href:"operators.md#aggregation-operators",children:"aggregation operator"})," (e.g. ",o.jsx("code",{children:"sum()"}),") or a function aggregating over time (any function ending in ",o.jsx("code",{children:"_over_time"}),"), always take an ",o.jsx("code",{children:"irate()"})," ","first, then aggregate. Otherwise ",o.jsx("code",{children:"irate()"})," cannot detect counter resets when your target restarts."]})]}),label_join:o.jsxs(o.Fragment,{children:[o.jsxs("p",{children:["For each timeseries in ",o.jsx("code",{children:"v"}),","," ",o.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 ",o.jsx("code",{children:"src_labels"}),"using ",o.jsx("code",{children:"separator"})," and returns the timeseries with the label ",o.jsx("code",{children:"dst_label"})," containing the joined value. There can be any number of ",o.jsx("code",{children:"src_labels"})," in this function."]}),o.jsxs("p",{children:[o.jsx("code",{children:"label_join"})," acts on float and histogram samples in the same way."]}),o.jsxs("p",{children:["This example will return a vector with each time series having a ",o.jsx("code",{children:"foo"})," label with the value"," ",o.jsx("code",{children:"a,b,c"})," added to it:"]}),o.jsx("pre",{children:o.jsxs("code",{children:["label_join(up","{",'job="api-server",src1="a",src2="b",src3="c"',"}",', "foo", ",", "src1", "src2", "src3")']})})]}),label_replace:o.jsxs(o.Fragment,{children:[o.jsxs("p",{children:["For each timeseries in ",o.jsx("code",{children:"v"}),","," ",o.jsx("code",{children:"label_replace(v instant-vector, dst_label string, replacement string, src_label string, regex string)"}),"matches the ",o.jsx("a",{href:"./basics.md#regular-expressions",children:"regular expression"})," ",o.jsx("code",{children:"regex"})," against the value of the label ",o.jsx("code",{children:"src_label"}),". If it matches, the value of the label ",o.jsx("code",{children:"dst_label"})," in the returned timeseries will be the expansion of ",o.jsx("code",{children:"replacement"}),", together with the original labels in the input. Capturing groups in the regular expression can be referenced with ",o.jsx("code",{children:"$1"}),", ",o.jsx("code",{children:"$2"}),", etc. Named capturing groups in the regular expression can be referenced with ",o.jsx("code",{children:"$name"})," (where"," ",o.jsx("code",{children:"name"})," is the capturing group name). If the regular expression doesn’t match then the timeseries is returned unchanged."]}),o.jsxs("p",{children:[o.jsx("code",{children:"label_replace"})," acts on float and histogram samples in the same way."]}),o.jsxs("p",{children:["This example will return timeseries with the values ",o.jsx("code",{children:"a:c"})," at label ",o.jsx("code",{children:"service"})," and"," ",o.jsx("code",{children:"a"})," at label ",o.jsx("code",{children:"foo"}),":"]}),o.jsx("pre",{children:o.jsxs("code",{children:["label_replace(up","{",'job="api-server",service="a:c"',"}",', "foo", "$1", "service", "(.*):.*")']})}),o.jsx("p",{children:"This second example has the same effect than the first example, and illustrates use of named capturing groups:"}),o.jsx("pre",{children:o.jsxs("code",{children:["label_replace(up","{",'job="api-server",service="a:c"',"}",', "foo", "$name", "service", "(?P<name>.*):(?P<version>.*)")']})})]}),last_over_time:o.jsxs(o.Fragment,{children:[o.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:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"avg_over_time(range-vector)"}),": the average value of all float or histogram samples in the specified interval (see details below)."]}),o.jsxs("li",{children:[o.jsx("code",{children:"min_over_time(range-vector)"}),": the minimum value of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"max_over_time(range-vector)"}),": the maximum value of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sum_over_time(range-vector)"}),": the sum of all float or histogram samples in the specified interval (see details below)."]}),o.jsxs("li",{children:[o.jsx("code",{children:"count_over_time(range-vector)"}),": the count of all samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"quantile_over_time(scalar, range-vector)"}),": the φ-quantile (0 ≤ φ ≤ 1) of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"stddev_over_time(range-vector)"}),": the population standard deviation of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"stdvar_over_time(range-vector)"}),": the population variance of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"last_over_time(range-vector)"}),": the most recent sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"first_over_time(range-vector)"}),": the oldest sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"present_over_time(range-vector)"}),": the value 1 for any series in the specified interval."]})]}),o.jsxs("p",{children:["If the ",o.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),o.jsx("code",{children:"--enable-feature=promql-experimental-functions"})," is set, the following additional functions are available:"]}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"mad_over_time(range-vector)"}),": the median absolute deviation of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.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."]}),o.jsxs("li",{children:[o.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."]}),o.jsxs("li",{children:[o.jsx("code",{children:"ts_of_last_over_time(range-vector)"}),": the timestamp of last sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"ts_of_first_over_time(range-vector)"}),": the timestamp of earliest sample in the specified interval."]})]}),o.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."}),o.jsx("p",{children:"These functions act on histograms in the following way:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"count_over_time"}),", ",o.jsx("code",{children:"first_over_time"}),", ",o.jsx("code",{children:"last_over_time"}),", and",o.jsx("code",{children:"present_over_time()"})," act on float and histogram samples in the same way."]}),o.jsxs("li",{children:[o.jsx("code",{children:"avg_over_time()"})," and ",o.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."]}),o.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."})]}),o.jsxs("p",{children:[o.jsx("code",{children:"first_over_time(m[1m])"})," differs from ",o.jsx("code",{children:"m offset 1m"})," in that the former will select the first sample of ",o.jsx("code",{children:"m"})," ",o.jsx("em",{children:"within"})," the 1m range, where ",o.jsx("code",{children:"m offset 1m"})," will select the most recent sample within the lookback interval ",o.jsx("em",{children:"outside and prior to"})," the 1m offset. This is particularly useful with ",o.jsx("code",{children:"first_over_time(m[step()])"}),"in range queries to ensure that the sample selected is within the range step."]})]}),ln:o.jsxs(o.Fragment,{children:[o.jsxs("p",{children:[o.jsx("code",{children:"ln(v instant-vector)"})," calculates the natural logarithm for all float samples in ",o.jsx("code",{children:"v"}),". Histogram samples in the input vector are ignored silently. Special cases are:"]}),o.jsxs("ul",{children:[o.jsx("li",{children:o.jsx("code",{children:"ln(+Inf) = +Inf"})}),o.jsx("li",{children:o.jsx("code",{children:"ln(0) = -Inf"})}),o.jsx("li",{children:o.jsx("code",{children:"ln(x < 0) = NaN"})}),o.jsx("li",{children:o.jsx("code",{children:"ln(NaN) = NaN"})})]})]}),log10:o.jsx(o.Fragment,{children:o.jsxs("p",{children:[o.jsx("code",{children:"log10(v instant-vector)"})," calculates the decimal logarithm for all float samples in ",o.jsx("code",{children:"v"}),". Histogram samples in the input vector are ignored silently. The special cases are equivalent to those in"," ",o.jsx("code",{children:"ln"}),"."]})}),log2:o.jsx(o.Fragment,{children:o.jsxs("p",{children:[o.jsx("code",{children:"log2(v instant-vector)"})," calculates the binary logarithm for all float samples in ",o.jsx("code",{children:"v"}),". Histogram samples in the input vector are ignored silently. The special cases are equivalent to those in"," ",o.jsx("code",{children:"ln"}),"."]})}),mad_over_time:o.jsxs(o.Fragment,{children:[o.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:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"avg_over_time(range-vector)"}),": the average value of all float or histogram samples in the specified interval (see details below)."]}),o.jsxs("li",{children:[o.jsx("code",{children:"min_over_time(range-vector)"}),": the minimum value of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"max_over_time(range-vector)"}),": the maximum value of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sum_over_time(range-vector)"}),": the sum of all float or histogram samples in the specified interval (see details below)."]}),o.jsxs("li",{children:[o.jsx("code",{children:"count_over_time(range-vector)"}),": the count of all samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"quantile_over_time(scalar, range-vector)"}),": the φ-quantile (0 ≤ φ ≤ 1) of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"stddev_over_time(range-vector)"}),": the population standard deviation of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"stdvar_over_time(range-vector)"}),": the population variance of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"last_over_time(range-vector)"}),": the most recent sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"first_over_time(range-vector)"}),": the oldest sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"present_over_time(range-vector)"}),": the value 1 for any series in the specified interval."]})]}),o.jsxs("p",{children:["If the ",o.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),o.jsx("code",{children:"--enable-feature=promql-experimental-functions"})," is set, the following additional functions are available:"]}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"mad_over_time(range-vector)"}),": the median absolute deviation of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.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."]}),o.jsxs("li",{children:[o.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."]}),o.jsxs("li",{children:[o.jsx("code",{children:"ts_of_last_over_time(range-vector)"}),": the timestamp of last sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"ts_of_first_over_time(range-vector)"}),": the timestamp of earliest sample in the specified interval."]})]}),o.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."}),o.jsx("p",{children:"These functions act on histograms in the following way:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"count_over_time"}),", ",o.jsx("code",{children:"first_over_time"}),", ",o.jsx("code",{children:"last_over_time"}),", and",o.jsx("code",{children:"present_over_time()"})," act on float and histogram samples in the same way."]}),o.jsxs("li",{children:[o.jsx("code",{children:"avg_over_time()"})," and ",o.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."]}),o.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."})]}),o.jsxs("p",{children:[o.jsx("code",{children:"first_over_time(m[1m])"})," differs from ",o.jsx("code",{children:"m offset 1m"})," in that the former will select the first sample of ",o.jsx("code",{children:"m"})," ",o.jsx("em",{children:"within"})," the 1m range, where ",o.jsx("code",{children:"m offset 1m"})," will select the most recent sample within the lookback interval ",o.jsx("em",{children:"outside and prior to"})," the 1m offset. This is particularly useful with ",o.jsx("code",{children:"first_over_time(m[step()])"}),"in range queries to ensure that the sample selected is within the range step."]})]}),max_of:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:o.jsxs("strong",{children:["This function has to be enabled via the"," ",o.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),o.jsx("code",{children:"--enable-feature=promql-experimental-functions"}),"."]})}),o.jsxs("p",{children:[o.jsx("code",{children:"max_of(a scalar, b scalar)"})," returns the larger of the two scalar values ",o.jsx("code",{children:"a"}),"and ",o.jsx("code",{children:"b"}),"."]})]}),max_over_time:o.jsxs(o.Fragment,{children:[o.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:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"avg_over_time(range-vector)"}),": the average value of all float or histogram samples in the specified interval (see details below)."]}),o.jsxs("li",{children:[o.jsx("code",{children:"min_over_time(range-vector)"}),": the minimum value of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"max_over_time(range-vector)"}),": the maximum value of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sum_over_time(range-vector)"}),": the sum of all float or histogram samples in the specified interval (see details below)."]}),o.jsxs("li",{children:[o.jsx("code",{children:"count_over_time(range-vector)"}),": the count of all samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"quantile_over_time(scalar, range-vector)"}),": the φ-quantile (0 ≤ φ ≤ 1) of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"stddev_over_time(range-vector)"}),": the population standard deviation of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"stdvar_over_time(range-vector)"}),": the population variance of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"last_over_time(range-vector)"}),": the most recent sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"first_over_time(range-vector)"}),": the oldest sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"present_over_time(range-vector)"}),": the value 1 for any series in the specified interval."]})]}),o.jsxs("p",{children:["If the ",o.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),o.jsx("code",{children:"--enable-feature=promql-experimental-functions"})," is set, the following additional functions are available:"]}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"mad_over_time(range-vector)"}),": the median absolute deviation of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.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."]}),o.jsxs("li",{children:[o.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."]}),o.jsxs("li",{children:[o.jsx("code",{children:"ts_of_last_over_time(range-vector)"}),": the timestamp of last sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"ts_of_first_over_time(range-vector)"}),": the timestamp of earliest sample in the specified interval."]})]}),o.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."}),o.jsx("p",{children:"These functions act on histograms in the following way:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"count_over_time"}),", ",o.jsx("code",{children:"first_over_time"}),", ",o.jsx("code",{children:"last_over_time"}),", and",o.jsx("code",{children:"present_over_time()"})," act on float and histogram samples in the same way."]}),o.jsxs("li",{children:[o.jsx("code",{children:"avg_over_time()"})," and ",o.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."]}),o.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."})]}),o.jsxs("p",{children:[o.jsx("code",{children:"first_over_time(m[1m])"})," differs from ",o.jsx("code",{children:"m offset 1m"})," in that the former will select the first sample of ",o.jsx("code",{children:"m"})," ",o.jsx("em",{children:"within"})," the 1m range, where ",o.jsx("code",{children:"m offset 1m"})," will select the most recent sample within the lookback interval ",o.jsx("em",{children:"outside and prior to"})," the 1m offset. This is particularly useful with ",o.jsx("code",{children:"first_over_time(m[step()])"}),"in range queries to ensure that the sample selected is within the range step."]})]}),min_of:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:o.jsxs("strong",{children:["This function has to be enabled via the"," ",o.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),o.jsx("code",{children:"--enable-feature=promql-experimental-functions"}),"."]})}),o.jsxs("p",{children:[o.jsx("code",{children:"min_of(a scalar, b scalar)"})," returns the smaller of the two scalar values ",o.jsx("code",{children:"a"}),"and ",o.jsx("code",{children:"b"}),"."]})]}),min_over_time:o.jsxs(o.Fragment,{children:[o.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:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"avg_over_time(range-vector)"}),": the average value of all float or histogram samples in the specified interval (see details below)."]}),o.jsxs("li",{children:[o.jsx("code",{children:"min_over_time(range-vector)"}),": the minimum value of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"max_over_time(range-vector)"}),": the maximum value of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sum_over_time(range-vector)"}),": the sum of all float or histogram samples in the specified interval (see details below)."]}),o.jsxs("li",{children:[o.jsx("code",{children:"count_over_time(range-vector)"}),": the count of all samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"quantile_over_time(scalar, range-vector)"}),": the φ-quantile (0 ≤ φ ≤ 1) of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"stddev_over_time(range-vector)"}),": the population standard deviation of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"stdvar_over_time(range-vector)"}),": the population variance of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"last_over_time(range-vector)"}),": the most recent sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"first_over_time(range-vector)"}),": the oldest sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"present_over_time(range-vector)"}),": the value 1 for any series in the specified interval."]})]}),o.jsxs("p",{children:["If the ",o.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),o.jsx("code",{children:"--enable-feature=promql-experimental-functions"})," is set, the following additional functions are available:"]}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"mad_over_time(range-vector)"}),": the median absolute deviation of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.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."]}),o.jsxs("li",{children:[o.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."]}),o.jsxs("li",{children:[o.jsx("code",{children:"ts_of_last_over_time(range-vector)"}),": the timestamp of last sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"ts_of_first_over_time(range-vector)"}),": the timestamp of earliest sample in the specified interval."]})]}),o.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."}),o.jsx("p",{children:"These functions act on histograms in the following way:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"count_over_time"}),", ",o.jsx("code",{children:"first_over_time"}),", ",o.jsx("code",{children:"last_over_time"}),", and",o.jsx("code",{children:"present_over_time()"})," act on float and histogram samples in the same way."]}),o.jsxs("li",{children:[o.jsx("code",{children:"avg_over_time()"})," and ",o.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."]}),o.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."})]}),o.jsxs("p",{children:[o.jsx("code",{children:"first_over_time(m[1m])"})," differs from ",o.jsx("code",{children:"m offset 1m"})," in that the former will select the first sample of ",o.jsx("code",{children:"m"})," ",o.jsx("em",{children:"within"})," the 1m range, where ",o.jsx("code",{children:"m offset 1m"})," will select the most recent sample within the lookback interval ",o.jsx("em",{children:"outside and prior to"})," the 1m offset. This is particularly useful with ",o.jsx("code",{children:"first_over_time(m[step()])"}),"in range queries to ensure that the sample selected is within the range step."]})]}),minute:o.jsx(o.Fragment,{children:o.jsxs("p",{children:[o.jsx("code",{children:"minute(v=vector(time()) instant-vector)"})," interprets float samples in ",o.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:o.jsx(o.Fragment,{children:o.jsxs("p",{children:[o.jsx("code",{children:"month(v=vector(time()) instant-vector)"})," interprets float samples in ",o.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:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"The trigonometric functions work in radians. They ignore histogram samples in the input vector."}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"acos(v instant-vector)"}),": calculates the arccosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Acos",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"acosh(v instant-vector)"}),": calculates the inverse hyperbolic cosine of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Acosh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"asin(v instant-vector)"}),": calculates the arcsine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Asin",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"asinh(v instant-vector)"}),": calculates the inverse hyperbolic sine of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Asinh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"atan(v instant-vector)"}),": calculates the arctangent of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Atan",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"atanh(v instant-vector)"}),": calculates the inverse hyperbolic tangent of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Atanh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"cos(v instant-vector)"}),": calculates the cosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Cos",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"cosh(v instant-vector)"}),": calculates the hyperbolic cosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Cosh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sin(v instant-vector)"}),": calculates the sine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Sin",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sinh(v instant-vector)"}),": calculates the hyperbolic sine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Sinh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"tan(v instant-vector)"}),": calculates the tangent of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Tan",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"tanh(v instant-vector)"}),": calculates the hyperbolic tangent of all float samples in ",o.jsx("code",{children:"v"})," ","(",o.jsx("a",{href:"https://pkg.go.dev/math#Tanh",children:"special cases"}),")."]})]}),o.jsx("p",{children:"The following are useful for converting between degrees and radians:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"deg(v instant-vector)"}),": converts radians to degrees for all float samples in ",o.jsx("code",{children:"v"}),"."]}),o.jsxs("li",{children:[o.jsx("code",{children:"pi()"}),": returns pi."]}),o.jsxs("li",{children:[o.jsx("code",{children:"rad(v instant-vector)"}),": converts degrees to radians for all float samples in ",o.jsx("code",{children:"v"}),"."]})]})]}),predict_linear:o.jsxs(o.Fragment,{children:[o.jsxs("p",{children:[o.jsx("code",{children:"predict_linear(v range-vector, t scalar)"})," predicts the value of time series",o.jsx("code",{children:"t"})," seconds from now, based on the range vector ",o.jsx("code",{children:"v"}),", using"," ",o.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 ",o.jsx("code",{children:"+Inf"})," or"," ",o.jsx("code",{children:"-Inf"})," are found in the range vector, the predicted value will be ",o.jsx("code",{children:"NaN"}),"."]}),o.jsxs("p",{children:[o.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:o.jsxs(o.Fragment,{children:[o.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:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"avg_over_time(range-vector)"}),": the average value of all float or histogram samples in the specified interval (see details below)."]}),o.jsxs("li",{children:[o.jsx("code",{children:"min_over_time(range-vector)"}),": the minimum value of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"max_over_time(range-vector)"}),": the maximum value of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sum_over_time(range-vector)"}),": the sum of all float or histogram samples in the specified interval (see details below)."]}),o.jsxs("li",{children:[o.jsx("code",{children:"count_over_time(range-vector)"}),": the count of all samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"quantile_over_time(scalar, range-vector)"}),": the φ-quantile (0 ≤ φ ≤ 1) of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"stddev_over_time(range-vector)"}),": the population standard deviation of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"stdvar_over_time(range-vector)"}),": the population variance of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"last_over_time(range-vector)"}),": the most recent sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"first_over_time(range-vector)"}),": the oldest sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"present_over_time(range-vector)"}),": the value 1 for any series in the specified interval."]})]}),o.jsxs("p",{children:["If the ",o.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),o.jsx("code",{children:"--enable-feature=promql-experimental-functions"})," is set, the following additional functions are available:"]}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"mad_over_time(range-vector)"}),": the median absolute deviation of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.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."]}),o.jsxs("li",{children:[o.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."]}),o.jsxs("li",{children:[o.jsx("code",{children:"ts_of_last_over_time(range-vector)"}),": the timestamp of last sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"ts_of_first_over_time(range-vector)"}),": the timestamp of earliest sample in the specified interval."]})]}),o.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."}),o.jsx("p",{children:"These functions act on histograms in the following way:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"count_over_time"}),", ",o.jsx("code",{children:"first_over_time"}),", ",o.jsx("code",{children:"last_over_time"}),", and",o.jsx("code",{children:"present_over_time()"})," act on float and histogram samples in the same way."]}),o.jsxs("li",{children:[o.jsx("code",{children:"avg_over_time()"})," and ",o.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."]}),o.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."})]}),o.jsxs("p",{children:[o.jsx("code",{children:"first_over_time(m[1m])"})," differs from ",o.jsx("code",{children:"m offset 1m"})," in that the former will select the first sample of ",o.jsx("code",{children:"m"})," ",o.jsx("em",{children:"within"})," the 1m range, where ",o.jsx("code",{children:"m offset 1m"})," will select the most recent sample within the lookback interval ",o.jsx("em",{children:"outside and prior to"})," the 1m offset. This is particularly useful with ",o.jsx("code",{children:"first_over_time(m[step()])"}),"in range queries to ensure that the sample selected is within the range step."]})]}),quantile_over_time:o.jsxs(o.Fragment,{children:[o.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:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"avg_over_time(range-vector)"}),": the average value of all float or histogram samples in the specified interval (see details below)."]}),o.jsxs("li",{children:[o.jsx("code",{children:"min_over_time(range-vector)"}),": the minimum value of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"max_over_time(range-vector)"}),": the maximum value of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sum_over_time(range-vector)"}),": the sum of all float or histogram samples in the specified interval (see details below)."]}),o.jsxs("li",{children:[o.jsx("code",{children:"count_over_time(range-vector)"}),": the count of all samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"quantile_over_time(scalar, range-vector)"}),": the φ-quantile (0 ≤ φ ≤ 1) of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"stddev_over_time(range-vector)"}),": the population standard deviation of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"stdvar_over_time(range-vector)"}),": the population variance of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"last_over_time(range-vector)"}),": the most recent sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"first_over_time(range-vector)"}),": the oldest sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"present_over_time(range-vector)"}),": the value 1 for any series in the specified interval."]})]}),o.jsxs("p",{children:["If the ",o.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),o.jsx("code",{children:"--enable-feature=promql-experimental-functions"})," is set, the following additional functions are available:"]}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"mad_over_time(range-vector)"}),": the median absolute deviation of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.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."]}),o.jsxs("li",{children:[o.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."]}),o.jsxs("li",{children:[o.jsx("code",{children:"ts_of_last_over_time(range-vector)"}),": the timestamp of last sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"ts_of_first_over_time(range-vector)"}),": the timestamp of earliest sample in the specified interval."]})]}),o.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."}),o.jsx("p",{children:"These functions act on histograms in the following way:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"count_over_time"}),", ",o.jsx("code",{children:"first_over_time"}),", ",o.jsx("code",{children:"last_over_time"}),", and",o.jsx("code",{children:"present_over_time()"})," act on float and histogram samples in the same way."]}),o.jsxs("li",{children:[o.jsx("code",{children:"avg_over_time()"})," and ",o.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."]}),o.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."})]}),o.jsxs("p",{children:[o.jsx("code",{children:"first_over_time(m[1m])"})," differs from ",o.jsx("code",{children:"m offset 1m"})," in that the former will select the first sample of ",o.jsx("code",{children:"m"})," ",o.jsx("em",{children:"within"})," the 1m range, where ",o.jsx("code",{children:"m offset 1m"})," will select the most recent sample within the lookback interval ",o.jsx("em",{children:"outside and prior to"})," the 1m offset. This is particularly useful with ",o.jsx("code",{children:"first_over_time(m[step()])"}),"in range queries to ensure that the sample selected is within the range step."]})]}),rad:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"The trigonometric functions work in radians. They ignore histogram samples in the input vector."}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"acos(v instant-vector)"}),": calculates the arccosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Acos",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"acosh(v instant-vector)"}),": calculates the inverse hyperbolic cosine of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Acosh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"asin(v instant-vector)"}),": calculates the arcsine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Asin",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"asinh(v instant-vector)"}),": calculates the inverse hyperbolic sine of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Asinh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"atan(v instant-vector)"}),": calculates the arctangent of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Atan",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"atanh(v instant-vector)"}),": calculates the inverse hyperbolic tangent of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Atanh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"cos(v instant-vector)"}),": calculates the cosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Cos",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"cosh(v instant-vector)"}),": calculates the hyperbolic cosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Cosh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sin(v instant-vector)"}),": calculates the sine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Sin",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sinh(v instant-vector)"}),": calculates the hyperbolic sine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Sinh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"tan(v instant-vector)"}),": calculates the tangent of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Tan",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"tanh(v instant-vector)"}),": calculates the hyperbolic tangent of all float samples in ",o.jsx("code",{children:"v"})," ","(",o.jsx("a",{href:"https://pkg.go.dev/math#Tanh",children:"special cases"}),")."]})]}),o.jsx("p",{children:"The following are useful for converting between degrees and radians:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"deg(v instant-vector)"}),": converts radians to degrees for all float samples in ",o.jsx("code",{children:"v"}),"."]}),o.jsxs("li",{children:[o.jsx("code",{children:"pi()"}),": returns pi."]}),o.jsxs("li",{children:[o.jsx("code",{children:"rad(v instant-vector)"}),": converts degrees to radians for all float samples in ",o.jsx("code",{children:"v"}),"."]})]})]}),range:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:o.jsxs("strong",{children:["This function has to be enabled via the"," ",o.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),o.jsx("code",{children:"--enable-feature=promql-experimental-functions"}),"."]})}),o.jsxs("p",{children:[o.jsx("code",{children:"range()"})," returns the range duration of the current query range evaluation in seconds and is equivalent to ",o.jsx("code",{children:"end() - start()"}),". For instant queries, this returns ",o.jsx("code",{children:"0"}),"."]})]}),rate:o.jsxs(o.Fragment,{children:[o.jsxs("p",{children:[o.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."]}),o.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:"}),o.jsx("pre",{children:o.jsxs("code",{children:["rate(http_requests_total","{",'job="api-server"',"}","[5m])"]})}),o.jsxs("p",{children:[o.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 ",o.jsx("code",{children:"v"}),". However, each element in ",o.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."]}),o.jsxs("p",{children:[o.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."]}),o.jsxs("p",{children:["Note that when combining ",o.jsx("code",{children:"rate()"})," with an aggregation operator (e.g. ",o.jsx("code",{children:"sum()"}),") or a function aggregating over time (any function ending in ",o.jsx("code",{children:"_over_time"}),"), always take a"," ",o.jsx("code",{children:"rate()"})," first, then aggregate. Otherwise ",o.jsx("code",{children:"rate()"})," cannot detect counter resets when your target restarts."]})]}),resets:o.jsxs(o.Fragment,{children:[o.jsxs("p",{children:["For each input time series, ",o.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."]}),o.jsxs("p",{children:[o.jsx("code",{children:"resets"})," should only be used with counters (for both floats and histograms)."]}),o.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 ",o.jsx("code",{children:"resets"})," ","should not be used on gauges in the first place, see above)."]})]}),round:o.jsx(o.Fragment,{children:o.jsxs("p",{children:[o.jsx("code",{children:"round(v instant-vector, to_nearest=1 scalar)"})," rounds the sample values of all elements in"," ",o.jsx("code",{children:"v"})," to the nearest integer. Ties are resolved by rounding up. The optional ",o.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:o.jsx(o.Fragment,{children:o.jsxs("p",{children:["Given an input vector that contains only one element with a float sample,",o.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, ",o.jsx("code",{children:"scalar"})," will return ",o.jsx("code",{children:"NaN"}),". Histogram samples in the input vector are ignored silently."]})}),sgn:o.jsx(o.Fragment,{children:o.jsxs("p",{children:[o.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:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"The trigonometric functions work in radians. They ignore histogram samples in the input vector."}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"acos(v instant-vector)"}),": calculates the arccosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Acos",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"acosh(v instant-vector)"}),": calculates the inverse hyperbolic cosine of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Acosh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"asin(v instant-vector)"}),": calculates the arcsine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Asin",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"asinh(v instant-vector)"}),": calculates the inverse hyperbolic sine of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Asinh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"atan(v instant-vector)"}),": calculates the arctangent of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Atan",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"atanh(v instant-vector)"}),": calculates the inverse hyperbolic tangent of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Atanh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"cos(v instant-vector)"}),": calculates the cosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Cos",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"cosh(v instant-vector)"}),": calculates the hyperbolic cosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Cosh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sin(v instant-vector)"}),": calculates the sine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Sin",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sinh(v instant-vector)"}),": calculates the hyperbolic sine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Sinh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"tan(v instant-vector)"}),": calculates the tangent of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Tan",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"tanh(v instant-vector)"}),": calculates the hyperbolic tangent of all float samples in ",o.jsx("code",{children:"v"})," ","(",o.jsx("a",{href:"https://pkg.go.dev/math#Tanh",children:"special cases"}),")."]})]}),o.jsx("p",{children:"The following are useful for converting between degrees and radians:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"deg(v instant-vector)"}),": converts radians to degrees for all float samples in ",o.jsx("code",{children:"v"}),"."]}),o.jsxs("li",{children:[o.jsx("code",{children:"pi()"}),": returns pi."]}),o.jsxs("li",{children:[o.jsx("code",{children:"rad(v instant-vector)"}),": converts degrees to radians for all float samples in ",o.jsx("code",{children:"v"}),"."]})]})]}),sinh:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"The trigonometric functions work in radians. They ignore histogram samples in the input vector."}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"acos(v instant-vector)"}),": calculates the arccosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Acos",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"acosh(v instant-vector)"}),": calculates the inverse hyperbolic cosine of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Acosh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"asin(v instant-vector)"}),": calculates the arcsine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Asin",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"asinh(v instant-vector)"}),": calculates the inverse hyperbolic sine of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Asinh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"atan(v instant-vector)"}),": calculates the arctangent of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Atan",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"atanh(v instant-vector)"}),": calculates the inverse hyperbolic tangent of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Atanh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"cos(v instant-vector)"}),": calculates the cosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Cos",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"cosh(v instant-vector)"}),": calculates the hyperbolic cosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Cosh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sin(v instant-vector)"}),": calculates the sine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Sin",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sinh(v instant-vector)"}),": calculates the hyperbolic sine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Sinh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"tan(v instant-vector)"}),": calculates the tangent of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Tan",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"tanh(v instant-vector)"}),": calculates the hyperbolic tangent of all float samples in ",o.jsx("code",{children:"v"})," ","(",o.jsx("a",{href:"https://pkg.go.dev/math#Tanh",children:"special cases"}),")."]})]}),o.jsx("p",{children:"The following are useful for converting between degrees and radians:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"deg(v instant-vector)"}),": converts radians to degrees for all float samples in ",o.jsx("code",{children:"v"}),"."]}),o.jsxs("li",{children:[o.jsx("code",{children:"pi()"}),": returns pi."]}),o.jsxs("li",{children:[o.jsx("code",{children:"rad(v instant-vector)"}),": converts degrees to radians for all float samples in ",o.jsx("code",{children:"v"}),"."]})]})]}),sort:o.jsxs(o.Fragment,{children:[o.jsxs("p",{children:[o.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."]}),o.jsxs("p",{children:["Please note that ",o.jsx("code",{children:"sort"})," only affects the results of instant queries, as range query results always have a fixed output ordering."]})]}),sort_by_label:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:o.jsxs("strong",{children:["This function has to be enabled via the"," ",o.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),o.jsx("code",{children:"--enable-feature=promql-experimental-functions"}),"."]})}),o.jsxs("p",{children:[o.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.",o.jsx("code",{children:"sort_by_label"})," acts on float and histogram samples in the same way."]}),o.jsxs("p",{children:["Please note that ",o.jsx("code",{children:"sort_by_label"})," only affects the results of instant queries, as range query results always have a fixed output ordering."]}),o.jsxs("p",{children:[o.jsx("code",{children:"sort_by_label"})," uses"," ",o.jsx("a",{href:"https://en.wikipedia.org/wiki/Natural_sort_order",children:"natural sort order"}),"."]})]}),sort_by_label_desc:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:o.jsxs("strong",{children:["This function has to be enabled via the"," ",o.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),o.jsx("code",{children:"--enable-feature=promql-experimental-functions"}),"."]})}),o.jsxs("p",{children:["Same as ",o.jsx("code",{children:"sort_by_label"}),", but sorts in descending order."]})]}),sort_desc:o.jsx(o.Fragment,{children:o.jsxs("p",{children:["Same as ",o.jsx("code",{children:"sort"}),", but sorts in descending order."]})}),sqrt:o.jsx(o.Fragment,{children:o.jsxs("p",{children:[o.jsx("code",{children:"sqrt(v instant-vector)"})," calculates the square root of all float samples in",o.jsx("code",{children:"v"}),". Histogram samples in the input vector are ignored silently."]})}),start:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:o.jsxs("strong",{children:["This function has to be enabled via the"," ",o.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),o.jsx("code",{children:"--enable-feature=promql-experimental-functions"}),"."]})}),o.jsxs("p",{children:[o.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."]})]}),start_timestamp:o.jsxs(o.Fragment,{children:[o.jsxs("p",{children:[o.jsx("code",{children:"start_timestamp(v instant-vector)"})," returns the start 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."]}),o.jsxs("p",{children:["This function only works when used directly on an instant vector and when ",o.jsx("code",{children:"use-start-timestamps"})," ","feature flag is enabled. Otherwise, if it’s used on an expression or if ",o.jsx("code",{children:"use-start-timestamps"})," ","is disabled, it returns empty results."]})]}),stddev_over_time:o.jsxs(o.Fragment,{children:[o.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:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"avg_over_time(range-vector)"}),": the average value of all float or histogram samples in the specified interval (see details below)."]}),o.jsxs("li",{children:[o.jsx("code",{children:"min_over_time(range-vector)"}),": the minimum value of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"max_over_time(range-vector)"}),": the maximum value of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sum_over_time(range-vector)"}),": the sum of all float or histogram samples in the specified interval (see details below)."]}),o.jsxs("li",{children:[o.jsx("code",{children:"count_over_time(range-vector)"}),": the count of all samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"quantile_over_time(scalar, range-vector)"}),": the φ-quantile (0 ≤ φ ≤ 1) of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"stddev_over_time(range-vector)"}),": the population standard deviation of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"stdvar_over_time(range-vector)"}),": the population variance of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"last_over_time(range-vector)"}),": the most recent sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"first_over_time(range-vector)"}),": the oldest sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"present_over_time(range-vector)"}),": the value 1 for any series in the specified interval."]})]}),o.jsxs("p",{children:["If the ",o.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),o.jsx("code",{children:"--enable-feature=promql-experimental-functions"})," is set, the following additional functions are available:"]}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"mad_over_time(range-vector)"}),": the median absolute deviation of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.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."]}),o.jsxs("li",{children:[o.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."]}),o.jsxs("li",{children:[o.jsx("code",{children:"ts_of_last_over_time(range-vector)"}),": the timestamp of last sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"ts_of_first_over_time(range-vector)"}),": the timestamp of earliest sample in the specified interval."]})]}),o.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."}),o.jsx("p",{children:"These functions act on histograms in the following way:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"count_over_time"}),", ",o.jsx("code",{children:"first_over_time"}),", ",o.jsx("code",{children:"last_over_time"}),", and",o.jsx("code",{children:"present_over_time()"})," act on float and histogram samples in the same way."]}),o.jsxs("li",{children:[o.jsx("code",{children:"avg_over_time()"})," and ",o.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."]}),o.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."})]}),o.jsxs("p",{children:[o.jsx("code",{children:"first_over_time(m[1m])"})," differs from ",o.jsx("code",{children:"m offset 1m"})," in that the former will select the first sample of ",o.jsx("code",{children:"m"})," ",o.jsx("em",{children:"within"})," the 1m range, where ",o.jsx("code",{children:"m offset 1m"})," will select the most recent sample within the lookback interval ",o.jsx("em",{children:"outside and prior to"})," the 1m offset. This is particularly useful with ",o.jsx("code",{children:"first_over_time(m[step()])"}),"in range queries to ensure that the sample selected is within the range step."]})]}),stdvar_over_time:o.jsxs(o.Fragment,{children:[o.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:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"avg_over_time(range-vector)"}),": the average value of all float or histogram samples in the specified interval (see details below)."]}),o.jsxs("li",{children:[o.jsx("code",{children:"min_over_time(range-vector)"}),": the minimum value of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"max_over_time(range-vector)"}),": the maximum value of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sum_over_time(range-vector)"}),": the sum of all float or histogram samples in the specified interval (see details below)."]}),o.jsxs("li",{children:[o.jsx("code",{children:"count_over_time(range-vector)"}),": the count of all samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"quantile_over_time(scalar, range-vector)"}),": the φ-quantile (0 ≤ φ ≤ 1) of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"stddev_over_time(range-vector)"}),": the population standard deviation of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"stdvar_over_time(range-vector)"}),": the population variance of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"last_over_time(range-vector)"}),": the most recent sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"first_over_time(range-vector)"}),": the oldest sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"present_over_time(range-vector)"}),": the value 1 for any series in the specified interval."]})]}),o.jsxs("p",{children:["If the ",o.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),o.jsx("code",{children:"--enable-feature=promql-experimental-functions"})," is set, the following additional functions are available:"]}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"mad_over_time(range-vector)"}),": the median absolute deviation of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.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."]}),o.jsxs("li",{children:[o.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."]}),o.jsxs("li",{children:[o.jsx("code",{children:"ts_of_last_over_time(range-vector)"}),": the timestamp of last sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"ts_of_first_over_time(range-vector)"}),": the timestamp of earliest sample in the specified interval."]})]}),o.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."}),o.jsx("p",{children:"These functions act on histograms in the following way:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"count_over_time"}),", ",o.jsx("code",{children:"first_over_time"}),", ",o.jsx("code",{children:"last_over_time"}),", and",o.jsx("code",{children:"present_over_time()"})," act on float and histogram samples in the same way."]}),o.jsxs("li",{children:[o.jsx("code",{children:"avg_over_time()"})," and ",o.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."]}),o.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."})]}),o.jsxs("p",{children:[o.jsx("code",{children:"first_over_time(m[1m])"})," differs from ",o.jsx("code",{children:"m offset 1m"})," in that the former will select the first sample of ",o.jsx("code",{children:"m"})," ",o.jsx("em",{children:"within"})," the 1m range, where ",o.jsx("code",{children:"m offset 1m"})," will select the most recent sample within the lookback interval ",o.jsx("em",{children:"outside and prior to"})," the 1m offset. This is particularly useful with ",o.jsx("code",{children:"first_over_time(m[step()])"}),"in range queries to ensure that the sample selected is within the range step."]})]}),step:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:o.jsxs("strong",{children:["This function has to be enabled via the"," ",o.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),o.jsx("code",{children:"--enable-feature=promql-experimental-functions"}),"."]})}),o.jsxs("p",{children:[o.jsx("code",{children:"step()"})," returns the query resolution step as the number of seconds. For instant queries, this returns ",o.jsx("code",{children:"0"}),"."]})]}),sum_over_time:o.jsxs(o.Fragment,{children:[o.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:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"avg_over_time(range-vector)"}),": the average value of all float or histogram samples in the specified interval (see details below)."]}),o.jsxs("li",{children:[o.jsx("code",{children:"min_over_time(range-vector)"}),": the minimum value of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"max_over_time(range-vector)"}),": the maximum value of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sum_over_time(range-vector)"}),": the sum of all float or histogram samples in the specified interval (see details below)."]}),o.jsxs("li",{children:[o.jsx("code",{children:"count_over_time(range-vector)"}),": the count of all samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"quantile_over_time(scalar, range-vector)"}),": the φ-quantile (0 ≤ φ ≤ 1) of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"stddev_over_time(range-vector)"}),": the population standard deviation of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"stdvar_over_time(range-vector)"}),": the population variance of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"last_over_time(range-vector)"}),": the most recent sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"first_over_time(range-vector)"}),": the oldest sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"present_over_time(range-vector)"}),": the value 1 for any series in the specified interval."]})]}),o.jsxs("p",{children:["If the ",o.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),o.jsx("code",{children:"--enable-feature=promql-experimental-functions"})," is set, the following additional functions are available:"]}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"mad_over_time(range-vector)"}),": the median absolute deviation of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.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."]}),o.jsxs("li",{children:[o.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."]}),o.jsxs("li",{children:[o.jsx("code",{children:"ts_of_last_over_time(range-vector)"}),": the timestamp of last sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"ts_of_first_over_time(range-vector)"}),": the timestamp of earliest sample in the specified interval."]})]}),o.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."}),o.jsx("p",{children:"These functions act on histograms in the following way:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"count_over_time"}),", ",o.jsx("code",{children:"first_over_time"}),", ",o.jsx("code",{children:"last_over_time"}),", and",o.jsx("code",{children:"present_over_time()"})," act on float and histogram samples in the same way."]}),o.jsxs("li",{children:[o.jsx("code",{children:"avg_over_time()"})," and ",o.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."]}),o.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."})]}),o.jsxs("p",{children:[o.jsx("code",{children:"first_over_time(m[1m])"})," differs from ",o.jsx("code",{children:"m offset 1m"})," in that the former will select the first sample of ",o.jsx("code",{children:"m"})," ",o.jsx("em",{children:"within"})," the 1m range, where ",o.jsx("code",{children:"m offset 1m"})," will select the most recent sample within the lookback interval ",o.jsx("em",{children:"outside and prior to"})," the 1m offset. This is particularly useful with ",o.jsx("code",{children:"first_over_time(m[step()])"}),"in range queries to ensure that the sample selected is within the range step."]})]}),tan:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"The trigonometric functions work in radians. They ignore histogram samples in the input vector."}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"acos(v instant-vector)"}),": calculates the arccosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Acos",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"acosh(v instant-vector)"}),": calculates the inverse hyperbolic cosine of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Acosh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"asin(v instant-vector)"}),": calculates the arcsine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Asin",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"asinh(v instant-vector)"}),": calculates the inverse hyperbolic sine of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Asinh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"atan(v instant-vector)"}),": calculates the arctangent of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Atan",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"atanh(v instant-vector)"}),": calculates the inverse hyperbolic tangent of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Atanh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"cos(v instant-vector)"}),": calculates the cosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Cos",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"cosh(v instant-vector)"}),": calculates the hyperbolic cosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Cosh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sin(v instant-vector)"}),": calculates the sine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Sin",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sinh(v instant-vector)"}),": calculates the hyperbolic sine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Sinh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"tan(v instant-vector)"}),": calculates the tangent of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Tan",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"tanh(v instant-vector)"}),": calculates the hyperbolic tangent of all float samples in ",o.jsx("code",{children:"v"})," ","(",o.jsx("a",{href:"https://pkg.go.dev/math#Tanh",children:"special cases"}),")."]})]}),o.jsx("p",{children:"The following are useful for converting between degrees and radians:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"deg(v instant-vector)"}),": converts radians to degrees for all float samples in ",o.jsx("code",{children:"v"}),"."]}),o.jsxs("li",{children:[o.jsx("code",{children:"pi()"}),": returns pi."]}),o.jsxs("li",{children:[o.jsx("code",{children:"rad(v instant-vector)"}),": converts degrees to radians for all float samples in ",o.jsx("code",{children:"v"}),"."]})]})]}),tanh:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"The trigonometric functions work in radians. They ignore histogram samples in the input vector."}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"acos(v instant-vector)"}),": calculates the arccosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Acos",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"acosh(v instant-vector)"}),": calculates the inverse hyperbolic cosine of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Acosh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"asin(v instant-vector)"}),": calculates the arcsine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Asin",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"asinh(v instant-vector)"}),": calculates the inverse hyperbolic sine of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Asinh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"atan(v instant-vector)"}),": calculates the arctangent of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Atan",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"atanh(v instant-vector)"}),": calculates the inverse hyperbolic tangent of all float samples in"," ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Atanh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"cos(v instant-vector)"}),": calculates the cosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Cos",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"cosh(v instant-vector)"}),": calculates the hyperbolic cosine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Cosh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sin(v instant-vector)"}),": calculates the sine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Sin",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sinh(v instant-vector)"}),": calculates the hyperbolic sine of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Sinh",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"tan(v instant-vector)"}),": calculates the tangent of all float samples in ",o.jsx("code",{children:"v"})," (",o.jsx("a",{href:"https://pkg.go.dev/math#Tan",children:"special cases"}),")."]}),o.jsxs("li",{children:[o.jsx("code",{children:"tanh(v instant-vector)"}),": calculates the hyperbolic tangent of all float samples in ",o.jsx("code",{children:"v"})," ","(",o.jsx("a",{href:"https://pkg.go.dev/math#Tanh",children:"special cases"}),")."]})]}),o.jsx("p",{children:"The following are useful for converting between degrees and radians:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"deg(v instant-vector)"}),": converts radians to degrees for all float samples in ",o.jsx("code",{children:"v"}),"."]}),o.jsxs("li",{children:[o.jsx("code",{children:"pi()"}),": returns pi."]}),o.jsxs("li",{children:[o.jsx("code",{children:"rad(v instant-vector)"}),": converts degrees to radians for all float samples in ",o.jsx("code",{children:"v"}),"."]})]})]}),time:o.jsx(o.Fragment,{children:o.jsxs("p",{children:[o.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:o.jsx(o.Fragment,{children:o.jsxs("p",{children:[o.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:o.jsxs(o.Fragment,{children:[o.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:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"avg_over_time(range-vector)"}),": the average value of all float or histogram samples in the specified interval (see details below)."]}),o.jsxs("li",{children:[o.jsx("code",{children:"min_over_time(range-vector)"}),": the minimum value of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"max_over_time(range-vector)"}),": the maximum value of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sum_over_time(range-vector)"}),": the sum of all float or histogram samples in the specified interval (see details below)."]}),o.jsxs("li",{children:[o.jsx("code",{children:"count_over_time(range-vector)"}),": the count of all samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"quantile_over_time(scalar, range-vector)"}),": the φ-quantile (0 ≤ φ ≤ 1) of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"stddev_over_time(range-vector)"}),": the population standard deviation of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"stdvar_over_time(range-vector)"}),": the population variance of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"last_over_time(range-vector)"}),": the most recent sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"first_over_time(range-vector)"}),": the oldest sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"present_over_time(range-vector)"}),": the value 1 for any series in the specified interval."]})]}),o.jsxs("p",{children:["If the ",o.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),o.jsx("code",{children:"--enable-feature=promql-experimental-functions"})," is set, the following additional functions are available:"]}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"mad_over_time(range-vector)"}),": the median absolute deviation of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.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."]}),o.jsxs("li",{children:[o.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."]}),o.jsxs("li",{children:[o.jsx("code",{children:"ts_of_last_over_time(range-vector)"}),": the timestamp of last sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"ts_of_first_over_time(range-vector)"}),": the timestamp of earliest sample in the specified interval."]})]}),o.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."}),o.jsx("p",{children:"These functions act on histograms in the following way:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"count_over_time"}),", ",o.jsx("code",{children:"first_over_time"}),", ",o.jsx("code",{children:"last_over_time"}),", and",o.jsx("code",{children:"present_over_time()"})," act on float and histogram samples in the same way."]}),o.jsxs("li",{children:[o.jsx("code",{children:"avg_over_time()"})," and ",o.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."]}),o.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."})]}),o.jsxs("p",{children:[o.jsx("code",{children:"first_over_time(m[1m])"})," differs from ",o.jsx("code",{children:"m offset 1m"})," in that the former will select the first sample of ",o.jsx("code",{children:"m"})," ",o.jsx("em",{children:"within"})," the 1m range, where ",o.jsx("code",{children:"m offset 1m"})," will select the most recent sample within the lookback interval ",o.jsx("em",{children:"outside and prior to"})," the 1m offset. This is particularly useful with ",o.jsx("code",{children:"first_over_time(m[step()])"}),"in range queries to ensure that the sample selected is within the range step."]})]}),ts_of_last_over_time:o.jsxs(o.Fragment,{children:[o.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:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"avg_over_time(range-vector)"}),": the average value of all float or histogram samples in the specified interval (see details below)."]}),o.jsxs("li",{children:[o.jsx("code",{children:"min_over_time(range-vector)"}),": the minimum value of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"max_over_time(range-vector)"}),": the maximum value of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sum_over_time(range-vector)"}),": the sum of all float or histogram samples in the specified interval (see details below)."]}),o.jsxs("li",{children:[o.jsx("code",{children:"count_over_time(range-vector)"}),": the count of all samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"quantile_over_time(scalar, range-vector)"}),": the φ-quantile (0 ≤ φ ≤ 1) of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"stddev_over_time(range-vector)"}),": the population standard deviation of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"stdvar_over_time(range-vector)"}),": the population variance of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"last_over_time(range-vector)"}),": the most recent sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"first_over_time(range-vector)"}),": the oldest sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"present_over_time(range-vector)"}),": the value 1 for any series in the specified interval."]})]}),o.jsxs("p",{children:["If the ",o.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),o.jsx("code",{children:"--enable-feature=promql-experimental-functions"})," is set, the following additional functions are available:"]}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"mad_over_time(range-vector)"}),": the median absolute deviation of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.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."]}),o.jsxs("li",{children:[o.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."]}),o.jsxs("li",{children:[o.jsx("code",{children:"ts_of_last_over_time(range-vector)"}),": the timestamp of last sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"ts_of_first_over_time(range-vector)"}),": the timestamp of earliest sample in the specified interval."]})]}),o.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."}),o.jsx("p",{children:"These functions act on histograms in the following way:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"count_over_time"}),", ",o.jsx("code",{children:"first_over_time"}),", ",o.jsx("code",{children:"last_over_time"}),", and",o.jsx("code",{children:"present_over_time()"})," act on float and histogram samples in the same way."]}),o.jsxs("li",{children:[o.jsx("code",{children:"avg_over_time()"})," and ",o.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."]}),o.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."})]}),o.jsxs("p",{children:[o.jsx("code",{children:"first_over_time(m[1m])"})," differs from ",o.jsx("code",{children:"m offset 1m"})," in that the former will select the first sample of ",o.jsx("code",{children:"m"})," ",o.jsx("em",{children:"within"})," the 1m range, where ",o.jsx("code",{children:"m offset 1m"})," will select the most recent sample within the lookback interval ",o.jsx("em",{children:"outside and prior to"})," the 1m offset. This is particularly useful with ",o.jsx("code",{children:"first_over_time(m[step()])"}),"in range queries to ensure that the sample selected is within the range step."]})]}),ts_of_max_over_time:o.jsxs(o.Fragment,{children:[o.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:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"avg_over_time(range-vector)"}),": the average value of all float or histogram samples in the specified interval (see details below)."]}),o.jsxs("li",{children:[o.jsx("code",{children:"min_over_time(range-vector)"}),": the minimum value of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"max_over_time(range-vector)"}),": the maximum value of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sum_over_time(range-vector)"}),": the sum of all float or histogram samples in the specified interval (see details below)."]}),o.jsxs("li",{children:[o.jsx("code",{children:"count_over_time(range-vector)"}),": the count of all samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"quantile_over_time(scalar, range-vector)"}),": the φ-quantile (0 ≤ φ ≤ 1) of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"stddev_over_time(range-vector)"}),": the population standard deviation of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"stdvar_over_time(range-vector)"}),": the population variance of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"last_over_time(range-vector)"}),": the most recent sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"first_over_time(range-vector)"}),": the oldest sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"present_over_time(range-vector)"}),": the value 1 for any series in the specified interval."]})]}),o.jsxs("p",{children:["If the ",o.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),o.jsx("code",{children:"--enable-feature=promql-experimental-functions"})," is set, the following additional functions are available:"]}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"mad_over_time(range-vector)"}),": the median absolute deviation of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.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."]}),o.jsxs("li",{children:[o.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."]}),o.jsxs("li",{children:[o.jsx("code",{children:"ts_of_last_over_time(range-vector)"}),": the timestamp of last sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"ts_of_first_over_time(range-vector)"}),": the timestamp of earliest sample in the specified interval."]})]}),o.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."}),o.jsx("p",{children:"These functions act on histograms in the following way:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"count_over_time"}),", ",o.jsx("code",{children:"first_over_time"}),", ",o.jsx("code",{children:"last_over_time"}),", and",o.jsx("code",{children:"present_over_time()"})," act on float and histogram samples in the same way."]}),o.jsxs("li",{children:[o.jsx("code",{children:"avg_over_time()"})," and ",o.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."]}),o.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."})]}),o.jsxs("p",{children:[o.jsx("code",{children:"first_over_time(m[1m])"})," differs from ",o.jsx("code",{children:"m offset 1m"})," in that the former will select the first sample of ",o.jsx("code",{children:"m"})," ",o.jsx("em",{children:"within"})," the 1m range, where ",o.jsx("code",{children:"m offset 1m"})," will select the most recent sample within the lookback interval ",o.jsx("em",{children:"outside and prior to"})," the 1m offset. This is particularly useful with ",o.jsx("code",{children:"first_over_time(m[step()])"}),"in range queries to ensure that the sample selected is within the range step."]})]}),ts_of_min_over_time:o.jsxs(o.Fragment,{children:[o.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:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"avg_over_time(range-vector)"}),": the average value of all float or histogram samples in the specified interval (see details below)."]}),o.jsxs("li",{children:[o.jsx("code",{children:"min_over_time(range-vector)"}),": the minimum value of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"max_over_time(range-vector)"}),": the maximum value of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"sum_over_time(range-vector)"}),": the sum of all float or histogram samples in the specified interval (see details below)."]}),o.jsxs("li",{children:[o.jsx("code",{children:"count_over_time(range-vector)"}),": the count of all samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"quantile_over_time(scalar, range-vector)"}),": the φ-quantile (0 ≤ φ ≤ 1) of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"stddev_over_time(range-vector)"}),": the population standard deviation of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"stdvar_over_time(range-vector)"}),": the population variance of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"last_over_time(range-vector)"}),": the most recent sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"first_over_time(range-vector)"}),": the oldest sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"present_over_time(range-vector)"}),": the value 1 for any series in the specified interval."]})]}),o.jsxs("p",{children:["If the ",o.jsx("a",{href:"../feature_flags.md#experimental-promql-functions",children:"feature flag"}),o.jsx("code",{children:"--enable-feature=promql-experimental-functions"})," is set, the following additional functions are available:"]}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"mad_over_time(range-vector)"}),": the median absolute deviation of all float samples in the specified interval."]}),o.jsxs("li",{children:[o.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."]}),o.jsxs("li",{children:[o.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."]}),o.jsxs("li",{children:[o.jsx("code",{children:"ts_of_last_over_time(range-vector)"}),": the timestamp of last sample in the specified interval."]}),o.jsxs("li",{children:[o.jsx("code",{children:"ts_of_first_over_time(range-vector)"}),": the timestamp of earliest sample in the specified interval."]})]}),o.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."}),o.jsx("p",{children:"These functions act on histograms in the following way:"}),o.jsxs("ul",{children:[o.jsxs("li",{children:[o.jsx("code",{children:"count_over_time"}),", ",o.jsx("code",{children:"first_over_time"}),", ",o.jsx("code",{children:"last_over_time"}),", and",o.jsx("code",{children:"present_over_time()"})," act on float and histogram samples in the same way."]}),o.jsxs("li",{children:[o.jsx("code",{children:"avg_over_time()"})," and ",o.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."]}),o.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."})]}),o.jsxs("p",{children:[o.jsx("code",{children:"first_over_time(m[1m])"})," differs from ",o.jsx("code",{children:"m offset 1m"})," in that the former will select the first sample of ",o.jsx("code",{children:"m"})," ",o.jsx("em",{children:"within"})," the 1m range, where ",o.jsx("code",{children:"m offset 1m"})," will select the most recent sample within the lookback interval ",o.jsx("em",{children:"outside and prior to"})," the 1m offset. This is particularly useful with ",o.jsx("code",{children:"first_over_time(m[step()])"}),"in range queries to ensure that the sample selected is within the range step."]})]}),vector:o.jsx(o.Fragment,{children:o.jsxs("p",{children:[o.jsx("code",{children:"vector(s scalar)"})," converts the scalar ",o.jsx("code",{children:"s"})," to a float sample and returns it as a single-element instant vector with no labels."]})}),year:o.jsx(o.Fragment,{children:o.jsxs("p",{children:[o.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."]})})},DE=(t,e,n)=>{if(!(!t||t.type==="numberLiteral")){if(t.op==="step"){n.has("step")||(n.add("step"),e.push(o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"promql-code promql-keyword",children:"step()"})," resolves to the query step (the interval between data points in a range query, or"," ",o.jsx("span",{className:"promql-code promql-number",children:"0"})," for instant queries)."]})));return}if(t.op==="range"){n.has("range")||(n.add("range"),e.push(o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"promql-code promql-keyword",children:"range()"})," resolves to the query range (the total time window covered by a range query)."]})));return}if((t.op==="min_of"||t.op==="max_of")&&t.lhs&&t.rhs){const i=`${t.op}:${ol(t.lhs)}:${ol(t.rhs)}`;n.has(i)||(n.add(i),e.push(o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"promql-code",children:Pr(t)})," returns the ",t.op==="min_of"?"smaller":"larger"," of"," ",o.jsx("span",{className:"promql-code",children:Pr(t.lhs)})," and"," ",o.jsx("span",{className:"promql-code",children:Pr(t.rhs)}),"."]})))}DE(t.lhs,e,n),DE(t.rhs,e,n)}},wv=t=>{const e=[];if(DE(t,e,new Set),e.length===0)return null;const n=o.jsx("span",{className:"promql-code",children:Pr(t)});return e.length===1?o.jsxs(ft,{fz:"sm",mt:"sm",children:["In the duration expression ",n,", ",e[0]]}):o.jsxs(ft,{fz:"sm",mt:"sm",children:["In the duration expression ",n,":",o.jsx(Un,{fz:"sm",mt:"xs",withPadding:!0,children:e.map((i,r)=>o.jsx(Un.Item,{children:i},r))})]})},U_e="_funcDoc_mrib5_1",V_e={funcDoc:U_e},G_e=(t,e)=>o.jsxs(Un,{fz:"sm",my:"md",withPadding:!0,children:[t.length>0&&o.jsxs(Un.Item,{children:["The metric name is"," ",o.jsx("span",{className:"promql-code promql-metric-name",children:t}),"."]}),e.filter(n=>n.name!=="__name__").map(n=>{switch(n.type){case Ta.equal:return o.jsxs(Un.Item,{children:[o.jsx("span",{className:"promql-code promql-label-name",children:n.name}),o.jsx("span",{className:"promql-code promql-operator",children:n.type}),o.jsxs("span",{className:"promql-code promql-string",children:['"',vs(n.value),'"']}),": The label"," ",o.jsx("span",{className:"promql-code promql-label-name",children:n.name})," ","is exactly"," ",o.jsxs("span",{className:"promql-code promql-string",children:['"',vs(n.value),'"']}),"."]});case Ta.notEqual:return o.jsxs(Un.Item,{children:[o.jsx("span",{className:"promql-code promql-label-name",children:n.name}),o.jsx("span",{className:"promql-code promql-operator",children:n.type}),o.jsxs("span",{className:"promql-code promql-string",children:['"',vs(n.value),'"']}),": The label"," ",o.jsx("span",{className:"promql-code promql-label-name",children:n.name})," ","is not"," ",o.jsxs("span",{className:"promql-code promql-string",children:['"',vs(n.value),'"']}),"."]});case Ta.matchRegexp:return o.jsxs(Un.Item,{children:[o.jsx("span",{className:"promql-code promql-label-name",children:n.name}),o.jsx("span",{className:"promql-code promql-operator",children:n.type}),o.jsxs("span",{className:"promql-code promql-string",children:['"',vs(n.value),'"']}),": The label"," ",o.jsx("span",{className:"promql-code promql-label-name",children:n.name})," ","matches the regular expression"," ",o.jsxs("span",{className:"promql-code promql-string",children:['"',vs(n.value),'"']}),"."]});case Ta.matchNotRegexp:return o.jsxs(Un.Item,{children:[o.jsx("span",{className:"promql-code promql-label-name",children:n.name}),o.jsx("span",{className:"promql-code promql-operator",children:n.type}),o.jsxs("span",{className:"promql-code promql-string",children:['"',vs(n.value),'"']}),": The label"," ",o.jsx("span",{className:"promql-code promql-label-name",children:n.name})," ","does not match the regular expression"," ",o.jsxs("span",{className:"promql-code promql-string",children:['"',vs(n.value),'"']}),"."]});default:throw new Error("invalid matcher type")}})]}),NF=({node:t})=>{const e=t.name.replace(/(_count|_sum|_bucket|_total)$/,""),{lookbackDelta:n}=xr(),{data:i}=br({path:"/metadata",params:{metric:t.name}}),{data:r}=br({path:"/metadata",params:{metric:e}}),s=i.data[t.name]??r.data[e];return o.jsxs(Xi,{withBorder:!0,children:[o.jsxs(ft,{fz:"lg",fw:600,mb:"md",children:[t.type===St.vectorSelector?"Instant":"Range"," vector selector"]}),o.jsx(ft,{fz:"sm",children:s===void 0||s.length<1?o.jsx(o.Fragment,{children:"No metric metadata found."}):o.jsxs(o.Fragment,{children:[o.jsx("strong",{children:"Metric help"}),": ",s[0].help,o.jsx("br",{}),o.jsx("strong",{children:"Metric type"}),": ",s[0].type]})}),o.jsx(vg,{my:"md"}),o.jsxs(ft,{fz:"sm",children:[t.type===St.vectorSelector?o.jsxs(o.Fragment,{children:["This node ",t.smoothed?"smooths the value":"selects the latest"," ",t.anchored||t.smoothed?"":"non-stale ",!t.smoothed&&o.jsxs(o.Fragment,{children:["sample value within the last"," ",o.jsx("span",{className:"promql-code promql-duration",children:n})]}),t.smoothed&&o.jsxs(o.Fragment,{children:["using ",o.jsx("code",{children:"smoothed"})," mode (linear interpolation with nearest points within"," ",o.jsx("span",{className:"promql-code promql-duration",children:n})," ","before and after execution timestamp, ignoring staleness markers)"]})]}):o.jsxs(o.Fragment,{children:["This node looks back"," ",t.rangeExpr?o.jsxs(o.Fragment,{children:["a duration defined by"," ",o.jsx("span",{className:"promql-code",children:Pr(t.rangeExpr)})]}):o.jsx("span",{className:"promql-code",children:o.jsx("span",{className:"promql-duration",children:Gn(t.range)})})," ","from the evaluation timestamp",t.anchored&&o.jsxs(o.Fragment,{children:[" ","using ",o.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&&o.jsxs(o.Fragment,{children:[" ","using ",o.jsx("code",{children:"smoothed"})," mode (applies linear interpolation at the boundaries using nearest samples before and after boundaries, ignoring staleness markers)"]})]}),t.timestamp!==null?o.jsxs(o.Fragment,{children:[", evaluated relative to an absolute evaluation timestamp of"," ",o.jsx("span",{className:"promql-number",children:(t.timestamp/1e3).toFixed(3)})]}):t.startOrEnd!==null?o.jsxs(o.Fragment,{children:[", evaluated relative to the ",t.startOrEnd," of the query range"]}):o.jsx(o.Fragment,{}),t.offsetExpr?o.jsxs(o.Fragment,{children:[", time-shifted"," ",o.jsx("span",{className:"promql-code",children:Pr(t.offsetExpr)}),t.offset>0?" into the past":t.offset<0?" into the future":"",","]}):t.offset===0?o.jsx(o.Fragment,{}):t.offset>0?o.jsxs(o.Fragment,{children:[", time-shifted"," ",o.jsx("span",{className:"promql-code promql-duration",children:Gn(t.offset)})," ","into the past,"]}):o.jsxs(o.Fragment,{children:[", time-shifted"," ",o.jsx("span",{className:"promql-code promql-duration",children:Gn(-t.offset)})," ","into the future,"]})," ","for any series that match all of the following criteria:"]}),G_e(t.name,t.matchers),o.jsxs(ft,{fz:"sm",children:["If a series has no values in that window",(t.offsetExpr||t.offset>0)&&o.jsxs(o.Fragment,{children:[" ","(relative to the time-shifted instant"," ",o.jsx("span",{className:"promql-code",children:t.offsetExpr?Pr(t.offsetExpr):o.jsx("span",{className:"promql-duration",children:Gn(t.offset)})})," ","in the past)"]}),", the series will not be returned."]}),t.type===St.matrixSelector&&t.rangeExpr&&wv(t.rangeExpr),t.offsetExpr&&wv(t.offsetExpr)]})},fd=t=>{switch(t){case"+Inf":return 1/0;case"-Inf":return-1/0;default:return parseFloat(t)}},Sv=t=>{switch(t){case 1/0:return"+Inf";case-1/0:return"-Inf";default:return t.toString()}},X_e=(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 o.jsxs(o.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 ",wo([e.val])," ","label)"]});case"bottomk":return e===null||e.type!=="numberLiteral"?o.jsxs(o.Fragment,{children:["returns the bottom"," ",o.jsx("span",{className:"promql-code promql-number",children:"K"})," series by value"]}):o.jsxs(o.Fragment,{children:["returns the bottom"," ",o.jsx("span",{className:"promql-code promql-number",children:e.val})," series by value"]});case"topk":return e===null||e.type!=="numberLiteral"?o.jsxs(o.Fragment,{children:["returns the top ",o.jsx("span",{className:"promql-code promql-number",children:"K"})," ","series by value"]}):o.jsxs(o.Fragment,{children:["returns the top"," ",o.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 (${fd(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"?o.jsxs(o.Fragment,{children:["limits the output to"," ",o.jsx("span",{className:"promql-code promql-number",children:"K"})," series"]}):o.jsxs(o.Fragment,{children:["limits the output to"," ",o.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":o.jsxs(o.Fragment,{children:["limits the output to a ratio of"," ",o.jsx("span",{className:"promql-code promql-number",children:e.val})," (",fd(e.val)*100,"%) of the input series"]});default:throw new Error(`invalid aggregation type ${t}`)}},K_e=(t,e)=>e?o.jsxs(o.Fragment,{children:["aggregating away the [",wo(t),"] label dimensions"]}):t.length===1?o.jsxs(o.Fragment,{children:["grouped by their ",wo(t)," label dimension"]}):t.length>1?o.jsxs(o.Fragment,{children:["grouped by their [",wo(t),"] label dimensions"]}):"aggregating away any label dimensions",Z_e=({node:t})=>o.jsxs(Xi,{withBorder:!0,children:[o.jsx(ft,{fz:"lg",fw:600,mb:"md",children:"Aggregation"}),o.jsxs(ft,{fz:"sm",children:["This node ",X_e(t.op,t.param),","," ",K_e(t.grouping,t.without),"."]})]}),sG="filtered";var av=(t=>(t.multipleMatchesForOneToOneMatching="multipleMatchesForOneToOneMatching",t.multipleMatchesOnBothSides="multipleMatchesOnBothSides",t.multipleMatchesOnOneSide="multipleMatchesOnOneSide",t))(av||{});const IF=16777619,J_e=2166136261,eke=55296,BF=t=>{let e=J_e;for(let n=0;n<t.length;n++){if(t[n]!==void 0)for(let i=0;i<t[n].length;i++)e^=t[n].charCodeAt(i),e*=IF;n<t.length-1&&(e^=eke,e*=IF)}return e.toString()},tke=(t,e)=>(e.sort(),t?n=>BF(e.map(i=>n[i])):n=>BF(Object.keys(n).filter(i=>!e.includes(i)&&i!=="__name__").map(i=>n[i]))),LF=(t,e,n)=>{const i={};for(const r in t)n.includes(r)===e&&(e||r!=="__name__")&&(i[r]=t[r]);return i},nke=(t,e,n)=>{const{value:i,keep:r}=Ew(t,e,n);return KD(t)?Number(r):i},Ew=(t,e,n)=>{switch(t){case sn.add:return{value:e+n,keep:!0};case sn.sub:return{value:e-n,keep:!0};case sn.mul:return{value:e*n,keep:!0};case sn.div:return{value:e/n,keep:!0};case sn.pow:return{value:Math.pow(e,n),keep:!0};case sn.mod:return{value:e%n,keep:!0};case sn.eql:return{value:e,keep:e===n};case sn.neq:return{value:e,keep:e!==n};case sn.gtr:return{value:e,keep:e>n};case sn.lss:return{value:e,keep:e<n};case sn.gte:return{value:e,keep:e>=n};case sn.lte:return{value:e,keep:e<=n};case sn.atan2:return{value:Math.atan2(e,n),keep:!0};default:throw new Error("invalid binop")}},ike=t=>[sn.add,sn.sub,sn.mul,sn.div,sn.pow,sn.mod,sn.atan2].includes(t),rke=(t,e,n,i)=>{const r={};for(const s in t)r[s]=t[s];if(ike(n)&&delete r.__name__,i.card===Li.oneToOne)if(i.on)for(const s in r)i.labels.includes(s)||delete r[s];else for(const s of i.labels)delete r[s];return i.include.forEach(s=>{s in e?r[s]=e[s]:delete r[s]}),r},ske=(t,e,n,i,r,s)=>{[i,r]=e.card===Li.oneToMany?[r,i]:[i,r];const a={},l=tke(e.on,e.labels),u=new Set;return r.forEach(d=>{const f=l(d.metric);if(!(f in a)){if(s!=null&&s.maxGroups&&Object.keys(a).length>=s.maxGroups){u.add(f);return}a[f]={groupLabels:LF(d.metric,e.on,e.labels),lhs:[],lhsCount:0,rhs:[],rhsCount:0,result:[],error:null}}(!(s!=null&&s.maxSeriesPerGroup)||a[f].rhsCount<s.maxSeriesPerGroup)&&a[f].rhs.push(d),a[f].rhsCount++}),i.forEach(d=>{const f=l(d.metric);if(!(f in a)){if(s!=null&&s.maxGroups&&Object.keys(a).length>=s.maxGroups){u.add(f);return}a[f]={groupLabels:LF(d.metric,e.on,e.labels),lhs:[],lhsCount:0,rhs:[],rhsCount:0,result:[],error:null}}(!(s!=null&&s.maxSeriesPerGroup)||a[f].lhsCount<s.maxSeriesPerGroup)&&a[f].lhs.push(d),a[f].lhsCount++}),Object.values(a).forEach(d=>{d.lhs.length===0&&e.fillValues.lhs!==null&&(d.lhs.push({metric:d.groupLabels,value:[0,Sv(e.fillValues.lhs)],filled:!0}),d.lhsCount=1),d.rhs.length===0&&e.fillValues.rhs!==null&&(d.rhs.push({metric:d.groupLabels,value:[0,Sv(e.fillValues.rhs)],filled:!0}),d.rhsCount=1)}),Object.values(a).forEach(d=>{switch(e.card){case Li.oneToOne:d.lhs.length>1&&d.rhs.length>1?d.error={type:"multipleMatchesOnBothSides"}:(d.lhs.length>1||d.rhs.length>1)&&(d.error={type:"multipleMatchesForOneToOneMatching",dupeSide:d.lhs.length>1?"left":"right"});break;case Li.oneToMany:case Li.manyToOne:d.rhs.length>1&&(d.error={type:"multipleMatchesOnOneSide"});break;case Li.manyToMany:if(!AE(t))throw new Error("unexpected many-to-many matching for non-set operator");break;default:throw new Error("unknown vector matching cardinality")}d.error||(AE(t)?(d.lhs.forEach((f,p)=>{(t===sn.and&&d.rhs.length>0||t===sn.unless&&d.rhs.length===0||t===sn.or)&&d.result.push({sample:{metric:f.metric,value:f.value},manySideIdx:p})}),t===sn.or&&d.rhs.forEach((f,p)=>{d.lhs.length===0&&d.result.push({sample:{metric:f.metric,value:f.value},manySideIdx:p})})):d.rhs.forEach(f=>{d.lhs.forEach((p,m)=>{if(!p.value||!f.value)throw new Error("native histogram support not implemented yet");const[v,y]=e.card!==Li.oneToMany?[p.value[1],f.value[1]]:[f.value[1],p.value[1]];let{value:b,keep:A}=Ew(t,fd(v),fd(y));const w=rke(p.metric,f.metric,t,e);n&&(b=A?1:0,delete w.__name__),d.result.push({sample:{metric:w,value:[p.value[0],A||n?Sv(b):sG]},manySideIdx:m})})}))}),e.card===Li.oneToMany&&Object.keys(a).forEach(d=>{[a[d].lhs,a[d].rhs]=[a[d].rhs,a[d].lhs],[a[d].lhsCount,a[d].rhsCount]=[a[d].rhsCount,a[d].lhsCount]}),{groups:a,numGroups:Object.keys(a).length+u.size}},PF=({node:t,scalar:e,vector:n,scalarLeft:i})=>n.length===0?o.jsx(Pt,{children:"One side of the binary operation produces 0 results, no matching information shown."}):o.jsxs(le,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,fz:"xs",children:[o.jsx(le.Thead,{children:o.jsxs(le.Tr,{children:[!i&&o.jsx(le.Th,{children:"Left labels"}),o.jsx(le.Th,{children:"Left value"}),o.jsx(le.Th,{children:"Operator"}),i&&o.jsx(le.Th,{children:"Right labels"}),o.jsx(le.Th,{children:"Right value"}),o.jsx(le.Th,{}),o.jsx(le.Th,{children:"Result"})]})}),o.jsx(le.Tbody,{children:n.map((r,s)=>{if(!r.value)throw new Error("Native histograms are not supported yet");const a=fd(r.value[1]),l=fd(e[1]);let{value:u,keep:d}=i?Ew(t.op,l,a):Ew(t.op,a,l);KD(t.op)&&i&&(u=a),t.bool&&(u=Number(d),d=!0);const f=o.jsx(le.Td,{ta:"right",children:e[1]}),p=o.jsxs(o.Fragment,{children:[o.jsx(le.Td,{children:o.jsx(ym,{labels:r.metric,format:!0})}),o.jsx(le.Td,{ta:"right",children:r.value[1]})]});return o.jsxs(le.Tr,{children:[i?f:p,o.jsxs(le.Td,{ta:"center",children:[t.op,t.bool&&" bool"]}),i?p:f,o.jsx(le.Td,{ta:"center",children:"="}),o.jsx(le.Td,{ta:"right",children:d?Sv(u):o.jsx(ft,{c:"dimmed",children:"dropped"})})]},s)})})]}),ly=["#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"],FF=ly.length/2+3,nO=(t,e)=>`${ly[(t+(e||0))%ly.length]}80`,iO=t=>o.jsx(xe,{display:"inline-block",w:12,h:12,bg:t,style:{borderRadius:2,flexShrink:0}}),oke=(t,e,n)=>{const i={};for(const r in t)n.includes(r)===e&&(e||r!=="__name__")||(i[r]=t[r]);return i},ake=t=>{const e=t.matching,[n,i]=e.card===Li.oneToMany?["left","right"]:["right","left"];return o.jsxs(o.Fragment,{children:[o.jsx(ft,{size:"sm",children:KD(t.op)?o.jsxs(o.Fragment,{children:['This node filters the series from the left-hand side based on the result of a "',o.jsx("span",{className:"promql-code promql-operator",children:t.op}),'" comparison with matching series from the right-hand side.']}):o.jsxs(o.Fragment,{children:['This node calculates the result of applying the "',o.jsx("span",{className:"promql-code promql-operator",children:t.op}),'" operator between the sample values of matching series from two sets of time series.']})}),o.jsxs(Un,{my:"md",fz:"sm",withPadding:!0,children:[(e.labels.length>0||e.on)&&(e.on?o.jsxs(Un.Item,{children:[o.jsx("span",{className:"promql-code promql-keyword",children:"on"}),"(",wo(e.labels),"):"," ",e.labels.length>0?o.jsxs(o.Fragment,{children:["series on both sides are matched on the labels"," ",wo(e.labels)]}):o.jsx(o.Fragment,{children:"all series from one side are matched to all series on the other side."})]}):o.jsxs(Un.Item,{children:[o.jsx("span",{className:"promql-code promql-keyword",children:"ignoring"}),"(",wo(e.labels),"): series on both sides are matched on all of their labels, except"," ",wo(e.labels),"."]})),e.card===Li.oneToOne?o.jsx(Un.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."}):o.jsxs(Un.Item,{children:[o.jsxs("span",{className:"promql-code promql-keyword",children:["group_",i]}),"(",wo(e.include),") : ",e.card," match. Each series from the ",n,"-hand side is allowed to match with multiple series from the ",i,"-hand side.",e.include.length!==0&&o.jsxs(o.Fragment,{children:[" ","Any ",wo(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?o.jsxs(Un.Item,{children:[o.jsx("span",{className:"promql-code promql-keyword",children:"fill"}),"(",o.jsx("span",{className:"promql-code promql-number",children:e.fillValues.lhs}),") : For series on either side missing a match, fill in the sample value"," ",o.jsx("span",{className:"promql-code promql-number",children:e.fillValues.lhs}),"."]}):o.jsxs(o.Fragment,{children:[e.fillValues.lhs!==null&&o.jsxs(Un.Item,{children:[o.jsx("span",{className:"promql-code promql-keyword",children:"fill_left"}),"(",o.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"," ",o.jsx("span",{className:"promql-code promql-number",children:e.fillValues.lhs}),"."]}),e.fillValues.rhs!==null&&o.jsxs(Un.Item,{children:[o.jsx("span",{className:"promql-code promql-keyword",children:"fill_right"}),"(",o.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"," ",o.jsx("span",{className:"promql-code promql-number",children:e.fillValues.rhs}),"."]})]})),t.bool&&o.jsxs(Un.Item,{children:[o.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 ",o.jsx("span",{className:"promql-code promql-number",children:"0"})," or"," ",o.jsx("span",{className:"promql-code promql-number",children:"1"})," sample value."]})]})]})},lke=(t,e,n)=>{const i=o.jsxs(o.Fragment,{children:[o.jsx(ft,{size:"sm",children:o.jsx("strong",{children:"Possible fixes:"})}),o.jsxs(Un,{withPadding:!0,my:"md",fz:"sm",children:[n.type===av.multipleMatchesForOneToOneMatching&&o.jsxs(Un.Item,{children:[o.jsxs(ft,{size:"sm",children:[o.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"," ",o.jsxs("span",{className:"promql-code promql-keyword",children:["group_",n.dupeSide,"()"]})," ","modifier to the operator:"]}),o.jsx(ft,{size:"sm",ta:"center",my:"md",children:Ya({...t,matching:{...t.matching?t.matching:{labels:[],on:!1,include:[],fillValues:{lhs:null,rhs:null}},card:n.dupeSide==="left"?Li.manyToOne:Li.oneToMany}},!0,1)})]}),o.jsxs(Un.Item,{children:[o.jsx("strong",{children:"Update your matching parameters:"})," Consider including more differentiating labels in your matching modifiers (via"," ",o.jsx("span",{className:"promql-code promql-keyword",children:"on()"})," /"," ",o.jsx("span",{className:"promql-code promql-keyword",children:"ignoring()"}),") to split multiple series into distinct match groups."]}),o.jsxs(Un.Item,{children:[o.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 av.multipleMatchesForOneToOneMatching:return o.jsxs(o.Fragment,{children:[o.jsxs(ft,{size:"sm",children:["Binary operators only allow ",o.jsx("strong",{children:"one-to-one"})," matching by default, but we found"," ",o.jsxs("strong",{children:["multiple series on the ",n.dupeSide," side"]})," for this match group."]}),i]});case av.multipleMatchesOnBothSides:return o.jsxs(o.Fragment,{children:[o.jsxs(ft,{size:"sm",children:["We found ",o.jsx("strong",{children:"multiple series on both sides"})," for this match group. Since ",o.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."]}),i]});case av.multipleMatchesOnOneSide:{const[r,s]=t.matching.card===Li.oneToMany?["left","right"]:["right","left"];return o.jsxs(o.Fragment,{children:[o.jsxs(ft,{size:"sm",children:["You requested"," ",o.jsxs("strong",{children:[r==="right"?"many-to-one":"one-to-many"," matching"]})," ","via"," ",o.jsxs("span",{className:"promql-code promql-keyword",children:["group_",s,"()"]}),", but we also found"," ",o.jsxs("strong",{children:["multiple series on the ",r," side"]})," of the match group. Make sure that the ",r," side only contains a single series."]}),i]})}default:throw new Error("unknown match error")}},cke=({node:t,lhs:e,rhs:n})=>{const[i,r]=by({key:"queryPage.explain.binaryOperators.showSampleValues",defaultValue:!1}),[s,a]=T.useState(100),[l,u]=T.useState(100),{matching:d}=t;if(d===null)throw new Error("missing matching parameters in vector-to-vector binop");const{groups:f,numGroups:p}=ske(t.op,d,t.bool,e,n,{maxGroups:s,maxSeriesPerGroup:l}),m=Object.values(f).filter(v=>v.error).length;return o.jsxs(o.Fragment,{children:[o.jsx(ft,{size:"sm",children:ake(t)}),o.jsx(pt,{my:"lg",justify:"flex-end",gap:"xl",children:o.jsx(Hy,{label:"Show sample values",checked:i,onChange:v=>r(v.currentTarget.checked)})}),p>Object.keys(f).length&&o.jsxs(Pt,{color:"yellow",mb:"md",icon:o.jsx(Fr,{}),children:["Too many match groups to display, only showing"," ",Object.keys(f).length," out of ",p," groups.",o.jsx("br",{}),o.jsx("br",{}),o.jsx(Zi,{fz:"sm",onClick:()=>a(void 0),children:"Show all groups"})]}),m>0&&o.jsxs(Pt,{color:"yellow",mb:"md",icon:o.jsx(Fr,{}),children:["Found matching issues in ",m," match group",m>1?"s":"",". See below for per-group error details."]}),o.jsx(le,{fz:"xs",withRowBorders:!1,children:o.jsx(le.Tbody,{children:Object.values(f).map((v,y)=>{const{groupLabels:b,lhs:A,lhsCount:w,rhs:S,rhsCount:j,result:C,error:k}=v,E=Q=>o.jsx(le.Tr,{ta:"center",children:o.jsx(le.Td,{colSpan:2,style:{backgroundColor:`${Q}25`},children:o.jsx(ym,{labels:b,format:!0})})}),M=(Q,G,L,q)=>o.jsx(xe,{style:{borderRadius:3,border:"2px solid",borderColor:G===0?"light-dark(var(--mantine-color-gray-4), var(--mantine-color-gray-7))":L},children:o.jsx(le,{fz:"xs",withRowBorders:!1,verticalSpacing:5,children:o.jsxs(le.Tbody,{children:[G===0?o.jsx(le.Tr,{children:o.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"})}):o.jsxs(o.Fragment,{children:[E(L),Q.map((N,P)=>{if(N.value===void 0)throw new Error("Native histograms are not supported yet");return o.jsxs(le.Tr,{children:[o.jsx(le.Td,{children:o.jsxs(pt,{wrap:"nowrap",gap:7,align:"center",children:[iO(nO(P,q)),o.jsx(ym,{labels:oke(N.metric,d.on,d.labels),format:!0}),N.filled&&o.jsx(ft,{size:"sm",c:"dimmed",children:"no match, filling in default value"})]})}),i&&o.jsx(le.Td,{ta:"right",children:N.value[1]})]},P)})]}),G>Q.length&&o.jsx(le.Tr,{children:o.jsxs(le.Td,{ta:"center",py:"md",fw:"bold",c:"gray.6",children:[G-Q.length," more series omitted   –  ",o.jsx(Zi,{size:"xs",onClick:()=>u(void 0),children:"Show all series"})]})})]})})}),R=ly[y%ly.length],D=M(A,w,R),F=M(S,j,R,FF),I=o.jsx(xe,{style:{borderRadius:3,border:"2px solid",borderColor:C.length===0||k!==null?"light-dark(var(--mantine-color-gray-4), var(--mantine-color-gray-7))":R},children:o.jsx(le,{fz:"xs",withRowBorders:!1,verticalSpacing:5,children:o.jsx(le.Tbody,{children:k!==null?o.jsx(le.Tr,{children:o.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"})}):C.length===0?o.jsx(le.Tr,{children:o.jsx(le.Td,{ta:"center",c:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-gray-5))",py:"md",fw:"bold",children:"dropped"})}):k!==null?o.jsx(le.Tr,{children:o.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"})}):o.jsx(o.Fragment,{children:C.map(({sample:Q,manySideIdx:G},L)=>{if(Q.value===void 0)throw new Error("Native histograms are not supported yet");const q=Q.value[1]===sG,[N,P]=d.card===Li.oneToMany?[0,G]:[G,0];return o.jsxs(le.Tr,{children:[o.jsx(le.Td,{style:{opacity:q?.5:1},title:q?"Series has been filtered by comparison operator":void 0,children:o.jsxs(pt,{wrap:"nowrap",gap:"xs",align:"flex-start",children:[o.jsxs(pt,{wrap:"nowrap",gap:0,children:[iO(nO(N)),o.jsx("span",{style:{color:"#aaa"},children:"–"}),iO(nO(P,FF))]}),o.jsx(ym,{labels:Q.metric,format:!0})]})}),i&&o.jsx(le.Td,{ta:"right",children:q?o.jsx("span",{style:{color:"grey"},children:"filtered"}):o.jsx("span",{children:Q.value[1]})})]},L)})})})})});return o.jsxs(Vn.Fragment,{children:[y!==0&&o.jsx("tr",{style:{height:30}}),o.jsx(le.Tr,{children:o.jsx(le.Td,{colSpan:5,children:k&&o.jsx(Pt,{color:"red",mb:"md",title:"Error in match group below",icon:o.jsx(Fr,{}),children:lke(t,v,k)})})}),o.jsxs(le.Tr,{children:[o.jsx(le.Td,{valign:"middle",p:0,children:D}),o.jsxs(le.Td,{ta:"center",fw:AE(t.op)?"bold":void 0,children:[t.op,t.bool&&" bool"]}),o.jsx(le.Td,{valign:"middle",p:0,children:F}),o.jsx(le.Td,{ta:"center",children:"="}),o.jsx(le.Td,{valign:"middle",p:0,children:I})]})]},y)})})})]})},uke=({node:t,lhs:e,rhs:n})=>{const[i,r]=[fd(e[1]),fd(n[1])];return o.jsxs(le,{withColumnBorders:!0,withTableBorder:!0,children:[o.jsx(le.Thead,{children:o.jsxs(le.Tr,{children:[o.jsx(le.Th,{children:"Left value"}),o.jsx(le.Th,{children:"Operator"}),o.jsx(le.Th,{children:"Right value"}),o.jsx(le.Th,{}),o.jsx(le.Th,{children:"Result"})]})}),o.jsx(le.Tbody,{children:o.jsxs(le.Tr,{children:[o.jsx(le.Td,{className:"number-cell",children:e[1]}),o.jsxs(le.Td,{className:"op-cell",children:[t.op,t.bool&&" bool"]}),o.jsx(le.Td,{className:"number-cell",children:n[1]}),o.jsx(le.Td,{className:"op-cell",children:"="}),o.jsx(le.Td,{className:"number-cell",children:Sv(nke(t.op,i,r))})]})})]})},hke=({node:t})=>{const{data:e}=br({path:"/query",params:{query:gs(t.lhs)}}),{data:n}=br({path:"/query",params:{query:gs(t.rhs)}});if(e.data.resultType!==Kp(t.lhs)||n.data.resultType!==Kp(t.rhs))return null;if(e.data.resultType==="scalar"&&n.data.resultType==="scalar")return o.jsxs(Xi,{withBorder:!0,children:[o.jsx(ft,{fz:"lg",fw:600,mb:"md",children:"Scalar-to-scalar binary operation"}),o.jsx(uke,{node:t,lhs:e.data.result,rhs:n.data.result})]});if(e.data.resultType==="scalar"&&n.data.resultType==="vector")return o.jsxs(Xi,{withBorder:!0,children:[o.jsx(ft,{fz:"lg",fw:600,mb:"md",children:"Scalar-to-vector binary operation"}),o.jsx(PF,{node:t,vector:n.data.result,scalar:e.data.result,scalarLeft:!0})]});if(e.data.resultType==="vector"&&n.data.resultType==="scalar")return o.jsxs(Xi,{withBorder:!0,children:[o.jsx(ft,{fz:"lg",fw:600,mb:"md",children:"Vector-to-scalar binary operation"}),o.jsx(PF,{node:t,scalar:n.data.result,vector:e.data.result,scalarLeft:!1})]});if(e.data.resultType==="vector"&&n.data.resultType==="vector")return o.jsxs(Xi,{withBorder:!0,children:[o.jsx(ft,{fz:"lg",fw:600,mb:"md",children:"Vector-to-vector binary operation"}),o.jsx(cke,{node:t,lhs:e.data.result,rhs:n.data.result})]});throw new Error("invalid binary operator argument types")},dke=({node:t,treeShown:e,showTree:n})=>{if(t===null)return o.jsxs(Pt,{title:"How to use the Explain view",icon:o.jsx(oi,{}),children:["This tab can help you understand the behavior of individual components of a query.",o.jsx("br",{}),o.jsx("br",{}),"To use the Explain view,"," ",!e&&o.jsxs(o.Fragment,{children:[o.jsx(Zi,{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 St.aggregation:return o.jsx(Z_e,{node:t});case St.binaryExpr:return o.jsx(hke,{node:t});case St.call:return o.jsxs(Xi,{withBorder:!0,children:[o.jsx(ft,{fz:"lg",fw:600,mb:"md",children:"Function call"}),o.jsxs(ft,{fz:"sm",children:["This node calls the"," ",o.jsx(Zi,{fz:"inherit",href:`https://prometheus.io/docs/prometheus/latest/querying/functions/#${t.func.name}`,target:"_blank",children:o.jsxs("span",{className:"promql-code promql-keyword",children:[t.func.name,"()"]})})," ","function",t.args.length>0?" on the provided inputs":"","."]}),o.jsx(vg,{my:"md"}),o.jsx(ft,{fz:"sm",className:V_e.funcDoc,children:W_e[t.func.name]})]});case St.matrixSelector:return o.jsx(NF,{node:t});case St.subquery:return o.jsxs(Xi,{withBorder:!0,children:[o.jsx(ft,{fz:"lg",fw:600,mb:"md",children:"Subquery"}),o.jsxs(ft,{fz:"sm",children:["This node evaluates the passed expression as a subquery over"," ",t.rangeExpr?o.jsxs(o.Fragment,{children:["a duration defined by"," ",o.jsx("span",{className:"promql-code",children:Pr(t.rangeExpr)})]}):o.jsxs(o.Fragment,{children:["the last"," ",o.jsx("span",{className:"promql-code",children:o.jsx("span",{className:"promql-duration",children:Gn(t.range)})})]})," ","at a query resolution"," ",t.stepExpr?o.jsxs(o.Fragment,{children:["of"," ",o.jsx("span",{className:"promql-code",children:Pr(t.stepExpr)})]}):t.step>0?o.jsxs(o.Fragment,{children:["of"," ",o.jsx("span",{className:"promql-code promql-duration",children:Gn(t.step)})]}):"equal to the default rule evaluation interval",t.timestamp!==null?o.jsxs(o.Fragment,{children:[", evaluated relative to an absolute evaluation timestamp of"," ",o.jsx("span",{className:"promql-number",children:(t.timestamp/1e3).toFixed(3)})]}):t.startOrEnd!==null?o.jsxs(o.Fragment,{children:[", evaluated relative to the ",t.startOrEnd," of the query range"]}):o.jsx(o.Fragment,{}),t.offsetExpr?o.jsxs(o.Fragment,{children:[", time-shifted"," ",o.jsx("span",{className:"promql-code",children:Pr(t.offsetExpr)}),t.offset>0?" into the past":t.offset<0?" into the future":""]}):t.offset===0?o.jsx(o.Fragment,{}):t.offset>0?o.jsxs(o.Fragment,{children:[", time-shifted"," ",o.jsx("span",{className:"promql-code promql-duration",children:Gn(t.offset)})," ","into the past"]}):o.jsxs(o.Fragment,{children:[", time-shifted"," ",o.jsx("span",{className:"promql-code promql-duration",children:Gn(-t.offset)})," ","into the future"]}),"."]}),t.rangeExpr&&wv(t.rangeExpr),t.stepExpr&&wv(t.stepExpr),t.offsetExpr&&wv(t.offsetExpr)]});case St.numberLiteral:return o.jsxs(Xi,{withBorder:!0,children:[o.jsx(ft,{fz:"lg",fw:600,mb:"md",children:"Number literal"}),o.jsxs(ft,{fz:"sm",children:["A scalar number literal with the value"," ",o.jsx("span",{className:"promql-code promql-number",children:t.val}),"."]})]});case St.parenExpr:return o.jsxs(Xi,{withBorder:!0,children:[o.jsx(ft,{fz:"lg",fw:600,mb:"md",children:"Parentheses"}),o.jsx(ft,{fz:"sm",children:"Parentheses that contain a sub-expression to be evaluated."})]});case St.stringLiteral:return o.jsxs(Xi,{withBorder:!0,children:[o.jsx(ft,{fz:"lg",fw:600,mb:"md",children:"String literal"}),o.jsxs(ft,{fz:"sm",children:["A string literal with the value"," ",o.jsxs("span",{className:"promql-code promql-string",children:['"',vs(t.val),'"']}),"."]})]});case St.unaryExpr:return o.jsxs(Xi,{withBorder:!0,children:[o.jsx(ft,{fz:"lg",fw:600,mb:"md",children:"Unary expression"}),o.jsxs(ft,{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 St.vectorSelector:return o.jsx(NF,{node:t});default:throw new Error("invalid node type")}},q0={width:"0.9rem",height:"0.9rem"},fke=({idx:t,metricNames:e})=>{const[n,i]=T.useState(0),r=bc(f=>f.queryPage.panels[t]),s=Tu(),[a,l]=T.useState(null),u=T.useMemo(()=>a!==null?gs(a.node):r.expr,[a,r.expr]),d=T.useCallback((f,p)=>s(gh({idx:t,visualizer:{...r.visualizer,range:(p-f)*1e3,endTime:p*1e3}})),[s,t,r.visualizer]);return o.jsxs(Mn,{gap:"lg",children:[o.jsx($Se,{initialExpr:r.expr,metricNames:e,executeQuery:f=>{i(p=>p+1),s(Jue({idx:t,expr:f})),!e.includes(f)&&f.trim()!==""&&s(Gq(f))},treeShown:r.showTree,setShowTree:f=>{s(Tk({idx:t,showTree:f})),f||l(null)},duplicatePanel:f=>{s(Zue({idx:t,expr:f}))},removePanel:()=>{s(Kue(t))}}),r.expr.trim()!==""&&r.showTree&&o.jsx(Hf,{title:"Error showing tree view",children:o.jsx(T.Suspense,{fallback:o.jsx(xe,{mt:"lg",children:Array.from(Array(20),(f,p)=>o.jsx(ta,{height:30,mb:15,width:"100%"},p))}),children:o.jsx(Y_e,{panelIdx:t,selectedNode:a,setSelectedNode:l,closeTreeView:()=>{s(Tk({idx:t,showTree:!1})),l(null)}})})},n),o.jsxs(vo,{value:r.visualizer.activeTab,onChange:f=>s(gh({idx:t,visualizer:{...r.visualizer,activeTab:f}})),keepMounted:!1,children:[o.jsxs(vo.List,{children:[o.jsx(vo.Tab,{value:"table",leftSection:o.jsx(I9,{style:q0}),children:"Table"}),o.jsx(vo.Tab,{value:"graph",leftSection:o.jsx(Zse,{style:q0}),children:"Graph"}),o.jsx(vo.Tab,{value:"explain",leftSection:o.jsx(oi,{style:q0}),children:"Explain"})]}),o.jsx(vo.Panel,{pt:"sm",value:"table",children:o.jsx(P_e,{expr:u,panelIdx:t,retriggerIdx:n})}),o.jsxs(vo.Panel,{pt:"sm",value:"graph",children:[o.jsxs(pt,{mt:"xs",justify:"space-between",children:[o.jsxs(pt,{children:[o.jsx(ude,{range:r.visualizer.range,onChangeRange:f=>s(gh({idx:t,visualizer:{...r.visualizer,range:f}}))}),o.jsx(E7,{time:r.visualizer.endTime,range:r.visualizer.range,description:"End time",onChangeTime:f=>s(gh({idx:t,visualizer:{...r.visualizer,endTime:f}}))}),o.jsx(e_e,{resolution:r.visualizer.resolution,range:r.visualizer.range,onChangeResolution:f=>{s(gh({idx:t,visualizer:{...r.visualizer,resolution:f}}))}})]}),o.jsxs(pt,{gap:"lg",children:[o.jsx(Sg,{onChange:f=>s(gh({idx:t,visualizer:{...r.visualizer,displayMode:f}})),value:r.visualizer.displayMode,data:[{value:Gm.Lines,label:o.jsxs(Ov,{fw:500,children:[o.jsx(jse,{style:q0}),o.jsx(xe,{ml:10,children:"Unstacked"})]})},{value:Gm.Stacked,label:o.jsxs(Ov,{fw:500,children:[o.jsx(Voe,{style:q0}),o.jsx(xe,{ml:10,children:"Stacked"})]})}]}),o.jsxs(En,{position:"bottom",withArrow:!0,shadow:"md",children:[o.jsx(En.Target,{children:o.jsx(mi,{variant:"light",color:"gray",size:32,title:"Graph settings",children:o.jsx(ase,{style:Au,stroke:1.5})})}),o.jsx(En.Dropdown,{p:"lg",children:o.jsx(Vs,{size:"xs",checked:r.visualizer.yAxisMin!==null,label:"Start Y axis at 0",onChange:f=>s(gh({idx:t,visualizer:{...r.visualizer,yAxisMin:f.currentTarget.checked?0:null}}))})})]})]})]}),o.jsx(f9,{h:"lg"}),o.jsx(JCe,{expr:u,node:(a==null?void 0:a.node)??null,endTime:r.visualizer.endTime,range:r.visualizer.range,resolution:r.visualizer.resolution,showExemplars:r.visualizer.showExemplars,displayMode:r.visualizer.displayMode,yAxisMin:r.visualizer.yAxisMin,retriggerIdx:n,onSelectRange:d})]}),o.jsx(vo.Panel,{pt:"sm",value:"explain",children:o.jsx(Hf,{title:"Error showing explain view",children:o.jsx(T.Suspense,{fallback:o.jsx(xe,{mt:"lg",children:Array.from(Array(20),(f,p)=>o.jsx(ta,{height:30,mb:15,width:"100%"},p))}),children:o.jsx(dke,{node:(a==null?void 0:a.node)??null,treeShown:r.showTree,showTree:()=>{s(Tk({idx:t,showTree:!0}))}})})},a==null?void 0:a.id)})]})]})};function oG(){const t=bc(u=>u.queryPage.panels),e=Tu(),[n,i]=T.useState(0);T.useEffect(()=>{const u=()=>{const d=Uue(window.location.search);d.length>0&&e(AL(d))};return u(),window.addEventListener("popstate",u),()=>{window.removeEventListener("popstate",u)}},[e]),T.useEffect(()=>()=>{e(AL([YS()]))},[e]);const{data:r,error:s}=ud({path:"/label/__name__/values"}),{data:a,error:l}=ud({path:"/query",params:{query:"time()"}});return T.useEffect(()=>{if(!a)return;if(a.data.resultType!=="scalar")throw new Error("Unexpected result type from time query");const u=new Date().getTime()/1e3,d=a.data.result[0];i(Math.abs(u-d))},[a]),o.jsxs(xe,{mt:"xs",children:[s&&o.jsxs(Pt,{mb:"sm",icon:o.jsx(Fr,{}),color:"red",title:"Error fetching metrics list",children:["Unable to fetch list of metric names: ",s.message]}),l&&o.jsx(Pt,{mb:"sm",icon:o.jsx(Fr,{}),color:"red",title:"Error fetching server time",children:l.message}),n>30&&o.jsxs(Pt,{mb:"sm",title:"Server time is out of sync",color:"red",icon:o.jsx(cse,{}),onClose:()=>i(0),children:["Detected a time difference of"," ",o.jsx("strong",{children:im(n*1e3)})," between your browser and the server. You may see unexpected time-shifted query results due to the time drift."]}),o.jsx(Mn,{gap:"xl",children:t.map((u,d)=>o.jsx(fke,{idx:d,metricNames:(r==null?void 0:r.data)||[]},u.id))}),o.jsx(Lr,{variant:"light",mt:"xl",leftSection:o.jsx(R9,{style:iv}),onClick:()=>e(Xue()),children:"Add query"})]})}const pke="_statsBadge_w76va_1",mke="_labelBadge_w76va_9",gke="_healthOk_w76va_35",vke="_healthErr_w76va_43",yke="_healthWarn_w76va_51",xke="_healthInfo_w76va_62",bke="_healthUnknown_w76va_70",wn={statsBadge:pke,labelBadge:mke,healthOk:gke,healthErr:vke,healthWarn:yke,healthInfo:xke,healthUnknown:bke},Ake="_panelHealthOk_p1xoy_1",wke="_panelHealthErr_p1xoy_6",Ske="_panelHealthWarn_p1xoy_11",jke="_panelHealthUnknown_p1xoy_16",Qh={panelHealthOk:Ake,panelHealthErr:wke,panelHealthWarn:Ske,panelHealthUnknown:jke},Cke="_codebox_12gal_1",_ke="_queryButton_12gal_8",$F={codebox:Cke,queryButton:_ke},ug=({labels:t,wrapper:e=pt,style:n})=>o.jsx(e,{gap:"xs",children:Object.entries(t).map(([i,r])=>o.jsxs("span",{className:wn.labelBadge,style:n,children:[hd(i),'="',Kh(r),'"']},i))}),kke=new wW,aG=({rule:t})=>{const e=Lw(),{pathPrefix:n}=xr();return o.jsxs(o.Fragment,{children:[o.jsxs(Xi,{p:"xs",className:$F.codebox,fz:"sm",shadow:"none",children:[o.jsx(BD,{basicSetup:!1,value:t.query,editable:!1,extensions:[mU,gU,gj(e==="light"?vU:yU),kke.asExtension(),ut.lineWrapping]}),o.jsx(Gi,{label:"Query rule expression",withArrow:!0,position:"top",children:o.jsx(mi,{pos:"absolute",top:7,right:7,variant:"light",onClick:()=>{window.open(`${n}/query?g0.expr=${encodeURIComponent(t.query)}&g0.tab=1`,"_blank")},className:$F.queryButton,children:o.jsx(yd,{style:Au})})})]}),t.type==="alerting"&&o.jsxs(pt,{mt:"lg",gap:"xs",children:[t.duration&&o.jsxs(Hi,{variant:"light",styles:{label:{textTransform:"none"}},leftSection:o.jsx(Bse,{style:al}),children:["for: ",Gn(t.duration*1e3)]}),t.keepFiringFor&&o.jsxs(Hi,{variant:"light",styles:{label:{textTransform:"none"}},leftSection:o.jsx(Pse,{style:al}),children:["keep_firing_for: ",Gn(t.keepFiringFor*1e3)]})]}),t.labels&&Object.keys(t.labels).length>0&&o.jsx(xe,{mt:"lg",children:o.jsx(ug,{labels:t.labels})}),t.type==="alerting"&&Object.keys(t.annotations).length>0&&o.jsx(le,{mt:"lg",fz:"sm",children:o.jsx(le.Tbody,{children:Object.entries(t.annotations).map(([i,r])=>o.jsxs(le.Tr,{children:[o.jsx(le.Th,{c:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-gray-4))",children:i}),o.jsx(le.Td,{children:r})]},i))})})]})};function zF({value:t,onRemove:e,...n}){return o.jsx(tc,{fw:600,style:{textTransform:"uppercase",fontWeight:600},onRemove:e,...n,withRemoveButton:!!e,children:t})}const Lj=({options:t,optionClass:e,optionCount:n,placeholder:i,values:r,onChange:s})=>{const a=nS({onDropdownClose:()=>a.resetSelectedOption(),onDropdownOpen:()=>a.updateSelectedOptionIndex("active")}),l=f=>s(r.includes(f)?r.filter(p=>p!==f):[...r,f]),u=f=>s(r.filter(p=>p!==f)),d=r.map(f=>o.jsx(zF,{value:n?`${f} (${n(f)})`:f,className:e(f),onRemove:()=>u(f)},f));return o.jsxs(fn,{store:a,onOptionSubmit:l,withinPortal:!1,children:[o.jsx(fn.DropdownTarget,{children:o.jsx(tm,{pointer:!0,onClick:()=>a.toggleDropdown(),miw:200,leftSection:o.jsx(O9,{style:Gf}),rightSection:r.length>0?o.jsx(kM,{onClear:()=>s([])}):o.jsx(Dy,{}),children:o.jsxs(tc.Group,{children:[d.length>0?d:o.jsx(tm.Field,{placeholder:i,mt:1}),o.jsx(fn.EventsTarget,{children:o.jsx(tm.Field,{type:"hidden",onBlur:()=>a.closeDropdown(),onKeyDown:f=>{f.key==="Backspace"&&(f.preventDefault(),u(r[r.length-1]))}})})]})})}),o.jsx(fn.Dropdown,{children:o.jsx(fn.Options,{children:t.map(f=>o.jsx(fn.Option,{value:f,active:r.includes(f),children:o.jsxs(pt,{gap:"sm",children:[r.includes(f)?o.jsx(Hm,{size:12,color:"gray"}):null,o.jsx(zF,{value:n?`${f} (${n(f)})`:f,className:e(f)})]})},f))})})]})};function cc(t,e,n=!0){return{...t,default:e,decode:(...r)=>{const s=t.decode(...r);return s===void 0||n&&s===null?e:s}}}function lG(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 Tke(t){return t==null||t instanceof Array?t:t===""?[]:[t]}function Oke(t){return t==null?t:String(t)}function Eke(t){const e=lG(t);return e==null?e:e===""?null:+e}function Mke(t){return t==null?t:String(t)}function Rke(t){const e=lG(t,!0);return e==null?e:String(e)}function Dke(t){return t==null,t}function Nke(t){const e=Tke(t);return e==null,e}const pd={encode:Mke,decode:Rke},cG={encode:Oke,decode:Eke},Pj={encode:Dke,decode:Nke};function Ike(t){const e=new URLSearchParams,n=Object.entries(t);for(const[i,r]of n)if(r!==void 0&&r!==null)if(Array.isArray(r))for(const s of r)e.append(i,s??"");else e.append(i,r);return e.toString()}'{}[],":'.split("").map(t=>[t,encodeURIComponent(t)]);function Bke(t,e){const n={},i=Object.keys(e);for(const r of i){const s=e[r];t[r]?n[r]=t[r].encode(e[r]):n[r]=s==null?s:String(s)}return n}function Lke(t){const e=new URLSearchParams(t),n={};for(let[i,r]of e)Object.prototype.hasOwnProperty.call(n,i)?Array.isArray(n[i])?n[i].push(r):n[i]=[n[i],r]:n[i]=r;return n}class Pke{constructor(){this.paramsMap=new Map,this.registeredParams=new Map}set(e,n,i,r){this.paramsMap.set(e,{stringified:n,decoded:i,decode:r})}has(e,n,i){if(!this.paramsMap.has(e))return!1;const r=this.paramsMap.get(e);return r?r.stringified===n&&(i==null||r.decode===i):!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 i=this.registeredParams.get(n)||0;this.registeredParams.set(n,i+1)}}unregisterParams(e){for(const n of e){const i=(this.registeredParams.get(n)||0)-1;i<=0?(this.registeredParams.delete(n),this.paramsMap.has(n)&&this.paramsMap.delete(n)):this.registeredParams.set(n,i)}}clear(){this.paramsMap.clear(),this.registeredParams.clear()}}const d1=new Pke;function Fke(t,e){var n,i,r;const s={};let a=!1;const l=Object.keys(t);let u=l;if(e.includeKnownParams||e.includeKnownParams!==!1&&l.length===0){const f=Object.keys((n=e.params)!=null?n:{});u.push(...f)}for(const f of u){const p=t[f];if(p!=null&&typeof p=="object"){s[f]=p;continue}a=!0,s[f]=(r=(i=e.params)==null?void 0:i[f])!=null?r:pd}return a?s:t}function uG(t,e,n,i){var r;if(!n||!e.length)return t;let s={...t},a=!1;for(const l of e)Object.prototype.hasOwnProperty.call(s,l)||(s[l]=(r=n[l])!=null?r:i,a=!0);return a?s:t}const $ke=Object.prototype.hasOwnProperty;function HF(t,e){return t===e?t!==0||e!==0||1/t===1/e:t!==t&&e!==e}function hG(t,e,n){var i,r;if(HF(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;const s=Object.keys(t),a=Object.keys(e);if(s.length!==a.length)return!1;for(let l=0;l<s.length;l++){const u=(r=(i=void 0)==null?void 0:i.equals)!=null?r:HF;if(!$ke.call(e,s[l])||!u(t[s[l]],e[s[l]]))return!1}return!0}function dG(t,e,n){const i={},r=Object.keys(e);for(const s of r){const a=e[s],l=t[s];let u;if(n.has(s,l,a.decode))u=n.get(s);else{if(u=a.decode(l),a.equals&&n.has(s,l)){const d=n.get(s);a.equals(u,d)&&(u=d)}u!==void 0&&n.set(s,l,u,a.decode)}u===void 0&&a.default!==void 0&&(u=a.default),i[s]=u}return i}function zke(){let t;function e(n,i,r){const s=dG(n,i,r);return t!=null&&hG(t,s)?t:(t=s,s)}return e}function Hke(t){let e;for(const n in t)if(t[n].urlName){const r=`${t[n].urlName}\0${n}`;e?e.push(r):e=[r]}return e?e.join(`
`):void 0}function qke(t){if(t)return Object.fromEntries(t.split(`
`).map(e=>e.split("\0")))}function Qke(t,e){var n;let i={};for(const r in t)((n=e[r])==null?void 0:n.urlName)!=null?i[e[r].urlName]=t[r]:i[r]=t[r];return i}let qF,QF,YF,rO={};const fG=(t,e,n)=>{if(qF===e&&YF===t&&QF===n)return rO;qF=e,YF=t;const i=t(e??"");QF=n;const r=qke(n);for(let[s,a]of Object.entries(i)){r!=null&&r[s]&&(delete i[s],s=r[s],i[s]=a);const l=rO[s];hG(a,l)&&(i[s]=l)}return rO=i,i},Yke={searchStringToObject:Lke,objectToSearchString:Ike,updateType:"pushIn",includeKnownParams:void 0,includeAllParams:!1,removeDefaultsFromUrl:!1,enableBatching:!1,skipUpdateWhenNoChange:!0};function pG(t,e){e==null&&(e={});const n={...t,...e};return e.params&&t.params&&(n.params={...t.params,...e.params}),n}const mG={adapter:{},options:Yke},NE=T.createContext(mG);function Wke(){const t=T.useContext(NE);if(t===void 0||t===mG)throw new Error("useQueryParams must be used within a QueryParamProvider");return t}function WF({children:t,adapter:e,options:n}){const{adapter:i,options:r}=T.useContext(NE),s=T.useMemo(()=>({adapter:e??i,options:pG(r,n)}),[e,n,i,r]);return T.createElement(NE.Provider,{value:s},t)}function Uke({children:t,adapter:e,options:n}){const i=e;return i?T.createElement(i,null,r=>T.createElement(WF,{adapter:r,options:n},t)):T.createElement(WF,{options:n},t)}function Vke(t,e){var n;for(const i in t)((n=e[i])==null?void 0:n.default)!==void 0&&t[i]!==void 0&&e[i].encode(e[i].default)===t[i]&&(t[i]=void 0)}function Gke({changes:t,updateType:e,currentSearchString:n,paramConfigMap:i,options:r}){const{searchStringToObject:s,objectToSearchString:a}=r;e==null&&(e=r.updateType);let l;const u=fG(s,n),d=uG(i,Object.keys(t),r.params);let f;if(typeof t=="function"){const m=dG(u,d,d1);f=t(m)}else f=t;l=Bke(d,f),r.removeDefaultsFromUrl&&Vke(l,d),l=Qke(l,d);let p;return e==="push"||e==="replace"?p=a(l):p=a({...u,...l}),p!=null&&p.length&&p[0]!=="?"&&(p=`?${p}`),p??""}function Xke({searchString:t,adapter:e,navigate:n,updateType:i}){const s={...e.location,search:t};typeof i=="string"&&i.startsWith("replace")?e.replace(s):e.push(s)}const Kke=t=>t(),Zke=t=>setTimeout(()=>t(),0),jA=[];function Jke(t,{immediate:e}={}){jA.push(t);let n=e?Kke:Zke;jA.length===1&&n(()=>{const i=jA.slice();jA.length=0;const r=i[0].currentSearchString;let s;for(let a=0;a<i.length;++a){const l=a===0?i[a]:{...i[a],currentSearchString:s};s=Gke(l)}t.options.skipUpdateWhenNoChange&&s===r||Xke({searchString:s??"",adapter:i[i.length-1].adapter,navigate:!0,updateType:i[i.length-1].updateType})})}function eTe(t,e){const{adapter:n,options:i}=Wke(),[r]=T.useState(zke),{paramConfigMap:s,options:a}=nTe(t,e),l=T.useMemo(()=>pG(i,a),[i,a]);let u=Fke(s,l);const d=fG(l.searchStringToObject,n.location.search,Hke(u));l.includeAllParams&&(u=uG(u,Object.keys(d),l.params,pd));const f=r(d,u,d1),p=Object.keys(u).join("\0");T.useEffect(()=>{const b=p.split("\0");return d1.registerParams(b),()=>{d1.unregisterParams(b)}},[p]);const m={adapter:n,paramConfigMap:u,options:l},v=T.useRef(m);v.current==null&&(v.current=m),T.useEffect(()=>{v.current.adapter=n,v.current.paramConfigMap=u,v.current.options=l},[n,u,l]);const[y]=T.useState(()=>(A,w)=>{const{adapter:S,paramConfigMap:j,options:C}=v.current;w==null&&(w=C.updateType),Jke({changes:A,updateType:w,currentSearchString:S.location.search,paramConfigMap:j,options:C,adapter:S},{immediate:!C.enableBatching})});return[f,y]}var tTe=eTe;function nTe(t,e){let n,i;return t===void 0?(n={},i=e):Array.isArray(t)?(n=Object.fromEntries(t.map(r=>[r,"inherit"])),i=e):(n=t,i=e),{paramConfigMap:n,options:i}}const Ma=(t,e,n)=>{const i=T.useMemo(()=>({[t]:e??"inherit"}),[t,e]),[r,s]=tTe(i,n),a=r[t],l=T.useCallback((u,d)=>s(typeof u=="function"?f=>{const p=u(f[t]);return{[t]:p}}:{[t]:u},d),[t,s]);return[a,l]};function iTe(t,e,n,i){let r=[];for(const s of e){const a=dN(t,s,n,i.concat([]));a!==null&&(Array.isArray(a)?r=r.concat(a):r.push(a))}return r.length===0?null:r.length===1?r[0]:r}function dN(t,e,n=0,i=[]){let r=e;for(let s=n;s<t.length;s++){if(r==null||typeof r!="object")return null;if(Array.isArray(r))return iTe(t,r,s,i);const a=t[s];if(typeof a=="string")if(r[a]!==void 0)i.push(a),r=r[a];else return null;else{let l=[];for(const u of Object.keys(r))if(a.test(u)){const d=dN(t,r[u],s+1,i.concat([u]));d!==null&&(Array.isArray(d)?l=l.concat(d):l.push(d))}return l}}return{path:i,value:r}}function rTe(t){return t.right!==void 0}function sTe(t){return t.keyPath!==void 0}function Mw(t,e){const n={original:t.original,rendered:t.rendered,score:t.score+e.score,index:t.index};let i;return t.matched&&e.matched?i=t.matched.concat(e.matched):t.matched?i=t.matched:e.matched&&(i=e.matched),i&&(n.matched=i),n}function oTe(t,e){const n=t;for(const[i,r]of Object.entries(e)){const s=i;n[s]!==void 0?n[s]=Mw(n[s],r):n[s]=r}}function aTe(t,e){const n={};for(const[i,r]of Object.entries(e)){const s=i;t[s]!==void 0&&(n[s]=Mw(t[s],r))}return n}function lTe(t,e,n){return Bg(t,e,(i,r)=>i===r,n)}function cTe(t,e,n){return Bg(t,e,(i,r)=>i!==r,n)}function uTe(t,e,n){return Bg(t,e,(i,r)=>i>r,n)}function hTe(t,e,n){return Bg(t,e,(i,r)=>i>=r,n)}function dTe(t,e,n){return Bg(t,e,(i,r)=>i<r,n)}function fTe(t,e,n){return Bg(t,e,(i,r)=>i<=r,n)}function Bg(t,e,n,i){let r=t,s=e;return!i&&typeof r=="string"&&typeof s=="string"&&(r=r.toLocaleLowerCase(),s=s.toLocaleLowerCase()),n(s,r)}function UF(t,e){const n={match:"fuzzy",pattern:t,keyPath:[]};return Array.isArray(e)?n.keyPath=n.keyPath.concat(e):n.keyPath=[e],n}class dx{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,i){const r=i!=null&&i.indexedKeys?i.indexedKeys:this.conf.indexedKeys;if(r===void 0)return[];const s=r.length,a=UF(e,r[0]);if(s===1)return this.filterWithQuery(a,n,i);const l={operator:"or",left:a,right:a};let u=l;for(let d=1;d<s;d++){const f=UF(e,r[d]);if(d+1<s){const p={operator:"or",left:f,right:f};u.right=p,u=p}else u.right=f}return this.filterWithQuery(l,n,i)}filterWithQuery(e,n,i){const r=(i==null?void 0:i.shouldSort)!==void 0?i.shouldSort:this.conf.shouldSort,s=(i==null?void 0:i.shouldRender)!==void 0?i.shouldRender:this.conf.shouldRender,a=(i==null?void 0:i.includeMatches)!==void 0?i.includeMatches:this.conf.includeMatches,l=(i==null?void 0:i.findAllMatches)!==void 0?i.findAllMatches:this.conf.findAllMatches,u=[{current:e,depth:0}],d=[];for(;u.length>0;){const p=u.shift();if(!p)break;const m=p.current;if(rTe(m)){u.unshift({current:m.left,parent:m.operator,depth:p.depth+1},{current:m.right,parent:m.operator,depth:p.depth+1},{current:m.operator,parent:p.parent,depth:p.depth});continue}if(sTe(m)){let b;!l&&d.length>1&&d[d.length-1].depth===p.depth&&p.parent!==void 0&&(b={result:d[d.length-1].result,parent:p.parent}),d.push({result:this.executeQuery(m,n,b,i),depth:p.depth});continue}const v=d.pop(),y=d.pop();if(!v||!y)break;m==="or"?(oTe(v.result,y.result),d.push({result:v.result,depth:p.depth})):d.push({result:aTe(v.result,y.result),depth:p.depth})}let f=Object.values(d[0].result);for(let p=0;p<f.length;p++)f[p].rendered=s?this.render(f[p].original,f[p].matched,i):f[p].original,a||(f[p].matched=void 0);return r&&(f=f.sort((p,m)=>m.score-p.score)),f||[]}match(e,n,i){const r=(i==null?void 0:i.includeMatches)!==void 0?i.includeMatches:this.conf.includeMatches,s=(i==null?void 0:i.shouldRender)!==void 0?i.shouldRender:this.conf.shouldRender,a=this.internalMatch(e,n,i);return a!==null&&(a.original=n,a.rendered=s?this.render(n,a.matched,i):n,r||(a.matched=void 0)),a}render(e,n,i){const r=i!=null&&i.pre?i.pre:this.conf.pre,s=i!=null&&i.post?i.post:this.conf.post;if(r===void 0&&s===void 0||n===void 0)return e;const a=JSON.parse(JSON.stringify(e)),l={};for(const u of n)this.renderingWalk(u,a,l,i);return a}renderingWalk(e,n,i,r){let s=n,a=0;const l=e.path;for(;a<l.length-1;)s[l[a]]!==void 0?s=s[l[a]]:s=s[i[l.slice(0,a).toString()]],a++;const u={pre:r!=null&&r.pre?r.pre:this.conf.pre,post:r!=null&&r.post?r.post:this.conf.post,escapeHTML:r!=null&&r.escapeHTML?r.escapeHTML:this.conf.escapeHTML};let d=l[a];if(typeof s[d]=="object"&&typeof e.value=="string"){s=s[d];const f=F6(e.value,e.intervals,u);s[f]=s[e.value],i[l.concat(e.value).toString()]=f,delete s[e.value]}else s[d]===void 0&&(d=i[l.toString()]),s[d]=F6(s[d],e.intervals,u)}executeQuery(e,n,i,r){const s={};for(let a=0;a<n.length;a++){const l=n[a];if(i){if(i.parent==="or"){if(i.result[a])continue}else if(!i.result[a])continue}const u=this.internalMatch(e,l,r);u!==null&&(u.index=a,u.original=l,s[a]=u)}return s}internalMatch(e,n,i){const r=dN(e.keyPath,n);return this.processWalkingPath(r,e,i)}processWalkingPath(e,n,i){let r=null;if(e===null)return null;if(Array.isArray(e))for(const s of e){const a=this.recursiveMatch(s.value,s.path,n,i);a!==null&&(r!=null?r=Mw(a,r):r=a)}else r=this.recursiveMatch(e.value,e.path,n,i);return r}recursiveMatch(e,n,i,r){let s=null;if(typeof e=="string"||typeof e=="number")s=this.matchSingleStringOrNumber(e,n,i,r);else if(Array.isArray(e))for(const a of e){const l=this.recursiveMatch(a,n,i,r);l!==null&&(s!=null?s=Mw(l,s):s=l)}else for(const a of Object.keys(e))if(s=this.matchSingleStringOrNumber(a,n,i,r),s!==null)break;return s}matchSingleStringOrNumber(e,n,i,r){const s=(r==null?void 0:r.caseSensitive)!==void 0?r.caseSensitive:this.conf.caseSensitive;let a=[];switch((r==null?void 0:r.excludedChars)!==void 0?a=r.excludedChars:this.conf.excludedChars!==void 0&&(a=this.conf.excludedChars),i.match){case"exact":return lTe(i.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 cTe(i.pattern,e,s)?{score:1,matched:[{path:n,value:e,intervals:[]}]}:null;case"fuzzy":{if(typeof i.pattern!="string"||typeof e!="string")return null;const l=F1e(i.pattern,e,{includeMatches:!0,caseSensitive:s,excludedChars:a});return l===null?null:{score:l.score,matched:[{path:n,value:e,intervals:l.intervals?l.intervals:[]}]}}case"greater":return uTe(i.pattern,e,s)?{score:1,matched:[{path:n,value:e,intervals:[]}]}:null;case"greaterEqual":return hTe(i.pattern,e,s)?{score:1,matched:[{path:n,value:e,intervals:[]}]}:null;case"less":return dTe(i.pattern,e,s)?{score:1,matched:[{path:n,value:e,intervals:[]}]}:null;case"lessEqual":return fTe(i.pattern,e,s)?{score:1,matched:[{path:n,value:e,intervals:[]}]}:null}}}const pTe="_item_1un2i_1",mTe="_copyAlertNameButton_1un2i_5",gTe="_ruleControl_1un2i_10",sO={item:pTe,copyAlertNameButton:mTe,ruleControl:gTe},vTe=new dx({shouldSort:!0,indexedKeys:["name","labels",["labels",/.*/]]}),yTe=(t,e,n)=>{const i={globalCounts:{inactive:0,pending:0,firing:0,unknown:0},groups:[]};for(const r of t.groups){const s={total:0,inactive:0,pending:0,firing:0,unknown:0};for(const l of r.rules)switch(s.total++,l.state){case"inactive":i.globalCounts.inactive++,s.inactive++;break;case"firing":i.globalCounts.firing++,s.firing++;break;case"pending":i.globalCounts.pending++,s.pending++;break;case"unknown":i.globalCounts.unknown++,s.unknown++;break;default:throw new Error(`Unknown rule state: ${l.state}`)}const a=(e===""?r.rules:vTe.filter(e,r.rules).map(l=>l.original)).filter(l=>n.length===0||n.includes(l.state));i.groups.push({name:r.name,file:r.file,counts:s,rules:a.map(l=>({rule:l,counts:{firing:l.alerts.filter(u=>u.state==="firing").length,pending:l.alerts.filter(u=>u.state==="pending").length}}))})}return i},xTe=[];function gG(){const{data:t}=br({path:"/rules",params:{type:"alert"}}),{showAnnotations:e}=xr(),[n,i]=Ma("state",cc(Pj,xTe)),[r,s]=Ma("search",cc(pd,"")),[a]=xy(r.trim(),250),[l,u]=by({key:"alertsPage.showEmptyGroups",defaultValue:!1}),{alertGroupsPerPage:d}=xr(),[f,p]=Ma("page",cc(cG,1)),m=T.useMemo(()=>yTe(t.data,a,n),[t,n,a]),v=T.useMemo(()=>l?m.groups:m.groups.filter(S=>S.rules.length>0),[m.groups,l]),y=Math.ceil(v.length/d),b=Math.max(1,Math.min(f,y));T.useEffect(()=>{b!==f&&p(b)},[b,f,p]);const A=T.useMemo(()=>v.slice((b-1)*d,b*d),[v,b,d]),w=T.useMemo(()=>A.map(S=>o.jsxs(Xi,{shadow:"xs",withBorder:!0,p:"md",children:[o.jsxs(pt,{mb:"sm",justify:"space-between",children:[o.jsxs(pt,{align:"baseline",children:[o.jsx(ft,{fz:"xl",fw:600,children:S.name}),o.jsx(ft,{fz:"sm",c:"gray.6",children:S.file})]}),o.jsxs(pt,{children:[S.counts.firing>0&&o.jsxs(Hi,{className:wn.healthErr,children:["firing (",S.counts.firing,")"]}),S.counts.pending>0&&o.jsxs(Hi,{className:wn.healthWarn,children:["pending (",S.counts.pending,")"]}),S.counts.unknown>0&&o.jsxs(Hi,{className:wn.healthUnknown,children:["unknown (",S.counts.unknown,")"]}),S.counts.inactive>0&&o.jsxs(Hi,{className:wn.healthOk,children:["inactive (",S.counts.inactive,")"]})]})]}),S.counts.total===0?o.jsxs(Pt,{title:"No rules",icon:o.jsx(oi,{}),children:["No rules in this group.",o.jsx(Zi,{ml:"md",fz:"1em",onClick:()=>u(!1),children:"Hide empty groups"})]}):S.rules.length===0?o.jsxs(Pt,{title:"No matching rules",icon:o.jsx(oi,{}),children:["No rules in this group match your filter criteria (omitted"," ",S.counts.total," filtered rules).",o.jsx(Zi,{ml:"md",fz:"1em",onClick:()=>u(!1),children:"Hide empty groups"})]}):o.jsx(sg,{allItems:S.rules,child:({items:j})=>o.jsx(Ki,{multiple:!0,variant:"separated",keepMounted:!1,classNames:sO,children:j.map((C,k)=>o.jsxs(Ki.Item,{mt:ge(5),value:k.toString(),className:C.counts.firing>0?Qh.panelHealthErr:C.counts.pending>0?Qh.panelHealthWarn:C.rule.state==="unknown"?Qh.panelHealthUnknown:Qh.panelHealthOk,children:[o.jsx(Ki.Control,{className:sO.ruleControl,styles:{label:{paddingBlock:ge(10)}},children:o.jsxs(pt,{wrap:"nowrap",justify:"space-between",mr:"lg",children:[o.jsxs(pt,{gap:"xs",wrap:"nowrap",children:[o.jsx(ft,{children:C.rule.name}),o.jsx(Ny,{value:C.rule.name,children:({copied:E,copy:M})=>o.jsx(mi,{className:sO.copyAlertNameButton,variant:"subtle",color:"gray",onClick:R=>{R.stopPropagation(),M()},size:"xs",children:E?o.jsx(Ym,{size:12}):o.jsx(Yy,{size:12})})})]}),o.jsxs(pt,{gap:"xs",children:[C.counts.firing>0&&o.jsxs(Hi,{className:wn.healthErr,children:["firing (",C.counts.firing,")"]}),C.counts.pending>0&&o.jsxs(Hi,{className:wn.healthWarn,children:["pending (",C.counts.pending,")"]})]})]})}),o.jsxs(Ki.Panel,{children:[o.jsx(aG,{rule:C.rule}),C.rule.alerts.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(vg,{my:"md"}),o.jsx(sg,{allItems:C.rule.alerts,child:({items:E})=>o.jsxs(le,{mt:"lg",children:[o.jsx(le.Thead,{children:o.jsxs(le.Tr,{style:{whiteSpace:"nowrap"},children:[o.jsx(le.Th,{children:"Alert labels"}),o.jsx(le.Th,{children:"State"}),o.jsx(le.Th,{children:"Active Since"}),o.jsx(le.Th,{children:"Value"})]})}),o.jsx(le.Tbody,{children:E.map((M,R)=>o.jsxs(T.Fragment,{children:[o.jsxs(le.Tr,{children:[o.jsx(le.Td,{children:o.jsx(ug,{labels:M.labels})}),o.jsx(le.Td,{children:o.jsx(Hi,{className:M.state==="firing"?wn.healthErr:wn.healthWarn,children:M.state})}),o.jsx(le.Td,{style:{whiteSpace:"nowrap"},children:o.jsx(Gi,{label:M.activeAt,children:o.jsx(xe,{children:F1(M.activeAt,P1(),"")})})}),o.jsx(le.Td,{style:{whiteSpace:"nowrap"},children:isNaN(Number(M.value))?M.value:Number(M.value)})]}),e&&o.jsx(le.Tr,{children:o.jsx(le.Td,{colSpan:4,children:o.jsx(le,{mt:"md",mb:"xl",children:o.jsx(le.Tbody,{children:Object.entries(M.annotations).map(([D,F])=>o.jsxs(le.Tr,{children:[o.jsx(le.Th,{c:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-gray-4))",children:D}),o.jsx(le.Td,{children:F})]},D))})})})})]},R))})]})})]})]})]},k))})})]},`${S.file}-${S.name}`)),[A,e,u]);return o.jsxs(Mn,{mt:"xs",children:[o.jsxs(pt,{children:[o.jsx(Lj,{options:["inactive","pending","firing","unknown"],optionClass:S=>S==="inactive"?wn.healthOk:S==="pending"?wn.healthWarn:S==="firing"?wn.healthErr:wn.healthUnknown,optionCount:S=>m.globalCounts[S],placeholder:"Filter by rule group state",values:(n==null?void 0:n.filter(S=>S!==null))||[],onChange:S=>i(S)}),o.jsx(yc,{flex:1,leftSection:o.jsx(yd,{style:Gf}),placeholder:"Filter by rule name or labels",value:r||"",onChange:S=>s(S.currentTarget.value||null)})]}),m.groups.length===0?o.jsx(Pt,{title:"No rules found",icon:o.jsx(oi,{}),children:"No rules found."}):!l&&m.groups.length!==v.length&&o.jsxs(Pt,{title:"Hiding groups with no matching rules",icon:o.jsx(oi,{}),children:["Hiding ",m.groups.length-v.length," empty groups due to filters or no rules.",o.jsx(Zi,{ml:"md",fz:"1em",onClick:()=>u(!0),children:"Show empty groups"})]}),o.jsx(sa,{total:y,value:b,onChange:p,hideWithOnePage:!0}),w]})}const bTe="_item_16t7o_1",ATe="_copyRuleNameButton_16t7o_5",wTe="_ruleControl_16t7o_10",oO={item:bTe,copyRuleNameButton:ATe,ruleControl:wTe},STe=new dx({shouldSort:!0,indexedKeys:["name","labels",["labels",/.*/]]}),jTe=(t,e,n)=>({groups:t.groups.map(r=>({...r,prefilterRulesCount:r.rules.length,rules:(e===""?r.rules:STe.filter(e,r.rules).map(s=>s.original)).filter(s=>n.length===0||n.includes(s.health))}))}),CTe=t=>{switch(t){case"ok":return wn.healthOk;case"err":return wn.healthErr;case"unknown":return wn.healthUnknown;default:throw new Error("Unknown rule health state")}},_Te=[];function kTe(){const{data:t}=br({path:"/rules"}),[e,n]=Ma("health",cc(Pj,_Te)),[i,r]=Ma("search",cc(pd,"")),[s]=xy(i.trim(),250),[a,l]=by({key:"alertsPage.showEmptyGroups",defaultValue:!1}),{ruleGroupsPerPage:u}=xr(),[d,f]=Ma("page",cc(cG,1)),p=T.useMemo(()=>jTe(t.data,s,e),[t,e,s]),m=T.useMemo(()=>a?p.groups:p.groups.filter(w=>w.rules.length>0),[p.groups,a]),v=Math.ceil(m.length/u),y=Math.max(1,Math.min(d,v));T.useEffect(()=>{y!==d&&f(y)},[y,d,f]);const b=T.useMemo(()=>m.slice((y-1)*u,y*u),[m,y,u]),A=T.useMemo(()=>b.map(w=>o.jsxs(Xi,{shadow:"xs",withBorder:!0,p:"md",children:[o.jsxs(pt,{mb:"sm",justify:"space-between",children:[o.jsxs(pt,{align:"baseline",children:[o.jsx(ft,{fz:"xl",fw:600,children:w.name}),o.jsx(ft,{fz:"sm",c:"gray.6",children:w.file})]}),o.jsxs(pt,{children:[o.jsx(Gi,{label:"Last group evaluation",withArrow:!0,children:o.jsxs(Hi,{variant:"light",className:wn.statsBadge,styles:{label:{textTransform:"none"}},leftSection:o.jsx(OO,{style:al}),children:["last run ",F1(w.lastEvaluation,P1())]})}),o.jsx(Gi,{label:"Duration of last group evaluation",withArrow:!0,children:o.jsxs(Hi,{variant:"light",className:wn.statsBadge,styles:{label:{textTransform:"none"}},leftSection:o.jsx(TO,{style:al}),children:["took ",im(parseFloat(w.evaluationTime)*1e3)]})}),o.jsx(Gi,{label:"Group evaluation interval",withArrow:!0,children:o.jsxs(Hi,{variant:"transparent",className:wn.statsBadge,styles:{label:{textTransform:"none"}},leftSection:o.jsx(D9,{style:al}),children:["every ",im(parseFloat(w.interval)*1e3)," "]})})]})]}),w.prefilterRulesCount===0?o.jsxs(Pt,{title:"No rules",icon:o.jsx(oi,{}),children:["No rules in this group.",o.jsx(Zi,{ml:"md",fz:"1em",onClick:()=>l(!1),children:"Hide empty groups"})]}):w.rules.length===0?o.jsxs(Pt,{title:"No matching rules",icon:o.jsx(oi,{}),children:["No rules in this group match your filter criteria (omitted"," ",w.prefilterRulesCount," filtered rules).",o.jsx(Zi,{ml:"md",fz:"1em",onClick:()=>l(!1),children:"Hide empty groups"})]}):o.jsx(sg,{allItems:w.rules,child:({items:S})=>o.jsx(Ki,{multiple:!0,variant:"separated",keepMounted:!1,classNames:oO,children:S.map((j,C)=>o.jsxs(Ki.Item,{mt:ge(5),value:C.toString(),style:{borderLeft:j.health==="err"?"5px solid var(--mantine-color-red-4)":j.health==="unknown"?"5px solid var(--mantine-color-gray-5)":"5px solid var(--mantine-color-green-4)"},children:[o.jsx(Ki.Control,{className:oO.ruleControl,styles:{label:{paddingBlock:ge(10)}},children:o.jsxs(pt,{justify:"space-between",mr:"lg",children:[o.jsxs(pt,{gap:"xs",wrap:"nowrap",children:[j.type==="alerting"?o.jsx(Gi,{label:"Alerting rule",withArrow:!0,children:o.jsx(uR,{style:{width:ge(15),height:ge(15)}})}):o.jsx(Gi,{label:"Recording rule",withArrow:!0,children:o.jsx(Ioe,{style:{width:ge(15),height:ge(15)}})}),o.jsx(ft,{children:j.name}),o.jsx(Ny,{value:j.name,children:({copied:k,copy:E})=>o.jsx(mi,{className:oO.copyRuleNameButton,variant:"subtle",color:"gray",onClick:M=>{M.stopPropagation(),E()},size:"xs",children:k?o.jsx(Ym,{size:12}):o.jsx(Yy,{size:12})})})]}),o.jsxs(pt,{gap:"xs",children:[o.jsxs(pt,{gap:"xs",wrap:"wrap",children:[o.jsx(Gi,{label:"Last rule evaluation",withArrow:!0,children:o.jsx(Hi,{variant:"light",className:wn.statsBadge,styles:{label:{textTransform:"none"}},leftSection:o.jsx(OO,{style:al}),children:F1(j.lastEvaluation,P1())})}),o.jsx(Gi,{label:"Duration of last rule evaluation",withArrow:!0,children:o.jsx(Hi,{variant:"light",className:wn.statsBadge,styles:{label:{textTransform:"none"}},leftSection:o.jsx(TO,{style:al}),children:im(parseFloat(j.evaluationTime)*1e3)})})]}),o.jsx(Hi,{className:CTe(j.health),children:j.health})]})]})}),o.jsxs(Ki.Panel,{children:[o.jsx(aG,{rule:j}),j.lastError&&o.jsxs(Pt,{color:"red",mt:"sm",title:"Rule failed to evaluate",icon:o.jsx(Fr,{}),children:[o.jsx("strong",{children:"Error:"})," ",j.lastError]})]})]},C))})})]},`${w.file}-${w.name}`)),[b,l]);return o.jsxs(Mn,{mt:"xs",children:[o.jsxs(pt,{children:[o.jsx(Lj,{options:["ok","unknown","err"],optionClass:w=>w==="ok"?wn.healthOk:w==="unknown"?wn.healthWarn:wn.healthErr,placeholder:"Filter by rule health",values:(e==null?void 0:e.filter(w=>w!==null))||[],onChange:w=>n(w)}),o.jsx(yc,{flex:1,leftSection:o.jsx(yd,{style:Gf}),placeholder:"Filter by rule name or labels",value:i||"",onChange:w=>r(w.currentTarget.value||null)})]}),p.groups.length===0?o.jsx(Pt,{title:"No rules found",icon:o.jsx(oi,{}),children:"No rules found."}):!a&&p.groups.length!==m.length&&o.jsxs(Pt,{title:"Hiding groups with no matching rules",icon:o.jsx(oi,{}),children:["Hiding ",p.groups.length-m.length," empty groups due to filters or no rules.",o.jsx(Zi,{ml:"md",fz:"1em",onClick:()=>l(!0),children:"Show empty groups"})]}),o.jsx(sa,{total:v,value:y,onChange:f,hideWithOnePage:!0}),A]})}const vG="targetsPage.collapsedPools",TTe={collapsedPools:zo(vG,[]),showLimitAlert:!1},yG=HS({name:"targetsPage",initialState:TTe,reducers:{setCollapsedPools:(t,{payload:e})=>{t.collapsedPools=e},setShowLimitAlert:(t,{payload:e})=>{t.showLimitAlert=e}}}),{setCollapsedPools:fN,setShowLimitAlert:IE}=yG.actions,OTe=yG.reducer,BE=({endpoint:t,globalUrl:e})=>{let n,i="",r=!1;try{n=new URL(t)}catch{r=!0,t.indexOf("?")>-1&&(i=t.substring(t.indexOf("?"))),n=new URL("http://0.0.0.0"+i)}const{host:s,pathname:a,protocol:l,searchParams:u}=n,d=Array.from(u.entries()),f=r?t.replace(i,""):`${l}//${s}${a}`;return o.jsxs(Mn,{gap:0,children:[o.jsx(Zi,{size:"sm",href:e,target:"_blank",children:f}),d.length>0&&o.jsx(pt,{gap:"xs",mt:"md",children:d.map(([p,m])=>o.jsx(Hi,{size:"sm",variant:"light",color:"gray",style:{textTransform:"none"},children:`${p}="${m}"`},`${p}/${m}`))})]})},ETe=({discoveredLabels:t,labels:e})=>{const[n,{toggle:i}]=Dw(!1);return o.jsxs(Mn,{children:[o.jsxs(pt,{wrap:"nowrap",align:"flex-start",children:[o.jsx(ug,{labels:e}),o.jsx(mi,{size:"xs",color:"gray",variant:"light",onClick:i,title:`${n?"Hide":"Show"} discovered (pre-relabeling) labels`,children:n?o.jsx(hR,{style:Au}):o.jsx(Rv,{style:Au})})]}),o.jsx(Fw,{expanded:n,children:n&&o.jsxs(o.Fragment,{children:[o.jsx(ft,{fw:700,size:"1em",my:"lg",c:"gray.7",children:"Discovered labels:"}),o.jsx(ug,{labels:t,style:{color:"var(--mantine-color-blue-light-color)",backgroundColor:"var(--mantine-color-blue-light)"}})]})})]})},MTe=({target:t})=>{const[e,{toggle:n}]=Dw(!1);return o.jsxs(Mn,{gap:"xs",children:[o.jsxs(pt,{wrap:"nowrap",align:"flex-start",children:[o.jsxs(pt,{gap:"xs",wrap:"wrap",children:[o.jsx(Gi,{label:"Last target scrape",withArrow:!0,children:o.jsx(Hi,{variant:"light",className:wn.statsBadge,styles:{label:{textTransform:"none"}},leftSection:o.jsx(OO,{style:al}),children:F1(t.lastScrape,P1())})}),o.jsx(Gi,{label:"Duration of last target scrape",withArrow:!0,children:o.jsx(Hi,{variant:"light",className:wn.statsBadge,styles:{label:{textTransform:"none"}},leftSection:o.jsx(TO,{style:al}),children:im(t.lastScrapeDuration*1e3)})})]}),o.jsx(mi,{size:"xs",color:"gray",variant:"light",onClick:n,title:`${e?"Hide":"Show"} additional timing info`,children:e?o.jsx(hR,{style:Au}):o.jsx(Rv,{style:Au})})]}),o.jsx(Fw,{expanded:e,children:e&&o.jsxs(pt,{gap:"xs",wrap:"wrap",children:[o.jsx(Gi,{label:"Scrape interval",withArrow:!0,children:o.jsxs(Hi,{variant:"light",className:wn.statsBadge,styles:{label:{textTransform:"none"}},leftSection:o.jsx(D9,{style:al}),children:["every ",t.scrapeInterval]})}),o.jsx(Gi,{label:"Scrape timeout",withArrow:!0,children:o.jsxs(Hi,{variant:"light",className:wn.statsBadge,styles:{label:{textTransform:"none"}},leftSection:o.jsx(hoe,{style:al}),children:["after ",t.scrapeTimeout]})})]})})]})},RTe=t=>t.count>0&&t.downCount===t.count?Qh.panelHealthErr:t.downCount>=1?Qh.panelHealthWarn:t.unknownCount===t.count?Qh.panelHealthUnknown:Qh.panelHealthOk,DTe=t=>{switch(t.toLowerCase()){case"up":return wn.healthOk;case"down":return wn.healthErr;case"unknown":return wn.healthUnknown;default:return wn.healthWarn}},NTe=new dx({shouldSort:!0,indexedKeys:["labels","scrapePool",["labels",/.*/]]}),ITe=(t,e,n,i)=>{const r={};for(const a of t)r[a]={targets:[],count:0,upCount:0,downCount:0,unknownCount:0};for(const a of e){if(!r[a.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(r[a.scrapePool].count++,a.health.toLowerCase()){case"up":r[a.scrapePool].upCount++;break;case"down":r[a.scrapePool].downCount++;break;case"unknown":r[a.scrapePool].unknownCount++;break}}const s=(n===""?e:NTe.filter(n,e).map(a=>a.original)).filter(a=>i.length===0||i.includes(a.health));for(const a of s)r[a.scrapePool].targets.push(a);return r},BTe=T.memo(({poolNames:t,selectedPool:e,healthFilter:n,searchFilter:i})=>{const{data:{data:{activeTargets:r}}}=br({path:"/targets",params:{state:"active",scrapePool:e===null?"":e}}),s=Tu(),[a,l]=by({key:"targetsPage.showEmptyPools",defaultValue:!1}),{collapsedPools:u,showLimitAlert:d}=bc(v=>v.targetsPage),f=T.useMemo(()=>ITe(e?[e]:t,r,i,n),[e,t,r,i,n]),p=Object.keys(f),m=a?p:p.filter(v=>f[v].targets.length!==0);return o.jsxs(Mn,{children:[p.length===0?o.jsx(Pt,{title:"No scrape pools found",icon:o.jsx(oi,{}),children:"No scrape pools found."}):!a&&p.length!==m.length&&o.jsxs(Pt,{title:"Hiding pools with no matching targets",icon:o.jsx(oi,{}),children:["Hiding ",p.length-m.length," empty pools due to filters or no targets.",o.jsx(Zi,{ml:"md",fz:"1em",onClick:()=>l(!0),children:"Show empty pools"})]}),d&&o.jsxs(Pt,{title:"Found many pools, showing only one",icon:o.jsx(oi,{}),withCloseButton:!0,onClose:()=>s(IE(!1)),children:["There are more than ",xG," scrape pools. Showing only the first one. Use the dropdown to select a different pool."]}),o.jsx(Ki,{multiple:!0,variant:"separated",keepMounted:!1,value:p.filter(v=>!u.includes(v)),onChange:v=>s(fN(p.filter(y=>!v.includes(y)))),children:m.map(v=>{const y=f[v];return o.jsxs(Ki.Item,{value:v,className:RTe(y),children:[o.jsx(Ki.Control,{children:o.jsxs(pt,{wrap:"nowrap",justify:"space-between",mr:"lg",children:[o.jsx(ft,{children:v}),o.jsxs(pt,{gap:"xs",children:[o.jsxs(ft,{c:"gray.6",children:[y.upCount," / ",y.count," up"]}),o.jsx(zy,{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"}]})]})]})}),o.jsx(Ki.Panel,{children:y.count===0?o.jsxs(Pt,{title:"No targets",icon:o.jsx(oi,{}),children:["No active targets in this scrape pool.",o.jsx(Zi,{ml:"md",fz:"1em",onClick:()=>l(!1),children:"Hide empty pools"})]}):y.targets.length===0?o.jsxs(Pt,{title:"No matching targets",icon:o.jsx(oi,{}),children:["No targets in this pool match your filter criteria (omitted ",y.count," filtered targets).",o.jsx(Zi,{ml:"md",fz:"1em",onClick:()=>l(!1),children:"Hide empty pools"})]}):o.jsx(sg,{allItems:y.targets,child:({items:b})=>o.jsxs(le,{children:[o.jsx(le.Thead,{children:o.jsxs(le.Tr,{children:[o.jsx(le.Th,{w:"25%",children:"Endpoint"}),o.jsx(le.Th,{children:"Labels"}),o.jsx(le.Th,{w:230,children:"Last scrape"}),o.jsx(le.Th,{w:100,children:"State"})]})}),o.jsx(le.Tbody,{children:b.map((A,w)=>o.jsxs(Vn.Fragment,{children:[o.jsxs(le.Tr,{style:{borderBottom:A.lastError?"none":void 0},children:[o.jsx(le.Td,{valign:"top",children:o.jsx(BE,{endpoint:A.scrapeUrl,globalUrl:A.globalUrl})}),o.jsx(le.Td,{valign:"top",children:o.jsx(ETe,{labels:A.labels,discoveredLabels:A.discoveredLabels})}),o.jsx(le.Td,{valign:"top",children:o.jsx(MTe,{target:A})}),o.jsx(le.Td,{valign:"top",children:o.jsx(Hi,{className:DTe(A.health),children:A.health})})]}),A.lastError&&o.jsx(le.Tr,{children:o.jsx(le.Td,{colSpan:5,valign:"top",children:o.jsxs(Pt,{color:"red",mb:"sm",icon:o.jsx(Fr,{}),children:[o.jsx("strong",{children:"Error scraping target:"})," ",A.lastError]})})})]},w))})]})})})]},v)})})]})}),xG=20,LTe=[];function PTe(){const{data:{data:{scrapePools:t}}}=br({path:"/scrape_pools"}),e=Tu(),n="Select scrape pool",[i,r]=Ma("pool",pd),[s,a]=T.useState(n),[l,u]=T.useState(!1),[d,f]=Ma("health",cc(Pj,LTe)),[p,m]=Ma("search",cc(pd,"")),[v]=xy(p.trim(),250),{collapsedPools:y,showLimitAlert:b}=bc(w=>w.targetsPage),A=t.length>xG&&i===void 0;return A&&(r(t[0]),e(IE(!0))),o.jsxs(o.Fragment,{children:[o.jsxs(pt,{mb:"md",mt:"xs",children:[o.jsx(jg,{placeholder:s,data:[{label:"All pools",value:""},...t],value:l?null:A&&t[0]||i||null,onChange:w=>{r(w),b&&e(IE(!1))},onDropdownOpen:()=>{a(i||n),u(!0)},onDropdownClose:()=>{a(n),u(!1)},searchable:!0}),o.jsx(Lj,{options:["unknown","up","down"],optionClass:w=>w==="unknown"?wn.healthUnknown:w==="up"?wn.healthOk:wn.healthErr,placeholder:"Filter by target health",values:(d==null?void 0:d.filter(w=>w!==null))||[],onChange:w=>f(w)}),o.jsx(yc,{flex:1,leftSection:o.jsx(yd,{style:Gf}),placeholder:"Filter by endpoint or labels",value:p||"",onChange:w=>m(w.currentTarget.value||null)}),o.jsx(mi,{size:"input-sm",title:y.length>0?"Expand all pools":"Collapse all pools",variant:"light",onClick:()=>e(fN(y.length>0?[]:t)),children:y.length>0?o.jsx(M9,{style:Cw}):o.jsx(E9,{style:Cw})})]}),o.jsx(Hf,{title:"Error showing target pools",children:o.jsx(T.Suspense,{fallback:o.jsx(xe,{mt:"lg",children:Array.from(Array(10),(w,S)=>o.jsx(ta,{height:40,mb:15,width:1e3,mx:"auto"},S))}),children:o.jsx(BTe,{poolNames:t,selectedPool:A&&t[0]||i||null,healthFilter:d,searchFilter:v})})},location.pathname)]})}const mu=({children:t,title:e,icon:n})=>o.jsxs(Xi,{shadow:"xs",withBorder:!0,p:"md",children:[e&&o.jsxs(pt,{wrap:"nowrap",align:"center",ml:"xs",mb:"sm",gap:"xs",fz:"xl",fw:600,children:[n&&o.jsx(n,{style:kSe}),e]}),t]}),fx=({children:t})=>o.jsx(Mn,{gap:"lg",maw:1e3,mx:"auto",mt:"xs",children:t});function FTe(){const{data:t}=br({path:"/status/buildinfo"}),{data:e}=br({path:"/status/runtimeinfo"}),{useLocalTime:n}=xr(),i={startTime:{title:"Start time",formatValue:r=>Tf(new Date(r).valueOf()/1e3,n)},CWD:{title:"Working directory"},hostname:{title:"Hostname"},serverTime:{title:"Server Time",formatValue:r=>Tf(new Date(r).valueOf()/1e3,n)},reloadConfigSuccess:{title:"Configuration reload",formatValue:r=>r?"Successful":"Unsuccessful"},lastConfigTime:{title:"Last successful configuration reload",formatValue:r=>Tf(new Date(r).valueOf()/1e3,n)},corruptionCount:{title:"WAL corruptions"},goroutineCount:{title:"Goroutines"},storageRetention:{title:"Storage retention"}};return o.jsxs(fx,{children:[o.jsx(mu,{title:"Build information",icon:Poe,children:o.jsx(le,{layout:"fixed",children:o.jsx(le.Tbody,{children:Object.entries(t.data).map(([r,s])=>o.jsxs(le.Tr,{children:[o.jsx(le.Th,{style:{textTransform:"capitalize"},children:r}),o.jsx(le.Td,{children:s})]},r))})})}),o.jsx(mu,{title:"Runtime information",icon:voe,children:o.jsx(le,{layout:"fixed",children:o.jsx(le.Tbody,{children:Object.entries(e.data).map(([r,s])=>{const{title:a=r,formatValue:l=u=>u}=i[r]||{};return o.jsxs(le.Tr,{children:[o.jsx(le.Th,{style:{textTransform:"capitalize"},children:a}),o.jsx(le.Td,{children:l(s)})]},r)})})})})]})}De.extend(Yq);function $Te(){const{data:{data:{headStats:t,labelValueCountByLabelName:e,seriesCountByMetricName:n,memoryInBytesByLabelName:i,seriesCountByLabelValuePair:r}}}=br({path:"/status/tsdb"}),{data:{data:{api:s}}}=br({path:"/features"}),a=(s==null?void 0:s.admin)??!1,{useLocalTime:l,pathPrefix:u}=xr(),d=W=>{const z=Tf(W,l);return z==="Invalid Date"?p===0?"No datapoints yet":`Error parsing time (${W})`:z},{chunkCount:f,numSeries:p,numLabelPairs:m,minTime:v,maxTime:y}=t,b=[{name:"Number of Series",value:p},{name:"Number of Chunks",value:f},{name:"Number of Label Pairs",value:m},{name:"Current Min Time",value:`${d(v/1e3)}`},{name:"Current Max Time",value:`${d(y/1e3)}`}],[A,w]=T.useState(""),[S,j]=T.useState(null),[C,k]=T.useState(null),[E,M]=T.useState(null),[R,D]=T.useState(null),[F,I]=T.useState(!1),[Q,G]=T.useState(null),[L,q]=T.useState(null),[N,P]=T.useState(!1),Y=async()=>{var U;M(null),D(null);const W=A.split(`
`).map(V=>V.trim()).filter(V=>V!=="");if(W.length===0){M("Provide at least one match[] selector.");return}const z=new URLSearchParams;for(const V of W)z.append("match[]",V);S!==null&&z.append("start",(S/1e3).toString()),C!==null&&z.append("end",(C/1e3).toString()),I(!0);try{const V=await fetch(`${u}/${fE}/admin/tsdb/delete_series?${z.toString()}`,{method:"POST",credentials:"same-origin"});if(!V.ok){if((U=V.headers.get("content-type"))!=null&&U.startsWith("application/json")){const J=await V.json();throw new Error(J.error||V.statusText)}throw new Error(V.statusText)}D(`Successfully deleted series matching: ${W.join(", ")}`),w(""),j(null),k(null)}catch(V){M(V instanceof Error?V.message:"Unknown error")}finally{I(!1)}},K=async()=>{var W;G(null),q(null),P(!0);try{const z=await fetch(`${u}/${fE}/admin/tsdb/clean_tombstones`,{method:"POST",credentials:"same-origin"});if(!z.ok){if((W=z.headers.get("content-type"))!=null&&W.startsWith("application/json")){const U=await z.json();throw new Error(U.error||z.statusText)}throw new Error(z.statusText)}q("Tombstones cleaned successfully.")}catch(z){G(z instanceof Error?z.message:"Unknown error")}finally{P(!1)}};return o.jsxs(fx,{children:[[{title:"TSDB Head Status",stats:b,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:i,formatAsCode:!0},{title:"Top 10 series count by label value pairs",stats:r,formatAsCode:!0}].map(({title:W,unit:z="Count",stats:U,formatAsCode:V})=>o.jsx(mu,{title:W,children:o.jsxs(le,{layout:"fixed",children:[o.jsx(le.Thead,{children:o.jsxs(le.Tr,{children:[o.jsx(le.Th,{children:"Name"}),o.jsx(le.Th,{children:z})]})}),o.jsx(le.Tbody,{children:U.map(({name:J,value:ee})=>o.jsxs(le.Tr,{children:[o.jsx(le.Td,{style:{wordBreak:"break-all"},children:V?o.jsx("code",{children:J}):J}),o.jsx(le.Td,{children:ee})]},J))})]})})),o.jsx(mu,{title:"Delete Series",icon:EO,children:o.jsxs(Mn,{gap:"md",children:[o.jsx(Pt,{icon:o.jsx(Fr,{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.'}),E&&o.jsx(Pt,{color:"red",title:"Error",withCloseButton:!0,onClose:()=>M(null),children:E}),R&&o.jsx(Pt,{icon:o.jsx(Ym,{size:16}),color:"green",title:"Success",withCloseButton:!0,onClose:()=>D(null),children:R}),o.jsx(HM,{label:"Series selector(s)",description:'PromQL series selectors, one per line. Example: up{job="prometheus"}',placeholder:'up{job="prometheus"}',disabled:!a,title:a?"":"Requires --web.enable-admin-api flag",value:A,onChange:W=>w(W.currentTarget.value),autosize:!0,minRows:2,maxRows:6}),o.jsxs(pt,{grow:!0,children:[o.jsx(Fv,{label:"Start time",description:"Optional",placeholder:"Select start time",valueFormat:"YYYY-MM-DD HH:mm:ss",disabled:!a,title:a?"":"Requires --web.enable-admin-api flag",withSeconds:!0,value:S!==null?l?De(S).format():De(S).subtract(De().utcOffset(),"minutes").format():void 0,onChange:W=>j(W?l?new Date(W).getTime():De.utc(W).valueOf():null),clearable:!0}),o.jsx(Fv,{label:"End time",description:"Optional",placeholder:"Select end time",valueFormat:"YYYY-MM-DD HH:mm:ss",disabled:!a,title:a?"":"Requires --web.enable-admin-api flag",withSeconds:!0,value:C!==null?l?De(C).format():De(C).subtract(De().utcOffset(),"minutes").format():void 0,onChange:W=>k(W?l?new Date(W).getTime():De.utc(W).valueOf():null),clearable:!0})]}),o.jsx(pt,{children:o.jsx(Lr,{color:"red",leftSection:o.jsx(EO,{size:16}),onClick:Y,loading:F,disabled:!A.trim()||!a,title:a?"":"Requires --web.enable-admin-api flag",children:"Delete series"})})]})}),o.jsx(mu,{title:"Clean Tombstones",children:o.jsxs(Mn,{gap:"md",children:[Q&&o.jsx(Pt,{color:"red",title:"Error",withCloseButton:!0,onClose:()=>G(null),children:Q}),L&&o.jsx(Pt,{icon:o.jsx(Ym,{size:16}),color:"green",title:"Success",withCloseButton:!0,onClose:()=>q(null),children:L}),o.jsx(ft,{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."}),o.jsx(pt,{children:o.jsx(Lr,{variant:"outline",onClick:K,loading:N,disabled:!a,title:a?"":"Requires --web.enable-admin-api flag",children:"Clean tombstones"})})]})})]})}const zTe="_th_1w9xk_1",HTe="_control_1w9xk_5",qTe="_icon_1w9xk_17",aO={th:zTe,control:HTe,icon:qTe};function VF({children:t,reversed:e,sorted:n,onSort:i}){const r=n?e?hR:Rv:boe;return o.jsx(le.Th,{className:aO.th,children:o.jsx(Fi,{onClick:i,className:aO.control,children:o.jsxs(pt,{justify:"space-between",children:[o.jsx(ft,{fw:600,fz:"sm",children:t}),o.jsx(Ov,{className:aO.icon,children:o.jsx(r,{style:{width:ge(16),height:ge(16)},stroke:1.5})})]})})})}function GF(t,e){const n=e.toLowerCase().trim();return t.filter(i=>cr(t[0]).some(r=>i[r].toLowerCase().includes(n)))}function XF(t,e){const{sortBy:n}=e;return GF(n?[...t].sort((i,r)=>e.reversed?r[n].localeCompare(i[n]):i[n].localeCompare(r[n])):t,e.search)}function QTe(){const{data:t}=br({path:"/status/flags"}),e=Object.entries(t.data).map(([v,y])=>({flag:v,value:y})),[n,i]=T.useState(""),[r,s]=T.useState(e),[a,l]=T.useState(null),[u,d]=T.useState(!1),f=v=>{const y=v===a?!u:!1;d(y),l(v),s(XF(e,{sortBy:v,reversed:y,search:n}))},p=v=>{const{value:y}=v.currentTarget;i(y),s(XF(e,{sortBy:a,reversed:u,search:y}))},m=r.map(v=>o.jsxs(le.Tr,{children:[o.jsx(le.Td,{children:o.jsxs("code",{children:["--",v.flag]})}),o.jsx(le.Td,{children:o.jsx("code",{children:v.value})})]},v.flag));return o.jsx(fx,{children:o.jsxs(mu,{children:[o.jsx(yc,{placeholder:"Filter by flag name or value",mb:"md",autoFocus:!0,leftSection:o.jsx(yd,{style:Gf}),value:n,onChange:p}),o.jsxs(le,{horizontalSpacing:"md",verticalSpacing:"xs",miw:700,layout:"fixed",children:[o.jsx(le.Tbody,{children:o.jsxs(le.Tr,{children:[o.jsx(VF,{sorted:a==="flag",reversed:u,onSort:()=>f("flag"),children:"Flag"}),o.jsx(VF,{sorted:a==="value",reversed:u,onSort:()=>f("value"),children:"Value"})]})}),o.jsx(le.Tbody,{children:m.length>0?m:o.jsx(le.Tr,{children:o.jsx(le.Td,{colSpan:2,children:o.jsx(ft,{fw:500,ta:"center",children:"Nothing found"})})})})]})]})})}const LE={getHighlighter:()=>({code:t})=>({highlightedCode:t,isHighlighted:!1})},bG=T.createContext({adapter:LE,highlight:LE.getHighlighter(null)});function YTe({adapter:t,children:e}){const[n,i]=T.useState(null),r=T.useMemo(()=>t.getHighlighter(n),[t,n]);return T.useEffect(()=>{t.loadContext&&t.loadContext().then(i)},[t]),o.jsx(bG,{value:{adapter:t,highlight:r},children:e})}function WTe(){var t;return((t=T.use(bG))==null?void 0:t.highlight)||LE.getHighlighter(null)}const[UTe,VTe]=rs("CodeHighlightProvider was not found in the component tree"),Fj=ss(t=>{const{children:e,vars:n,tooltipLabel:i,...r}=we("CodeHighlightControl",null,t),s=VTe(),a=s.getStyles("controlTooltip"),l=o.jsx(mi,{...s.getStyles("control"),...r,variant:"none","data-code-color-scheme":s.codeColorScheme,children:e});return i?o.jsx(Gi,{label:i,fz:"sm",position:"bottom",classNames:{tooltip:a.className},styles:{tooltip:a.style},"data-code-color-scheme":s.codeColorScheme,transitionProps:{duration:0},children:l}):l});Fj.displayName="@mantine/code-highlight/CodeHighlightControl";function AG({copied:t,...e}){return o.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?o.jsxs(o.Fragment,{children:[o.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),o.jsx("path",{d:"M5 12l5 5l10 -10"})]}):o.jsxs(o.Fragment,{children:[o.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),o.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"}),o.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"})]})})}AG.displayName="@mantine/code-highlight/CopyIcon";function wG({code:t,copyLabel:e="Copy",copiedLabel:n="Copied"}){const i=b8();return o.jsx(Fj,{onClick:()=>i.copy(t.trim()),variant:"none",tooltipLabel:i.copied?n:e,"aria-label":i.copied?n:`${e} code`,children:o.jsx(AG,{copied:i.copied})})}wG.displayName="@mantine/code-highlight/CopyCodeButton";function SG({expanded:t,style:e,...n}){return o.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?o.jsxs(o.Fragment,{children:[o.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),o.jsx("path",{d:"M12 13v-8l-3 3m6 0l-3 -3"}),o.jsx("path",{d:"M9 17l1 0"}),o.jsx("path",{d:"M14 17l1 0"}),o.jsx("path",{d:"M19 17l1 0"}),o.jsx("path",{d:"M4 17l1 0"})]}):o.jsxs(o.Fragment,{children:[o.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),o.jsx("path",{d:"M12 11v8l3 -3m-6 0l3 3"}),o.jsx("path",{d:"M9 7l1 0"}),o.jsx("path",{d:"M14 7l1 0"}),o.jsx("path",{d:"M19 7l1 0"}),o.jsx("path",{d:"M4 7l1 0"})]})})}SG.displayName="@mantine/code-highlight/ExpandIcon";function jG({expanded:t,onExpand:e,expandCodeLabel:n="Expand code",collapseCodeLabel:i="Collapse code"}){return o.jsx(Fj,{onClick:()=>e(!t),tooltipLabel:t?i:n,"aria-label":t?i:n,children:o.jsx(SG,{expanded:t})})}jG.displayName="@mantine/code-highlight/ExpandCodeButton";var CG={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 GTe={withCopyButton:!0,expandCodeLabel:"Expand code",collapseCodeLabel:"Collapse code"},_G=(t,{maxCollapsedHeight:e,background:n,radius:i})=>({codeHighlight:{"--ch-max-height":ge(e),"--ch-background":n?Oi(n,t):void 0,"--ch-radius":typeof i<"u"?ai(i):void 0}}),px=Pe(t=>{var U,V,J,ee;const e=we("CodeHighlight",GTe,t),{classNames:n,className:i,style:r,styles:s,unstyled:a,vars:l,code:u,copiedLabel:d,copyLabel:f,defaultExpanded:p,expanded:m,onExpandedChange:v,maxCollapsedHeight:y,withCopyButton:b,withExpandButton:A,expandCodeLabel:w,collapseCodeLabel:S,radius:j,background:C,withBorder:k,withLineNumbers:E,controls:M,language:R,codeColorScheme:D,__withOffset:F,__inline:I,__staticSelector:Q,attributes:G,...L}=e,q=gt({name:Q||"CodeHighlight",classes:CG,props:e,className:i,style:r,classNames:n,styles:s,unstyled:a,attributes:G,vars:l,varsResolver:_G,rootSelector:"codeHighlight"}),[N,P]=hr({value:m,defaultValue:p,finalValue:!0,onChange:v}),Y=M&&M.length>0||A||b,K=Lw(),W=WTe()({code:u.trim(),language:R,colorScheme:D??K}),z=W.isHighlighted?{dangerouslySetInnerHTML:{__html:W.highlightedCode}}:{children:u.trim()};return I?o.jsx(xe,{component:"code",...L,...W.codeElementProps,...q("codeHighlight",{className:Yi((U=W.codeElementProps)==null?void 0:U.className,i),style:[{...(V=W.codeElementProps)==null?void 0:V.style},r]}),"data-with-border":k||void 0,...z}):o.jsx(UTe,{value:{getStyles:q,codeColorScheme:D},children:o.jsxs(xe,{...q("codeHighlight"),...L,dir:"ltr","data-code-color-scheme":D,"data-with-border":k||void 0,children:[Y&&o.jsxs("div",{...q("controls"),"data-with-offset":F||void 0,children:[M,A&&o.jsx(jG,{expanded:N,onExpand:P,expandCodeLabel:w,collapseCodeLabel:S}),b&&o.jsx(wG,{code:u,copiedLabel:d,copyLabel:f})]}),o.jsx(Co,{type:"hover",scrollbarSize:4,dir:"ltr",offsetScrollbars:!1,"data-collapsed":!N||void 0,styles:{viewport:{overscrollBehaviorInline:"none"}},...q("scrollarea"),children:o.jsxs("div",{...q("codeWrapper"),children:[E&&o.jsx("div",{...q("lineNumbers"),"data-with-offset":F||void 0,children:u.trim().split(`
`).map((ce,he)=>o.jsx("div",{children:he+1},he))}),o.jsx("pre",{...q("pre"),"data-with-offset":F||void 0,children:o.jsx("code",{...W.codeElementProps,...q("code",{className:(J=W.codeElementProps)==null?void 0:J.className,style:(ee=W.codeElementProps)==null?void 0:ee.style}),...z})})]})}),o.jsx(Fi,{...q("showCodeButton"),mod:{hidden:N},onClick:()=>P(!0),"data-code-color-scheme":D,children:w})]})})});px.displayName="@mantine/code-highlight/CodeHighlight";px.classes=CG;px.varsResolver=_G;px.Control=Fj;function XTe(t){return{getHighlighter:()=>({code:e,language:n})=>{const i=t.getLanguage(n)?n:"plaintext";return{highlightedCode:t.highlight(e.trim(),{language:i}).value,isHighlighted:!0,codeElementProps:{className:`hljs ${i}`}}}}}function KTe(){const{data:{data:{yaml:t}}}=br({path:"/status/config"});return o.jsx(px,{code:t,language:"yaml",miw:"50vw",w:"fit-content",maw:"calc(100vw - 75px)",mx:"auto",mt:"xs"})}const ZTe=()=>o.jsx(fx,{children:o.jsxs(mu,{title:"Prometheus Agent",icon:Toe,children:[o.jsxs(ft,{p:"md",children:["This Prometheus instance is running in ",o.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."]}),o.jsx(ft,{p:"md",children:"Some features are not available in this mode, such as querying and alerting."})]})}),JTe=()=>{const{colorScheme:t,setColorScheme:e}=M8(),n={style:{width:ge(20),height:ge(20),display:"block"},stroke:1.5};return o.jsx(mi,{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"?o.jsx(Joe,{...n}):t==="dark"?o.jsx(Xoe,{...n}):o.jsx(Woe,{...n})})},eOe=()=>{const{useLocalTime:t,enableQueryHistory:e,enableAutocomplete:n,enableSyntaxHighlighting:i,enableLinter:r,showAnnotations:s,showQueryWarnings:a,showQueryInfoNotices:l,ruleGroupsPerPage:u,alertGroupsPerPage:d}=xr(),f=Tu();return o.jsxs(En,{position:"bottom",withArrow:!0,shadow:"md",children:[o.jsx(En.Target,{children:o.jsx(mi,{color:"gray",title:"Settings","aria-label":"Settings",size:32,children:o.jsx(_oe,{style:Au})})}),o.jsx(En.Dropdown,{children:o.jsxs(pt,{align:"flex-start",children:[o.jsxs(Mn,{children:[o.jsx(of,{p:"md",legend:"Global settings",children:o.jsx(Vs,{checked:t,label:"Use local time",onChange:p=>f(ba({useLocalTime:p.currentTarget.checked}))})}),o.jsx(of,{p:"md",legend:"Query page settings",children:o.jsxs(Mn,{children:[o.jsx(Vs,{checked:e,label:"Enable query history",onChange:p=>f(ba({enableQueryHistory:p.currentTarget.checked}))}),o.jsx(Vs,{checked:n,label:"Enable autocomplete",onChange:p=>f(ba({enableAutocomplete:p.currentTarget.checked}))}),o.jsx(Vs,{checked:i,label:"Enable syntax highlighting",onChange:p=>f(ba({enableSyntaxHighlighting:p.currentTarget.checked}))}),o.jsx(Vs,{checked:r,label:"Enable linter",onChange:p=>f(ba({enableLinter:p.currentTarget.checked}))}),o.jsx(Vs,{checked:a,label:"Show query warnings",onChange:p=>f(ba({showQueryWarnings:p.currentTarget.checked}))}),o.jsx(Vs,{checked:l,label:"Show query info notices",onChange:p=>f(ba({showQueryInfoNotices:p.currentTarget.checked}))})]})})]}),o.jsxs(Mn,{children:[o.jsx(of,{p:"md",legend:"Alerts page settings",children:o.jsxs(Mn,{children:[o.jsx(Vs,{checked:s,label:"Show expanded annotations",onChange:p=>f(ba({showAnnotations:p.currentTarget.checked}))}),o.jsx(Mv,{min:1,allowDecimal:!1,label:"Alert groups per page",value:d,onChange:p=>{typeof p=="number"&&f(ba({alertGroupsPerPage:p}))}})]})}),o.jsx(of,{p:"md",legend:"Rules page settings",children:o.jsx(Mv,{min:1,allowDecimal:!1,label:"Rule groups per page",value:u,onChange:p=>{typeof p=="number"&&f(ba({ruleGroupsPerPage:p}))}})})]})]})})]})},KF="is starting up...",tOe="is shutting down...",nOe="is not ready...",iOe=()=>{const{pathPrefix:t,agentMode:e}=xr(),n=Tu(),[i,r]=T.useState(0),[s,a]=T.useState(""),{data:l}=gq({queryKey:["ready",i],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 a(""),!0;case 503:return m.headers.get("X-Prometheus-Stopping")==="true"?a(tOe):a(KF),!1;default:throw new Error(m.statusText)}}catch{throw new Error("Unexpected error while fetching ready status")}}}),u=s===KF,{data:d,isSuccess:f}=br({path:"/status/walreplay",key:["walreplay",i]});return T.useEffect(()=>{l&&n(ba({ready:l}))},[l,n]),T.useEffect(()=>{const p=setInterval(()=>r(m=>m+1),1e3);return()=>clearInterval(p)},[]),o.jsx(Pt,{color:"yellow",title:"Prometheus "+(e&&"Agent "||"")+(s||nOe),icon:o.jsx(Fr,{}),maw:500,mx:"auto",mt:"lg",children:u&&f&&d&&o.jsxs(Mn,{children:[o.jsxs("strong",{children:["Replaying WAL (",d.data.current,"/",d.data.max,")"]}),o.jsx(wg,{size:"xl",animated:!0,color:"yellow",value:(d.data.current-d.data.min+1)/(d.data.max-d.data.min+1)*100})]})})},CA=({children:t})=>{const{ready:e}=xr();return e?o.jsx(o.Fragment,{children:t}):o.jsx(iOe,{})},rOe={notifications:[],isConnectionError:!1},kG=T.createContext(rOe),sOe=()=>T.useContext(kG);async function oOe(t,e){const n=t.getReader();let i;for(;!(i=await n.read()).done;)e(i.value)}function aOe(t){let e,n,i,r=!1;return function(a){e===void 0?(e=a,n=0,i=-1):e=cOe(e,a);const l=e.length;let u=0;for(;n<l;){r&&(e[n]===10&&(u=++n),r=!1);let d=-1;for(;n<l&&d===-1;++n)switch(e[n]){case 58:i===-1&&(i=n-u);break;case 13:r=!0;case 10:d=n;break}if(d===-1)break;t(e.subarray(u,d),i),u=n,i=-1}u===l?e=void 0:u!==0&&(e=e.subarray(u),n-=u)}}function lOe(t,e,n){let i=ZF();const r=new TextDecoder;return function(a,l){if(a.length===0)n==null||n(i),i=ZF();else if(l>0){const u=r.decode(a.subarray(0,l)),d=l+(a[l+1]===32?2:1),f=r.decode(a.subarray(d));switch(u){case"data":i.data=i.data?i.data+`
`+f:f;break;case"event":i.event=f;break;case"id":t(i.id=f);break;case"retry":const p=parseInt(f,10);isNaN(p)||e(i.retry=p);break}}}}function cOe(t,e){const n=new Uint8Array(t.length+e.length);return n.set(t),n.set(e,t.length),n}function ZF(){return{data:"",event:"",id:"",retry:void 0}}var uOe=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]]);return n};const PE="text/event-stream",hOe=1e3,JF="last-event-id";function dOe(t,e){var{signal:n,headers:i,onopen:r,onmessage:s,onclose:a,onerror:l,openWhenHidden:u,fetch:d}=e,f=uOe(e,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((p,m)=>{const v=Object.assign({},i);v.accept||(v.accept=PE);let y;function b(){y.abort(),document.hidden||k()}u||document.addEventListener("visibilitychange",b);let A=hOe,w=0;function S(){document.removeEventListener("visibilitychange",b),window.clearTimeout(w),y.abort()}n==null||n.addEventListener("abort",()=>{S(),p()});const j=d??window.fetch,C=r??fOe;async function k(){var E;y=new AbortController;try{const M=await j(t,Object.assign(Object.assign({},f),{headers:v,signal:y.signal}));await C(M),await oOe(M.body,aOe(lOe(R=>{R?v[JF]=R:delete v[JF]},R=>{A=R},s))),a==null||a(),S(),p()}catch(M){if(!y.signal.aborted)try{const R=(E=l==null?void 0:l(M))!==null&&E!==void 0?E:A;window.clearTimeout(w),w=window.setTimeout(k,R)}catch(R){S(),m(R)}}}k()})}function fOe(t){const e=t.headers.get("content-type");if(!(e!=null&&e.startsWith(PE)))throw new Error(`Expected content-type to be ${PE}, Actual: ${e}`)}const pOe=({children:t})=>{const{pathPrefix:e}=xr(),[n,i]=T.useState([]),[r,s]=T.useState(!1),[a,l]=T.useState(!1),{data:u,isError:d}=ud({path:"/notifications",enabled:a,refetchInterval:1e4});return T.useEffect(()=>{u&&u.data&&i(u.data),s(d)},[u,d]),T.useEffect(()=>{const f=new AbortController;return dOe(`${e}/api/v1/notifications/live`,{signal:f.signal,async onopen(p){if(p.ok)p.status===200?(i([]),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);i(v=>{const y=[...v.filter(b=>b.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]),o.jsx(kG.Provider,{value:{notifications:n,isConnectionError:r},children:t})},mOe=()=>{const{notifications:t,isConnectionError:e}=sOe(),{useLocalTime:n}=xr();return t.length===0&&!e?null:o.jsx(uS,{color:"red",size:16,label:e?"!":t.length,children:o.jsxs(En,{position:"bottom-end",shadow:"md",withArrow:!0,children:[o.jsx(En.Target,{children:o.jsx(mi,{color:"gray",title:"Notifications","aria-label":"Notifications",size:32,children:o.jsx(soe,{style:Au})})}),o.jsx(En.Dropdown,{children:o.jsxs(Mn,{gap:"xs",children:[o.jsx(ft,{fw:700,size:"xs",c:"dimmed",ta:"center",children:"Notifications"}),o.jsx(Co.Autosize,{mah:200,children:e?o.jsx(Xi,{p:"xs",color:"red",children:o.jsxs(pt,{wrap:"nowrap",children:[o.jsx(coe,{color:"red",style:{width:ge(20),height:ge(20)}}),o.jsxs(Mn,{gap:"0",children:[o.jsx(ft,{size:"sm",fw:500,children:"Real-time notifications interrupted."}),o.jsx(ft,{size:"xs",c:"dimmed",children:"Please refresh the page or check your connection."})]})]})}):t.length===0?o.jsx(ft,{ta:"center",c:"dimmed",children:"No notifications"}):t.map((i,r)=>o.jsx(Xi,{p:"xs",children:o.jsxs(pt,{wrap:"nowrap",align:"flex-start",children:[o.jsx(Fr,{color:"red",style:{width:ge(20),height:ge(20),marginTop:ge(3)}}),o.jsxs(Mn,{maw:250,gap:5,children:[o.jsx(ft,{size:"sm",fw:500,children:i.text}),o.jsx(ft,{size:"xs",c:"dimmed",children:Tf(new Date(i.date).valueOf()/1e3,n)})]})]})},r))})]})})]})})},gOe=({children:t})=>{var e;const{navigator:n}=T.useContext(Oo),i=mR(),r=(e=T.useContext(Yf))==null?void 0:e.router,s=Ia();return t({replace(l){i(l.search||"?",{replace:!0,state:l.state})},push(l){i(l.search||"?",{replace:!1,state:l.state})},get location(){var l,u,d;return(d=(u=(l=r==null?void 0:r.state)==null?void 0:l.location)!=null?u:n==null?void 0:n.location)!=null?d:s}})},TG="serviceDiscovery.collapsedPools",vOe={collapsedPools:zo(TG,[]),showLimitAlert:!1},OG=HS({name:"serviceDiscoveryPage",initialState:vOe,reducers:{setCollapsedPools:(t,{payload:e})=>{t.collapsedPools=e},setShowLimitAlert:(t,{payload:e})=>{t.showLimitAlert=e}}}),{setCollapsedPools:pN,setShowLimitAlert:FE}=OG.actions,yOe=OG.reducer,df={width:Ps(18),height:Ps(18),verticalAlign:"middle"},xOe=(t,e)=>o.jsxs(le,{w:"60%",withTableBorder:!0,withColumnBorders:!0,bg:"light-dark(var(--mantine-color-gray-0), var(--mantine-color-gray-8))",children:[o.jsx(le.Thead,{children:o.jsx(le.Tr,{bg:"light-dark(var(--mantine-color-gray-1), var(--mantine-color-gray-7))",children:o.jsx(le.Th,{colSpan:2,children:o.jsxs(pt,{gap:"xs",children:[o.jsx(N9,{style:df})," Rule ",e+1]})})})}),o.jsx(le.Tbody,{children:Object.entries(t).sort(([n],[i])=>{const r=["action","source_labels","regex","modulus","replacement","target_label"],s=r.indexOf(n),a=r.indexOf(i);return s===-1&&a===-1?n.localeCompare(i):s===-1?1:a===-1?-1:s-a}).map(([n,i])=>o.jsxs(le.Tr,{children:[o.jsx(le.Th,{children:o.jsx("code",{children:n})}),o.jsx(le.Td,{children:o.jsx("code",{children:typeof i=="object"?JSON.stringify(i):String(i)})})]},n))})]}),e8=(t,e)=>t===null?o.jsx(ft,{c:"dimmed",children:"dropped"}):o.jsxs(le,{w:"50%",withTableBorder:!0,children:[o.jsx(le.Thead,{children:o.jsx(le.Tr,{bg:"light-dark(var(--mantine-color-gray-1), var(--mantine-color-gray-7))",children:o.jsx(le.Th,{colSpan:3,children:o.jsxs(pt,{gap:"xs",children:[o.jsx(Moe,{style:df})," Labels"]})})})}),o.jsx(le.Tbody,{children:Object.entries(t).concat(e?Object.entries(e).filter(([n])=>t[n]===void 0):[]).sort(([n],[i])=>n.localeCompare(i)).map(([n,i])=>{const r=e!==null&&e[n]===void 0,s=e!==null&&!r&&e[n]!==i,a=e!==null&&!s&&e[n]!==void 0&&t[n]===void 0;return o.jsxs(le.Tr,{bg:r?"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))":a?"light-dark(var(--mantine-color-red-1), var(--mantine-color-red-8))":void 0,children:[o.jsx(le.Td,{w:40,children:r?o.jsx(Nse,{style:df}):s?o.jsx(N9,{style:df}):a?o.jsx(Rse,{style:df}):null}),o.jsx(le.Th,{children:o.jsx("code",{children:n})}),o.jsx(le.Td,{children:o.jsx("code",{children:i})})]},n)})})]}),bOe=({labels:t,pool:e})=>{const{data:n}=br({path:"/targets/relabel_steps",params:{labels:JSON.stringify(t),scrapePool:e}});return o.jsxs(Mn,{align:"center",children:[e8(t,null),n.data.steps.map((i,r)=>o.jsxs(Vn.Fragment,{children:[o.jsx(D4,{style:df}),xOe(i.rule,r),o.jsx(D4,{style:df}),i.keep?e8(i.output,r===0?t:n.data.steps[r-1].output):o.jsx(ft,{c:"dimmed",children:"dropped"})]},r))]})},AOe=new dx({shouldSort:!0,indexedKeys:["labels","discoveredLabels",["discoveredLabels",/.*/],["labels",/.*/]]}),wOe=new dx({shouldSort:!0,indexedKeys:["discoveredLabels",["discoveredLabels",/.*/]]}),SOe=(t,e,n,i)=>{const{activeTargets:r,droppedTargets:s,droppedTargetCounts:a}=e,l={};for(const f of t)l[f]={targets:[],active:0,total:0,serverTotal:a[f]||0};for(const f of r){const p=l[f.scrapePool];if(!p)throw new Error("Received target information for an unknown scrape pool, likely the list of scrape pools has changed. Please reload the page.");p.active++,p.total++,p.serverTotal++}const u=i.length!==0&&!i.includes("active")?[]:n===""?r:AOe.filter(n,r).map(f=>f.original);for(const f of u)l[f.scrapePool].targets.push({discoveredLabels:f.discoveredLabels,labels:f.labels,isDropped:!1});for(const f of s){const p=l[f.scrapePool];if(!p)throw new Error("Received target information for an unknown scrape pool, likely the list of scrape pools has changed. Please reload the page.");p.total++}const d=i.length!==0&&!i.includes("dropped")?[]:n===""?s:wOe.filter(n,s).map(f=>f.original);for(const f of d)l[f.scrapePool].targets.push({discoveredLabels:f.discoveredLabels,isDropped:!0,labels:{}});return l},jOe=({poolNames:t,selectedPool:e,stateFilter:n,searchFilter:i})=>{const r=Tu(),[s,a]=by({key:"serviceDiscoveryPage.showEmptyPools",defaultValue:!1}),[l,u]=T.useState(null),{data:{data:d}}=br({path:"/targets",params:{scrapePool:e===null?"":e}}),{collapsedPools:f,showLimitAlert:p}=bc(A=>A.serviceDiscoveryPage),[m]=xy(i,250),v=T.useMemo(()=>SOe(e?[e]:t,d,m,n),[e,t,d,m,n]),y=Object.keys(v),b=s?y:y.filter(A=>v[A].targets.length!==0);return o.jsxs(Mn,{children:[y.length===0?o.jsx(Pt,{title:"No scrape pools found",icon:o.jsx(oi,{}),children:"No scrape pools found."}):!s&&y.length!==b.length&&o.jsxs(Pt,{title:"Hiding pools with no matching targets",icon:o.jsx(oi,{}),children:["Hiding ",y.length-b.length," empty pools due to filters or no targets.",o.jsx(Zi,{ml:"md",fz:"1em",onClick:()=>a(!0),children:"Show empty pools"})]}),p&&o.jsxs(Pt,{title:"Found many pools, showing only one",icon:o.jsx(oi,{}),withCloseButton:!0,onClose:()=>r(FE(!1)),children:["There are more than ",EG," scrape pools. Showing only the first one. Use the dropdown to select a different pool."]}),o.jsx(Ki,{multiple:!0,variant:"separated",keepMounted:!1,value:y.filter(A=>!f.includes(A)),onChange:A=>r(pN(y.filter(w=>!A.includes(w)))),children:b.map(A=>{const w=v[A];return o.jsxs(Ki.Item,{value:A,children:[o.jsx(Ki.Control,{children:o.jsxs(pt,{wrap:"nowrap",justify:"space-between",mr:"lg",children:[o.jsx(ft,{children:A}),o.jsxs(pt,{gap:"xs",children:[o.jsxs(ft,{c:"gray.6",children:[w.active," / ",w.serverTotal]}),o.jsx(zy,{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"}]})]})]})}),o.jsxs(Ki.Panel,{children:[w.total!==w.serverTotal&&o.jsxs(Pt,{title:"Only showing partial dropped targets",icon:o.jsx(oi,{}),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 (",o.jsx("code",{children:"keep_dropped_targets"})," configuration setting)."]}),w.total===0?o.jsxs(Pt,{title:"No targets",icon:o.jsx(oi,{}),children:["No targets in this scrape pool.",o.jsx(Zi,{ml:"md",fz:"1em",onClick:()=>a(!1),children:"Hide empty pools"})]}):w.targets.length===0?o.jsxs(Pt,{title:"No matching targets",icon:o.jsx(oi,{}),children:["No targets in this pool match your filter criteria (omitted"," ",w.total," filtered targets).",o.jsx(Zi,{ml:"md",fz:"1em",onClick:()=>a(!1),children:"Hide empty pools"})]}):o.jsx(sg,{allItems:w.targets,child:({items:S})=>o.jsxs(le,{children:[o.jsx(le.Thead,{children:o.jsxs(le.Tr,{children:[o.jsx(le.Th,{w:"50%",children:"Discovered labels"}),o.jsx(le.Th,{w:"50%",children:"Target labels"})]})}),o.jsx(le.Tbody,{children:S.map((j,C)=>o.jsxs(le.Tr,{children:[o.jsx(le.Td,{py:"lg",valign:"top",children:o.jsx(ug,{labels:j.discoveredLabels,wrapper:Mn})}),o.jsx(le.Td,{py:"lg",valign:j.isDropped?"middle":"top",children:o.jsxs(Mn,{children:[j.isDropped?o.jsx(ft,{c:"dimmed",fw:"bold",children:"dropped"}):o.jsx(ug,{labels:j.labels,wrapper:Mn}),o.jsx(Zi,{inherit:!0,onClick:()=>{u({labels:j.discoveredLabels,pool:A})},children:"show relabeling"})]})})]},C))})]})})]})]},A)})}),o.jsx(ra,{size:"95%",opened:l!==null,onClose:()=>u(null),title:"Relabeling steps for target",children:o.jsx(Hf,{title:"Error showing relabeling steps",children:o.jsx(T.Suspense,{fallback:o.jsx(xe,{mt:"lg",children:Array.from(Array(20),(A,w)=>o.jsx(ta,{height:30,mb:15,width:"100%"},w))}),children:o.jsx(bOe,{pool:(l==null?void 0:l.pool)||"",labels:(l==null?void 0:l.labels)||{}})})},location.pathname)})]})},EG=20;function COe(){const{data:{data:{scrapePools:t}}}=br({path:"/scrape_pools"}),e=Tu(),[n,i]=Ma("pool",pd),[r,s]=Ma("state",cc(Pj,[])),[a,l]=Ma("search",cc(pd,"")),{collapsedPools:u,showLimitAlert:d}=bc(p=>p.serviceDiscoveryPage),f=t.length>EG&&n===void 0;return f&&(i(t[0]),e(FE(!0))),o.jsxs(o.Fragment,{children:[o.jsxs(pt,{mb:"md",mt:"xs",children:[o.jsx(jg,{placeholder:"Select scrape pool",data:[{label:"All pools",value:""},...t],value:f&&t[0]||n||null,onChange:p=>{i(p),d&&e(FE(!1))},searchable:!0}),o.jsx(Lj,{options:["active","dropped"],optionClass:p=>p==="active"?wn.healthOk:wn.healthInfo,placeholder:"Filter by state",values:(r==null?void 0:r.filter(p=>p!==null))||[],onChange:p=>s(p)}),o.jsx(yc,{flex:1,leftSection:o.jsx(yd,{style:Gf}),placeholder:"Filter by labels",value:a||"",onChange:p=>l(p.currentTarget.value)}),o.jsx(mi,{size:"input-sm",title:u.length>0?"Expand all pools":"Collapse all pools",variant:"light",onClick:()=>e(pN(u.length>0?[]:t)),children:u.length>0?o.jsx(M9,{style:Cw}):o.jsx(E9,{style:Cw})})]}),o.jsx(Hf,{title:"Error showing target pools",children:o.jsx(T.Suspense,{fallback:o.jsx(xe,{mt:"lg",children:Array.from(Array(10),(p,m)=>o.jsx(ta,{height:40,mb:15,width:1e3,mx:"auto"},m))}),children:o.jsx(jOe,{poolNames:t,selectedPool:f&&t[0]||n||null,stateFilter:r,searchFilter:a})})},location.pathname)]})}function _Oe(){const{data:{data:{activeAlertmanagers:t,droppedAlertmanagers:e}}}=br({path:"/alertmanagers"});return o.jsxs(fx,{children:[o.jsx(mu,{title:"Active Alertmanagers",icon:uR,children:t.length===0?o.jsx(Pt,{title:"No active alertmanagers",icon:o.jsx(oi,{}),children:"No active alertmanagers found."}):o.jsx(le,{layout:"fixed",children:o.jsx(le.Tbody,{children:t.map(n=>o.jsx(le.Tr,{children:o.jsx(le.Td,{children:o.jsx(BE,{endpoint:n.url,globalUrl:n.url})})},n.url))})})}),o.jsx(mu,{title:"Dropped Alertmanagers",icon:vse,children:e.length===0?o.jsx(Pt,{title:"No dropped alertmanagers",icon:o.jsx(oi,{}),children:"No dropped alertmanagers found."}):o.jsx(le,{layout:"fixed",children:o.jsx(le.Tbody,{children:e.map(n=>o.jsx(le.Tr,{children:o.jsx(le.Td,{children:o.jsx(BE,{endpoint:n.url,globalUrl:n.url})})},n.url))})})})]})}var lO,t8;function kOe(){if(t8)return lO;t8=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(ve=>{const pe=re[ve],Ne=typeof pe;(Ne==="object"||Ne==="function")&&!Object.isFrozen(pe)&&t(pe)}),re}class e{constructor(ve){ve.data===void 0&&(ve.data={}),this.data=ve.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 i(re,...ve){const pe=Object.create(null);for(const Ne in re)pe[Ne]=re[Ne];return ve.forEach(function(Ne){for(const Ut in Ne)pe[Ut]=Ne[Ut]}),pe}const r="</span>",s=re=>!!re.scope,a=(re,{prefix:ve})=>{if(re.startsWith("language:"))return re.replace("language:","language-");if(re.includes(".")){const pe=re.split(".");return[`${ve}${pe.shift()}`,...pe.map((Ne,Ut)=>`${Ne}${"_".repeat(Ut+1)}`)].join(" ")}return`${ve}${re}`};class l{constructor(ve,pe){this.buffer="",this.classPrefix=pe.classPrefix,ve.walk(this)}addText(ve){this.buffer+=n(ve)}openNode(ve){if(!s(ve))return;const pe=a(ve.scope,{prefix:this.classPrefix});this.span(pe)}closeNode(ve){s(ve)&&(this.buffer+=r)}value(){return this.buffer}span(ve){this.buffer+=`<span class="${ve}">`}}const u=(re={})=>{const ve={children:[]};return Object.assign(ve,re),ve};class d{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(ve){this.top.children.push(ve)}openNode(ve){const pe=u({scope:ve});this.add(pe),this.stack.push(pe)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(ve){return this.constructor._walk(ve,this.rootNode)}static _walk(ve,pe){return typeof pe=="string"?ve.addText(pe):pe.children&&(ve.openNode(pe),pe.children.forEach(Ne=>this._walk(ve,Ne)),ve.closeNode(pe)),ve}static _collapse(ve){typeof ve!="string"&&ve.children&&(ve.children.every(pe=>typeof pe=="string")?ve.children=[ve.children.join("")]:ve.children.forEach(pe=>{d._collapse(pe)}))}}class f extends d{constructor(ve){super(),this.options=ve}addText(ve){ve!==""&&this.add(ve)}startScope(ve){this.openNode(ve)}endScope(){this.closeNode()}__addSublanguage(ve,pe){const Ne=ve.root;pe&&(Ne.scope=`language:${pe}`),this.add(Ne)}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 b("(?=",re,")")}function v(re){return b("(?:",re,")*")}function y(re){return b("(?:",re,")?")}function b(...re){return re.map(pe=>p(pe)).join("")}function A(re){const ve=re[re.length-1];return typeof ve=="object"&&ve.constructor===Object?(re.splice(re.length-1,1),ve):{}}function w(...re){return"("+(A(re).capture?"":"?:")+re.map(Ne=>p(Ne)).join("|")+")"}function S(re){return new RegExp(re.toString()+"|").exec("").length-1}function j(re,ve){const pe=re&&re.exec(ve);return pe&&pe.index===0}const C=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function k(re,{joinWith:ve}){let pe=0;return re.map(Ne=>{pe+=1;const Ut=pe;let Kt=p(Ne),it="";for(;Kt.length>0;){const rt=C.exec(Kt);if(!rt){it+=Kt;break}it+=Kt.substring(0,rt.index),Kt=Kt.substring(rt.index+rt[0].length),rt[0][0]==="\\"&&rt[1]?it+="\\"+String(Number(rt[1])+Ut):(it+=rt[0],rt[0]==="("&&pe++)}return it}).map(Ne=>`(${Ne})`).join(ve)}const E=/\b\B/,M="[a-zA-Z]\\w*",R="[a-zA-Z_]\\w*",D="\\b\\d+(\\.\\d+)?",F="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",I="\\b(0b[01]+)",Q="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",G=(re={})=>{const ve=/^#![ ]*\//;return re.binary&&(re.begin=b(ve,/.*\b/,re.binary,/\b.*/)),i({scope:"meta",begin:ve,end:/$/,relevance:0,"on:begin":(pe,Ne)=>{pe.index!==0&&Ne.ignoreMatch()}},re)},L={begin:"\\\\[\\s\\S]",relevance:0},q={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[L]},N={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[L]},P={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/},Y=function(re,ve,pe={}){const Ne=i({scope:"comment",begin:re,end:ve,contains:[]},pe);Ne.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 Ut=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 Ne.contains.push({begin:b(/[ ]+/,"(",Ut,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Ne},K=Y("//","$"),W=Y("/\\*","\\*/"),z=Y("#","$"),U={scope:"number",begin:D,relevance:0},V={scope:"number",begin:F,relevance:0},J={scope:"number",begin:I,relevance:0},ee={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[L,{begin:/\[/,end:/\]/,relevance:0,contains:[L]}]},ce={scope:"title",begin:M,relevance:0},he={scope:"title",begin:R,relevance:0},Oe={begin:"\\.\\s*"+R,relevance:0};var Re=Object.freeze({__proto__:null,APOS_STRING_MODE:q,BACKSLASH_ESCAPE:L,BINARY_NUMBER_MODE:J,BINARY_NUMBER_RE:I,COMMENT:Y,C_BLOCK_COMMENT_MODE:W,C_LINE_COMMENT_MODE:K,C_NUMBER_MODE:V,C_NUMBER_RE:F,END_SAME_AS_BEGIN:function(re){return Object.assign(re,{"on:begin":(ve,pe)=>{pe.data._beginMatch=ve[1]},"on:end":(ve,pe)=>{pe.data._beginMatch!==ve[1]&&pe.ignoreMatch()}})},HASH_COMMENT_MODE:z,IDENT_RE:M,MATCH_NOTHING_RE:E,METHOD_GUARD:Oe,NUMBER_MODE:U,NUMBER_RE:D,PHRASAL_WORDS_MODE:P,QUOTE_STRING_MODE:N,REGEXP_MODE:ee,RE_STARTERS_RE:Q,SHEBANG:G,TITLE_MODE:ce,UNDERSCORE_IDENT_RE:R,UNDERSCORE_TITLE_MODE:he});function qe(re,ve){re.input[re.index-1]==="."&&ve.ignoreMatch()}function ie(re,ve){re.className!==void 0&&(re.scope=re.className,delete re.className)}function je(re,ve){ve&&re.beginKeywords&&(re.begin="\\b("+re.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",re.__beforeBegin=qe,re.keywords=re.keywords||re.beginKeywords,delete re.beginKeywords,re.relevance===void 0&&(re.relevance=0))}function se(re,ve){Array.isArray(re.illegal)&&(re.illegal=w(...re.illegal))}function be(re,ve){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 Be(re,ve){re.relevance===void 0&&(re.relevance=1)}const Ce=(re,ve)=>{if(!re.beforeMatch)return;if(re.starts)throw new Error("beforeMatch cannot be used with starts");const pe=Object.assign({},re);Object.keys(re).forEach(Ne=>{delete re[Ne]}),re.keywords=pe.keywords,re.begin=b(pe.beforeMatch,m(pe.begin)),re.starts={relevance:0,contains:[Object.assign(pe,{endsParent:!0})]},re.relevance=0,delete pe.beforeMatch},Ve=["of","and","for","in","not","or","if","then","parent","list","value"],st="keyword";function Ye(re,ve,pe=st){const Ne=Object.create(null);return typeof re=="string"?Ut(pe,re.split(" ")):Array.isArray(re)?Ut(pe,re):Object.keys(re).forEach(function(Kt){Object.assign(Ne,Ye(re[Kt],ve,Kt))}),Ne;function Ut(Kt,it){ve&&(it=it.map(rt=>rt.toLowerCase())),it.forEach(function(rt){const ht=rt.split("|");Ne[ht[0]]=[Kt,Ge(ht[0],ht[1])]})}}function Ge(re,ve){return ve?Number(ve):dt(re)?0:1}function dt(re){return Ve.includes(re.toLowerCase())}const nt={},Ee=re=>{console.error(re)},Qe=(re,...ve)=>{console.log(`WARN: ${re}`,...ve)},Xe=(re,ve)=>{nt[`${re}/${ve}`]||(console.log(`Deprecated as of ${re}. ${ve}`),nt[`${re}/${ve}`]=!0)},Ze=new Error;function vt(re,ve,{key:pe}){let Ne=0;const Ut=re[pe],Kt={},it={};for(let rt=1;rt<=ve.length;rt++)it[rt+Ne]=Ut[rt],Kt[rt+Ne]=!0,Ne+=S(ve[rt-1]);re[pe]=it,re[pe]._emit=Kt,re[pe]._multi=!0}function pn(re){if(Array.isArray(re.begin)){if(re.skip||re.excludeBegin||re.returnBegin)throw Ee("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Ze;if(typeof re.beginScope!="object"||re.beginScope===null)throw Ee("beginScope must be object"),Ze;vt(re,re.begin,{key:"beginScope"}),re.begin=k(re.begin,{joinWith:""})}}function mn(re){if(Array.isArray(re.end)){if(re.skip||re.excludeEnd||re.returnEnd)throw Ee("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Ze;if(typeof re.endScope!="object"||re.endScope===null)throw Ee("endScope must be object"),Ze;vt(re,re.end,{key:"endScope"}),re.end=k(re.end,{joinWith:""})}}function un(re){re.scope&&typeof re.scope=="object"&&re.scope!==null&&(re.beginScope=re.scope,delete re.scope)}function Qt(re){un(re),typeof re.beginScope=="string"&&(re.beginScope={_wrap:re.beginScope}),typeof re.endScope=="string"&&(re.endScope={_wrap:re.endScope}),pn(re),mn(re)}function ct(re){function ve(it,rt){return new RegExp(p(it),"m"+(re.case_insensitive?"i":"")+(re.unicodeRegex?"u":"")+(rt?"g":""))}class pe{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(rt,ht){ht.position=this.position++,this.matchIndexes[this.matchAt]=ht,this.regexes.push([ht,rt]),this.matchAt+=S(rt)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const rt=this.regexes.map(ht=>ht[1]);this.matcherRe=ve(k(rt,{joinWith:"|"}),!0),this.lastIndex=0}exec(rt){this.matcherRe.lastIndex=this.lastIndex;const ht=this.matcherRe.exec(rt);if(!ht)return null;const Et=ht.findIndex((Ct,vn)=>vn>0&&Ct!==void 0),Tt=this.matchIndexes[Et];return ht.splice(0,Et),Object.assign(ht,Tt)}}class Ne{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(rt){if(this.multiRegexes[rt])return this.multiRegexes[rt];const ht=new pe;return this.rules.slice(rt).forEach(([Et,Tt])=>ht.addRule(Et,Tt)),ht.compile(),this.multiRegexes[rt]=ht,ht}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(rt,ht){this.rules.push([rt,ht]),ht.type==="begin"&&this.count++}exec(rt){const ht=this.getMatcher(this.regexIndex);ht.lastIndex=this.lastIndex;let Et=ht.exec(rt);if(this.resumingScanAtSamePosition()&&!(Et&&Et.index===this.lastIndex)){const Tt=this.getMatcher(0);Tt.lastIndex=this.lastIndex+1,Et=Tt.exec(rt)}return Et&&(this.regexIndex+=Et.position+1,this.regexIndex===this.count&&this.considerAll()),Et}}function Ut(it){const rt=new Ne;return it.contains.forEach(ht=>rt.addRule(ht.begin,{rule:ht,type:"begin"})),it.terminatorEnd&&rt.addRule(it.terminatorEnd,{type:"end"}),it.illegal&&rt.addRule(it.illegal,{type:"illegal"}),rt}function Kt(it,rt){const ht=it;if(it.isCompiled)return ht;[ie,be,Qt,Ce].forEach(Tt=>Tt(it,rt)),re.compilerExtensions.forEach(Tt=>Tt(it,rt)),it.__beforeBegin=null,[je,se,Be].forEach(Tt=>Tt(it,rt)),it.isCompiled=!0;let Et=null;return typeof it.keywords=="object"&&it.keywords.$pattern&&(it.keywords=Object.assign({},it.keywords),Et=it.keywords.$pattern,delete it.keywords.$pattern),Et=Et||/\w+/,it.keywords&&(it.keywords=Ye(it.keywords,re.case_insensitive)),ht.keywordPatternRe=ve(Et,!0),rt&&(it.begin||(it.begin=/\B|\b/),ht.beginRe=ve(ht.begin),!it.end&&!it.endsWithParent&&(it.end=/\B|\b/),it.end&&(ht.endRe=ve(ht.end)),ht.terminatorEnd=p(ht.end)||"",it.endsWithParent&&rt.terminatorEnd&&(ht.terminatorEnd+=(it.end?"|":"")+rt.terminatorEnd)),it.illegal&&(ht.illegalRe=ve(it.illegal)),it.contains||(it.contains=[]),it.contains=[].concat(...it.contains.map(function(Tt){return on(Tt==="self"?it:Tt)})),it.contains.forEach(function(Tt){Kt(Tt,ht)}),it.starts&&Kt(it.starts,rt),ht.matcher=Ut(ht),ht}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=i(re.classNameAliases||{}),Kt(re)}function zt(re){return re?re.endsWithParent||zt(re.starts):!1}function on(re){return re.variants&&!re.cachedVariants&&(re.cachedVariants=re.variants.map(function(ve){return i(re,{variants:null},ve)})),re.cachedVariants?re.cachedVariants:zt(re)?i(re,{starts:re.starts?i(re.starts):null}):Object.isFrozen(re)?i(re):re}var Lt="11.11.1";class It extends Error{constructor(ve,pe){super(ve),this.name="HTMLInjectionError",this.html=pe}}const $t=n,dn=i,ji=Symbol("nomatch"),tn=7,an=function(re){const ve=Object.create(null),pe=Object.create(null),Ne=[];let Ut=!0;const Kt="Could not find the language '{}', did you forget to load/include a language module?",it={disableAutodetect:!0,name:"Plain text",contains:[]};let rt={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:f};function ht(tt){return rt.noHighlightRe.test(tt)}function Et(tt){let Rt=tt.className+" ";Rt+=tt.parentNode?tt.parentNode.className:"";const ln=rt.languageDetectRe.exec(Rt);if(ln){const Nn=Rn(ln[1]);return Nn||(Qe(Kt.replace("{}",ln[1])),Qe("Falling back to no-highlight mode for this block.",tt)),Nn?ln[1]:"no-highlight"}return Rt.split(/\s+/).find(Nn=>ht(Nn)||Rn(Nn))}function Tt(tt,Rt,ln){let Nn="",Mi="";typeof Rt=="object"?(Nn=tt,ln=Rt.ignoreIllegals,Mi=Rt.language):(Xe("10.7.0","highlight(lang, code, ...args) has been deprecated."),Xe("10.7.0",`Please use highlight(code, options) instead.
https://github.com/highlightjs/highlight.js/issues/2277`),Mi=tt,Nn=Rt),ln===void 0&&(ln=!0);const Sr={code:Nn,language:Mi};aa("before:highlight",Sr);const os=Sr.result?Sr.result:Ct(Sr.language,Sr.code,ln);return os.code=Sr.code,aa("after:highlight",os),os}function Ct(tt,Rt,ln,Nn){const Mi=Object.create(null);function Sr(at,kt){return at.keywords[kt]}function os(){if(!Ht.keywords){tr.addText(qn);return}let at=0;Ht.keywordPatternRe.lastIndex=0;let kt=Ht.keywordPatternRe.exec(qn),Wt="";for(;kt;){Wt+=qn.substring(at,kt.index);const yn=dr.case_insensitive?kt[0].toLowerCase():kt[0],Ci=Sr(Ht,yn);if(Ci){const[Ts,Oc]=Ci;if(tr.addText(Wt),Wt="",Mi[yn]=(Mi[yn]||0)+1,Mi[yn]<=tn&&(Ol+=Oc),Ts.startsWith("_"))Wt+=kt[0];else{const Pu=dr.classNameAliases[Ts]||Ts;_s(kt[0],Pu)}}else Wt+=kt[0];at=Ht.keywordPatternRe.lastIndex,kt=Ht.keywordPatternRe.exec(qn)}Wt+=qn.substring(at),tr.addText(Wt)}function ei(){if(qn==="")return;let at=null;if(typeof Ht.subLanguage=="string"){if(!ve[Ht.subLanguage]){tr.addText(qn);return}at=Ct(Ht.subLanguage,qn,!0,Lu[Ht.subLanguage]),Lu[Ht.subLanguage]=at._top}else at=gi(qn,Ht.subLanguage.length?Ht.subLanguage:null);Ht.relevance>0&&(Ol+=at.relevance),tr.__addSublanguage(at._emitter,at.language)}function ti(){Ht.subLanguage!=null?ei():os(),qn=""}function _s(at,kt){at!==""&&(tr.startScope(kt),tr.addText(at),tr.endScope())}function Nu(at,kt){let Wt=1;const yn=kt.length-1;for(;Wt<=yn;){if(!at._emit[Wt]){Wt++;continue}const Ci=dr.classNameAliases[at[Wt]]||at[Wt],Ts=kt[Wt];Ci?_s(Ts,Ci):(qn=Ts,os(),qn=""),Wt++}}function Cc(at,kt){return at.scope&&typeof at.scope=="string"&&tr.openNode(dr.classNameAliases[at.scope]||at.scope),at.beginScope&&(at.beginScope._wrap?(_s(qn,dr.classNameAliases[at.beginScope._wrap]||at.beginScope._wrap),qn=""):at.beginScope._multi&&(Nu(at.beginScope,kt),qn="")),Ht=Object.create(at,{parent:{value:Ht}}),Ht}function Sd(at,kt,Wt){let yn=j(at.endRe,Wt);if(yn){if(at["on:end"]){const Ci=new e(at);at["on:end"](kt,Ci),Ci.isMatchIgnored&&(yn=!1)}if(yn){for(;at.endsParent&&at.parent;)at=at.parent;return at}}if(at.endsWithParent)return Sd(at.parent,kt,Wt)}function Iu(at){return Ht.matcher.regexIndex===0?(qn+=at[0],1):(la=!0,0)}function Lg(at){const kt=at[0],Wt=at.rule,yn=new e(Wt),Ci=[Wt.__beforeBegin,Wt["on:begin"]];for(const Ts of Ci)if(Ts&&(Ts(at,yn),yn.isMatchIgnored))return Iu(kt);return Wt.skip?qn+=kt:(Wt.excludeBegin&&(qn+=kt),ti(),!Wt.returnBegin&&!Wt.excludeBegin&&(qn=kt)),Cc(Wt,at),Wt.returnBegin?0:kt.length}function as(at){const kt=at[0],Wt=Rt.substring(at.index),yn=Sd(Ht,at,Wt);if(!yn)return ji;const Ci=Ht;Ht.endScope&&Ht.endScope._wrap?(ti(),_s(kt,Ht.endScope._wrap)):Ht.endScope&&Ht.endScope._multi?(ti(),Nu(Ht.endScope,at)):Ci.skip?qn+=kt:(Ci.returnEnd||Ci.excludeEnd||(qn+=kt),ti(),Ci.excludeEnd&&(qn=kt));do Ht.scope&&tr.closeNode(),!Ht.skip&&!Ht.subLanguage&&(Ol+=Ht.relevance),Ht=Ht.parent;while(Ht!==yn.parent);return yn.starts&&Cc(yn.starts,at),Ci.returnEnd?0:kt.length}function Bu(){const at=[];for(let kt=Ht;kt!==dr;kt=kt.parent)kt.scope&&at.unshift(kt.scope);at.forEach(kt=>tr.openNode(kt))}let _c={};function kc(at,kt){const Wt=kt&&kt[0];if(qn+=at,Wt==null)return ti(),0;if(_c.type==="begin"&&kt.type==="end"&&_c.index===kt.index&&Wt===""){if(qn+=Rt.slice(kt.index,kt.index+1),!Ut){const yn=new Error(`0 width match regex (${tt})`);throw yn.languageName=tt,yn.badRule=_c.rule,yn}return 1}if(_c=kt,kt.type==="begin")return Lg(kt);if(kt.type==="illegal"&&!ln){const yn=new Error('Illegal lexeme "'+Wt+'" for mode "'+(Ht.scope||"<unnamed>")+'"');throw yn.mode=Ht,yn}else if(kt.type==="end"){const yn=as(kt);if(yn!==ji)return yn}if(kt.type==="illegal"&&Wt==="")return qn+=`
`,1;if(El>1e5&&El>kt.index*3)throw new Error("potential infinite loop, way more iterations than matches");return qn+=Wt,Wt.length}const dr=Rn(tt);if(!dr)throw Ee(Kt.replace("{}",tt)),new Error('Unknown language: "'+tt+'"');const Tc=ct(dr);let La="",Ht=Nn||Tc;const Lu={},tr=new rt.__emitter(rt);Bu();let qn="",Ol=0,ks=0,El=0,la=!1;try{if(dr.__emitTokens)dr.__emitTokens(Rt,tr);else{for(Ht.matcher.considerAll();;){El++,la?la=!1:Ht.matcher.considerAll(),Ht.matcher.lastIndex=ks;const at=Ht.matcher.exec(Rt);if(!at)break;const kt=Rt.substring(ks,at.index),Wt=kc(kt,at);ks=at.index+Wt}kc(Rt.substring(ks))}return tr.finalize(),La=tr.toHTML(),{language:tt,value:La,relevance:Ol,illegal:!1,_emitter:tr,_top:Ht}}catch(at){if(at.message&&at.message.includes("Illegal"))return{language:tt,value:$t(Rt),illegal:!0,relevance:0,_illegalBy:{message:at.message,index:ks,context:Rt.slice(ks-100,ks+100),mode:at.mode,resultSoFar:La},_emitter:tr};if(Ut)return{language:tt,value:$t(Rt),illegal:!1,relevance:0,errorRaised:at,_emitter:tr,_top:Ht};throw at}}function vn(tt){const Rt={value:$t(tt),illegal:!1,relevance:0,_top:it,_emitter:new rt.__emitter(rt)};return Rt._emitter.addText(tt),Rt}function gi(tt,Rt){Rt=Rt||rt.languages||Object.keys(ve);const ln=vn(tt),Nn=Rt.filter(Rn).filter(wr).map(ti=>Ct(ti,tt,!1));Nn.unshift(ln);const Mi=Nn.sort((ti,_s)=>{if(ti.relevance!==_s.relevance)return _s.relevance-ti.relevance;if(ti.language&&_s.language){if(Rn(ti.language).supersetOf===_s.language)return 1;if(Rn(_s.language).supersetOf===ti.language)return-1}return 0}),[Sr,os]=Mi,ei=Sr;return ei.secondBest=os,ei}function er(tt,Rt,ln){const Nn=Rt&&pe[Rt]||ln;tt.classList.add("hljs"),tt.classList.add(`language-${Nn}`)}function li(tt){let Rt=null;const ln=Et(tt);if(ht(ln))return;if(aa("before:highlightElement",{el:tt,language:ln}),tt.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",tt);return}if(tt.children.length>0&&(rt.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(tt)),rt.throwUnescapedHTML))throw new It("One of your code blocks includes unescaped HTML.",tt.innerHTML);Rt=tt;const Nn=Rt.textContent,Mi=ln?Tt(Nn,{language:ln,ignoreIllegals:!0}):gi(Nn);tt.innerHTML=Mi.value,tt.dataset.highlighted="yes",er(tt,ln,Mi.language),tt.result={language:Mi.language,re:Mi.relevance,relevance:Mi.relevance},Mi.secondBest&&(tt.secondBest={language:Mi.secondBest.language,relevance:Mi.secondBest.relevance}),aa("after:highlightElement",{el:tt,result:Mi,text:Nn})}function Qr(tt){rt=dn(rt,tt)}const js=()=>{jc(),Xe("10.6.0","initHighlighting() deprecated.  Use highlightAll() now.")};function wd(){jc(),Xe("10.6.0","initHighlightingOnLoad() deprecated.  Use highlightAll() now.")}let Tl=!1;function jc(){function tt(){jc()}if(document.readyState==="loading"){Tl||window.addEventListener("DOMContentLoaded",tt,!1),Tl=!0;return}document.querySelectorAll(rt.cssSelector).forEach(li)}function Eo(tt,Rt){let ln=null;try{ln=Rt(re)}catch(Nn){if(Ee("Language definition for '{}' could not be registered.".replace("{}",tt)),Ut)Ee(Nn);else throw Nn;ln=it}ln.name||(ln.name=tt),ve[tt]=ln,ln.rawDefinition=Rt.bind(null,re),ln.aliases&&ro(ln.aliases,{languageName:tt})}function Ei(tt){delete ve[tt];for(const Rt of Object.keys(pe))pe[Rt]===tt&&delete pe[Rt]}function $i(){return Object.keys(ve)}function Rn(tt){return tt=(tt||"").toLowerCase(),ve[tt]||ve[pe[tt]]}function ro(tt,{languageName:Rt}){typeof tt=="string"&&(tt=[tt]),tt.forEach(ln=>{pe[ln.toLowerCase()]=Rt})}function wr(tt){const Rt=Rn(tt);return Rt&&!Rt.disableAutodetect}function so(tt){tt["before:highlightBlock"]&&!tt["before:highlightElement"]&&(tt["before:highlightElement"]=Rt=>{tt["before:highlightBlock"](Object.assign({block:Rt.el},Rt))}),tt["after:highlightBlock"]&&!tt["after:highlightElement"]&&(tt["after:highlightElement"]=Rt=>{tt["after:highlightBlock"](Object.assign({block:Rt.el},Rt))})}function Wi(tt){so(tt),Ne.push(tt)}function Du(tt){const Rt=Ne.indexOf(tt);Rt!==-1&&Ne.splice(Rt,1)}function aa(tt,Rt){const ln=tt;Ne.forEach(function(Nn){Nn[ln]&&Nn[ln](Rt)})}function Cs(tt){return Xe("10.7.0","highlightBlock will be removed entirely in v12.0"),Xe("10.7.0","Please use highlightElement now."),li(tt)}Object.assign(re,{highlight:Tt,highlightAuto:gi,highlightAll:jc,highlightElement:li,highlightBlock:Cs,configure:Qr,initHighlighting:js,initHighlightingOnLoad:wd,registerLanguage:Eo,unregisterLanguage:Ei,listLanguages:$i,getLanguage:Rn,registerAliases:ro,autoDetection:wr,inherit:dn,addPlugin:Wi,removePlugin:Du}),re.debugMode=function(){Ut=!1},re.safeMode=function(){Ut=!0},re.versionString=Lt,re.regex={concat:b,lookahead:m,either:w,optional:y,anyNumberOfTimes:v};for(const tt in Re)typeof Re[tt]=="object"&&t(Re[tt]);return Object.assign(re,Re),re},gn=an({});return gn.newInstance=()=>an({}),lO=gn,gn.HighlightJS=gn,gn.default=gn,lO}var TOe=kOe();const MG=Al(TOe);function OOe(t){const e="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},a={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,r]},l=t.inherit(a,{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},b={begin:"\\[",end:"\\]",contains:[v],illegal:"\\n",relevance:0},A=[i,{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,b,s,a],w=[...A];return w.pop(),w.push(l),v.contains=w,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:A}}MG.registerLanguage("yaml",OOe);const EOe=XTe(MG),MOe=new tce,ROe=[{title:"Query",path:"/query",icon:o.jsx(yd,{style:Xs}),element:o.jsx(oG,{}),inAgentMode:!1},{title:"Alerts",path:"/alerts",icon:o.jsx(Qoe,{style:Xs}),element:o.jsx(gG,{}),inAgentMode:!1}],RG=[{title:"Target health",path:"/targets",icon:o.jsx(O9,{style:Xs}),element:o.jsx(PTe,{}),inAgentMode:!0},{title:"Rule health",path:"/rules",icon:o.jsx(I9,{style:Xs}),element:o.jsx(kTe,{}),inAgentMode:!1},{title:"Service discovery",path:"/service-discovery",icon:o.jsx($se,{style:Xs}),element:o.jsx(COe,{}),inAgentMode:!0}],DG=[{title:"Runtime & build information",path:"/status",icon:o.jsx(oi,{style:Xs}),element:o.jsx(FTe,{}),inAgentMode:!0},{title:"TSDB status",path:"/tsdb-status",icon:o.jsx(Qse,{style:Xs}),element:o.jsx($Te,{}),inAgentMode:!1},{title:"Command-line flags",path:"/flags",icon:o.jsx(Xse,{style:Xs}),element:o.jsx(QTe,{}),inAgentMode:!0},{title:"Configuration",path:"/config",icon:o.jsx(woe,{style:Xs}),element:o.jsx(KTe,{}),inAgentMode:!0},{title:"Alertmanager discovery",path:"/alertmanager-discovery",icon:o.jsx(uR,{style:Xs}),element:o.jsx(_Oe,{}),inAgentMode:!1}],n8=[...RG,...DG],DOe={defaultRadius:"sm",colors:{"codebox-bg":["#f5f5f5","#e7e7e7","#cdcdcd","#b2b2b2","#9a9a9a","#8b8b8b","#848484","#717171","#656565","#575757"]}},_A="md";function NOe(){const[t,{toggle:e}]=Dw(),{agentMode:n,consolesLink:i,pathPrefix:r}=xr(),s=o.jsxs(o.Fragment,{children:[i&&o.jsx(Lr,{component:"a",href:i,className:Ob.link,leftSection:o.jsx(Wse,{style:Xs}),px:_A,children:"Consoles"}),ROe.filter(l=>!n||l.inAgentMode).map(l=>o.jsx(Lr,{component:W0,to:l.path,className:Ob.link,leftSection:l.icon,px:_A,children:l.title},l.path)),o.jsxs(Fn,{shadow:"md",width:240,children:[o.jsxs($4,{children:[n8.filter(l=>!n||l.inAgentMode).map(l=>o.jsx(ph,{path:l.path,element:o.jsx(Fn.Target,{children:o.jsxs(Lr,{component:W0,to:l.path,className:Ob.link,leftSection:l.icon,rightSection:o.jsx(Rv,{style:Xs}),px:_A,onClick:u=>u.preventDefault(),children:["Status ",o.jsx(k9,{style:Xs})," ",l.title]})})},l.path)),o.jsx(ph,{path:"*",element:o.jsx(Fn.Target,{children:o.jsx(Lr,{className:Ob.link,leftSection:o.jsx(joe,{style:Xs}),rightSection:o.jsx(Rv,{style:Xs}),px:_A,children:"Status"})})})]}),o.jsxs(Fn.Dropdown,{children:[o.jsx(Fn.Label,{children:"Monitoring status"}),RG.filter(l=>!n||l.inAgentMode).map(l=>o.jsx(Fn.Item,{component:W0,to:l.path,leftSection:l.icon,children:l.title},l.path)),o.jsx(Fn.Divider,{}),o.jsx(Fn.Label,{children:"Server status"}),DG.filter(l=>!n||l.inAgentMode).map(l=>o.jsx(Fn.Item,{component:W0,to:l.path,leftSection:l.icon,children:l.title},l.path))]})]})]}),a=o.jsxs(o.Fragment,{children:[o.jsx(JTe,{}),o.jsx(mOe,{}),o.jsx(eOe,{}),o.jsx(mi,{component:"a",href:"https://prometheus.io/docs/prometheus/latest/getting_started/",target:"_blank",color:"gray",title:"Documentation","aria-label":"Documentation",size:ge(32),children:o.jsx(wse,{style:Au})})]});return o.jsx(wle,{basename:r,children:o.jsx(Uke,{adapter:gOe,children:o.jsx(B8,{defaultColorScheme:"auto",theme:DOe,children:o.jsxs(YTe,{adapter:EOe,children:[o.jsx(Sc,{position:"top-right"}),o.jsx(ice,{client:MOe,children:o.jsxs(Xo,{header:{height:56},navbar:{width:300,breakpoint:"sm",collapsed:{desktop:!0,mobile:!t}},padding:"md",children:[o.jsxs(pOe,{children:[o.jsx(Xo.Header,{bg:"rgb(65, 73, 81)",c:"#fff",children:o.jsxs(pt,{h:"100%",px:"md",wrap:"nowrap",children:[o.jsxs(pt,{style:{flex:1},justify:"space-between",wrap:"nowrap",children:[o.jsxs(pt,{gap:40,wrap:"nowrap",children:[o.jsx(AR,{to:"/",style:{textDecoration:"none",color:"white"},children:o.jsxs(pt,{gap:10,wrap:"nowrap",children:[o.jsx("img",{src:fK,height:30}),o.jsx(ft,{hiddenFrom:"sm",fz:20,children:"Prometheus"}),o.jsx(ft,{visibleFrom:"md",fz:20,children:"Prometheus"}),o.jsx(ft,{fz:20,children:n&&"Agent"})]})}),o.jsx(pt,{gap:12,visibleFrom:"sm",wrap:"nowrap",children:s})]}),o.jsx(pt,{visibleFrom:"xs",wrap:"nowrap",gap:"xs",children:a})]}),o.jsx(sS,{opened:t,onClick:e,hiddenFrom:"sm",size:"sm",color:"gray.2"})]})}),o.jsxs(Xo.Navbar,{py:"md",px:4,bg:"rgb(65, 73, 81)",c:"#fff",children:[s,o.jsx(pt,{mt:"md",hiddenFrom:"xs",justify:"center",children:a})]})]}),o.jsx(Xo.Main,{children:o.jsx(Hf,{children:o.jsx(T.Suspense,{fallback:o.jsx(xe,{mt:"lg",children:Array.from(Array(10),(l,u)=>o.jsx(ta,{height:40,mb:15,width:1e3,mx:"auto"},u))}),children:o.jsxs($4,{children:[o.jsx(ph,{path:"/",element:o.jsx(Kae,{to:n?"/agent":"/query",replace:!0})}),n?o.jsx(ph,{path:"/agent",element:o.jsx(CA,{children:o.jsx(ZTe,{})})}):o.jsxs(o.Fragment,{children:[o.jsx(ph,{path:"/query",element:o.jsx(CA,{children:o.jsx(oG,{})})}),o.jsx(ph,{path:"/alerts",element:o.jsx(CA,{children:o.jsx(gG,{})})})]}),n8.map(l=>o.jsx(ph,{path:l.path,element:o.jsx(CA,{children:l.element})},l.path))]})})},location.pathname)})]})})]})})})})}const $j=(t,e)=>{localStorage.setItem(t,JSON.stringify(e))},NG=Bue(),zj=NG.startListening.withTypes();zj({actionCreator:fN,effect:({payload:t})=>{$j(vG,t)}});zj({actionCreator:pN,effect:({payload:t})=>{$j(TG,t)}});zj({actionCreator:Gq,effect:(t,{getState:e})=>{$j(Uq,e().queryPage.queryHistory)}});zj({actionCreator:ba,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 $j(`settings.${e}`,n)}})}});const IOe=due({reducer:{settings:cde,queryPage:ehe,targetsPage:OTe,serviceDiscoveryPage:yOe},middleware:t=>t().prepend(NG.middleware)});hK.createRoot(document.getElementById("root")).render(o.jsx(Vn.StrictMode,{children:o.jsx(Ece,{store:IOe,children:o.jsx(NOe,{})})}));
