diff --git a/fastcrawler_ui/core/fastapi/app.py b/fastcrawler_ui/core/fastapi/app.py index 51fc254..064c022 100644 --- a/fastcrawler_ui/core/fastapi/app.py +++ b/fastcrawler_ui/core/fastapi/app.py @@ -1,3 +1,5 @@ +from pathlib import Path + from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from fastapi.staticfiles import StaticFiles @@ -5,19 +7,27 @@ from .routers import get_routers -def get_application(router=get_routers(), base_app=FastAPI) -> FastAPI: - app = base_app() - origins = ["*"] - app.add_middleware( - CORSMiddleware, - allow_origins=origins, - allow_credentials=True, - allow_methods=["*"], - allow_headers=["*"], - ) - app.include_router(router) - app.mount("/", StaticFiles(directory="frontend/dist", html=True), name="static") - return app +class ApplicationFactory: + def __init__(self, router=get_routers(), base_app=FastAPI, dist_frontend=None): + self.router = router + self.base_app = base_app + self.dist_frontend = ( + dist_frontend or Path(__file__).parent.parent.parent.parent / "frontend" / "dist" + ) + + def create_application(self) -> FastAPI: + app = self.base_app() + app.add_middleware( + CORSMiddleware, + allow_origins=["*"], + allow_credentials=True, + allow_methods=["*"], + allow_headers=["*"], + ) + app.include_router(self.router) + app.mount("/", StaticFiles(directory=self.dist_frontend, html=True), name="static") + return app -app = get_application() +def create_app(factory=ApplicationFactory()) -> FastAPI: + return factory.create_application() diff --git a/fastcrawler_ui/run.py b/fastcrawler_ui/run.py index 32b7379..dfd0511 100644 --- a/fastcrawler_ui/run.py +++ b/fastcrawler_ui/run.py @@ -7,10 +7,12 @@ from fastcrawler import FastCrawler -from fastcrawler_ui.core.fastapi.app import app +from fastcrawler_ui.core.fastapi.app import create_app from fastcrawler_ui.core.fastapi.server import UvicornConfig, UvicornServer from fastcrawler_ui.core.fastapi.sync import sync_crawler_to_fastapi +app = create_app() + async def run_async( crawler: FastCrawler, diff --git a/frontend/dist/assets/index-25e06ec3.js b/frontend/dist/assets/index-0f5c240a.js similarity index 71% rename from frontend/dist/assets/index-25e06ec3.js rename to frontend/dist/assets/index-0f5c240a.js index 4a53352..beff8e5 100644 --- a/frontend/dist/assets/index-25e06ec3.js +++ b/frontend/dist/assets/index-0f5c240a.js @@ -1,4 +1,4 @@ -var uv=Object.defineProperty;var cv=(e,t,n)=>t in e?uv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var I=(e,t,n)=>(cv(e,typeof t!="symbol"?t+"":t,n),n);function dv(e,t){for(var n=0;ni[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).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 tm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var nm={exports:{}},vl={},im={exports:{}},q={};/** +var uv=Object.defineProperty;var cv=(e,t,n)=>t in e?uv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var I=(e,t,n)=>(cv(e,typeof t!="symbol"?t+"":t,n),n);function dv(e,t){for(var n=0;ni[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).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 tm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var nm={exports:{}},xl={},im={exports:{}},q={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ var uv=Object.defineProperty;var cv=(e,t,n)=>t in e?uv(e,t,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var bs=Symbol.for("react.element"),fv=Symbol.for("react.portal"),hv=Symbol.for("react.fragment"),pv=Symbol.for("react.strict_mode"),mv=Symbol.for("react.profiler"),gv=Symbol.for("react.provider"),yv=Symbol.for("react.context"),vv=Symbol.for("react.forward_ref"),xv=Symbol.for("react.suspense"),wv=Symbol.for("react.memo"),_v=Symbol.for("react.lazy"),Kd=Symbol.iterator;function bv(e){return e===null||typeof e!="object"?null:(e=Kd&&e[Kd]||e["@@iterator"],typeof e=="function"?e:null)}var rm={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},sm=Object.assign,om={};function ir(e,t,n){this.props=e,this.context=t,this.refs=om,this.updater=n||rm}ir.prototype.isReactComponent={};ir.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ir.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function lm(){}lm.prototype=ir.prototype;function bc(e,t,n){this.props=e,this.context=t,this.refs=om,this.updater=n||rm}var Sc=bc.prototype=new lm;Sc.constructor=bc;sm(Sc,ir.prototype);Sc.isPureReactComponent=!0;var Qd=Array.isArray,am=Object.prototype.hasOwnProperty,kc={current:null},um={key:!0,ref:!0,__self:!0,__source:!0};function cm(e,t,n){var i,r={},s=null,o=null;if(t!=null)for(i in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)am.call(t,i)&&!um.hasOwnProperty(i)&&(r[i]=t[i]);var l=arguments.length-2;if(l===1)r.children=n;else if(1t in e?uv(e,t,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Pv=w,Tv=Symbol.for("react.element"),Ov=Symbol.for("react.fragment"),Mv=Object.prototype.hasOwnProperty,Lv=Pv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Rv={key:!0,ref:!0,__self:!0,__source:!0};function dm(e,t,n){var i,r={},s=null,o=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(o=t.ref);for(i in t)Mv.call(t,i)&&!Rv.hasOwnProperty(i)&&(r[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps,t)r[i]===void 0&&(r[i]=t[i]);return{$$typeof:Tv,type:e,key:s,ref:o,props:r,_owner:Lv.current}}vl.Fragment=Ov;vl.jsx=dm;vl.jsxs=dm;nm.exports=vl;var b=nm.exports;/** + */var Pv=w,Tv=Symbol.for("react.element"),Ov=Symbol.for("react.fragment"),Mv=Object.prototype.hasOwnProperty,Lv=Pv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Rv={key:!0,ref:!0,__self:!0,__source:!0};function dm(e,t,n){var i,r={},s=null,o=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(o=t.ref);for(i in t)Mv.call(t,i)&&!Rv.hasOwnProperty(i)&&(r[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps,t)r[i]===void 0&&(r[i]=t[i]);return{$$typeof:Tv,type:e,key:s,ref:o,props:r,_owner:Lv.current}}xl.Fragment=Ov;xl.jsx=dm;xl.jsxs=dm;nm.exports=xl;var b=nm.exports;/** * @remix-run/router v1.7.1 * * Copyright (c) Remix Software Inc. @@ -23,7 +23,7 @@ var uv=Object.defineProperty;var cv=(e,t,n)=>t in e?uv(e,t,{enumerable:!0,config * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Gr(){return Gr=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Cc(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Nv(){return Math.random().toString(36).substr(2,8)}function Jd(e,t){return{usr:e.state,key:e.key,idx:t}}function eu(e,t,n,i){return n===void 0&&(n=null),Gr({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?rr(t):t,{state:n,key:t&&t.key||i||Nv()})}function fm(e){let{pathname:t="/",search:n="",hash:i=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),i&&i!=="#"&&(t+=i.charAt(0)==="#"?i:"#"+i),t}function rr(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let i=e.indexOf("?");i>=0&&(t.search=e.substr(i),e=e.substr(0,i)),e&&(t.pathname=e)}return t}function Fv(e,t,n,i){i===void 0&&(i={});let{window:r=document.defaultView,v5Compat:s=!1}=i,o=r.history,l=xn.Pop,a=null,u=c();u==null&&(u=0,o.replaceState(Gr({},o.state,{idx:u}),""));function c(){return(o.state||{idx:null}).idx}function d(){l=xn.Pop;let v=c(),y=v==null?null:v-u;u=v,a&&a({action:l,location:g.location,delta:y})}function f(v,y){l=xn.Push;let m=eu(g.location,v,y);n&&n(m,v),u=c()+1;let x=Jd(m,u),_=g.createHref(m);try{o.pushState(x,"",_)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;r.location.assign(_)}s&&a&&a({action:l,location:g.location,delta:1})}function p(v,y){l=xn.Replace;let m=eu(g.location,v,y);n&&n(m,v),u=c();let x=Jd(m,u),_=g.createHref(m);o.replaceState(x,"",_),s&&a&&a({action:l,location:g.location,delta:0})}function h(v){let y=r.location.origin!=="null"?r.location.origin:r.location.href,m=typeof v=="string"?v:fm(v);return ke(y,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,y)}let g={get action(){return l},get location(){return e(r,o)},listen(v){if(a)throw new Error("A history only accepts one active listener");return r.addEventListener(Gd,d),a=v,()=>{r.removeEventListener(Gd,d),a=null}},createHref(v){return t(r,v)},createURL:h,encodeLocation(v){let y=h(v);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:f,replace:p,go(v){return o.go(v)}};return g}var Zd;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Zd||(Zd={}));function Av(e,t,n){n===void 0&&(n="/");let i=typeof t=="string"?rr(t):t,r=mm(i.pathname||"/",n);if(r==null)return null;let s=hm(e);Iv(s);let o=null;for(let l=0;o==null&&l{let a={relativePath:l===void 0?s.path||"":l,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};a.relativePath.startsWith("/")&&(ke(a.relativePath.startsWith(i),'Absolute route path "'+a.relativePath+'" nested under path '+('"'+i+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),a.relativePath=a.relativePath.slice(i.length));let u=oi([i,a.relativePath]),c=n.concat(a);s.children&&s.children.length>0&&(ke(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),hm(s.children,t,c,u)),!(s.path==null&&!s.index)&&t.push({path:u,score:Vv(u,s.index),routesMeta:c})};return e.forEach((s,o)=>{var l;if(s.path===""||!((l=s.path)!=null&&l.includes("?")))r(s,o);else for(let a of pm(s.path))r(s,o,a)}),t}function pm(e){let t=e.split("/");if(t.length===0)return[];let[n,...i]=t,r=n.endsWith("?"),s=n.replace(/\?$/,"");if(i.length===0)return r?[s,""]:[s];let o=pm(i.join("/")),l=[];return l.push(...o.map(a=>a===""?s:[s,a].join("/"))),r&&l.push(...o),l.map(a=>e.startsWith("/")&&a===""?"/":a)}function Iv(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Wv(t.routesMeta.map(i=>i.childrenIndex),n.routesMeta.map(i=>i.childrenIndex)))}const jv=/^:\w+$/,zv=3,$v=2,Bv=1,Hv=10,Uv=-2,ef=e=>e==="*";function Vv(e,t){let n=e.split("/"),i=n.length;return n.some(ef)&&(i+=Uv),t&&(i+=$v),n.filter(r=>!ef(r)).reduce((r,s)=>r+(jv.test(s)?zv:s===""?Bv:Hv),i)}function Wv(e,t){return e.length===t.length&&e.slice(0,-1).every((i,r)=>i===t[r])?e[e.length-1]-t[t.length-1]:0}function qv(e,t){let{routesMeta:n}=e,i={},r="/",s=[];for(let o=0;o{if(c==="*"){let f=l[d]||"";o=s.slice(0,s.length-f.length).replace(/(.)\/+$/,"$1")}return u[c]=Xv(l[d]||"",c),u},{}),pathname:s,pathnameBase:o,pattern:e}}function Kv(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Cc(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let i=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(o,l)=>(i.push(l),"/([^\\/]+)"));return e.endsWith("*")?(i.push("*"),r+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":e!==""&&e!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,t?void 0:"i"),i]}function Qv(e){try{return decodeURI(e)}catch(t){return Cc(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Xv(e,t){try{return decodeURIComponent(e)}catch(n){return Cc(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function mm(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,i=e.charAt(n);return i&&i!=="/"?null:e.slice(n)||"/"}function Gv(e,t){t===void 0&&(t="/");let{pathname:n,search:i="",hash:r=""}=typeof e=="string"?rr(e):e;return{pathname:n?n.startsWith("/")?n:Jv(n,t):t,search:n1(i),hash:i1(r)}}function Jv(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function ra(e,t,n,i){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(i)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Zv(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function e1(e,t,n,i){i===void 0&&(i=!1);let r;typeof e=="string"?r=rr(e):(r=Gr({},e),ke(!r.pathname||!r.pathname.includes("?"),ra("?","pathname","search",r)),ke(!r.pathname||!r.pathname.includes("#"),ra("#","pathname","hash",r)),ke(!r.search||!r.search.includes("#"),ra("#","search","hash",r)));let s=e===""||r.pathname==="",o=s?"/":r.pathname,l;if(i||o==null)l=n;else{let d=t.length-1;if(o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),d-=1;r.pathname=f.join("/")}l=d>=0?t[d]:"/"}let a=Gv(r,l),u=o&&o!=="/"&&o.endsWith("/"),c=(s||o===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(u||c)&&(a.pathname+="/"),a}const oi=e=>e.join("/").replace(/\/\/+/g,"/"),t1=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),n1=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,i1=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function r1(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const gm=["post","put","patch","delete"];new Set(gm);const s1=["get",...gm];new Set(s1);/** + */function Jr(){return Jr=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Pc(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Nv(){return Math.random().toString(36).substr(2,8)}function Jd(e,t){return{usr:e.state,key:e.key,idx:t}}function tu(e,t,n,i){return n===void 0&&(n=null),Jr({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?rr(t):t,{state:n,key:t&&t.key||i||Nv()})}function fm(e){let{pathname:t="/",search:n="",hash:i=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),i&&i!=="#"&&(t+=i.charAt(0)==="#"?i:"#"+i),t}function rr(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let i=e.indexOf("?");i>=0&&(t.search=e.substr(i),e=e.substr(0,i)),e&&(t.pathname=e)}return t}function Fv(e,t,n,i){i===void 0&&(i={});let{window:r=document.defaultView,v5Compat:s=!1}=i,o=r.history,l=xn.Pop,a=null,u=c();u==null&&(u=0,o.replaceState(Jr({},o.state,{idx:u}),""));function c(){return(o.state||{idx:null}).idx}function d(){l=xn.Pop;let v=c(),y=v==null?null:v-u;u=v,a&&a({action:l,location:g.location,delta:y})}function f(v,y){l=xn.Push;let m=tu(g.location,v,y);n&&n(m,v),u=c()+1;let x=Jd(m,u),_=g.createHref(m);try{o.pushState(x,"",_)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;r.location.assign(_)}s&&a&&a({action:l,location:g.location,delta:1})}function p(v,y){l=xn.Replace;let m=tu(g.location,v,y);n&&n(m,v),u=c();let x=Jd(m,u),_=g.createHref(m);o.replaceState(x,"",_),s&&a&&a({action:l,location:g.location,delta:0})}function h(v){let y=r.location.origin!=="null"?r.location.origin:r.location.href,m=typeof v=="string"?v:fm(v);return ke(y,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,y)}let g={get action(){return l},get location(){return e(r,o)},listen(v){if(a)throw new Error("A history only accepts one active listener");return r.addEventListener(Gd,d),a=v,()=>{r.removeEventListener(Gd,d),a=null}},createHref(v){return t(r,v)},createURL:h,encodeLocation(v){let y=h(v);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:f,replace:p,go(v){return o.go(v)}};return g}var Zd;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Zd||(Zd={}));function Av(e,t,n){n===void 0&&(n="/");let i=typeof t=="string"?rr(t):t,r=mm(i.pathname||"/",n);if(r==null)return null;let s=hm(e);Iv(s);let o=null;for(let l=0;o==null&&l{let a={relativePath:l===void 0?s.path||"":l,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};a.relativePath.startsWith("/")&&(ke(a.relativePath.startsWith(i),'Absolute route path "'+a.relativePath+'" nested under path '+('"'+i+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),a.relativePath=a.relativePath.slice(i.length));let u=oi([i,a.relativePath]),c=n.concat(a);s.children&&s.children.length>0&&(ke(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),hm(s.children,t,c,u)),!(s.path==null&&!s.index)&&t.push({path:u,score:Wv(u,s.index),routesMeta:c})};return e.forEach((s,o)=>{var l;if(s.path===""||!((l=s.path)!=null&&l.includes("?")))r(s,o);else for(let a of pm(s.path))r(s,o,a)}),t}function pm(e){let t=e.split("/");if(t.length===0)return[];let[n,...i]=t,r=n.endsWith("?"),s=n.replace(/\?$/,"");if(i.length===0)return r?[s,""]:[s];let o=pm(i.join("/")),l=[];return l.push(...o.map(a=>a===""?s:[s,a].join("/"))),r&&l.push(...o),l.map(a=>e.startsWith("/")&&a===""?"/":a)}function Iv(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Vv(t.routesMeta.map(i=>i.childrenIndex),n.routesMeta.map(i=>i.childrenIndex)))}const jv=/^:\w+$/,zv=3,$v=2,Bv=1,Hv=10,Uv=-2,ef=e=>e==="*";function Wv(e,t){let n=e.split("/"),i=n.length;return n.some(ef)&&(i+=Uv),t&&(i+=$v),n.filter(r=>!ef(r)).reduce((r,s)=>r+(jv.test(s)?zv:s===""?Bv:Hv),i)}function Vv(e,t){return e.length===t.length&&e.slice(0,-1).every((i,r)=>i===t[r])?e[e.length-1]-t[t.length-1]:0}function qv(e,t){let{routesMeta:n}=e,i={},r="/",s=[];for(let o=0;o{if(c==="*"){let f=l[d]||"";o=s.slice(0,s.length-f.length).replace(/(.)\/+$/,"$1")}return u[c]=Xv(l[d]||"",c),u},{}),pathname:s,pathnameBase:o,pattern:e}}function Kv(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Pc(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let i=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(o,l)=>(i.push(l),"/([^\\/]+)"));return e.endsWith("*")?(i.push("*"),r+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":e!==""&&e!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,t?void 0:"i"),i]}function Qv(e){try{return decodeURI(e)}catch(t){return Pc(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Xv(e,t){try{return decodeURIComponent(e)}catch(n){return Pc(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function mm(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,i=e.charAt(n);return i&&i!=="/"?null:e.slice(n)||"/"}function Gv(e,t){t===void 0&&(t="/");let{pathname:n,search:i="",hash:r=""}=typeof e=="string"?rr(e):e;return{pathname:n?n.startsWith("/")?n:Jv(n,t):t,search:n1(i),hash:i1(r)}}function Jv(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function sa(e,t,n,i){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(i)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Zv(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function e1(e,t,n,i){i===void 0&&(i=!1);let r;typeof e=="string"?r=rr(e):(r=Jr({},e),ke(!r.pathname||!r.pathname.includes("?"),sa("?","pathname","search",r)),ke(!r.pathname||!r.pathname.includes("#"),sa("#","pathname","hash",r)),ke(!r.search||!r.search.includes("#"),sa("#","search","hash",r)));let s=e===""||r.pathname==="",o=s?"/":r.pathname,l;if(i||o==null)l=n;else{let d=t.length-1;if(o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),d-=1;r.pathname=f.join("/")}l=d>=0?t[d]:"/"}let a=Gv(r,l),u=o&&o!=="/"&&o.endsWith("/"),c=(s||o===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(u||c)&&(a.pathname+="/"),a}const oi=e=>e.join("/").replace(/\/\/+/g,"/"),t1=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),n1=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,i1=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function r1(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const gm=["post","put","patch","delete"];new Set(gm);const s1=["get",...gm];new Set(s1);/** * React Router v6.14.1 * * Copyright (c) Remix Software Inc. @@ -32,7 +32,7 @@ var uv=Object.defineProperty;var cv=(e,t,n)=>t in e?uv(e,t,{enumerable:!0,config * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Do(){return Do=Object.assign?Object.assign.bind():function(e){for(var t=1;ta.pathnameBase)),o=w.useRef(!1);return vm(()=>{o.current=!0}),w.useCallback(function(a,u){if(u===void 0&&(u={}),!o.current)return;if(typeof a=="number"){n.go(a);return}let c=e1(a,JSON.parse(s),r,u.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:oi([t,c.pathname])),(u.replace?n.replace:n.push)(c,u.state,u)},[t,n,s,r,e])}function a1(e,t){return u1(e,t)}function u1(e,t,n){_l()||ke(!1);let{navigator:i}=w.useContext(xl),{matches:r}=w.useContext(sr),s=r[r.length-1],o=s?s.params:{};s&&s.pathname;let l=s?s.pathnameBase:"/";s&&s.route;let a=bl(),u;if(t){var c;let g=typeof t=="string"?rr(t):t;l==="/"||(c=g.pathname)!=null&&c.startsWith(l)||ke(!1),u=g}else u=a;let d=u.pathname||"/",f=l==="/"?d:d.slice(l.length)||"/",p=Av(e,{pathname:f}),h=p1(p&&p.map(g=>Object.assign({},g,{params:Object.assign({},o,g.params),pathname:oi([l,i.encodeLocation?i.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?l:oi([l,i.encodeLocation?i.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),r,n);return t&&h?w.createElement(wl.Provider,{value:{location:Do({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:xn.Pop}},h):h}function c1(){let e=v1(),t=r1(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},s=null;return w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},t),n?w.createElement("pre",{style:r},n):null,s)}const d1=w.createElement(c1,null);class f1 extends w.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,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error||n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error?w.createElement(sr.Provider,{value:this.props.routeContext},w.createElement(ym.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function h1(e){let{routeContext:t,match:n,children:i}=e,r=w.useContext(Pc);return r&&r.static&&r.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=n.route.id),w.createElement(sr.Provider,{value:t},i)}function p1(e,t,n){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),e==null){var r;if((r=n)!=null&&r.errors)e=n.matches;else return null}let s=e,o=(i=n)==null?void 0:i.errors;if(o!=null){let l=s.findIndex(a=>a.route.id&&(o==null?void 0:o[a.route.id]));l>=0||ke(!1),s=s.slice(0,Math.min(s.length,l+1))}return s.reduceRight((l,a,u)=>{let c=a.route.id?o==null?void 0:o[a.route.id]:null,d=null;n&&(d=a.route.errorElement||d1);let f=t.concat(s.slice(0,u+1)),p=()=>{let h;return c?h=d:a.route.Component?h=w.createElement(a.route.Component,null):a.route.element?h=a.route.element:h=l,w.createElement(h1,{match:a,routeContext:{outlet:l,matches:f,isDataRoute:n!=null},children:h})};return n&&(a.route.ErrorBoundary||a.route.errorElement||u===0)?w.createElement(f1,{location:n.location,revalidation:n.revalidation,component:d,error:c,children:p(),routeContext:{outlet:null,matches:f,isDataRoute:!0}}):p()},null)}var tu;(function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate"})(tu||(tu={}));var Jr;(function(e){e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId"})(Jr||(Jr={}));function m1(e){let t=w.useContext(Pc);return t||ke(!1),t}function g1(e){let t=w.useContext(o1);return t||ke(!1),t}function y1(e){let t=w.useContext(sr);return t||ke(!1),t}function xm(e){let t=y1(),n=t.matches[t.matches.length-1];return n.route.id||ke(!1),n.route.id}function v1(){var e;let t=w.useContext(ym),n=g1(Jr.UseRouteError),i=xm(Jr.UseRouteError);return t||((e=n.errors)==null?void 0:e[i])}function x1(){let{router:e}=m1(tu.UseNavigateStable),t=xm(Jr.UseNavigateStable),n=w.useRef(!1);return vm(()=>{n.current=!0}),w.useCallback(function(r,s){s===void 0&&(s={}),n.current&&(typeof r=="number"?e.navigate(r):e.navigate(r,Do({fromRouteId:t},s)))},[e,t])}function nu(e){ke(!1)}function w1(e){let{basename:t="/",children:n=null,location:i,navigationType:r=xn.Pop,navigator:s,static:o=!1}=e;_l()&&ke(!1);let l=t.replace(/^\/*/,"/"),a=w.useMemo(()=>({basename:l,navigator:s,static:o}),[l,s,o]);typeof i=="string"&&(i=rr(i));let{pathname:u="/",search:c="",hash:d="",state:f=null,key:p="default"}=i,h=w.useMemo(()=>{let g=mm(u,l);return g==null?null:{location:{pathname:g,search:c,hash:d,state:f,key:p},navigationType:r}},[l,u,c,d,f,p,r]);return h==null?null:w.createElement(xl.Provider,{value:a},w.createElement(wl.Provider,{children:n,value:h}))}function _1(e){let{children:t,location:n}=e;return a1(iu(t),n)}var tf;(function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"})(tf||(tf={}));new Promise(()=>{});function iu(e,t){t===void 0&&(t=[]);let n=[];return w.Children.forEach(e,(i,r)=>{if(!w.isValidElement(i))return;let s=[...t,r];if(i.type===w.Fragment){n.push.apply(n,iu(i.props.children,s));return}i.type!==nu&&ke(!1),!i.props.index||!i.props.children||ke(!1);let o={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,loader:i.props.loader,action:i.props.action,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(o.children=iu(i.props.children,s)),n.push(o)}),n}/** + */function No(){return No=Object.assign?Object.assign.bind():function(e){for(var t=1;ta.pathnameBase)),o=w.useRef(!1);return vm(()=>{o.current=!0}),w.useCallback(function(a,u){if(u===void 0&&(u={}),!o.current)return;if(typeof a=="number"){n.go(a);return}let c=e1(a,JSON.parse(s),r,u.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:oi([t,c.pathname])),(u.replace?n.replace:n.push)(c,u.state,u)},[t,n,s,r,e])}function a1(e,t){return u1(e,t)}function u1(e,t,n){bl()||ke(!1);let{navigator:i}=w.useContext(wl),{matches:r}=w.useContext(sr),s=r[r.length-1],o=s?s.params:{};s&&s.pathname;let l=s?s.pathnameBase:"/";s&&s.route;let a=Sl(),u;if(t){var c;let g=typeof t=="string"?rr(t):t;l==="/"||(c=g.pathname)!=null&&c.startsWith(l)||ke(!1),u=g}else u=a;let d=u.pathname||"/",f=l==="/"?d:d.slice(l.length)||"/",p=Av(e,{pathname:f}),h=p1(p&&p.map(g=>Object.assign({},g,{params:Object.assign({},o,g.params),pathname:oi([l,i.encodeLocation?i.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?l:oi([l,i.encodeLocation?i.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),r,n);return t&&h?w.createElement(_l.Provider,{value:{location:No({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:xn.Pop}},h):h}function c1(){let e=v1(),t=r1(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},s=null;return w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},t),n?w.createElement("pre",{style:r},n):null,s)}const d1=w.createElement(c1,null);class f1 extends w.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,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error||n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error?w.createElement(sr.Provider,{value:this.props.routeContext},w.createElement(ym.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function h1(e){let{routeContext:t,match:n,children:i}=e,r=w.useContext(Tc);return r&&r.static&&r.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=n.route.id),w.createElement(sr.Provider,{value:t},i)}function p1(e,t,n){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),e==null){var r;if((r=n)!=null&&r.errors)e=n.matches;else return null}let s=e,o=(i=n)==null?void 0:i.errors;if(o!=null){let l=s.findIndex(a=>a.route.id&&(o==null?void 0:o[a.route.id]));l>=0||ke(!1),s=s.slice(0,Math.min(s.length,l+1))}return s.reduceRight((l,a,u)=>{let c=a.route.id?o==null?void 0:o[a.route.id]:null,d=null;n&&(d=a.route.errorElement||d1);let f=t.concat(s.slice(0,u+1)),p=()=>{let h;return c?h=d:a.route.Component?h=w.createElement(a.route.Component,null):a.route.element?h=a.route.element:h=l,w.createElement(h1,{match:a,routeContext:{outlet:l,matches:f,isDataRoute:n!=null},children:h})};return n&&(a.route.ErrorBoundary||a.route.errorElement||u===0)?w.createElement(f1,{location:n.location,revalidation:n.revalidation,component:d,error:c,children:p(),routeContext:{outlet:null,matches:f,isDataRoute:!0}}):p()},null)}var nu;(function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate"})(nu||(nu={}));var Zr;(function(e){e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId"})(Zr||(Zr={}));function m1(e){let t=w.useContext(Tc);return t||ke(!1),t}function g1(e){let t=w.useContext(o1);return t||ke(!1),t}function y1(e){let t=w.useContext(sr);return t||ke(!1),t}function xm(e){let t=y1(),n=t.matches[t.matches.length-1];return n.route.id||ke(!1),n.route.id}function v1(){var e;let t=w.useContext(ym),n=g1(Zr.UseRouteError),i=xm(Zr.UseRouteError);return t||((e=n.errors)==null?void 0:e[i])}function x1(){let{router:e}=m1(nu.UseNavigateStable),t=xm(Zr.UseNavigateStable),n=w.useRef(!1);return vm(()=>{n.current=!0}),w.useCallback(function(r,s){s===void 0&&(s={}),n.current&&(typeof r=="number"?e.navigate(r):e.navigate(r,No({fromRouteId:t},s)))},[e,t])}function iu(e){ke(!1)}function w1(e){let{basename:t="/",children:n=null,location:i,navigationType:r=xn.Pop,navigator:s,static:o=!1}=e;bl()&&ke(!1);let l=t.replace(/^\/*/,"/"),a=w.useMemo(()=>({basename:l,navigator:s,static:o}),[l,s,o]);typeof i=="string"&&(i=rr(i));let{pathname:u="/",search:c="",hash:d="",state:f=null,key:p="default"}=i,h=w.useMemo(()=>{let g=mm(u,l);return g==null?null:{location:{pathname:g,search:c,hash:d,state:f,key:p},navigationType:r}},[l,u,c,d,f,p,r]);return h==null?null:w.createElement(wl.Provider,{value:a},w.createElement(_l.Provider,{children:n,value:h}))}function _1(e){let{children:t,location:n}=e;return a1(ru(t),n)}var tf;(function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"})(tf||(tf={}));new Promise(()=>{});function ru(e,t){t===void 0&&(t=[]);let n=[];return w.Children.forEach(e,(i,r)=>{if(!w.isValidElement(i))return;let s=[...t,r];if(i.type===w.Fragment){n.push.apply(n,ru(i.props.children,s));return}i.type!==iu&&ke(!1),!i.props.index||!i.props.children||ke(!1);let o={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,loader:i.props.loader,action:i.props.action,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(o.children=ru(i.props.children,s)),n.push(o)}),n}/** * React Router DOM v6.14.1 * * Copyright (c) Remix Software Inc. @@ -41,7 +41,7 @@ var uv=Object.defineProperty;var cv=(e,t,n)=>t in e?uv(e,t,{enumerable:!0,config * LICENSE.md file in the root directory of this source tree. * * @license MIT - */const b1="startTransition",nf=Ro[b1];function S1(e){let{basename:t,children:n,future:i,window:r}=e,s=w.useRef();s.current==null&&(s.current=Dv({window:r,v5Compat:!0}));let o=s.current,[l,a]=w.useState({action:o.action,location:o.location}),{v7_startTransition:u}=i||{},c=w.useCallback(d=>{u&&nf?nf(()=>a(d)):a(d)},[a,u]);return w.useLayoutEffect(()=>o.listen(c),[o,c]),w.createElement(w1,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o})}var rf;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher"})(rf||(rf={}));var sf;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(sf||(sf={}));var ru={},wm={exports:{}},dt={},_m={exports:{}},bm={};/** + */const b1="startTransition",nf=Do[b1];function S1(e){let{basename:t,children:n,future:i,window:r}=e,s=w.useRef();s.current==null&&(s.current=Dv({window:r,v5Compat:!0}));let o=s.current,[l,a]=w.useState({action:o.action,location:o.location}),{v7_startTransition:u}=i||{},c=w.useCallback(d=>{u&&nf?nf(()=>a(d)):a(d)},[a,u]);return w.useLayoutEffect(()=>o.listen(c),[o,c]),w.createElement(w1,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o})}var rf;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher"})(rf||(rf={}));var sf;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(sf||(sf={}));var su={},wm={exports:{}},dt={},_m={exports:{}},bm={};/** * @license React * scheduler.production.min.js * @@ -49,7 +49,7 @@ var uv=Object.defineProperty;var cv=(e,t,n)=>t in e?uv(e,t,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(e){function t(L,A){var N=L.length;L.push(A);e:for(;0>>1,V=L[z];if(0>>1;zr(ge,N))ver(fe,ge)?(L[z]=fe,L[ve]=N,z=ve):(L[z]=ge,L[de]=N,z=de);else if(ver(fe,N))L[z]=fe,L[ve]=N,z=ve;else break e}}return A}function r(L,A){var N=L.sortIndex-A.sortIndex;return N!==0?N:L.id-A.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var a=[],u=[],c=1,d=null,f=3,p=!1,h=!1,g=!1,v=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(L){for(var A=n(u);A!==null;){if(A.callback===null)i(u);else if(A.startTime<=L)i(u),A.sortIndex=A.expirationTime,t(a,A);else break;A=n(u)}}function _(L){if(g=!1,x(L),!h)if(n(a)!==null)h=!0,U(S);else{var A=n(u);A!==null&&Z(_,A.startTime-L)}}function S(L,A){h=!1,g&&(g=!1,y(E),E=-1),p=!0;var N=f;try{for(x(A),d=n(a);d!==null&&(!(d.expirationTime>A)||L&&!R());){var z=d.callback;if(typeof z=="function"){d.callback=null,f=d.priorityLevel;var V=z(d.expirationTime<=A);A=e.unstable_now(),typeof V=="function"?d.callback=V:d===n(a)&&i(a),x(A)}else i(a);d=n(a)}if(d!==null)var Ce=!0;else{var de=n(u);de!==null&&Z(_,de.startTime-A),Ce=!1}return Ce}finally{d=null,f=N,p=!1}}var k=!1,C=null,E=-1,T=5,M=-1;function R(){return!(e.unstable_now()-ML||125z?(L.sortIndex=N,t(u,L),n(a)===null&&L===n(u)&&(g?(y(E),E=-1):g=!0,Z(_,N-z))):(L.sortIndex=V,t(a,L),h||p||(h=!0,U(S))),L},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(L){var A=f;return function(){var N=f;f=A;try{return L.apply(this,arguments)}finally{f=N}}}})(bm);_m.exports=bm;var k1=_m.exports;/** + */(function(e){function t(O,A){var F=O.length;O.push(A);e:for(;0>>1,W=O[z];if(0>>1;zr(ge,F))ver(fe,ge)?(O[z]=fe,O[ve]=F,z=ve):(O[z]=ge,O[de]=F,z=de);else if(ver(fe,F))O[z]=fe,O[ve]=F,z=ve;else break e}}return A}function r(O,A){var F=O.sortIndex-A.sortIndex;return F!==0?F:O.id-A.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var a=[],u=[],c=1,d=null,f=3,p=!1,h=!1,g=!1,v=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(O){for(var A=n(u);A!==null;){if(A.callback===null)i(u);else if(A.startTime<=O)i(u),A.sortIndex=A.expirationTime,t(a,A);else break;A=n(u)}}function _(O){if(g=!1,x(O),!h)if(n(a)!==null)h=!0,U(S);else{var A=n(u);A!==null&&G(_,A.startTime-O)}}function S(O,A){h=!1,g&&(g=!1,y(k),k=-1),p=!0;var F=f;try{for(x(A),d=n(a);d!==null&&(!(d.expirationTime>A)||O&&!R());){var z=d.callback;if(typeof z=="function"){d.callback=null,f=d.priorityLevel;var W=z(d.expirationTime<=A);A=e.unstable_now(),typeof W=="function"?d.callback=W:d===n(a)&&i(a),x(A)}else i(a);d=n(a)}if(d!==null)var Ce=!0;else{var de=n(u);de!==null&&G(_,de.startTime-A),Ce=!1}return Ce}finally{d=null,f=F,p=!1}}var C=!1,E=null,k=-1,L=5,M=-1;function R(){return!(e.unstable_now()-MO||125z?(O.sortIndex=F,t(u,O),n(a)===null&&O===n(u)&&(g?(y(k),k=-1):g=!0,G(_,F-z))):(O.sortIndex=W,t(a,O),h||p||(h=!0,U(S))),O},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(O){var A=f;return function(){var F=f;f=A;try{return O.apply(this,arguments)}finally{f=F}}}})(bm);_m.exports=bm;var k1=_m.exports;/** * @license React * react-dom.production.min.js * @@ -57,35 +57,35 @@ var uv=Object.defineProperty;var cv=(e,t,n)=>t in e?uv(e,t,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Sm=w,ct=k1;function O(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),su=Object.prototype.hasOwnProperty,E1=/^[: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]*$/,of={},lf={};function C1(e){return su.call(lf,e)?!0:su.call(of,e)?!1:E1.test(e)?lf[e]=!0:(of[e]=!0,!1)}function P1(e,t,n,i){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function T1(e,t,n,i){if(t===null||typeof t>"u"||P1(e,t,n,i))return!0;if(i)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ke(e,t,n,i,r,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=r,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var Ae={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ae[e]=new Ke(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ae[t]=new Ke(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ae[e]=new Ke(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ae[e]=new Ke(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ae[e]=new Ke(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ae[e]=new Ke(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ae[e]=new Ke(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ae[e]=new Ke(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ae[e]=new Ke(e,5,!1,e.toLowerCase(),null,!1,!1)});var Oc=/[\-:]([a-z])/g;function Mc(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Oc,Mc);Ae[t]=new Ke(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Oc,Mc);Ae[t]=new Ke(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Oc,Mc);Ae[t]=new Ke(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ae[e]=new Ke(e,1,!1,e.toLowerCase(),null,!1,!1)});Ae.xlinkHref=new Ke("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ae[e]=new Ke(e,1,!1,e.toLowerCase(),null,!0,!0)});function Lc(e,t,n,i){var r=Ae.hasOwnProperty(t)?Ae[t]:null;(r!==null?r.type!==0:i||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ou=Object.prototype.hasOwnProperty,E1=/^[: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]*$/,of={},lf={};function C1(e){return ou.call(lf,e)?!0:ou.call(of,e)?!1:E1.test(e)?lf[e]=!0:(of[e]=!0,!1)}function P1(e,t,n,i){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function T1(e,t,n,i){if(t===null||typeof t>"u"||P1(e,t,n,i))return!0;if(i)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ke(e,t,n,i,r,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=r,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var Ae={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ae[e]=new Ke(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ae[t]=new Ke(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ae[e]=new Ke(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ae[e]=new Ke(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ae[e]=new Ke(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ae[e]=new Ke(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ae[e]=new Ke(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ae[e]=new Ke(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ae[e]=new Ke(e,5,!1,e.toLowerCase(),null,!1,!1)});var Oc=/[\-:]([a-z])/g;function Mc(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Oc,Mc);Ae[t]=new Ke(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Oc,Mc);Ae[t]=new Ke(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Oc,Mc);Ae[t]=new Ke(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ae[e]=new Ke(e,1,!1,e.toLowerCase(),null,!1,!1)});Ae.xlinkHref=new Ke("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ae[e]=new Ke(e,1,!1,e.toLowerCase(),null,!0,!0)});function Lc(e,t,n,i){var r=Ae.hasOwnProperty(t)?Ae[t]:null;(r!==null?r.type!==0:i||!(2l||r[o]!==s[l]){var a=` -`+r[o].replace(" at new "," at ");return e.displayName&&a.includes("")&&(a=a.replace("",e.displayName)),a}while(1<=o&&0<=l);break}}}finally{oa=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Pr(e):""}function O1(e){switch(e.tag){case 5:return Pr(e.type);case 16:return Pr("Lazy");case 13:return Pr("Suspense");case 19:return Pr("SuspenseList");case 0:case 2:case 15:return e=la(e.type,!1),e;case 11:return e=la(e.type.render,!1),e;case 1:return e=la(e.type,!0),e;default:return""}}function uu(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Si:return"Fragment";case bi:return"Portal";case ou:return"Profiler";case Rc:return"StrictMode";case lu:return"Suspense";case au:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Cm:return(e.displayName||"Context")+".Consumer";case Em:return(e._context.displayName||"Context")+".Provider";case Dc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Nc:return t=e.displayName||null,t!==null?t:uu(e.type)||"Memo";case pn:t=e._payload,e=e._init;try{return uu(e(t))}catch{}}return null}function M1(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return uu(t);case 8:return t===Rc?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function An(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Tm(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function L1(e){var t=Tm(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(o){i=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function As(e){e._valueTracker||(e._valueTracker=L1(e))}function Om(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=Tm(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function No(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function cu(e,t){var n=t.checked;return ce({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function uf(e,t){var n=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;n=An(t.value!=null?t.value:n),e._wrapperState={initialChecked:i,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Mm(e,t){t=t.checked,t!=null&&Lc(e,"checked",t,!1)}function du(e,t){Mm(e,t);var n=An(t.value),i=t.type;if(n!=null)i==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?fu(e,t.type,n):t.hasOwnProperty("defaultValue")&&fu(e,t.type,An(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function cf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function fu(e,t,n){(t!=="number"||No(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Tr=Array.isArray;function Fi(e,t,n,i){if(e=e.options,t){t={};for(var r=0;r"+t.valueOf().toString()+"",t=Is.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function es(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Fr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},R1=["Webkit","ms","Moz","O"];Object.keys(Fr).forEach(function(e){R1.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Fr[t]=Fr[e]})});function Nm(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Fr.hasOwnProperty(e)&&Fr[e]?(""+t).trim():t+"px"}function Fm(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var i=n.indexOf("--")===0,r=Nm(n,t[n],i);n==="float"&&(n="cssFloat"),i?e.setProperty(n,r):e[n]=r}}var D1=ce({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function mu(e,t){if(t){if(D1[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(O(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(O(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(O(61))}if(t.style!=null&&typeof t.style!="object")throw Error(O(62))}}function gu(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 yu=null;function Fc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var vu=null,Ai=null,Ii=null;function hf(e){if(e=Es(e)){if(typeof vu!="function")throw Error(O(280));var t=e.stateNode;t&&(t=Pl(t),vu(e.stateNode,e.type,t))}}function Am(e){Ai?Ii?Ii.push(e):Ii=[e]:Ai=e}function Im(){if(Ai){var e=Ai,t=Ii;if(Ii=Ai=null,hf(e),t)for(e=0;e>>=0,e===0?32:31-(V1(e)/W1|0)|0}var js=64,zs=4194304;function Or(e){switch(e&-e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function jo(e,t){var n=e.pendingLanes;if(n===0)return 0;var i=0,r=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~r;l!==0?i=Or(l):(s&=o,s!==0&&(i=Or(s)))}else o=n&~r,o!==0?i=Or(o):s!==0&&(i=Or(s));if(i===0)return 0;if(t!==0&&t!==i&&!(t&r)&&(r=i&-i,s=t&-t,r>=s||r===16&&(s&4194240)!==0))return t;if(i&4&&(i|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=i;0n;n++)t.push(e);return t}function Ss(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ot(t),e[t]=n}function Q1(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0=Ir),bf=String.fromCharCode(32),Sf=!1;function ig(e,t){switch(e){case"keyup":return Sx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function rg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ki=!1;function Ex(e,t){switch(e){case"compositionend":return rg(t);case"keypress":return t.which!==32?null:(Sf=!0,bf);case"textInput":return e=t.data,e===bf&&Sf?null:e;default:return null}}function Cx(e,t){if(ki)return e==="compositionend"||!Uc&&ig(e,t)?(e=tg(),go=$c=wn=null,ki=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Pf(n)}}function ag(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ag(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ug(){for(var e=window,t=No();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=No(e.document)}return t}function Vc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Fx(e){var t=ug(),n=e.focusedElem,i=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ag(n.ownerDocument.documentElement,n)){if(i!==null&&Vc(n)){if(t=i.start,e=i.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var r=n.textContent.length,s=Math.min(i.start,r);i=i.end===void 0?s:Math.min(i.end,r),!e.extend&&s>i&&(r=i,i=s,s=r),r=Tf(n,s);var o=Tf(n,i);r&&o&&(e.rangeCount!==1||e.anchorNode!==r.node||e.anchorOffset!==r.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(r.node,r.offset),e.removeAllRanges(),s>i?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Ei=null,ku=null,zr=null,Eu=!1;function Of(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Eu||Ei==null||Ei!==No(i)||(i=Ei,"selectionStart"in i&&Vc(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),zr&&os(zr,i)||(zr=i,i=Bo(ku,"onSelect"),0Ti||(e.current=Lu[Ti],Lu[Ti]=null,Ti--)}function te(e,t){Ti++,Lu[Ti]=e.current,e.current=t}var In={},He=$n(In),tt=$n(!1),ci=In;function Vi(e,t){var n=e.type.contextTypes;if(!n)return In;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var r={},s;for(s in n)r[s]=t[s];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=r),r}function nt(e){return e=e.childContextTypes,e!=null}function Uo(){re(tt),re(He)}function Af(e,t,n){if(He.current!==In)throw Error(O(168));te(He,t),te(tt,n)}function vg(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var r in i)if(!(r in t))throw Error(O(108,M1(e)||"Unknown",r));return ce({},n,i)}function Vo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||In,ci=He.current,te(He,e),te(tt,tt.current),!0}function If(e,t,n){var i=e.stateNode;if(!i)throw Error(O(169));n?(e=vg(e,t,ci),i.__reactInternalMemoizedMergedChildContext=e,re(tt),re(He),te(He,e)):re(tt),te(tt,n)}var qt=null,Tl=!1,_a=!1;function xg(e){qt===null?qt=[e]:qt.push(e)}function Yx(e){Tl=!0,xg(e)}function Bn(){if(!_a&&qt!==null){_a=!0;var e=0,t=G;try{var n=qt;for(G=1;e>=o,r-=o,Qt=1<<32-Ot(t)+r|n<E?(T=C,C=null):T=C.sibling;var M=f(y,C,x[E],_);if(M===null){C===null&&(C=T);break}e&&C&&M.alternate===null&&t(y,C),m=s(M,m,E),k===null?S=M:k.sibling=M,k=M,C=T}if(E===x.length)return n(y,C),se&&Xn(y,E),S;if(C===null){for(;EE?(T=C,C=null):T=C.sibling;var R=f(y,C,M.value,_);if(R===null){C===null&&(C=T);break}e&&C&&R.alternate===null&&t(y,C),m=s(R,m,E),k===null?S=R:k.sibling=R,k=R,C=T}if(M.done)return n(y,C),se&&Xn(y,E),S;if(C===null){for(;!M.done;E++,M=x.next())M=d(y,M.value,_),M!==null&&(m=s(M,m,E),k===null?S=M:k.sibling=M,k=M);return se&&Xn(y,E),S}for(C=i(y,C);!M.done;E++,M=x.next())M=p(C,y,E,M.value,_),M!==null&&(e&&M.alternate!==null&&C.delete(M.key===null?E:M.key),m=s(M,m,E),k===null?S=M:k.sibling=M,k=M);return e&&C.forEach(function(F){return t(y,F)}),se&&Xn(y,E),S}function v(y,m,x,_){if(typeof x=="object"&&x!==null&&x.type===Si&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Fs:e:{for(var S=x.key,k=m;k!==null;){if(k.key===S){if(S=x.type,S===Si){if(k.tag===7){n(y,k.sibling),m=r(k,x.props.children),m.return=y,y=m;break e}}else if(k.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===pn&&Vf(S)===k.type){n(y,k.sibling),m=r(k,x.props),m.ref=gr(y,k,x),m.return=y,y=m;break e}n(y,k);break}else t(y,k);k=k.sibling}x.type===Si?(m=ai(x.props.children,y.mode,_,x.key),m.return=y,y=m):(_=ko(x.type,x.key,x.props,null,y.mode,_),_.ref=gr(y,m,x),_.return=y,y=_)}return o(y);case bi:e:{for(k=x.key;m!==null;){if(m.key===k)if(m.tag===4&&m.stateNode.containerInfo===x.containerInfo&&m.stateNode.implementation===x.implementation){n(y,m.sibling),m=r(m,x.children||[]),m.return=y,y=m;break e}else{n(y,m);break}else t(y,m);m=m.sibling}m=Oa(x,y.mode,_),m.return=y,y=m}return o(y);case pn:return k=x._init,v(y,m,k(x._payload),_)}if(Tr(x))return h(y,m,x,_);if(dr(x))return g(y,m,x,_);qs(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,m!==null&&m.tag===6?(n(y,m.sibling),m=r(m,x),m.return=y,y=m):(n(y,m),m=Ta(x,y.mode,_),m.return=y,y=m),o(y)):n(y,m)}return v}var qi=Pg(!0),Tg=Pg(!1),Cs={},zt=$n(Cs),cs=$n(Cs),ds=$n(Cs);function ni(e){if(e===Cs)throw Error(O(174));return e}function Zc(e,t){switch(te(ds,t),te(cs,e),te(zt,Cs),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:pu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=pu(t,e)}re(zt),te(zt,t)}function Yi(){re(zt),re(cs),re(ds)}function Og(e){ni(ds.current);var t=ni(zt.current),n=pu(t,e.type);t!==n&&(te(cs,e),te(zt,n))}function ed(e){cs.current===e&&(re(zt),re(cs))}var ae=$n(0);function Xo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ba=[];function td(){for(var e=0;en?n:4,e(!0);var i=Sa.transition;Sa.transition={};try{e(!1),t()}finally{G=n,Sa.transition=i}}function Wg(){return St().memoizedState}function Gx(e,t,n){var i=Rn(e);if(n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},qg(e))Yg(t,n);else if(n=Sg(e,t,n,i),n!==null){var r=qe();Mt(n,e,i,r),Kg(n,t,i)}}function Jx(e,t,n){var i=Rn(e),r={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(qg(e))Yg(t,r);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,l=s(o,n);if(r.hasEagerState=!0,r.eagerState=l,Lt(l,o)){var a=t.interleaved;a===null?(r.next=r,Gc(t)):(r.next=a.next,a.next=r),t.interleaved=r;return}}catch{}finally{}n=Sg(e,t,r,i),n!==null&&(r=qe(),Mt(n,e,i,r),Kg(n,t,i))}}function qg(e){var t=e.alternate;return e===ue||t!==null&&t===ue}function Yg(e,t){$r=Go=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Kg(e,t,n){if(n&4194240){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,Ic(e,n)}}var Jo={readContext:bt,useCallback:je,useContext:je,useEffect:je,useImperativeHandle:je,useInsertionEffect:je,useLayoutEffect:je,useMemo:je,useReducer:je,useRef:je,useState:je,useDebugValue:je,useDeferredValue:je,useTransition:je,useMutableSource:je,useSyncExternalStore:je,useId:je,unstable_isNewReconciler:!1},Zx={readContext:bt,useCallback:function(e,t){return Nt().memoizedState=[e,t===void 0?null:t],e},useContext:bt,useEffect:qf,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,wo(4194308,4,$g.bind(null,t,e),n)},useLayoutEffect:function(e,t){return wo(4194308,4,e,t)},useInsertionEffect:function(e,t){return wo(4,2,e,t)},useMemo:function(e,t){var n=Nt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var i=Nt();return t=n!==void 0?n(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=Gx.bind(null,ue,e),[i.memoizedState,e]},useRef:function(e){var t=Nt();return e={current:e},t.memoizedState=e},useState:Wf,useDebugValue:od,useDeferredValue:function(e){return Nt().memoizedState=e},useTransition:function(){var e=Wf(!1),t=e[0];return e=Xx.bind(null,e[1]),Nt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=ue,r=Nt();if(se){if(n===void 0)throw Error(O(407));n=n()}else{if(n=t(),Me===null)throw Error(O(349));fi&30||Rg(i,t,n)}r.memoizedState=n;var s={value:n,getSnapshot:t};return r.queue=s,qf(Ng.bind(null,i,s,e),[e]),i.flags|=2048,ps(9,Dg.bind(null,i,s,n,t),void 0,null),n},useId:function(){var e=Nt(),t=Me.identifierPrefix;if(se){var n=Xt,i=Qt;n=(i&~(1<<32-Ot(i)-1)).toString(32)+n,t=":"+t+"R"+n,n=fs++,0")&&(a=a.replace("",e.displayName)),a}while(1<=o&&0<=l);break}}}finally{la=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Tr(e):""}function O1(e){switch(e.tag){case 5:return Tr(e.type);case 16:return Tr("Lazy");case 13:return Tr("Suspense");case 19:return Tr("SuspenseList");case 0:case 2:case 15:return e=aa(e.type,!1),e;case 11:return e=aa(e.type.render,!1),e;case 1:return e=aa(e.type,!0),e;default:return""}}function cu(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Si:return"Fragment";case bi:return"Portal";case lu:return"Profiler";case Rc:return"StrictMode";case au:return"Suspense";case uu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Cm:return(e.displayName||"Context")+".Consumer";case Em:return(e._context.displayName||"Context")+".Provider";case Dc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Nc:return t=e.displayName||null,t!==null?t:cu(e.type)||"Memo";case pn:t=e._payload,e=e._init;try{return cu(e(t))}catch{}}return null}function M1(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return cu(t);case 8:return t===Rc?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function An(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Tm(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function L1(e){var t=Tm(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(o){i=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Is(e){e._valueTracker||(e._valueTracker=L1(e))}function Om(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=Tm(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function Fo(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function du(e,t){var n=t.checked;return ce({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function uf(e,t){var n=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;n=An(t.value!=null?t.value:n),e._wrapperState={initialChecked:i,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Mm(e,t){t=t.checked,t!=null&&Lc(e,"checked",t,!1)}function fu(e,t){Mm(e,t);var n=An(t.value),i=t.type;if(n!=null)i==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?hu(e,t.type,n):t.hasOwnProperty("defaultValue")&&hu(e,t.type,An(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function cf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function hu(e,t,n){(t!=="number"||Fo(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Or=Array.isArray;function Fi(e,t,n,i){if(e=e.options,t){t={};for(var r=0;r"+t.valueOf().toString()+"",t=js.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ts(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ar={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},R1=["Webkit","ms","Moz","O"];Object.keys(Ar).forEach(function(e){R1.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ar[t]=Ar[e]})});function Nm(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ar.hasOwnProperty(e)&&Ar[e]?(""+t).trim():t+"px"}function Fm(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var i=n.indexOf("--")===0,r=Nm(n,t[n],i);n==="float"&&(n="cssFloat"),i?e.setProperty(n,r):e[n]=r}}var D1=ce({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function gu(e,t){if(t){if(D1[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(T(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(T(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(T(61))}if(t.style!=null&&typeof t.style!="object")throw Error(T(62))}}function yu(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 vu=null;function Fc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var xu=null,Ai=null,Ii=null;function hf(e){if(e=Cs(e)){if(typeof xu!="function")throw Error(T(280));var t=e.stateNode;t&&(t=Tl(t),xu(e.stateNode,e.type,t))}}function Am(e){Ai?Ii?Ii.push(e):Ii=[e]:Ai=e}function Im(){if(Ai){var e=Ai,t=Ii;if(Ii=Ai=null,hf(e),t)for(e=0;e>>=0,e===0?32:31-(W1(e)/V1|0)|0}var zs=64,$s=4194304;function Mr(e){switch(e&-e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function zo(e,t){var n=e.pendingLanes;if(n===0)return 0;var i=0,r=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~r;l!==0?i=Mr(l):(s&=o,s!==0&&(i=Mr(s)))}else o=n&~r,o!==0?i=Mr(o):s!==0&&(i=Mr(s));if(i===0)return 0;if(t!==0&&t!==i&&!(t&r)&&(r=i&-i,s=t&-t,r>=s||r===16&&(s&4194240)!==0))return t;if(i&4&&(i|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=i;0n;n++)t.push(e);return t}function ks(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ot(t),e[t]=n}function Q1(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0=jr),bf=String.fromCharCode(32),Sf=!1;function ig(e,t){switch(e){case"keyup":return Sx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function rg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ki=!1;function Ex(e,t){switch(e){case"compositionend":return rg(t);case"keypress":return t.which!==32?null:(Sf=!0,bf);case"textInput":return e=t.data,e===bf&&Sf?null:e;default:return null}}function Cx(e,t){if(ki)return e==="compositionend"||!Uc&&ig(e,t)?(e=tg(),yo=$c=wn=null,ki=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Pf(n)}}function ag(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ag(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ug(){for(var e=window,t=Fo();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Fo(e.document)}return t}function Wc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Fx(e){var t=ug(),n=e.focusedElem,i=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ag(n.ownerDocument.documentElement,n)){if(i!==null&&Wc(n)){if(t=i.start,e=i.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var r=n.textContent.length,s=Math.min(i.start,r);i=i.end===void 0?s:Math.min(i.end,r),!e.extend&&s>i&&(r=i,i=s,s=r),r=Tf(n,s);var o=Tf(n,i);r&&o&&(e.rangeCount!==1||e.anchorNode!==r.node||e.anchorOffset!==r.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(r.node,r.offset),e.removeAllRanges(),s>i?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Ei=null,Eu=null,$r=null,Cu=!1;function Of(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Cu||Ei==null||Ei!==Fo(i)||(i=Ei,"selectionStart"in i&&Wc(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),$r&&ls($r,i)||($r=i,i=Ho(Eu,"onSelect"),0Ti||(e.current=Ru[Ti],Ru[Ti]=null,Ti--)}function te(e,t){Ti++,Ru[Ti]=e.current,e.current=t}var In={},He=$n(In),tt=$n(!1),ci=In;function Wi(e,t){var n=e.type.contextTypes;if(!n)return In;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var r={},s;for(s in n)r[s]=t[s];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=r),r}function nt(e){return e=e.childContextTypes,e!=null}function Wo(){re(tt),re(He)}function Af(e,t,n){if(He.current!==In)throw Error(T(168));te(He,t),te(tt,n)}function vg(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var r in i)if(!(r in t))throw Error(T(108,M1(e)||"Unknown",r));return ce({},n,i)}function Vo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||In,ci=He.current,te(He,e),te(tt,tt.current),!0}function If(e,t,n){var i=e.stateNode;if(!i)throw Error(T(169));n?(e=vg(e,t,ci),i.__reactInternalMemoizedMergedChildContext=e,re(tt),re(He),te(He,e)):re(tt),te(tt,n)}var qt=null,Ol=!1,ba=!1;function xg(e){qt===null?qt=[e]:qt.push(e)}function Yx(e){Ol=!0,xg(e)}function Bn(){if(!ba&&qt!==null){ba=!0;var e=0,t=Z;try{var n=qt;for(Z=1;e>=o,r-=o,Qt=1<<32-Ot(t)+r|n<k?(L=E,E=null):L=E.sibling;var M=f(y,E,x[k],_);if(M===null){E===null&&(E=L);break}e&&E&&M.alternate===null&&t(y,E),m=s(M,m,k),C===null?S=M:C.sibling=M,C=M,E=L}if(k===x.length)return n(y,E),se&&Xn(y,k),S;if(E===null){for(;kk?(L=E,E=null):L=E.sibling;var R=f(y,E,M.value,_);if(R===null){E===null&&(E=L);break}e&&E&&R.alternate===null&&t(y,E),m=s(R,m,k),C===null?S=R:C.sibling=R,C=R,E=L}if(M.done)return n(y,E),se&&Xn(y,k),S;if(E===null){for(;!M.done;k++,M=x.next())M=d(y,M.value,_),M!==null&&(m=s(M,m,k),C===null?S=M:C.sibling=M,C=M);return se&&Xn(y,k),S}for(E=i(y,E);!M.done;k++,M=x.next())M=p(E,y,k,M.value,_),M!==null&&(e&&M.alternate!==null&&E.delete(M.key===null?k:M.key),m=s(M,m,k),C===null?S=M:C.sibling=M,C=M);return e&&E.forEach(function(N){return t(y,N)}),se&&Xn(y,k),S}function v(y,m,x,_){if(typeof x=="object"&&x!==null&&x.type===Si&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case As:e:{for(var S=x.key,C=m;C!==null;){if(C.key===S){if(S=x.type,S===Si){if(C.tag===7){n(y,C.sibling),m=r(C,x.props.children),m.return=y,y=m;break e}}else if(C.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===pn&&Wf(S)===C.type){n(y,C.sibling),m=r(C,x.props),m.ref=yr(y,C,x),m.return=y,y=m;break e}n(y,C);break}else t(y,C);C=C.sibling}x.type===Si?(m=ai(x.props.children,y.mode,_,x.key),m.return=y,y=m):(_=Eo(x.type,x.key,x.props,null,y.mode,_),_.ref=yr(y,m,x),_.return=y,y=_)}return o(y);case bi:e:{for(C=x.key;m!==null;){if(m.key===C)if(m.tag===4&&m.stateNode.containerInfo===x.containerInfo&&m.stateNode.implementation===x.implementation){n(y,m.sibling),m=r(m,x.children||[]),m.return=y,y=m;break e}else{n(y,m);break}else t(y,m);m=m.sibling}m=Ma(x,y.mode,_),m.return=y,y=m}return o(y);case pn:return C=x._init,v(y,m,C(x._payload),_)}if(Or(x))return h(y,m,x,_);if(fr(x))return g(y,m,x,_);Ys(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,m!==null&&m.tag===6?(n(y,m.sibling),m=r(m,x),m.return=y,y=m):(n(y,m),m=Oa(x,y.mode,_),m.return=y,y=m),o(y)):n(y,m)}return v}var qi=Pg(!0),Tg=Pg(!1),Ps={},zt=$n(Ps),ds=$n(Ps),fs=$n(Ps);function ni(e){if(e===Ps)throw Error(T(174));return e}function Zc(e,t){switch(te(fs,t),te(ds,e),te(zt,Ps),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:mu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=mu(t,e)}re(zt),te(zt,t)}function Yi(){re(zt),re(ds),re(fs)}function Og(e){ni(fs.current);var t=ni(zt.current),n=mu(t,e.type);t!==n&&(te(ds,e),te(zt,n))}function ed(e){ds.current===e&&(re(zt),re(ds))}var ae=$n(0);function Go(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Sa=[];function td(){for(var e=0;en?n:4,e(!0);var i=ka.transition;ka.transition={};try{e(!1),t()}finally{Z=n,ka.transition=i}}function Vg(){return St().memoizedState}function Gx(e,t,n){var i=Rn(e);if(n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},qg(e))Yg(t,n);else if(n=Sg(e,t,n,i),n!==null){var r=qe();Mt(n,e,i,r),Kg(n,t,i)}}function Jx(e,t,n){var i=Rn(e),r={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(qg(e))Yg(t,r);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,l=s(o,n);if(r.hasEagerState=!0,r.eagerState=l,Lt(l,o)){var a=t.interleaved;a===null?(r.next=r,Gc(t)):(r.next=a.next,a.next=r),t.interleaved=r;return}}catch{}finally{}n=Sg(e,t,r,i),n!==null&&(r=qe(),Mt(n,e,i,r),Kg(n,t,i))}}function qg(e){var t=e.alternate;return e===ue||t!==null&&t===ue}function Yg(e,t){Br=Jo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Kg(e,t,n){if(n&4194240){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,Ic(e,n)}}var Zo={readContext:bt,useCallback:je,useContext:je,useEffect:je,useImperativeHandle:je,useInsertionEffect:je,useLayoutEffect:je,useMemo:je,useReducer:je,useRef:je,useState:je,useDebugValue:je,useDeferredValue:je,useTransition:je,useMutableSource:je,useSyncExternalStore:je,useId:je,unstable_isNewReconciler:!1},Zx={readContext:bt,useCallback:function(e,t){return Nt().memoizedState=[e,t===void 0?null:t],e},useContext:bt,useEffect:qf,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,_o(4194308,4,$g.bind(null,t,e),n)},useLayoutEffect:function(e,t){return _o(4194308,4,e,t)},useInsertionEffect:function(e,t){return _o(4,2,e,t)},useMemo:function(e,t){var n=Nt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var i=Nt();return t=n!==void 0?n(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=Gx.bind(null,ue,e),[i.memoizedState,e]},useRef:function(e){var t=Nt();return e={current:e},t.memoizedState=e},useState:Vf,useDebugValue:od,useDeferredValue:function(e){return Nt().memoizedState=e},useTransition:function(){var e=Vf(!1),t=e[0];return e=Xx.bind(null,e[1]),Nt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=ue,r=Nt();if(se){if(n===void 0)throw Error(T(407));n=n()}else{if(n=t(),Me===null)throw Error(T(349));fi&30||Rg(i,t,n)}r.memoizedState=n;var s={value:n,getSnapshot:t};return r.queue=s,qf(Ng.bind(null,i,s,e),[e]),i.flags|=2048,ms(9,Dg.bind(null,i,s,n,t),void 0,null),n},useId:function(){var e=Nt(),t=Me.identifierPrefix;if(se){var n=Xt,i=Qt;n=(i&~(1<<32-Ot(i)-1)).toString(32)+n,t=":"+t+"R"+n,n=hs++,0<\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=o.createElement(n,{is:i.is}):(e=o.createElement(n),n==="select"&&(o=e,i.multiple?o.multiple=!0:i.size&&(o.size=i.size))):e=o.createElementNS(e,n),e[At]=t,e[us]=i,i0(e,t,!1,!1),t.stateNode=e;e:{switch(o=gu(n,i),n){case"dialog":ne("cancel",e),ne("close",e),r=i;break;case"iframe":case"object":case"embed":ne("load",e),r=i;break;case"video":case"audio":for(r=0;rQi&&(t.flags|=128,i=!0,yr(s,!1),t.lanes=4194304)}else{if(!i)if(e=Xo(o),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),yr(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!se)return ze(t),null}else 2*ye()-s.renderingStartTime>Qi&&n!==1073741824&&(t.flags|=128,i=!0,yr(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=ye(),t.sibling=null,n=ae.current,te(ae,i?n&1|2:n&1),t):(ze(t),null);case 22:case 23:return fd(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?st&1073741824&&(ze(t),t.subtreeFlags&6&&(t.flags|=8192)):ze(t),null;case 24:return null;case 25:return null}throw Error(O(156,t.tag))}function lw(e,t){switch(qc(t),t.tag){case 1:return nt(t.type)&&Uo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Yi(),re(tt),re(He),td(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ed(t),null;case 13:if(re(ae),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(O(340));Wi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return re(ae),null;case 4:return Yi(),null;case 10:return Xc(t.type._context),null;case 22:case 23:return fd(),null;case 24:return null;default:return null}}var Ks=!1,Be=!1,aw=typeof WeakSet=="function"?WeakSet:Set,D=null;function Ri(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(i){he(e,t,i)}else n.current=null}function Uu(e,t,n){try{n()}catch(i){he(e,t,i)}}var th=!1;function uw(e,t){if(Cu=zo,e=ug(),Vc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,l=-1,a=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var p;d!==n||r!==0&&d.nodeType!==3||(l=o+r),d!==s||i!==0&&d.nodeType!==3||(a=o+i),d.nodeType===3&&(o+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===n&&++u===r&&(l=o),f===s&&++c===i&&(a=o),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Pu={focusedElem:e,selectionRange:n},zo=!1,D=t;D!==null;)if(t=D,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,D=e;else for(;D!==null;){t=D;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,v=h.memoizedState,y=t.stateNode,m=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:Et(t.type,g),v);y.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(O(163))}}catch(_){he(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,D=e;break}D=t.return}return h=th,th=!1,h}function Br(e,t,n){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var r=i=i.next;do{if((r.tag&e)===e){var s=r.destroy;r.destroy=void 0,s!==void 0&&Uu(t,n,s)}r=r.next}while(r!==i)}}function Ll(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var i=n.create;n.destroy=i()}n=n.next}while(n!==t)}}function Vu(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function o0(e){var t=e.alternate;t!==null&&(e.alternate=null,o0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[At],delete t[us],delete t[Mu],delete t[Wx],delete t[qx])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function l0(e){return e.tag===5||e.tag===3||e.tag===4}function nh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||l0(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Wu(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ho));else if(i!==4&&(e=e.child,e!==null))for(Wu(e,t,n),e=e.sibling;e!==null;)Wu(e,t,n),e=e.sibling}function qu(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(qu(e,t,n),e=e.sibling;e!==null;)qu(e,t,n),e=e.sibling}var Re=null,Ct=!1;function dn(e,t,n){for(n=n.child;n!==null;)a0(e,t,n),n=n.sibling}function a0(e,t,n){if(jt&&typeof jt.onCommitFiberUnmount=="function")try{jt.onCommitFiberUnmount(Sl,n)}catch{}switch(n.tag){case 5:Be||Ri(n,t);case 6:var i=Re,r=Ct;Re=null,dn(e,t,n),Re=i,Ct=r,Re!==null&&(Ct?(e=Re,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Re.removeChild(n.stateNode));break;case 18:Re!==null&&(Ct?(e=Re,n=n.stateNode,e.nodeType===8?wa(e.parentNode,n):e.nodeType===1&&wa(e,n),rs(e)):wa(Re,n.stateNode));break;case 4:i=Re,r=Ct,Re=n.stateNode.containerInfo,Ct=!0,dn(e,t,n),Re=i,Ct=r;break;case 0:case 11:case 14:case 15:if(!Be&&(i=n.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){r=i=i.next;do{var s=r,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Uu(n,t,o),r=r.next}while(r!==i)}dn(e,t,n);break;case 1:if(!Be&&(Ri(n,t),i=n.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.componentWillUnmount()}catch(l){he(n,t,l)}dn(e,t,n);break;case 21:dn(e,t,n);break;case 22:n.mode&1?(Be=(i=Be)||n.memoizedState!==null,dn(e,t,n),Be=i):dn(e,t,n);break;default:dn(e,t,n)}}function ih(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new aw),t.forEach(function(i){var r=vw.bind(null,e,i);n.has(i)||(n.add(i),i.then(r,r))})}}function kt(e,t){var n=t.deletions;if(n!==null)for(var i=0;ir&&(r=o),i&=~s}if(i=r,i=ye()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*dw(i/1960))-i,10e?16:e,_n===null)var i=!1;else{if(e=_n,_n=null,tl=0,Q&6)throw Error(O(331));var r=Q;for(Q|=4,D=e.current;D!==null;){var s=D,o=s.child;if(D.flags&16){var l=s.deletions;if(l!==null){for(var a=0;aye()-cd?li(e,0):ud|=n),it(e,t)}function g0(e,t){t===0&&(e.mode&1?(t=zs,zs<<=1,!(zs&130023424)&&(zs=4194304)):t=1);var n=qe();e=on(e,t),e!==null&&(Ss(e,t,n),it(e,n))}function yw(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),g0(e,n)}function vw(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(O(314))}i!==null&&i.delete(t),g0(e,n)}var y0;y0=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||tt.current)Ze=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ze=!1,sw(e,t,n);Ze=!!(e.flags&131072)}else Ze=!1,se&&t.flags&1048576&&wg(t,qo,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;_o(e,t),e=t.pendingProps;var r=Vi(t,He.current);zi(t,n),r=id(null,t,i,e,r,n);var s=rd();return t.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,nt(i)?(s=!0,Vo(t)):s=!1,t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,Jc(t),r.updater=Ol,t.stateNode=r,r._reactInternals=t,Au(t,i,e,n),t=zu(null,t,i,!0,s,n)):(t.tag=0,se&&s&&Wc(t),We(null,t,r,n),t=t.child),t;case 16:i=t.elementType;e:{switch(_o(e,t),e=t.pendingProps,r=i._init,i=r(i._payload),t.type=i,r=t.tag=ww(i),e=Et(i,e),r){case 0:t=ju(null,t,i,e,n);break e;case 1:t=Jf(null,t,i,e,n);break e;case 11:t=Xf(null,t,i,e,n);break e;case 14:t=Gf(null,t,i,Et(i.type,e),n);break e}throw Error(O(306,i,""))}return t;case 0:return i=t.type,r=t.pendingProps,r=t.elementType===i?r:Et(i,r),ju(e,t,i,r,n);case 1:return i=t.type,r=t.pendingProps,r=t.elementType===i?r:Et(i,r),Jf(e,t,i,r,n);case 3:e:{if(e0(t),e===null)throw Error(O(387));i=t.pendingProps,s=t.memoizedState,r=s.element,kg(e,t),Qo(t,i,null,n);var o=t.memoizedState;if(i=o.element,s.isDehydrated)if(s={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){r=Ki(Error(O(423)),t),t=Zf(e,t,i,n,r);break e}else if(i!==r){r=Ki(Error(O(424)),t),t=Zf(e,t,i,n,r);break e}else for(lt=On(t.stateNode.containerInfo.firstChild),at=t,se=!0,Pt=null,n=Tg(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Wi(),i===r){t=ln(e,t,n);break e}We(e,t,i,n)}t=t.child}return t;case 5:return Og(t),e===null&&Du(t),i=t.type,r=t.pendingProps,s=e!==null?e.memoizedProps:null,o=r.children,Tu(i,r)?o=null:s!==null&&Tu(i,s)&&(t.flags|=32),Zg(e,t),We(e,t,o,n),t.child;case 6:return e===null&&Du(t),null;case 13:return t0(e,t,n);case 4:return Zc(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=qi(t,null,i,n):We(e,t,i,n),t.child;case 11:return i=t.type,r=t.pendingProps,r=t.elementType===i?r:Et(i,r),Xf(e,t,i,r,n);case 7:return We(e,t,t.pendingProps,n),t.child;case 8:return We(e,t,t.pendingProps.children,n),t.child;case 12:return We(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(i=t.type._context,r=t.pendingProps,s=t.memoizedProps,o=r.value,te(Yo,i._currentValue),i._currentValue=o,s!==null)if(Lt(s.value,o)){if(s.children===r.children&&!tt.current){t=ln(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var l=s.dependencies;if(l!==null){o=s.child;for(var a=l.firstContext;a!==null;){if(a.context===i){if(s.tag===1){a=Zt(-1,n&-n),a.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?a.next=a:(a.next=c.next,c.next=a),u.pending=a}}s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Nu(s.return,n,t),l.lanes|=n;break}a=a.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(O(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Nu(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}We(e,t,r.children,n),t=t.child}return t;case 9:return r=t.type,i=t.pendingProps.children,zi(t,n),r=bt(r),i=i(r),t.flags|=1,We(e,t,i,n),t.child;case 14:return i=t.type,r=Et(i,t.pendingProps),r=Et(i.type,r),Gf(e,t,i,r,n);case 15:return Gg(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,r=t.pendingProps,r=t.elementType===i?r:Et(i,r),_o(e,t),t.tag=1,nt(i)?(e=!0,Vo(t)):e=!1,zi(t,n),Cg(t,i,r),Au(t,i,r,n),zu(null,t,i,!0,e,n);case 19:return n0(e,t,n);case 22:return Jg(e,t,n)}throw Error(O(156,t.tag))};function v0(e,t){return Vm(e,t)}function xw(e,t,n,i){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yt(e,t,n,i){return new xw(e,t,n,i)}function pd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ww(e){if(typeof e=="function")return pd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Dc)return 11;if(e===Nc)return 14}return 2}function Dn(e,t){var n=e.alternate;return n===null?(n=yt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ko(e,t,n,i,r,s){var o=2;if(i=e,typeof e=="function")pd(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Si:return ai(n.children,r,s,t);case Rc:o=8,r|=8;break;case ou:return e=yt(12,n,t,r|2),e.elementType=ou,e.lanes=s,e;case lu:return e=yt(13,n,t,r),e.elementType=lu,e.lanes=s,e;case au:return e=yt(19,n,t,r),e.elementType=au,e.lanes=s,e;case Pm:return Dl(n,r,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Em:o=10;break e;case Cm:o=9;break e;case Dc:o=11;break e;case Nc:o=14;break e;case pn:o=16,i=null;break e}throw Error(O(130,e==null?e:typeof e,""))}return t=yt(o,n,t,r),t.elementType=e,t.type=i,t.lanes=s,t}function ai(e,t,n,i){return e=yt(7,e,i,t),e.lanes=n,e}function Dl(e,t,n,i){return e=yt(22,e,i,t),e.elementType=Pm,e.lanes=n,e.stateNode={isHidden:!1},e}function Ta(e,t,n){return e=yt(6,e,null,t),e.lanes=n,e}function Oa(e,t,n){return t=yt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function _w(e,t,n,i,r){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ua(0),this.expirationTimes=ua(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ua(0),this.identifierPrefix=i,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function md(e,t,n,i,r,s,o,l,a){return e=new _w(e,t,n,l,a),t===1?(t=1,s===!0&&(t|=8)):t=0,s=yt(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Jc(s),e}function bw(e,t,n){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(b0)}catch(e){console.error(e)}}b0(),wm.exports=dt;var S0=wm.exports,dh=S0;ru.createRoot=dh.createRoot,ru.hydrateRoot=dh.hydrateRoot;var Ma={exports:{}},La,fh;function Pw(){if(fh)return La;fh=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return La=e,La}var Ra,hh;function Tw(){if(hh)return Ra;hh=1;var e=Pw();function t(){}function n(){}return n.resetWarningCache=t,Ra=function(){function i(o,l,a,u,c,d){if(d!==e){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}i.isRequired=i;function r(){return i}var s={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:r,element:i,elementType:i,instanceOf:r,node:i,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},Ra}var ph;function Ow(){return ph||(ph=1,Ma.exports=Tw()()),Ma.exports}var Xi=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(i,r,s){n.o(i,r)||Object.defineProperty(i,r,{enumerable:!0,get:s})},n.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},n.t=function(i,r){if(1&r&&(i=n(i)),8&r||4&r&&typeof i=="object"&&i&&i.__esModule)return i;var s=Object.create(null);if(n.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:i}),2&r&&typeof i!="string")for(var o in i)n.d(s,o,function(l){return i[l]}.bind(null,o));return s},n.n=function(i){var r=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(r,"a",r),r},n.o=function(i,r){return Object.prototype.hasOwnProperty.call(i,r)},n.p="",n(n.s=2)}([function(e,t){e.exports=Ow()},function(e,t){e.exports=w},function(e,t,n){n.r(t);var i=n(1),r=n(0),s=function(){return(s=Object.assign||function(h){for(var g,v=1,y=arguments.length;v0&&(N.transform=ge.join(" "),N.transformOrigin="center",V&&(fe=i.createElement("g",{style:N},ve,i.createElement("rect",{width:"24",height:"24",fill:"transparent"}))));var Un,le=fe,ht=L===!0||typeof L!="number"?2:L,Le=!V&&(F||J);if(ht<0&&(Le=!Le),L&&(le=i.createElement("g",{style:{animation:"spin"+(Le?"-inverse":"")+" linear "+Math.abs(ht)+"s infinite",transformOrigin:"center"}},fe,!(F||J||U!==0)&&i.createElement("rect",{width:"24",height:"24",fill:"transparent"}))),V)return le;var Vn,na="icon_labelledby_"+m,Yd="icon_describedby_"+m;if(_)Un=k?na+" "+Yd:na;else if(Vn="presentation",k)throw new Error("title attribute required when description is set");return i.createElement("svg",c({ref:g,viewBox:"0 0 24 24",style:N,role:Vn,"aria-labelledby":Un},Ce),_&&i.createElement("title",{id:na},_),k&&i.createElement("desc",{id:Yd},k),!V&&L&&(Le?i.createElement("style",null,"@keyframes spin-inverse { from { transform: rotate(0deg) } to { transform: rotate(-360deg) } }"):i.createElement("style",null,"@keyframes spin { from { transform: rotate(0deg) } to { transform: rotate(360deg) } }")),le)});p.displayName="Icon",p.propTypes={path:r.string.isRequired,size:r.oneOfType([r.number,r.string]),color:r.string,horizontal:r.bool,vertical:r.bool,rotate:r.number,spin:r.oneOfType([r.bool,r.number]),style:r.object,inStack:r.bool,className:r.string},p.defaultProps={size:null,color:"currentColor",horizontal:!1,vertical:!1,rotate:0,spin:!1},t.default=p}]);const Gi=tm(Xi);var Mw="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z",Lw="M14,12V19.88C14.04,20.18 13.94,20.5 13.71,20.71C13.32,21.1 12.69,21.1 12.3,20.71L10.29,18.7C10.06,18.47 9.96,18.16 10,17.87V12H9.97L4.21,4.62C3.87,4.19 3.95,3.56 4.38,3.22C4.57,3.08 4.78,3 5,3V3H19V3C19.22,3 19.43,3.08 19.62,3.22C20.05,3.56 20.13,4.19 19.79,4.62L14.03,12H14Z",Rw="M12,2A10,10 0 0,0 2,12C2,16.42 4.87,20.17 8.84,21.5C9.34,21.58 9.5,21.27 9.5,21C9.5,20.77 9.5,20.14 9.5,19.31C6.73,19.91 6.14,17.97 6.14,17.97C5.68,16.81 5.03,16.5 5.03,16.5C4.12,15.88 5.1,15.9 5.1,15.9C6.1,15.97 6.63,16.93 6.63,16.93C7.5,18.45 8.97,18 9.54,17.76C9.63,17.11 9.89,16.67 10.17,16.42C7.95,16.17 5.62,15.31 5.62,11.5C5.62,10.39 6,9.5 6.65,8.79C6.55,8.54 6.2,7.5 6.75,6.15C6.75,6.15 7.59,5.88 9.5,7.17C10.29,6.95 11.15,6.84 12,6.84C12.85,6.84 13.71,6.95 14.5,7.17C16.41,5.88 17.25,6.15 17.25,6.15C17.8,7.5 17.45,8.54 17.35,8.79C18,9.5 18.38,10.39 18.38,11.5C18.38,15.32 16.04,16.16 13.81,16.41C14.17,16.72 14.5,17.33 14.5,18.26C14.5,19.6 14.5,20.68 14.5,21C14.5,21.27 14.66,21.59 15.17,21.5C19.14,20.16 22,16.42 22,12A10,10 0 0,0 12,2Z",k0="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z",Dw="M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z",E0="M7,10L12,15L17,10H7Z",Nw="M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z",Fw="M21.29 16.71L22.71 15.29L19.5 12.11L16.5 11.26L18.41 11L22.6 7.8L21.4 6.2L17.59 9.05L14.91 9.5L18.11 6.31L17 1.76L15 2.24L15.86 5.69L14.76 6.83A3 3 0 0 0 9.24 6.83L8.11 5.69L9 2.24L7 1.76L5.89 6.31L9.09 9.5L6.4 9.05L2.6 6.2L1.4 7.8L5.6 11L7.46 11.31L4.46 12.16L1.29 15.29L2.71 16.71L5.5 13.89L7.87 13.22L4 16.54V22H6V17.46L7.56 16.12A4.5 4.5 0 0 0 16.44 16.12L18 17.46V22H20V16.54L16.13 13.22L18.5 13.89Z",Aw="M3,11H11V3H3M3,21H11V13H3M13,21H21V13H13M13,3V11H21V3";var Iw=Object.defineProperty,jw=(e,t,n)=>t in e?Iw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Da=(e,t,n)=>(jw(e,typeof t!="symbol"?t+"":t,n),n);let zw=class{constructor(){Da(this,"current",this.detect()),Da(this,"handoffState","pending"),Da(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},en=new zw,Fe=(e,t)=>{en.isServer?w.useEffect(e,t):w.useLayoutEffect(e,t)};function tn(e){let t=w.useRef(e);return Fe(()=>{t.current=e},[e]),t}function jl(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function $t(){let e=[],t={addEventListener(n,i,r,s){return n.addEventListener(i,r,s),t.add(()=>n.removeEventListener(i,r,s))},requestAnimationFrame(...n){let i=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(i))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let i=setTimeout(...n);return t.add(()=>clearTimeout(i))},microTask(...n){let i={current:!0};return jl(()=>{i.current&&n[0]()}),t.add(()=>{i.current=!1})},style(n,i,r){let s=n.style.getPropertyValue(i);return Object.assign(n.style,{[i]:r}),this.add(()=>{Object.assign(n.style,{[i]:s})})},group(n){let i=$t();return n(i),this.add(()=>i.dispose())},add(n){return e.push(n),()=>{let i=e.indexOf(n);if(i>=0)for(let r of e.splice(i,1))r()}},dispose(){for(let n of e.splice(0))n()}};return t}function Ps(){let[e]=w.useState($t);return w.useEffect(()=>()=>e.dispose(),[e]),e}let H=function(e){let t=tn(e);return $.useCallback((...n)=>t.current(...n),[t])};function ar(){let[e,t]=w.useState(en.isHandoffComplete);return e&&en.isHandoffComplete===!1&&t(!1),w.useEffect(()=>{e!==!0&&t(!0)},[e]),w.useEffect(()=>en.handoff(),[]),e}var mh;let cn=(mh=$.useId)!=null?mh:function(){let e=ar(),[t,n]=$.useState(e?()=>en.nextId():null);return Fe(()=>{t===null&&n(en.nextId())},[t]),t!=null?""+t:void 0};function Oe(e,t,...n){if(e in t){let r=t[e];return typeof r=="function"?r(...n):r}let i=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(r=>`"${r}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(i,Oe),i}function zl(e){return en.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let Gu=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Kt=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(Kt||{}),C0=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(C0||{}),$w=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))($w||{});function P0(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Gu)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var xd=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(xd||{});function wd(e,t=0){var n;return e===((n=zl(e))==null?void 0:n.body)?!1:Oe(t,{[0](){return e.matches(Gu)},[1](){let i=e;for(;i!==null;){if(i.matches(Gu))return!0;i=i.parentElement}return!1}})}function T0(e){let t=zl(e);$t().nextFrame(()=>{t&&!wd(t.activeElement,0)&&Nn(e)})}var Bw=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Bw||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function Nn(e){e==null||e.focus({preventScroll:!0})}let Hw=["textarea","input"].join(",");function Uw(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Hw))!=null?n:!1}function O0(e,t=n=>n){return e.slice().sort((n,i)=>{let r=t(n),s=t(i);if(r===null||s===null)return 0;let o=r.compareDocumentPosition(s);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Vw(e,t){return Vr(P0(),t,{relativeTo:e})}function Vr(e,t,{sorted:n=!0,relativeTo:i=null,skipElements:r=[]}={}){let s=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,o=Array.isArray(e)?n?O0(e):e:P0(e);r.length>0&&o.length>1&&(o=o.filter(p=>!r.includes(p))),i=i??s.activeElement;let l=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),a=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,o.indexOf(i))-1;if(t&4)return Math.max(0,o.indexOf(i))+1;if(t&8)return o.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=t&32?{preventScroll:!0}:{},c=0,d=o.length,f;do{if(c>=d||c+d<=0)return 0;let p=a+c;if(t&16)p=(p+d)%d;else{if(p<0)return 3;if(p>=d)return 1}f=o[p],f==null||f.focus(u),c+=l}while(f!==s.activeElement);return t&6&&Uw(f)&&f.select(),2}function gh(e,t,n){let i=tn(t);w.useEffect(()=>{function r(s){i.current(s)}return document.addEventListener(e,r,n),()=>document.removeEventListener(e,r,n)},[e,n])}function M0(e,t,n){let i=tn(t);w.useEffect(()=>{function r(s){i.current(s)}return window.addEventListener(e,r,n),()=>window.removeEventListener(e,r,n)},[e,n])}function L0(e,t,n=!0){let i=w.useRef(!1);w.useEffect(()=>{requestAnimationFrame(()=>{i.current=n})},[n]);function r(o,l){if(!i.current||o.defaultPrevented)return;let a=l(o);if(a===null||!a.getRootNode().contains(a))return;let u=function c(d){return typeof d=="function"?c(d()):Array.isArray(d)||d instanceof Set?d:[d]}(e);for(let c of u){if(c===null)continue;let d=c instanceof HTMLElement?c:c.current;if(d!=null&&d.contains(a)||o.composed&&o.composedPath().includes(d))return}return!wd(a,xd.Loose)&&a.tabIndex!==-1&&o.preventDefault(),t(o,a)}let s=w.useRef(null);gh("mousedown",o=>{var l,a;i.current&&(s.current=((a=(l=o.composedPath)==null?void 0:l.call(o))==null?void 0:a[0])||o.target)},!0),gh("click",o=>{s.current&&(r(o,()=>s.current),s.current=null)},!0),M0("blur",o=>r(o,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function yh(e){var t;if(e.type)return e.type;let n=(t=e.as)!=null?t:"button";if(typeof n=="string"&&n.toLowerCase()==="button")return"button"}function Ww(e,t){let[n,i]=w.useState(()=>yh(e));return Fe(()=>{i(yh(e))},[e.type,e.as]),Fe(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&i("button")},[n,t]),n}let R0=Symbol();function qw(e,t=!0){return Object.assign(e,{[R0]:t})}function Qe(...e){let t=w.useRef(e);w.useEffect(()=>{t.current=e},[e]);let n=H(i=>{for(let r of t.current)r!=null&&(typeof r=="function"?r(i):r.current=i)});return e.every(i=>i==null||(i==null?void 0:i[R0]))?void 0:n}function Yw({container:e,accept:t,walk:n,enabled:i=!0}){let r=w.useRef(t),s=w.useRef(n);w.useEffect(()=>{r.current=t,s.current=n},[t,n]),Fe(()=>{if(!e||!i)return;let o=zl(e);if(!o)return;let l=r.current,a=s.current,u=Object.assign(d=>l(d),{acceptNode:l}),c=o.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,u,!1);for(;c.nextNode();)a(c.currentNode)},[e,i,r,s])}function Kw(e){throw new Error("Unexpected object: "+e)}var Tt=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(Tt||{});function Qw(e,t){let n=t.resolveItems();if(n.length<=0)return null;let i=t.resolveActiveIndex(),r=i??-1,s=(()=>{switch(e.focus){case 0:return n.findIndex(o=>!t.resolveDisabled(o));case 1:{let o=n.slice().reverse().findIndex((l,a,u)=>r!==-1&&u.length-a-1>=r?!1:!t.resolveDisabled(l));return o===-1?o:n.length-1-o}case 2:return n.findIndex((o,l)=>l<=r?!1:!t.resolveDisabled(o));case 3:{let o=n.slice().reverse().findIndex(l=>!t.resolveDisabled(l));return o===-1?o:n.length-1-o}case 4:return n.findIndex(o=>t.resolveId(o)===e.id);case 5:return null;default:Kw(e)}})();return s===-1?i:s}function Ju(...e){return e.filter(Boolean).join(" ")}var Ji=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Ji||{}),Gt=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Gt||{});function Ve({ourProps:e,theirProps:t,slot:n,defaultTag:i,features:r,visible:s=!0,name:o}){let l=D0(t,e);if(s)return Gs(l,n,i,o);let a=r??0;if(a&2){let{static:u=!1,...c}=l;if(u)return Gs(c,n,i,o)}if(a&1){let{unmount:u=!0,...c}=l;return Oe(u?0:1,{[0](){return null},[1](){return Gs({...c,hidden:!0,style:{display:"none"}},n,i,o)}})}return Gs(l,n,i,o)}function Gs(e,t={},n,i){let{as:r=n,children:s,refName:o="ref",...l}=Na(e,["unmount","static"]),a=e.ref!==void 0?{[o]:e.ref}:{},u=typeof s=="function"?s(t):s;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(t));let c={};if(t){let d=!1,f=[];for(let[p,h]of Object.entries(t))typeof h=="boolean"&&(d=!0),h===!0&&f.push(p);d&&(c["data-headlessui-state"]=f.join(" "))}if(r===w.Fragment&&Object.keys(vh(l)).length>0){if(!w.isValidElement(u)||Array.isArray(u)&&u.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${i} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(l).map(h=>` - ${h}`).join(` +`+s.stack}return{value:e,source:t,stack:r,digest:null}}function Pa(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ju(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var nw=typeof WeakMap=="function"?WeakMap:Map;function Qg(e,t,n){n=Zt(-1,n),n.tag=3,n.payload={element:null};var i=t.value;return n.callback=function(){tl||(tl=!0,Ku=i),ju(e,t)},n}function Xg(e,t,n){n=Zt(-1,n),n.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var r=t.value;n.payload=function(){return i(r)},n.callback=function(){ju(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){ju(e,t),typeof i!="function"&&(Ln===null?Ln=new Set([this]):Ln.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Yf(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new nw;var r=new Set;i.set(t,r)}else r=i.get(t),r===void 0&&(r=new Set,i.set(t,r));r.has(n)||(r.add(n),e=gw.bind(null,e,t,n),t.then(e,e))}function Kf(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Qf(e,t,n,i,r){return e.mode&1?(e.flags|=65536,e.lanes=r,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Zt(-1,1),t.tag=2,Mn(n,t,1))),n.lanes|=1),e)}var iw=un.ReactCurrentOwner,Ze=!1;function Ve(e,t,n,i){t.child=e===null?Tg(t,null,n,i):qi(t,e.child,n,i)}function Xf(e,t,n,i,r){n=n.render;var s=t.ref;return zi(t,r),i=id(e,t,n,i,s,r),n=rd(),e!==null&&!Ze?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,ln(e,t,r)):(se&&n&&Vc(t),t.flags|=1,Ve(e,t,i,r),t.child)}function Gf(e,t,n,i,r){if(e===null){var s=n.type;return typeof s=="function"&&!pd(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,Gg(e,t,s,i,r)):(e=Eo(n.type,null,i,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&r)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:ls,n(o,i)&&e.ref===t.ref)return ln(e,t,r)}return t.flags|=1,e=Dn(s,i),e.ref=t.ref,e.return=t,t.child=e}function Gg(e,t,n,i,r){if(e!==null){var s=e.memoizedProps;if(ls(s,i)&&e.ref===t.ref)if(Ze=!1,t.pendingProps=i=s,(e.lanes&r)!==0)e.flags&131072&&(Ze=!0);else return t.lanes=e.lanes,ln(e,t,r)}return zu(e,t,n,i,r)}function Jg(e,t,n){var i=t.pendingProps,r=i.children,s=e!==null?e.memoizedState:null;if(i.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},te(Di,st),st|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,te(Di,st),st|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=s!==null?s.baseLanes:n,te(Di,st),st|=i}else s!==null?(i=s.baseLanes|n,t.memoizedState=null):i=n,te(Di,st),st|=i;return Ve(e,t,r,n),t.child}function Zg(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function zu(e,t,n,i,r){var s=nt(n)?ci:He.current;return s=Wi(t,s),zi(t,r),n=id(e,t,n,i,s,r),i=rd(),e!==null&&!Ze?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,ln(e,t,r)):(se&&i&&Vc(t),t.flags|=1,Ve(e,t,n,r),t.child)}function Jf(e,t,n,i,r){if(nt(n)){var s=!0;Vo(t)}else s=!1;if(zi(t,r),t.stateNode===null)bo(e,t),Cg(t,n,i),Iu(t,n,i,r),i=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var a=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=bt(u):(u=nt(n)?ci:He.current,u=Wi(t,u));var c=n.getDerivedStateFromProps,d=typeof c=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==i||a!==u)&&Uf(t,o,i,u),mn=!1;var f=t.memoizedState;o.state=f,Xo(t,i,o,r),a=t.memoizedState,l!==i||f!==a||tt.current||mn?(typeof c=="function"&&(Au(t,n,c,i),a=t.memoizedState),(l=mn||Hf(t,n,l,i,f,a,u))?(d||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"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=a),o.props=i,o.state=a,o.context=u,i=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{o=t.stateNode,kg(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:Et(t.type,l),o.props=u,d=t.pendingProps,f=o.context,a=n.contextType,typeof a=="object"&&a!==null?a=bt(a):(a=nt(n)?ci:He.current,a=Wi(t,a));var p=n.getDerivedStateFromProps;(c=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==d||f!==a)&&Uf(t,o,i,a),mn=!1,f=t.memoizedState,o.state=f,Xo(t,i,o,r);var h=t.memoizedState;l!==d||f!==h||tt.current||mn?(typeof p=="function"&&(Au(t,n,p,i),h=t.memoizedState),(u=mn||Hf(t,n,u,i,f,h,a)||!1)?(c||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(i,h,a),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(i,h,a)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=h),o.props=i,o.state=h,o.context=a,i=u):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),i=!1)}return $u(e,t,n,i,s,r)}function $u(e,t,n,i,r,s){Zg(e,t);var o=(t.flags&128)!==0;if(!i&&!o)return r&&If(t,n,!1),ln(e,t,s);i=t.stateNode,iw.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:i.render();return t.flags|=1,e!==null&&o?(t.child=qi(t,e.child,null,s),t.child=qi(t,null,l,s)):Ve(e,t,l,s),t.memoizedState=i.state,r&&If(t,n,!0),t.child}function e0(e){var t=e.stateNode;t.pendingContext?Af(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Af(e,t.context,!1),Zc(e,t.containerInfo)}function Zf(e,t,n,i,r){return Vi(),Yc(r),t.flags|=256,Ve(e,t,n,i),t.child}var Bu={dehydrated:null,treeContext:null,retryLane:0};function Hu(e){return{baseLanes:e,cachePool:null,transitions:null}}function t0(e,t,n){var i=t.pendingProps,r=ae.current,s=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(r&2)!==0),l?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(r|=1),te(ae,r&1),e===null)return Nu(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=i.children,e=i.fallback,s?(i=t.mode,s=t.child,o={mode:"hidden",children:o},!(i&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=Nl(o,i,0,null),e=ai(e,i,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Hu(n),t.memoizedState=Bu,e):ld(t,o));if(r=e.memoizedState,r!==null&&(l=r.dehydrated,l!==null))return rw(e,t,o,i,l,r,n);if(s){s=i.fallback,o=t.mode,r=e.child,l=r.sibling;var a={mode:"hidden",children:i.children};return!(o&1)&&t.child!==r?(i=t.child,i.childLanes=0,i.pendingProps=a,t.deletions=null):(i=Dn(r,a),i.subtreeFlags=r.subtreeFlags&14680064),l!==null?s=Dn(l,s):(s=ai(s,o,n,null),s.flags|=2),s.return=t,i.return=t,i.sibling=s,t.child=i,i=s,s=t.child,o=e.child.memoizedState,o=o===null?Hu(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=Bu,i}return s=e.child,e=s.sibling,i=Dn(s,{mode:"visible",children:i.children}),!(t.mode&1)&&(i.lanes=n),i.return=t,i.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=i,t.memoizedState=null,i}function ld(e,t){return t=Nl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ks(e,t,n,i){return i!==null&&Yc(i),qi(t,e.child,null,n),e=ld(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function rw(e,t,n,i,r,s,o){if(n)return t.flags&256?(t.flags&=-257,i=Pa(Error(T(422))),Ks(e,t,o,i)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=i.fallback,r=t.mode,i=Nl({mode:"visible",children:i.children},r,0,null),s=ai(s,r,o,null),s.flags|=2,i.return=t,s.return=t,i.sibling=s,t.child=i,t.mode&1&&qi(t,e.child,null,o),t.child.memoizedState=Hu(o),t.memoizedState=Bu,s);if(!(t.mode&1))return Ks(e,t,o,null);if(r.data==="$!"){if(i=r.nextSibling&&r.nextSibling.dataset,i)var l=i.dgst;return i=l,s=Error(T(419)),i=Pa(s,i,void 0),Ks(e,t,o,i)}if(l=(o&e.childLanes)!==0,Ze||l){if(i=Me,i!==null){switch(o&-o){case 4:r=2;break;case 16:r=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:r=32;break;case 536870912:r=268435456;break;default:r=0}r=r&(i.suspendedLanes|o)?0:r,r!==0&&r!==s.retryLane&&(s.retryLane=r,on(e,r),Mt(i,e,r,-1))}return hd(),i=Pa(Error(T(421))),Ks(e,t,o,i)}return r.data==="$?"?(t.flags|=128,t.child=e.child,t=yw.bind(null,e),r._reactRetry=t,null):(e=s.treeContext,lt=On(r.nextSibling),at=t,se=!0,Pt=null,e!==null&&(mt[gt++]=Qt,mt[gt++]=Xt,mt[gt++]=di,Qt=e.id,Xt=e.overflow,di=t),t=ld(t,i.children),t.flags|=4096,t)}function eh(e,t,n){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Fu(e.return,t,n)}function Ta(e,t,n,i,r){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=i,s.tail=n,s.tailMode=r)}function n0(e,t,n){var i=t.pendingProps,r=i.revealOrder,s=i.tail;if(Ve(e,t,i.children,n),i=ae.current,i&2)i=i&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&eh(e,n,t);else if(e.tag===19)eh(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}if(te(ae,i),!(t.mode&1))t.memoizedState=null;else switch(r){case"forwards":for(n=t.child,r=null;n!==null;)e=n.alternate,e!==null&&Go(e)===null&&(r=n),n=n.sibling;n=r,n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),Ta(t,!1,r,n,s);break;case"backwards":for(n=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&Go(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}Ta(t,!0,n,null,s);break;case"together":Ta(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function bo(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ln(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),hi|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(T(153));if(t.child!==null){for(e=t.child,n=Dn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Dn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function sw(e,t,n){switch(t.tag){case 3:e0(t),Vi();break;case 5:Og(t);break;case 1:nt(t.type)&&Vo(t);break;case 4:Zc(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,r=t.memoizedProps.value;te(Ko,i._currentValue),i._currentValue=r;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(te(ae,ae.current&1),t.flags|=128,null):n&t.child.childLanes?t0(e,t,n):(te(ae,ae.current&1),e=ln(e,t,n),e!==null?e.sibling:null);te(ae,ae.current&1);break;case 19:if(i=(n&t.childLanes)!==0,e.flags&128){if(i)return n0(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),te(ae,ae.current),i)break;return null;case 22:case 23:return t.lanes=0,Jg(e,t,n)}return ln(e,t,n)}var i0,Uu,r0,s0;i0=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Uu=function(){};r0=function(e,t,n,i){var r=e.memoizedProps;if(r!==i){e=t.stateNode,ni(zt.current);var s=null;switch(n){case"input":r=du(e,r),i=du(e,i),s=[];break;case"select":r=ce({},r,{value:void 0}),i=ce({},i,{value:void 0}),s=[];break;case"textarea":r=pu(e,r),i=pu(e,i),s=[];break;default:typeof r.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=Uo)}gu(n,i);var o;n=null;for(u in r)if(!i.hasOwnProperty(u)&&r.hasOwnProperty(u)&&r[u]!=null)if(u==="style"){var l=r[u];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(es.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in i){var a=i[u];if(l=r!=null?r[u]:void 0,i.hasOwnProperty(u)&&a!==l&&(a!=null||l!=null))if(u==="style")if(l){for(o in l)!l.hasOwnProperty(o)||a&&a.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in a)a.hasOwnProperty(o)&&l[o]!==a[o]&&(n||(n={}),n[o]=a[o])}else n||(s||(s=[]),s.push(u,n)),n=a;else u==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,l=l?l.__html:void 0,a!=null&&l!==a&&(s=s||[]).push(u,a)):u==="children"?typeof a!="string"&&typeof a!="number"||(s=s||[]).push(u,""+a):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(es.hasOwnProperty(u)?(a!=null&&u==="onScroll"&&ne("scroll",e),s||l===a||(s=[])):(s=s||[]).push(u,a))}n&&(s=s||[]).push("style",n);var u=s;(t.updateQueue=u)&&(t.flags|=4)}};s0=function(e,t,n,i){n!==i&&(t.flags|=4)};function vr(e,t){if(!se)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function ze(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,i=0;if(t)for(var r=e.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags&14680064,i|=r.flags&14680064,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=i,e.childLanes=n,t}function ow(e,t,n){var i=t.pendingProps;switch(qc(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ze(t),null;case 1:return nt(t.type)&&Wo(),ze(t),null;case 3:return i=t.stateNode,Yi(),re(tt),re(He),td(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(qs(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Pt!==null&&(Gu(Pt),Pt=null))),Uu(e,t),ze(t),null;case 5:ed(t);var r=ni(fs.current);if(n=t.type,e!==null&&t.stateNode!=null)r0(e,t,n,i,r),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(T(166));return ze(t),null}if(e=ni(zt.current),qs(t)){i=t.stateNode,n=t.type;var s=t.memoizedProps;switch(i[At]=t,i[cs]=s,e=(t.mode&1)!==0,n){case"dialog":ne("cancel",i),ne("close",i);break;case"iframe":case"object":case"embed":ne("load",i);break;case"video":case"audio":for(r=0;r<\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=o.createElement(n,{is:i.is}):(e=o.createElement(n),n==="select"&&(o=e,i.multiple?o.multiple=!0:i.size&&(o.size=i.size))):e=o.createElementNS(e,n),e[At]=t,e[cs]=i,i0(e,t,!1,!1),t.stateNode=e;e:{switch(o=yu(n,i),n){case"dialog":ne("cancel",e),ne("close",e),r=i;break;case"iframe":case"object":case"embed":ne("load",e),r=i;break;case"video":case"audio":for(r=0;rQi&&(t.flags|=128,i=!0,vr(s,!1),t.lanes=4194304)}else{if(!i)if(e=Go(o),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),vr(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!se)return ze(t),null}else 2*ye()-s.renderingStartTime>Qi&&n!==1073741824&&(t.flags|=128,i=!0,vr(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=ye(),t.sibling=null,n=ae.current,te(ae,i?n&1|2:n&1),t):(ze(t),null);case 22:case 23:return fd(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?st&1073741824&&(ze(t),t.subtreeFlags&6&&(t.flags|=8192)):ze(t),null;case 24:return null;case 25:return null}throw Error(T(156,t.tag))}function lw(e,t){switch(qc(t),t.tag){case 1:return nt(t.type)&&Wo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Yi(),re(tt),re(He),td(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ed(t),null;case 13:if(re(ae),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(T(340));Vi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return re(ae),null;case 4:return Yi(),null;case 10:return Xc(t.type._context),null;case 22:case 23:return fd(),null;case 24:return null;default:return null}}var Qs=!1,Be=!1,aw=typeof WeakSet=="function"?WeakSet:Set,D=null;function Ri(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(i){he(e,t,i)}else n.current=null}function Wu(e,t,n){try{n()}catch(i){he(e,t,i)}}var th=!1;function uw(e,t){if(Pu=$o,e=ug(),Wc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,l=-1,a=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var p;d!==n||r!==0&&d.nodeType!==3||(l=o+r),d!==s||i!==0&&d.nodeType!==3||(a=o+i),d.nodeType===3&&(o+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===n&&++u===r&&(l=o),f===s&&++c===i&&(a=o),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Tu={focusedElem:e,selectionRange:n},$o=!1,D=t;D!==null;)if(t=D,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,D=e;else for(;D!==null;){t=D;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,v=h.memoizedState,y=t.stateNode,m=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:Et(t.type,g),v);y.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(T(163))}}catch(_){he(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,D=e;break}D=t.return}return h=th,th=!1,h}function Hr(e,t,n){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var r=i=i.next;do{if((r.tag&e)===e){var s=r.destroy;r.destroy=void 0,s!==void 0&&Wu(t,n,s)}r=r.next}while(r!==i)}}function Rl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var i=n.create;n.destroy=i()}n=n.next}while(n!==t)}}function Vu(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function o0(e){var t=e.alternate;t!==null&&(e.alternate=null,o0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[At],delete t[cs],delete t[Lu],delete t[Vx],delete t[qx])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function l0(e){return e.tag===5||e.tag===3||e.tag===4}function nh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||l0(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function qu(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Uo));else if(i!==4&&(e=e.child,e!==null))for(qu(e,t,n),e=e.sibling;e!==null;)qu(e,t,n),e=e.sibling}function Yu(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(Yu(e,t,n),e=e.sibling;e!==null;)Yu(e,t,n),e=e.sibling}var Re=null,Ct=!1;function dn(e,t,n){for(n=n.child;n!==null;)a0(e,t,n),n=n.sibling}function a0(e,t,n){if(jt&&typeof jt.onCommitFiberUnmount=="function")try{jt.onCommitFiberUnmount(kl,n)}catch{}switch(n.tag){case 5:Be||Ri(n,t);case 6:var i=Re,r=Ct;Re=null,dn(e,t,n),Re=i,Ct=r,Re!==null&&(Ct?(e=Re,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Re.removeChild(n.stateNode));break;case 18:Re!==null&&(Ct?(e=Re,n=n.stateNode,e.nodeType===8?_a(e.parentNode,n):e.nodeType===1&&_a(e,n),ss(e)):_a(Re,n.stateNode));break;case 4:i=Re,r=Ct,Re=n.stateNode.containerInfo,Ct=!0,dn(e,t,n),Re=i,Ct=r;break;case 0:case 11:case 14:case 15:if(!Be&&(i=n.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){r=i=i.next;do{var s=r,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Wu(n,t,o),r=r.next}while(r!==i)}dn(e,t,n);break;case 1:if(!Be&&(Ri(n,t),i=n.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.componentWillUnmount()}catch(l){he(n,t,l)}dn(e,t,n);break;case 21:dn(e,t,n);break;case 22:n.mode&1?(Be=(i=Be)||n.memoizedState!==null,dn(e,t,n),Be=i):dn(e,t,n);break;default:dn(e,t,n)}}function ih(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new aw),t.forEach(function(i){var r=vw.bind(null,e,i);n.has(i)||(n.add(i),i.then(r,r))})}}function kt(e,t){var n=t.deletions;if(n!==null)for(var i=0;ir&&(r=o),i&=~s}if(i=r,i=ye()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*dw(i/1960))-i,10e?16:e,_n===null)var i=!1;else{if(e=_n,_n=null,nl=0,Q&6)throw Error(T(331));var r=Q;for(Q|=4,D=e.current;D!==null;){var s=D,o=s.child;if(D.flags&16){var l=s.deletions;if(l!==null){for(var a=0;aye()-cd?li(e,0):ud|=n),it(e,t)}function g0(e,t){t===0&&(e.mode&1?(t=$s,$s<<=1,!($s&130023424)&&($s=4194304)):t=1);var n=qe();e=on(e,t),e!==null&&(ks(e,t,n),it(e,n))}function yw(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),g0(e,n)}function vw(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(T(314))}i!==null&&i.delete(t),g0(e,n)}var y0;y0=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||tt.current)Ze=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ze=!1,sw(e,t,n);Ze=!!(e.flags&131072)}else Ze=!1,se&&t.flags&1048576&&wg(t,Yo,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;bo(e,t),e=t.pendingProps;var r=Wi(t,He.current);zi(t,n),r=id(null,t,i,e,r,n);var s=rd();return t.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,nt(i)?(s=!0,Vo(t)):s=!1,t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,Jc(t),r.updater=Ml,t.stateNode=r,r._reactInternals=t,Iu(t,i,e,n),t=$u(null,t,i,!0,s,n)):(t.tag=0,se&&s&&Vc(t),Ve(null,t,r,n),t=t.child),t;case 16:i=t.elementType;e:{switch(bo(e,t),e=t.pendingProps,r=i._init,i=r(i._payload),t.type=i,r=t.tag=ww(i),e=Et(i,e),r){case 0:t=zu(null,t,i,e,n);break e;case 1:t=Jf(null,t,i,e,n);break e;case 11:t=Xf(null,t,i,e,n);break e;case 14:t=Gf(null,t,i,Et(i.type,e),n);break e}throw Error(T(306,i,""))}return t;case 0:return i=t.type,r=t.pendingProps,r=t.elementType===i?r:Et(i,r),zu(e,t,i,r,n);case 1:return i=t.type,r=t.pendingProps,r=t.elementType===i?r:Et(i,r),Jf(e,t,i,r,n);case 3:e:{if(e0(t),e===null)throw Error(T(387));i=t.pendingProps,s=t.memoizedState,r=s.element,kg(e,t),Xo(t,i,null,n);var o=t.memoizedState;if(i=o.element,s.isDehydrated)if(s={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){r=Ki(Error(T(423)),t),t=Zf(e,t,i,n,r);break e}else if(i!==r){r=Ki(Error(T(424)),t),t=Zf(e,t,i,n,r);break e}else for(lt=On(t.stateNode.containerInfo.firstChild),at=t,se=!0,Pt=null,n=Tg(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Vi(),i===r){t=ln(e,t,n);break e}Ve(e,t,i,n)}t=t.child}return t;case 5:return Og(t),e===null&&Nu(t),i=t.type,r=t.pendingProps,s=e!==null?e.memoizedProps:null,o=r.children,Ou(i,r)?o=null:s!==null&&Ou(i,s)&&(t.flags|=32),Zg(e,t),Ve(e,t,o,n),t.child;case 6:return e===null&&Nu(t),null;case 13:return t0(e,t,n);case 4:return Zc(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=qi(t,null,i,n):Ve(e,t,i,n),t.child;case 11:return i=t.type,r=t.pendingProps,r=t.elementType===i?r:Et(i,r),Xf(e,t,i,r,n);case 7:return Ve(e,t,t.pendingProps,n),t.child;case 8:return Ve(e,t,t.pendingProps.children,n),t.child;case 12:return Ve(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(i=t.type._context,r=t.pendingProps,s=t.memoizedProps,o=r.value,te(Ko,i._currentValue),i._currentValue=o,s!==null)if(Lt(s.value,o)){if(s.children===r.children&&!tt.current){t=ln(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var l=s.dependencies;if(l!==null){o=s.child;for(var a=l.firstContext;a!==null;){if(a.context===i){if(s.tag===1){a=Zt(-1,n&-n),a.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?a.next=a:(a.next=c.next,c.next=a),u.pending=a}}s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Fu(s.return,n,t),l.lanes|=n;break}a=a.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(T(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Fu(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Ve(e,t,r.children,n),t=t.child}return t;case 9:return r=t.type,i=t.pendingProps.children,zi(t,n),r=bt(r),i=i(r),t.flags|=1,Ve(e,t,i,n),t.child;case 14:return i=t.type,r=Et(i,t.pendingProps),r=Et(i.type,r),Gf(e,t,i,r,n);case 15:return Gg(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,r=t.pendingProps,r=t.elementType===i?r:Et(i,r),bo(e,t),t.tag=1,nt(i)?(e=!0,Vo(t)):e=!1,zi(t,n),Cg(t,i,r),Iu(t,i,r,n),$u(null,t,i,!0,e,n);case 19:return n0(e,t,n);case 22:return Jg(e,t,n)}throw Error(T(156,t.tag))};function v0(e,t){return Wm(e,t)}function xw(e,t,n,i){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yt(e,t,n,i){return new xw(e,t,n,i)}function pd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ww(e){if(typeof e=="function")return pd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Dc)return 11;if(e===Nc)return 14}return 2}function Dn(e,t){var n=e.alternate;return n===null?(n=yt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Eo(e,t,n,i,r,s){var o=2;if(i=e,typeof e=="function")pd(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Si:return ai(n.children,r,s,t);case Rc:o=8,r|=8;break;case lu:return e=yt(12,n,t,r|2),e.elementType=lu,e.lanes=s,e;case au:return e=yt(13,n,t,r),e.elementType=au,e.lanes=s,e;case uu:return e=yt(19,n,t,r),e.elementType=uu,e.lanes=s,e;case Pm:return Nl(n,r,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Em:o=10;break e;case Cm:o=9;break e;case Dc:o=11;break e;case Nc:o=14;break e;case pn:o=16,i=null;break e}throw Error(T(130,e==null?e:typeof e,""))}return t=yt(o,n,t,r),t.elementType=e,t.type=i,t.lanes=s,t}function ai(e,t,n,i){return e=yt(7,e,i,t),e.lanes=n,e}function Nl(e,t,n,i){return e=yt(22,e,i,t),e.elementType=Pm,e.lanes=n,e.stateNode={isHidden:!1},e}function Oa(e,t,n){return e=yt(6,e,null,t),e.lanes=n,e}function Ma(e,t,n){return t=yt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function _w(e,t,n,i,r){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ca(0),this.expirationTimes=ca(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ca(0),this.identifierPrefix=i,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function md(e,t,n,i,r,s,o,l,a){return e=new _w(e,t,n,l,a),t===1?(t=1,s===!0&&(t|=8)):t=0,s=yt(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Jc(s),e}function bw(e,t,n){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(b0)}catch(e){console.error(e)}}b0(),wm.exports=dt;var S0=wm.exports,dh=S0;su.createRoot=dh.createRoot,su.hydrateRoot=dh.hydrateRoot;var La={exports:{}},Ra,fh;function Pw(){if(fh)return Ra;fh=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ra=e,Ra}var Da,hh;function Tw(){if(hh)return Da;hh=1;var e=Pw();function t(){}function n(){}return n.resetWarningCache=t,Da=function(){function i(o,l,a,u,c,d){if(d!==e){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}i.isRequired=i;function r(){return i}var s={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:r,element:i,elementType:i,instanceOf:r,node:i,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},Da}var ph;function Ow(){return ph||(ph=1,La.exports=Tw()()),La.exports}var Xi=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(i,r,s){n.o(i,r)||Object.defineProperty(i,r,{enumerable:!0,get:s})},n.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},n.t=function(i,r){if(1&r&&(i=n(i)),8&r||4&r&&typeof i=="object"&&i&&i.__esModule)return i;var s=Object.create(null);if(n.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:i}),2&r&&typeof i!="string")for(var o in i)n.d(s,o,function(l){return i[l]}.bind(null,o));return s},n.n=function(i){var r=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(r,"a",r),r},n.o=function(i,r){return Object.prototype.hasOwnProperty.call(i,r)},n.p="",n(n.s=2)}([function(e,t){e.exports=Ow()},function(e,t){e.exports=w},function(e,t,n){n.r(t);var i=n(1),r=n(0),s=function(){return(s=Object.assign||function(h){for(var g,v=1,y=arguments.length;v0&&(F.transform=ge.join(" "),F.transformOrigin="center",W&&(fe=i.createElement("g",{style:F},ve,i.createElement("rect",{width:"24",height:"24",fill:"transparent"}))));var Un,le=fe,ht=O===!0||typeof O!="number"?2:O,Le=!W&&(N||X);if(ht<0&&(Le=!Le),O&&(le=i.createElement("g",{style:{animation:"spin"+(Le?"-inverse":"")+" linear "+Math.abs(ht)+"s infinite",transformOrigin:"center"}},fe,!(N||X||U!==0)&&i.createElement("rect",{width:"24",height:"24",fill:"transparent"}))),W)return le;var Wn,ia="icon_labelledby_"+m,Yd="icon_describedby_"+m;if(_)Un=C?ia+" "+Yd:ia;else if(Wn="presentation",C)throw new Error("title attribute required when description is set");return i.createElement("svg",c({ref:g,viewBox:"0 0 24 24",style:F,role:Wn,"aria-labelledby":Un},Ce),_&&i.createElement("title",{id:ia},_),C&&i.createElement("desc",{id:Yd},C),!W&&O&&(Le?i.createElement("style",null,"@keyframes spin-inverse { from { transform: rotate(0deg) } to { transform: rotate(-360deg) } }"):i.createElement("style",null,"@keyframes spin { from { transform: rotate(0deg) } to { transform: rotate(360deg) } }")),le)});p.displayName="Icon",p.propTypes={path:r.string.isRequired,size:r.oneOfType([r.number,r.string]),color:r.string,horizontal:r.bool,vertical:r.bool,rotate:r.number,spin:r.oneOfType([r.bool,r.number]),style:r.object,inStack:r.bool,className:r.string},p.defaultProps={size:null,color:"currentColor",horizontal:!1,vertical:!1,rotate:0,spin:!1},t.default=p}]);const Gi=tm(Xi);var Mw="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z",Lw="M14,12V19.88C14.04,20.18 13.94,20.5 13.71,20.71C13.32,21.1 12.69,21.1 12.3,20.71L10.29,18.7C10.06,18.47 9.96,18.16 10,17.87V12H9.97L4.21,4.62C3.87,4.19 3.95,3.56 4.38,3.22C4.57,3.08 4.78,3 5,3V3H19V3C19.22,3 19.43,3.08 19.62,3.22C20.05,3.56 20.13,4.19 19.79,4.62L14.03,12H14Z",Rw="M12,2A10,10 0 0,0 2,12C2,16.42 4.87,20.17 8.84,21.5C9.34,21.58 9.5,21.27 9.5,21C9.5,20.77 9.5,20.14 9.5,19.31C6.73,19.91 6.14,17.97 6.14,17.97C5.68,16.81 5.03,16.5 5.03,16.5C4.12,15.88 5.1,15.9 5.1,15.9C6.1,15.97 6.63,16.93 6.63,16.93C7.5,18.45 8.97,18 9.54,17.76C9.63,17.11 9.89,16.67 10.17,16.42C7.95,16.17 5.62,15.31 5.62,11.5C5.62,10.39 6,9.5 6.65,8.79C6.55,8.54 6.2,7.5 6.75,6.15C6.75,6.15 7.59,5.88 9.5,7.17C10.29,6.95 11.15,6.84 12,6.84C12.85,6.84 13.71,6.95 14.5,7.17C16.41,5.88 17.25,6.15 17.25,6.15C17.8,7.5 17.45,8.54 17.35,8.79C18,9.5 18.38,10.39 18.38,11.5C18.38,15.32 16.04,16.16 13.81,16.41C14.17,16.72 14.5,17.33 14.5,18.26C14.5,19.6 14.5,20.68 14.5,21C14.5,21.27 14.66,21.59 15.17,21.5C19.14,20.16 22,16.42 22,12A10,10 0 0,0 12,2Z",k0="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z",Dw="M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z",E0="M7,10L12,15L17,10H7Z",Nw="M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z",Fw="M21.29 16.71L22.71 15.29L19.5 12.11L16.5 11.26L18.41 11L22.6 7.8L21.4 6.2L17.59 9.05L14.91 9.5L18.11 6.31L17 1.76L15 2.24L15.86 5.69L14.76 6.83A3 3 0 0 0 9.24 6.83L8.11 5.69L9 2.24L7 1.76L5.89 6.31L9.09 9.5L6.4 9.05L2.6 6.2L1.4 7.8L5.6 11L7.46 11.31L4.46 12.16L1.29 15.29L2.71 16.71L5.5 13.89L7.87 13.22L4 16.54V22H6V17.46L7.56 16.12A4.5 4.5 0 0 0 16.44 16.12L18 17.46V22H20V16.54L16.13 13.22L18.5 13.89Z",Aw="M3,11H11V3H3M3,21H11V13H3M13,21H21V13H13M13,3V11H21V3";var Iw=Object.defineProperty,jw=(e,t,n)=>t in e?Iw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Na=(e,t,n)=>(jw(e,typeof t!="symbol"?t+"":t,n),n);let zw=class{constructor(){Na(this,"current",this.detect()),Na(this,"handoffState","pending"),Na(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},en=new zw,Fe=(e,t)=>{en.isServer?w.useEffect(e,t):w.useLayoutEffect(e,t)};function tn(e){let t=w.useRef(e);return Fe(()=>{t.current=e},[e]),t}function zl(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function $t(){let e=[],t={addEventListener(n,i,r,s){return n.addEventListener(i,r,s),t.add(()=>n.removeEventListener(i,r,s))},requestAnimationFrame(...n){let i=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(i))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let i=setTimeout(...n);return t.add(()=>clearTimeout(i))},microTask(...n){let i={current:!0};return zl(()=>{i.current&&n[0]()}),t.add(()=>{i.current=!1})},style(n,i,r){let s=n.style.getPropertyValue(i);return Object.assign(n.style,{[i]:r}),this.add(()=>{Object.assign(n.style,{[i]:s})})},group(n){let i=$t();return n(i),this.add(()=>i.dispose())},add(n){return e.push(n),()=>{let i=e.indexOf(n);if(i>=0)for(let r of e.splice(i,1))r()}},dispose(){for(let n of e.splice(0))n()}};return t}function Ts(){let[e]=w.useState($t);return w.useEffect(()=>()=>e.dispose(),[e]),e}let H=function(e){let t=tn(e);return B.useCallback((...n)=>t.current(...n),[t])};function ur(){let[e,t]=w.useState(en.isHandoffComplete);return e&&en.isHandoffComplete===!1&&t(!1),w.useEffect(()=>{e!==!0&&t(!0)},[e]),w.useEffect(()=>en.handoff(),[]),e}var mh;let cn=(mh=B.useId)!=null?mh:function(){let e=ur(),[t,n]=B.useState(e?()=>en.nextId():null);return Fe(()=>{t===null&&n(en.nextId())},[t]),t!=null?""+t:void 0};function Oe(e,t,...n){if(e in t){let r=t[e];return typeof r=="function"?r(...n):r}let i=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(r=>`"${r}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(i,Oe),i}function $l(e){return en.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let Ju=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Kt=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(Kt||{}),C0=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(C0||{}),$w=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))($w||{});function P0(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Ju)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var xd=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(xd||{});function wd(e,t=0){var n;return e===((n=$l(e))==null?void 0:n.body)?!1:Oe(t,{[0](){return e.matches(Ju)},[1](){let i=e;for(;i!==null;){if(i.matches(Ju))return!0;i=i.parentElement}return!1}})}function T0(e){let t=$l(e);$t().nextFrame(()=>{t&&!wd(t.activeElement,0)&&Nn(e)})}var Bw=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Bw||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function Nn(e){e==null||e.focus({preventScroll:!0})}let Hw=["textarea","input"].join(",");function Uw(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Hw))!=null?n:!1}function O0(e,t=n=>n){return e.slice().sort((n,i)=>{let r=t(n),s=t(i);if(r===null||s===null)return 0;let o=r.compareDocumentPosition(s);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Ww(e,t){return Vr(P0(),t,{relativeTo:e})}function Vr(e,t,{sorted:n=!0,relativeTo:i=null,skipElements:r=[]}={}){let s=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,o=Array.isArray(e)?n?O0(e):e:P0(e);r.length>0&&o.length>1&&(o=o.filter(p=>!r.includes(p))),i=i??s.activeElement;let l=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),a=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,o.indexOf(i))-1;if(t&4)return Math.max(0,o.indexOf(i))+1;if(t&8)return o.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=t&32?{preventScroll:!0}:{},c=0,d=o.length,f;do{if(c>=d||c+d<=0)return 0;let p=a+c;if(t&16)p=(p+d)%d;else{if(p<0)return 3;if(p>=d)return 1}f=o[p],f==null||f.focus(u),c+=l}while(f!==s.activeElement);return t&6&&Uw(f)&&f.select(),2}function gh(e,t,n){let i=tn(t);w.useEffect(()=>{function r(s){i.current(s)}return document.addEventListener(e,r,n),()=>document.removeEventListener(e,r,n)},[e,n])}function M0(e,t,n){let i=tn(t);w.useEffect(()=>{function r(s){i.current(s)}return window.addEventListener(e,r,n),()=>window.removeEventListener(e,r,n)},[e,n])}function L0(e,t,n=!0){let i=w.useRef(!1);w.useEffect(()=>{requestAnimationFrame(()=>{i.current=n})},[n]);function r(o,l){if(!i.current||o.defaultPrevented)return;let a=l(o);if(a===null||!a.getRootNode().contains(a))return;let u=function c(d){return typeof d=="function"?c(d()):Array.isArray(d)||d instanceof Set?d:[d]}(e);for(let c of u){if(c===null)continue;let d=c instanceof HTMLElement?c:c.current;if(d!=null&&d.contains(a)||o.composed&&o.composedPath().includes(d))return}return!wd(a,xd.Loose)&&a.tabIndex!==-1&&o.preventDefault(),t(o,a)}let s=w.useRef(null);gh("mousedown",o=>{var l,a;i.current&&(s.current=((a=(l=o.composedPath)==null?void 0:l.call(o))==null?void 0:a[0])||o.target)},!0),gh("click",o=>{s.current&&(r(o,()=>s.current),s.current=null)},!0),M0("blur",o=>r(o,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function yh(e){var t;if(e.type)return e.type;let n=(t=e.as)!=null?t:"button";if(typeof n=="string"&&n.toLowerCase()==="button")return"button"}function Vw(e,t){let[n,i]=w.useState(()=>yh(e));return Fe(()=>{i(yh(e))},[e.type,e.as]),Fe(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&i("button")},[n,t]),n}let R0=Symbol();function qw(e,t=!0){return Object.assign(e,{[R0]:t})}function Qe(...e){let t=w.useRef(e);w.useEffect(()=>{t.current=e},[e]);let n=H(i=>{for(let r of t.current)r!=null&&(typeof r=="function"?r(i):r.current=i)});return e.every(i=>i==null||(i==null?void 0:i[R0]))?void 0:n}function Yw({container:e,accept:t,walk:n,enabled:i=!0}){let r=w.useRef(t),s=w.useRef(n);w.useEffect(()=>{r.current=t,s.current=n},[t,n]),Fe(()=>{if(!e||!i)return;let o=$l(e);if(!o)return;let l=r.current,a=s.current,u=Object.assign(d=>l(d),{acceptNode:l}),c=o.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,u,!1);for(;c.nextNode();)a(c.currentNode)},[e,i,r,s])}function Kw(e){throw new Error("Unexpected object: "+e)}var Tt=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(Tt||{});function Qw(e,t){let n=t.resolveItems();if(n.length<=0)return null;let i=t.resolveActiveIndex(),r=i??-1,s=(()=>{switch(e.focus){case 0:return n.findIndex(o=>!t.resolveDisabled(o));case 1:{let o=n.slice().reverse().findIndex((l,a,u)=>r!==-1&&u.length-a-1>=r?!1:!t.resolveDisabled(l));return o===-1?o:n.length-1-o}case 2:return n.findIndex((o,l)=>l<=r?!1:!t.resolveDisabled(o));case 3:{let o=n.slice().reverse().findIndex(l=>!t.resolveDisabled(l));return o===-1?o:n.length-1-o}case 4:return n.findIndex(o=>t.resolveId(o)===e.id);case 5:return null;default:Kw(e)}})();return s===-1?i:s}function Zu(...e){return e.filter(Boolean).join(" ")}var Ji=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Ji||{}),Gt=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Gt||{});function We({ourProps:e,theirProps:t,slot:n,defaultTag:i,features:r,visible:s=!0,name:o}){let l=D0(t,e);if(s)return Js(l,n,i,o);let a=r??0;if(a&2){let{static:u=!1,...c}=l;if(u)return Js(c,n,i,o)}if(a&1){let{unmount:u=!0,...c}=l;return Oe(u?0:1,{[0](){return null},[1](){return Js({...c,hidden:!0,style:{display:"none"}},n,i,o)}})}return Js(l,n,i,o)}function Js(e,t={},n,i){let{as:r=n,children:s,refName:o="ref",...l}=Fa(e,["unmount","static"]),a=e.ref!==void 0?{[o]:e.ref}:{},u=typeof s=="function"?s(t):s;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(t));let c={};if(t){let d=!1,f=[];for(let[p,h]of Object.entries(t))typeof h=="boolean"&&(d=!0),h===!0&&f.push(p);d&&(c["data-headlessui-state"]=f.join(" "))}if(r===w.Fragment&&Object.keys(vh(l)).length>0){if(!w.isValidElement(u)||Array.isArray(u)&&u.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${i} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(l).map(h=>` - ${h}`).join(` `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(h=>` - ${h}`).join(` `)].join(` -`));let d=u.props,f=typeof(d==null?void 0:d.className)=="function"?(...h)=>Ju(d==null?void 0:d.className(...h),l.className):Ju(d==null?void 0:d.className,l.className),p=f?{className:f}:{};return w.cloneElement(u,Object.assign({},D0(u.props,vh(Na(l,["ref"]))),c,a,Xw(u.ref,a.ref),p))}return w.createElement(r,Object.assign({},Na(l,["ref"]),r!==w.Fragment&&a,r!==w.Fragment&&c),u)}function Xw(...e){return{ref:e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}}function D0(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let i of e)for(let r in i)r.startsWith("on")&&typeof i[r]=="function"?(n[r]!=null||(n[r]=[]),n[r].push(i[r])):t[r]=i[r];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(i=>[i,void 0])));for(let i in n)Object.assign(t,{[i](r,...s){let o=n[i];for(let l of o){if((r instanceof Event||(r==null?void 0:r.nativeEvent)instanceof Event)&&r.defaultPrevented)return;l(r,...s)}}});return t}function Ie(e){var t;return Object.assign(w.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function vh(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Na(e,t=[]){let n=Object.assign({},e);for(let i of t)i in n&&delete n[i];return n}function N0(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let i=(t==null?void 0:t.getAttribute("disabled"))==="";return i&&Gw(n)?!1:i}function Gw(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}let Jw="div";var rl=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(rl||{});function Zw(e,t){let{features:n=1,...i}=e,r={ref:t,"aria-hidden":(n&2)===2?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(n&4)===4&&(n&2)!==2&&{display:"none"}}};return Ve({ourProps:r,theirProps:i,slot:{},defaultTag:Jw,name:"Hidden"})}let Zu=Ie(Zw),_d=w.createContext(null);_d.displayName="OpenClosedContext";var De=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(De||{});function $l(){return w.useContext(_d)}function F0({value:e,children:t}){return $.createElement(_d.Provider,{value:e},t)}var Pe=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(Pe||{});function bd(e,t){let n=w.useRef([]),i=H(e);w.useEffect(()=>{let r=[...n.current];for(let[s,o]of t.entries())if(n.current[s]!==o){let l=i(t,r);return n.current=t,l}},[i,...t])}function xh(e){return[e.screenX,e.screenY]}function e_(){let e=w.useRef([-1,-1]);return{wasMoved(t){let n=xh(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=xh(t)}}}function t_(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}var Lr=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Lr||{});function n_(){let e=w.useRef(0);return M0("keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function Ts(){let e=w.useRef(!1);return Fe(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function ur(...e){return w.useMemo(()=>zl(...e),[...e])}function A0(e,t,n,i){let r=tn(n);w.useEffect(()=>{e=e??window;function s(o){r.current(o)}return e.addEventListener(t,s,i),()=>e.removeEventListener(t,s,i)},[e,t,i])}function i_(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}function I0(e){let t=H(e),n=w.useRef(!1);w.useEffect(()=>(n.current=!1,()=>{n.current=!0,jl(()=>{n.current&&t()})}),[t])}function j0(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let t=new Set;for(let n of e.current)n.current instanceof HTMLElement&&t.add(n.current);return t}let r_="div";var z0=(e=>(e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.RestoreFocus=16]="RestoreFocus",e[e.All=30]="All",e))(z0||{});function s_(e,t){let n=w.useRef(null),i=Qe(n,t),{initialFocus:r,containers:s,features:o=30,...l}=e;ar()||(o=1);let a=ur(n);a_({ownerDocument:a},!!(o&16));let u=u_({ownerDocument:a,container:n,initialFocus:r},!!(o&2));c_({ownerDocument:a,container:n,containers:s,previousActiveElement:u},!!(o&8));let c=n_(),d=H(g=>{let v=n.current;v&&(y=>y())(()=>{Oe(c.current,{[Lr.Forwards]:()=>{Vr(v,Kt.First,{skipElements:[g.relatedTarget]})},[Lr.Backwards]:()=>{Vr(v,Kt.Last,{skipElements:[g.relatedTarget]})}})})}),f=Ps(),p=w.useRef(!1),h={ref:i,onKeyDown(g){g.key=="Tab"&&(p.current=!0,f.requestAnimationFrame(()=>{p.current=!1}))},onBlur(g){let v=j0(s);n.current instanceof HTMLElement&&v.add(n.current);let y=g.relatedTarget;y instanceof HTMLElement&&y.dataset.headlessuiFocusGuard!=="true"&&($0(v,y)||(p.current?Vr(n.current,Oe(c.current,{[Lr.Forwards]:()=>Kt.Next,[Lr.Backwards]:()=>Kt.Previous})|Kt.WrapAround,{relativeTo:g.target}):g.target instanceof HTMLElement&&Nn(g.target)))}};return $.createElement($.Fragment,null,!!(o&4)&&$.createElement(Zu,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:d,features:rl.Focusable}),Ve({ourProps:h,theirProps:l,defaultTag:r_,name:"FocusTrap"}),!!(o&4)&&$.createElement(Zu,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:d,features:rl.Focusable}))}let o_=Ie(s_),xr=Object.assign(o_,{features:z0}),vn=[];i_(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&vn[0]!==t.target&&(vn.unshift(t.target),vn=vn.filter(n=>n!=null&&n.isConnected),vn.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function l_(e=!0){let t=w.useRef(vn.slice());return bd(([n],[i])=>{i===!0&&n===!1&&jl(()=>{t.current.splice(0)}),i===!1&&n===!0&&(t.current=vn.slice())},[e,vn,t]),H(()=>{var n;return(n=t.current.find(i=>i!=null&&i.isConnected))!=null?n:null})}function a_({ownerDocument:e},t){let n=l_(t);bd(()=>{t||(e==null?void 0:e.activeElement)===(e==null?void 0:e.body)&&Nn(n())},[t]),I0(()=>{t&&Nn(n())})}function u_({ownerDocument:e,container:t,initialFocus:n},i){let r=w.useRef(null),s=Ts();return bd(()=>{if(!i)return;let o=t.current;o&&jl(()=>{if(!s.current)return;let l=e==null?void 0:e.activeElement;if(n!=null&&n.current){if((n==null?void 0:n.current)===l){r.current=l;return}}else if(o.contains(l)){r.current=l;return}n!=null&&n.current?Nn(n.current):Vr(o,Kt.First)===C0.Error&&console.warn("There are no focusable elements inside the "),r.current=e==null?void 0:e.activeElement})},[i]),r}function c_({ownerDocument:e,container:t,containers:n,previousActiveElement:i},r){let s=Ts();A0(e==null?void 0:e.defaultView,"focus",o=>{if(!r||!s.current)return;let l=j0(n);t.current instanceof HTMLElement&&l.add(t.current);let a=i.current;if(!a)return;let u=o.target;u&&u instanceof HTMLElement?$0(l,u)?(i.current=u,Nn(u)):(o.preventDefault(),o.stopPropagation(),Nn(a)):Nn(i.current)},!0)}function $0(e,t){for(let n of e)if(n.contains(t))return!0;return!1}let B0=w.createContext(!1);function d_(){return w.useContext(B0)}function ec(e){return $.createElement(B0.Provider,{value:e.force},e.children)}function f_(e){let t=d_(),n=w.useContext(H0),i=ur(e),[r,s]=w.useState(()=>{if(!t&&n!==null||en.isServer)return null;let o=i==null?void 0:i.getElementById("headlessui-portal-root");if(o)return o;if(i===null)return null;let l=i.createElement("div");return l.setAttribute("id","headlessui-portal-root"),i.body.appendChild(l)});return w.useEffect(()=>{r!==null&&(i!=null&&i.body.contains(r)||i==null||i.body.appendChild(r))},[r,i]),w.useEffect(()=>{t||n!==null&&s(n.current)},[n,s,t]),r}let h_=w.Fragment;function p_(e,t){let n=e,i=w.useRef(null),r=Qe(qw(c=>{i.current=c}),t),s=ur(i),o=f_(i),[l]=w.useState(()=>{var c;return en.isServer?null:(c=s==null?void 0:s.createElement("div"))!=null?c:null}),a=w.useContext(tc),u=ar();return Fe(()=>{!o||!l||o.contains(l)||(l.setAttribute("data-headlessui-portal",""),o.appendChild(l))},[o,l]),Fe(()=>{if(l&&a)return a.register(l)},[a,l]),I0(()=>{var c;!o||!l||(l instanceof Node&&o.contains(l)&&o.removeChild(l),o.childNodes.length<=0&&((c=o.parentElement)==null||c.removeChild(o)))}),u?!o||!l?null:S0.createPortal(Ve({ourProps:{ref:r},theirProps:n,defaultTag:h_,name:"Portal"}),l):null}let m_=w.Fragment,H0=w.createContext(null);function g_(e,t){let{target:n,...i}=e,r={ref:Qe(t)};return $.createElement(H0.Provider,{value:n},Ve({ourProps:r,theirProps:i,defaultTag:m_,name:"Popover.Group"}))}let tc=w.createContext(null);function y_(){let e=w.useContext(tc),t=w.useRef([]),n=H(s=>(t.current.push(s),e&&e.register(s),()=>i(s))),i=H(s=>{let o=t.current.indexOf(s);o!==-1&&t.current.splice(o,1),e&&e.unregister(s)}),r=w.useMemo(()=>({register:n,unregister:i,portals:t}),[n,i,t]);return[t,w.useMemo(()=>function({children:s}){return $.createElement(tc.Provider,{value:r},s)},[r])]}let v_=Ie(p_),x_=Ie(g_),nc=Object.assign(v_,{Group:x_}),U0=w.createContext(null);function V0(){let e=w.useContext(U0);if(e===null){let t=new Error("You used a component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,V0),t}return e}function w_(){let[e,t]=w.useState([]);return[e.length>0?e.join(" "):void 0,w.useMemo(()=>function(n){let i=H(s=>(t(o=>[...o,s]),()=>t(o=>{let l=o.slice(),a=l.indexOf(s);return a!==-1&&l.splice(a,1),l}))),r=w.useMemo(()=>({register:i,slot:n.slot,name:n.name,props:n.props}),[i,n.slot,n.name,n.props]);return $.createElement(U0.Provider,{value:r},n.children)},[t])]}let __="p";function b_(e,t){let n=cn(),{id:i=`headlessui-description-${n}`,...r}=e,s=V0(),o=Qe(t);Fe(()=>s.register(i),[i,s.register]);let l={ref:o,...s.props,id:i};return Ve({ourProps:l,theirProps:r,slot:s.slot||{},defaultTag:__,name:s.name||"Description"})}let S_=Ie(b_),k_=Object.assign(S_,{}),Sd=w.createContext(()=>{});Sd.displayName="StackContext";var ic=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(ic||{});function E_(){return w.useContext(Sd)}function C_({children:e,onUpdate:t,type:n,element:i,enabled:r}){let s=E_(),o=H((...l)=>{t==null||t(...l),s(...l)});return Fe(()=>{let l=r===void 0||r===!0;return l&&o(0,n,i),()=>{l&&o(1,n,i)}},[o,n,i,r]),$.createElement(Sd.Provider,{value:o},e)}function P_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}const T_=typeof Object.is=="function"?Object.is:P_,{useState:O_,useEffect:M_,useLayoutEffect:L_,useDebugValue:R_}=Ro;function D_(e,t,n){const i=t(),[{inst:r},s]=O_({inst:{value:i,getSnapshot:t}});return L_(()=>{r.value=i,r.getSnapshot=t,Fa(r)&&s({inst:r})},[e,i,t]),M_(()=>(Fa(r)&&s({inst:r}),e(()=>{Fa(r)&&s({inst:r})})),[e]),R_(i),i}function Fa(e){const t=e.getSnapshot,n=e.value;try{const i=t();return!T_(n,i)}catch{return!0}}function N_(e,t,n){return t()}const F_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",A_=!F_,I_=A_?N_:D_,j_="useSyncExternalStore"in Ro?(e=>e.useSyncExternalStore)(Ro):I_;function z_(e){return j_(e.subscribe,e.getSnapshot,e.getSnapshot)}function $_(e,t){let n=e(),i=new Set;return{getSnapshot(){return n},subscribe(r){return i.add(r),()=>i.delete(r)},dispatch(r,...s){let o=t[r].call(n,...s);o&&(n=o,i.forEach(l=>l()))}}}function B_(){let e;return{before({doc:t}){var n;let i=t.documentElement;e=((n=t.defaultView)!=null?n:window).innerWidth-i.clientWidth},after({doc:t,d:n}){let i=t.documentElement,r=i.clientWidth-i.offsetWidth,s=e-r;n.style(i,"paddingRight",`${s}px`)}}}function H_(){if(!t_())return{};let e;return{before(){e=window.pageYOffset},after({doc:t,d:n,meta:i}){function r(o){return i.containers.flatMap(l=>l()).some(l=>l.contains(o))}n.style(t.body,"marginTop",`-${e}px`),window.scrollTo(0,0);let s=null;n.addEventListener(t,"click",o=>{if(o.target instanceof HTMLElement)try{let l=o.target.closest("a");if(!l)return;let{hash:a}=new URL(l.href),u=t.querySelector(a);u&&!r(u)&&(s=u)}catch{}},!0),n.addEventListener(t,"touchmove",o=>{o.target instanceof HTMLElement&&!r(o.target)&&o.preventDefault()},{passive:!1}),n.add(()=>{window.scrollTo(0,window.pageYOffset+e),s&&s.isConnected&&(s.scrollIntoView({block:"nearest"}),s=null)})}}}function U_(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function V_(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let ii=$_(()=>new Map,{PUSH(e,t){var n;let i=(n=this.get(e))!=null?n:{doc:e,count:0,d:$t(),meta:new Set};return i.count++,i.meta.add(t),this.set(e,i),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let i={doc:e,d:t,meta:V_(n)},r=[H_(),B_(),U_()];r.forEach(({before:s})=>s==null?void 0:s(i)),r.forEach(({after:s})=>s==null?void 0:s(i))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});ii.subscribe(()=>{let e=ii.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let i=t.get(n.doc)==="hidden",r=n.count!==0;(r&&!i||!r&&i)&&ii.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&ii.dispatch("TEARDOWN",n)}});function W_(e,t,n){let i=z_(ii),r=e?i.get(e):void 0,s=r?r.count>0:!1;return Fe(()=>{if(!(!e||!t))return ii.dispatch("PUSH",e,n),()=>ii.dispatch("POP",e,n)},[t,e]),s}let Aa=new Map,wr=new Map;function wh(e,t=!0){Fe(()=>{var n;if(!t)return;let i=typeof e=="function"?e():e.current;if(!i)return;function r(){var o;if(!i)return;let l=(o=wr.get(i))!=null?o:1;if(l===1?wr.delete(i):wr.set(i,l-1),l!==1)return;let a=Aa.get(i);a&&(a["aria-hidden"]===null?i.removeAttribute("aria-hidden"):i.setAttribute("aria-hidden",a["aria-hidden"]),i.inert=a.inert,Aa.delete(i))}let s=(n=wr.get(i))!=null?n:0;return wr.set(i,s+1),s!==0||(Aa.set(i,{"aria-hidden":i.getAttribute("aria-hidden"),inert:i.inert}),i.setAttribute("aria-hidden","true"),i.inert=!0),r},[e,t])}function q_({defaultContainers:e=[],portals:t}={}){let n=w.useRef(null),i=ur(n),r=H(()=>{var s;let o=[];for(let l of e)l!==null&&(l instanceof HTMLElement?o.push(l):"current"in l&&l.current instanceof HTMLElement&&o.push(l.current));if(t!=null&&t.current)for(let l of t.current)o.push(l);for(let l of(s=i==null?void 0:i.querySelectorAll("html > *, body > *"))!=null?s:[])l!==document.body&&l!==document.head&&l instanceof HTMLElement&&l.id!=="headlessui-portal-root"&&(l.contains(n.current)||o.some(a=>l.contains(a))||o.push(l));return o});return{resolveContainers:r,contains:H(s=>r().some(o=>o.contains(s))),mainTreeNodeRef:n,MainTreeNode:w.useMemo(()=>function(){return $.createElement(Zu,{features:rl.Hidden,ref:n})},[n])}}var Y_=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Y_||{}),K_=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(K_||{});let Q_={[0](e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},sl=w.createContext(null);sl.displayName="DialogContext";function Os(e){let t=w.useContext(sl);if(t===null){let n=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Os),n}return t}function X_(e,t,n=()=>[document.body]){W_(e,t,i=>{var r;return{containers:[...(r=i.containers)!=null?r:[],n]}})}function G_(e,t){return Oe(t.type,Q_,e,t)}let J_="div",Z_=Ji.RenderStrategy|Ji.Static;function eb(e,t){var n;let i=cn(),{id:r=`headlessui-dialog-${i}`,open:s,onClose:o,initialFocus:l,__demoMode:a=!1,...u}=e,[c,d]=w.useState(0),f=$l();s===void 0&&f!==null&&(s=(f&De.Open)===De.Open);let p=w.useRef(null),h=Qe(p,t),g=ur(p),v=e.hasOwnProperty("open")||f!==null,y=e.hasOwnProperty("onClose");if(!v&&!y)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!v)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!y)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(typeof s!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${s}`);if(typeof o!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${o}`);let m=s?0:1,[x,_]=w.useReducer(G_,{titleId:null,descriptionId:null,panelRef:w.createRef()}),S=H(()=>o(!1)),k=H(le=>_({type:0,id:le})),C=ar()?a?!1:m===0:!1,E=c>1,T=w.useContext(sl)!==null,[M,R]=y_(),{resolveContainers:F,mainTreeNodeRef:B,MainTreeNode:J}=q_({portals:M,defaultContainers:[(n=x.panelRef.current)!=null?n:p.current]}),j=E?"parent":"leaf",U=f!==null?(f&De.Closing)===De.Closing:!1,Z=(()=>T||U?!1:C)(),L=w.useCallback(()=>{var le,ht;return(ht=Array.from((le=g==null?void 0:g.querySelectorAll("body > *"))!=null?le:[]).find(Le=>Le.id==="headlessui-portal-root"?!1:Le.contains(B.current)&&Le instanceof HTMLElement))!=null?ht:null},[B]);wh(L,Z);let A=(()=>E?!0:C)(),N=w.useCallback(()=>{var le,ht;return(ht=Array.from((le=g==null?void 0:g.querySelectorAll("[data-headlessui-portal]"))!=null?le:[]).find(Le=>Le.contains(B.current)&&Le instanceof HTMLElement))!=null?ht:null},[B]);wh(N,A);let z=(()=>!(!C||E))();L0(F,S,z);let V=(()=>!(E||m!==0))();A0(g==null?void 0:g.defaultView,"keydown",le=>{V&&(le.defaultPrevented||le.key===Pe.Escape&&(le.preventDefault(),le.stopPropagation(),S()))});let Ce=(()=>!(U||m!==0||T))();X_(g,Ce,F),w.useEffect(()=>{if(m!==0||!p.current)return;let le=new ResizeObserver(ht=>{for(let Le of ht){let Vn=Le.target.getBoundingClientRect();Vn.x===0&&Vn.y===0&&Vn.width===0&&Vn.height===0&&S()}});return le.observe(p.current),()=>le.disconnect()},[m,p,S]);let[de,ge]=w_(),ve=w.useMemo(()=>[{dialogState:m,close:S,setTitleId:k},x],[m,x,S,k]),fe=w.useMemo(()=>({open:m===0}),[m]),Un={ref:h,id:r,role:"dialog","aria-modal":m===0?!0:void 0,"aria-labelledby":x.titleId,"aria-describedby":de};return $.createElement(C_,{type:"Dialog",enabled:m===0,element:p,onUpdate:H((le,ht)=>{ht==="Dialog"&&Oe(le,{[ic.Add]:()=>d(Le=>Le+1),[ic.Remove]:()=>d(Le=>Le-1)})})},$.createElement(ec,{force:!0},$.createElement(nc,null,$.createElement(sl.Provider,{value:ve},$.createElement(nc.Group,{target:p},$.createElement(ec,{force:!1},$.createElement(ge,{slot:fe,name:"Dialog.Description"},$.createElement(xr,{initialFocus:l,containers:F,features:C?Oe(j,{parent:xr.features.RestoreFocus,leaf:xr.features.All&~xr.features.FocusLock}):xr.features.None},$.createElement(R,null,Ve({ourProps:Un,theirProps:u,slot:fe,defaultTag:J_,features:Z_,visible:m===0,name:"Dialog"}))))))))),$.createElement(J,null))}let tb="div";function nb(e,t){let n=cn(),{id:i=`headlessui-dialog-overlay-${n}`,...r}=e,[{dialogState:s,close:o}]=Os("Dialog.Overlay"),l=Qe(t),a=H(c=>{if(c.target===c.currentTarget){if(N0(c.currentTarget))return c.preventDefault();c.preventDefault(),c.stopPropagation(),o()}}),u=w.useMemo(()=>({open:s===0}),[s]);return Ve({ourProps:{ref:l,id:i,"aria-hidden":!0,onClick:a},theirProps:r,slot:u,defaultTag:tb,name:"Dialog.Overlay"})}let ib="div";function rb(e,t){let n=cn(),{id:i=`headlessui-dialog-backdrop-${n}`,...r}=e,[{dialogState:s},o]=Os("Dialog.Backdrop"),l=Qe(t);w.useEffect(()=>{if(o.panelRef.current===null)throw new Error("A component is being used, but a component is missing.")},[o.panelRef]);let a=w.useMemo(()=>({open:s===0}),[s]);return $.createElement(ec,{force:!0},$.createElement(nc,null,Ve({ourProps:{ref:l,id:i,"aria-hidden":!0},theirProps:r,slot:a,defaultTag:ib,name:"Dialog.Backdrop"})))}let sb="div";function ob(e,t){let n=cn(),{id:i=`headlessui-dialog-panel-${n}`,...r}=e,[{dialogState:s},o]=Os("Dialog.Panel"),l=Qe(t,o.panelRef),a=w.useMemo(()=>({open:s===0}),[s]),u=H(c=>{c.stopPropagation()});return Ve({ourProps:{ref:l,id:i,onClick:u},theirProps:r,slot:a,defaultTag:sb,name:"Dialog.Panel"})}let lb="h2";function ab(e,t){let n=cn(),{id:i=`headlessui-dialog-title-${n}`,...r}=e,[{dialogState:s,setTitleId:o}]=Os("Dialog.Title"),l=Qe(t);w.useEffect(()=>(o(i),()=>o(null)),[i,o]);let a=w.useMemo(()=>({open:s===0}),[s]);return Ve({ourProps:{ref:l,id:i},theirProps:r,slot:a,defaultTag:lb,name:"Dialog.Title"})}let ub=Ie(eb),cb=Ie(rb),db=Ie(ob),fb=Ie(nb),hb=Ie(ab),_h=Object.assign(ub,{Backdrop:cb,Panel:db,Overlay:fb,Title:hb,Description:k_}),bh=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function Sh(e){var t,n;let i=(t=e.innerText)!=null?t:"",r=e.cloneNode(!0);if(!(r instanceof HTMLElement))return i;let s=!1;for(let l of r.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))l.remove(),s=!0;let o=s?(n=r.innerText)!=null?n:"":i;return bh.test(o)&&(o=o.replace(bh,"")),o}function pb(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let i=n.split(" ").map(r=>{let s=document.getElementById(r);if(s){let o=s.getAttribute("aria-label");return typeof o=="string"?o.trim():Sh(s).trim()}return null}).filter(Boolean);if(i.length>0)return i.join(", ")}return Sh(e).trim()}function mb(e){let t=w.useRef(""),n=w.useRef("");return H(()=>{let i=e.current;if(!i)return"";let r=i.innerText;if(t.current===r)return n.current;let s=pb(i).trim().toLowerCase();return t.current=r,n.current=s,s})}var gb=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(gb||{}),yb=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(yb||{}),vb=(e=>(e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem",e))(vb||{});function Ia(e,t=n=>n){let n=e.activeItemIndex!==null?e.items[e.activeItemIndex]:null,i=O0(t(e.items.slice()),s=>s.dataRef.current.domRef.current),r=n?i.indexOf(n):null;return r===-1&&(r=null),{items:i,activeItemIndex:r}}let xb={[1](e){return e.menuState===1?e:{...e,activeItemIndex:null,menuState:1}},[0](e){return e.menuState===0?e:{...e,__demoMode:!1,menuState:0}},[2]:(e,t)=>{var n;let i=Ia(e),r=Qw(t,{resolveItems:()=>i.items,resolveActiveIndex:()=>i.activeItemIndex,resolveId:s=>s.id,resolveDisabled:s=>s.dataRef.current.disabled});return{...e,...i,searchQuery:"",activeItemIndex:r,activationTrigger:(n=t.trigger)!=null?n:1}},[3]:(e,t)=>{let n=e.searchQuery!==""?0:1,i=e.searchQuery+t.value.toLowerCase(),r=(e.activeItemIndex!==null?e.items.slice(e.activeItemIndex+n).concat(e.items.slice(0,e.activeItemIndex+n)):e.items).find(o=>{var l;return((l=o.dataRef.current.textValue)==null?void 0:l.startsWith(i))&&!o.dataRef.current.disabled}),s=r?e.items.indexOf(r):-1;return s===-1||s===e.activeItemIndex?{...e,searchQuery:i}:{...e,searchQuery:i,activeItemIndex:s,activationTrigger:1}},[4](e){return e.searchQuery===""?e:{...e,searchQuery:"",searchActiveItemIndex:null}},[5]:(e,t)=>{let n=Ia(e,i=>[...i,{id:t.id,dataRef:t.dataRef}]);return{...e,...n}},[6]:(e,t)=>{let n=Ia(e,i=>{let r=i.findIndex(s=>s.id===t.id);return r!==-1&&i.splice(r,1),i});return{...e,...n,activationTrigger:1}}},kd=w.createContext(null);kd.displayName="MenuContext";function Bl(e){let t=w.useContext(kd);if(t===null){let n=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Bl),n}return t}function wb(e,t){return Oe(t.type,xb,e,t)}let _b=w.Fragment;function bb(e,t){let{__demoMode:n=!1,...i}=e,r=w.useReducer(wb,{__demoMode:n,menuState:n?0:1,buttonRef:w.createRef(),itemsRef:w.createRef(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:s,itemsRef:o,buttonRef:l},a]=r,u=Qe(t);L0([l,o],(p,h)=>{var g;a({type:1}),wd(h,xd.Loose)||(p.preventDefault(),(g=l.current)==null||g.focus())},s===0);let c=H(()=>{a({type:1})}),d=w.useMemo(()=>({open:s===0,close:c}),[s,c]),f={ref:u};return $.createElement(kd.Provider,{value:r},$.createElement(F0,{value:Oe(s,{[0]:De.Open,[1]:De.Closed})},Ve({ourProps:f,theirProps:i,slot:d,defaultTag:_b,name:"Menu"})))}let Sb="button";function kb(e,t){var n;let i=cn(),{id:r=`headlessui-menu-button-${i}`,...s}=e,[o,l]=Bl("Menu.Button"),a=Qe(o.buttonRef,t),u=Ps(),c=H(g=>{switch(g.key){case Pe.Space:case Pe.Enter:case Pe.ArrowDown:g.preventDefault(),g.stopPropagation(),l({type:0}),u.nextFrame(()=>l({type:2,focus:Tt.First}));break;case Pe.ArrowUp:g.preventDefault(),g.stopPropagation(),l({type:0}),u.nextFrame(()=>l({type:2,focus:Tt.Last}));break}}),d=H(g=>{switch(g.key){case Pe.Space:g.preventDefault();break}}),f=H(g=>{if(N0(g.currentTarget))return g.preventDefault();e.disabled||(o.menuState===0?(l({type:1}),u.nextFrame(()=>{var v;return(v=o.buttonRef.current)==null?void 0:v.focus({preventScroll:!0})})):(g.preventDefault(),l({type:0})))}),p=w.useMemo(()=>({open:o.menuState===0}),[o]),h={ref:a,id:r,type:Ww(e,o.buttonRef),"aria-haspopup":"menu","aria-controls":(n=o.itemsRef.current)==null?void 0:n.id,"aria-expanded":e.disabled?void 0:o.menuState===0,onKeyDown:c,onKeyUp:d,onClick:f};return Ve({ourProps:h,theirProps:s,slot:p,defaultTag:Sb,name:"Menu.Button"})}let Eb="div",Cb=Ji.RenderStrategy|Ji.Static;function Pb(e,t){var n,i;let r=cn(),{id:s=`headlessui-menu-items-${r}`,...o}=e,[l,a]=Bl("Menu.Items"),u=Qe(l.itemsRef,t),c=ur(l.itemsRef),d=Ps(),f=$l(),p=(()=>f!==null?(f&De.Open)===De.Open:l.menuState===0)();w.useEffect(()=>{let m=l.itemsRef.current;m&&l.menuState===0&&m!==(c==null?void 0:c.activeElement)&&m.focus({preventScroll:!0})},[l.menuState,l.itemsRef,c]),Yw({container:l.itemsRef.current,enabled:l.menuState===0,accept(m){return m.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:m.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(m){m.setAttribute("role","none")}});let h=H(m=>{var x,_;switch(d.dispose(),m.key){case Pe.Space:if(l.searchQuery!=="")return m.preventDefault(),m.stopPropagation(),a({type:3,value:m.key});case Pe.Enter:if(m.preventDefault(),m.stopPropagation(),a({type:1}),l.activeItemIndex!==null){let{dataRef:S}=l.items[l.activeItemIndex];(_=(x=S.current)==null?void 0:x.domRef.current)==null||_.click()}T0(l.buttonRef.current);break;case Pe.ArrowDown:return m.preventDefault(),m.stopPropagation(),a({type:2,focus:Tt.Next});case Pe.ArrowUp:return m.preventDefault(),m.stopPropagation(),a({type:2,focus:Tt.Previous});case Pe.Home:case Pe.PageUp:return m.preventDefault(),m.stopPropagation(),a({type:2,focus:Tt.First});case Pe.End:case Pe.PageDown:return m.preventDefault(),m.stopPropagation(),a({type:2,focus:Tt.Last});case Pe.Escape:m.preventDefault(),m.stopPropagation(),a({type:1}),$t().nextFrame(()=>{var S;return(S=l.buttonRef.current)==null?void 0:S.focus({preventScroll:!0})});break;case Pe.Tab:m.preventDefault(),m.stopPropagation(),a({type:1}),$t().nextFrame(()=>{Vw(l.buttonRef.current,m.shiftKey?Kt.Previous:Kt.Next)});break;default:m.key.length===1&&(a({type:3,value:m.key}),d.setTimeout(()=>a({type:4}),350));break}}),g=H(m=>{switch(m.key){case Pe.Space:m.preventDefault();break}}),v=w.useMemo(()=>({open:l.menuState===0}),[l]),y={"aria-activedescendant":l.activeItemIndex===null||(n=l.items[l.activeItemIndex])==null?void 0:n.id,"aria-labelledby":(i=l.buttonRef.current)==null?void 0:i.id,id:s,onKeyDown:h,onKeyUp:g,role:"menu",tabIndex:0,ref:u};return Ve({ourProps:y,theirProps:o,slot:v,defaultTag:Eb,features:Cb,visible:p,name:"Menu.Items"})}let Tb=w.Fragment;function Ob(e,t){let n=cn(),{id:i=`headlessui-menu-item-${n}`,disabled:r=!1,...s}=e,[o,l]=Bl("Menu.Item"),a=o.activeItemIndex!==null?o.items[o.activeItemIndex].id===i:!1,u=w.useRef(null),c=Qe(t,u);Fe(()=>{if(o.__demoMode||o.menuState!==0||!a||o.activationTrigger===0)return;let S=$t();return S.requestAnimationFrame(()=>{var k,C;(C=(k=u.current)==null?void 0:k.scrollIntoView)==null||C.call(k,{block:"nearest"})}),S.dispose},[o.__demoMode,u,a,o.menuState,o.activationTrigger,o.activeItemIndex]);let d=mb(u),f=w.useRef({disabled:r,domRef:u,get textValue(){return d()}});Fe(()=>{f.current.disabled=r},[f,r]),Fe(()=>(l({type:5,id:i,dataRef:f}),()=>l({type:6,id:i})),[f,i]);let p=H(()=>{l({type:1})}),h=H(S=>{if(r)return S.preventDefault();l({type:1}),T0(o.buttonRef.current)}),g=H(()=>{if(r)return l({type:2,focus:Tt.Nothing});l({type:2,focus:Tt.Specific,id:i})}),v=e_(),y=H(S=>v.update(S)),m=H(S=>{v.wasMoved(S)&&(r||a||l({type:2,focus:Tt.Specific,id:i,trigger:0}))}),x=H(S=>{v.wasMoved(S)&&(r||a&&l({type:2,focus:Tt.Nothing}))}),_=w.useMemo(()=>({active:a,disabled:r,close:p}),[a,r,p]);return Ve({ourProps:{id:i,ref:c,role:"menuitem",tabIndex:r===!0?void 0:-1,"aria-disabled":r===!0?!0:void 0,disabled:void 0,onClick:h,onFocus:g,onPointerEnter:y,onMouseEnter:y,onPointerMove:m,onMouseMove:m,onPointerLeave:x,onMouseLeave:x},theirProps:s,slot:_,defaultTag:Tb,name:"Menu.Item"})}let Mb=Ie(bb),Lb=Ie(kb),Rb=Ie(Pb),Db=Ie(Ob),ri=Object.assign(Mb,{Button:Lb,Items:Rb,Item:Db});function Nb(e=0){let[t,n]=w.useState(e),i=Ts(),r=w.useCallback(a=>{i.current&&n(u=>u|a)},[t,i]),s=w.useCallback(a=>!!(t&a),[t]),o=w.useCallback(a=>{i.current&&n(u=>u&~a)},[n,i]),l=w.useCallback(a=>{i.current&&n(u=>u^a)},[n]);return{flags:t,addFlag:r,hasFlag:s,removeFlag:o,toggleFlag:l}}function Fb(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function ja(e,...t){e&&t.length>0&&e.classList.add(...t)}function za(e,...t){e&&t.length>0&&e.classList.remove(...t)}function Ab(e,t){let n=$t();if(!e)return n.dispose;let{transitionDuration:i,transitionDelay:r}=getComputedStyle(e),[s,o]=[i,r].map(a=>{let[u=0]=a.split(",").filter(Boolean).map(c=>c.includes("ms")?parseFloat(c):parseFloat(c)*1e3).sort((c,d)=>d-c);return u}),l=s+o;if(l!==0){n.group(u=>{u.setTimeout(()=>{t(),u.dispose()},l),u.addEventListener(e,"transitionrun",c=>{c.target===c.currentTarget&&u.dispose()})});let a=n.addEventListener(e,"transitionend",u=>{u.target===u.currentTarget&&(t(),a())})}else t();return n.add(()=>t()),n.dispose}function Ib(e,t,n,i){let r=n?"enter":"leave",s=$t(),o=i!==void 0?Fb(i):()=>{};r==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let l=Oe(r,{enter:()=>t.enter,leave:()=>t.leave}),a=Oe(r,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),u=Oe(r,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return za(e,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),ja(e,...l,...u),s.nextFrame(()=>{za(e,...u),ja(e,...a),Ab(e,()=>(za(e,...l),ja(e,...t.entered),o()))}),s.dispose}function jb({container:e,direction:t,classes:n,onStart:i,onStop:r}){let s=Ts(),o=Ps(),l=tn(t);Fe(()=>{let a=$t();o.add(a.dispose);let u=e.current;if(u&&l.current!=="idle"&&s.current)return a.dispose(),i.current(l.current),a.add(Ib(u,n.current,l.current==="enter",()=>{a.dispose(),r.current(l.current)})),a.dispose},[t])}function Wn(e=""){return e.split(" ").filter(t=>t.trim().length>1)}let Hl=w.createContext(null);Hl.displayName="TransitionContext";var zb=(e=>(e.Visible="visible",e.Hidden="hidden",e))(zb||{});function $b(){let e=w.useContext(Hl);if(e===null)throw new Error("A is used but it is missing a parent or .");return e}function Bb(){let e=w.useContext(Ul);if(e===null)throw new Error("A is used but it is missing a parent or .");return e}let Ul=w.createContext(null);Ul.displayName="NestingContext";function Vl(e){return"children"in e?Vl(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function W0(e,t){let n=tn(e),i=w.useRef([]),r=Ts(),s=Ps(),o=H((p,h=Gt.Hidden)=>{let g=i.current.findIndex(({el:v})=>v===p);g!==-1&&(Oe(h,{[Gt.Unmount](){i.current.splice(g,1)},[Gt.Hidden](){i.current[g].state="hidden"}}),s.microTask(()=>{var v;!Vl(i)&&r.current&&((v=n.current)==null||v.call(n))}))}),l=H(p=>{let h=i.current.find(({el:g})=>g===p);return h?h.state!=="visible"&&(h.state="visible"):i.current.push({el:p,state:"visible"}),()=>o(p,Gt.Unmount)}),a=w.useRef([]),u=w.useRef(Promise.resolve()),c=w.useRef({enter:[],leave:[],idle:[]}),d=H((p,h,g)=>{a.current.splice(0),t&&(t.chains.current[h]=t.chains.current[h].filter(([v])=>v!==p)),t==null||t.chains.current[h].push([p,new Promise(v=>{a.current.push(v)})]),t==null||t.chains.current[h].push([p,new Promise(v=>{Promise.all(c.current[h].map(([y,m])=>m)).then(()=>v())})]),h==="enter"?u.current=u.current.then(()=>t==null?void 0:t.wait.current).then(()=>g(h)):g(h)}),f=H((p,h,g)=>{Promise.all(c.current[h].splice(0).map(([v,y])=>y)).then(()=>{var v;(v=a.current.shift())==null||v()}).then(()=>g(h))});return w.useMemo(()=>({children:i,register:l,unregister:o,onStart:d,onStop:f,wait:u,chains:c}),[l,o,i,d,f,c,u])}function Hb(){}let Ub=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function kh(e){var t;let n={};for(let i of Ub)n[i]=(t=e[i])!=null?t:Hb;return n}function Vb(e){let t=w.useRef(kh(e));return w.useEffect(()=>{t.current=kh(e)},[e]),t}let Wb="div",q0=Ji.RenderStrategy;function qb(e,t){let{beforeEnter:n,afterEnter:i,beforeLeave:r,afterLeave:s,enter:o,enterFrom:l,enterTo:a,entered:u,leave:c,leaveFrom:d,leaveTo:f,...p}=e,h=w.useRef(null),g=Qe(h,t),v=p.unmount?Gt.Unmount:Gt.Hidden,{show:y,appear:m,initial:x}=$b(),[_,S]=w.useState(y?"visible":"hidden"),k=Bb(),{register:C,unregister:E}=k,T=w.useRef(null);w.useEffect(()=>C(h),[C,h]),w.useEffect(()=>{if(v===Gt.Hidden&&h.current){if(y&&_!=="visible"){S("visible");return}return Oe(_,{hidden:()=>E(h),visible:()=>C(h)})}},[_,h,C,E,y,v]);let M=tn({enter:Wn(o),enterFrom:Wn(l),enterTo:Wn(a),entered:Wn(u),leave:Wn(c),leaveFrom:Wn(d),leaveTo:Wn(f)}),R=Vb({beforeEnter:n,afterEnter:i,beforeLeave:r,afterLeave:s}),F=ar();w.useEffect(()=>{if(F&&_==="visible"&&h.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[h,_,F]);let B=x&&!m,J=(()=>!F||B||T.current===y?"idle":y?"enter":"leave")(),j=Nb(0),U=H(z=>Oe(z,{enter:()=>{j.addFlag(De.Opening),R.current.beforeEnter()},leave:()=>{j.addFlag(De.Closing),R.current.beforeLeave()},idle:()=>{}})),Z=H(z=>Oe(z,{enter:()=>{j.removeFlag(De.Opening),R.current.afterEnter()},leave:()=>{j.removeFlag(De.Closing),R.current.afterLeave()},idle:()=>{}})),L=W0(()=>{S("hidden"),E(h)},k);jb({container:h,classes:M,direction:J,onStart:tn(z=>{L.onStart(h,z,U)}),onStop:tn(z=>{L.onStop(h,z,Z),z==="leave"&&!Vl(L)&&(S("hidden"),E(h))})}),w.useEffect(()=>{B&&(v===Gt.Hidden?T.current=null:T.current=y)},[y,B,_]);let A=p,N={ref:g};return m&&y&&x&&(A={...A,className:Ju(p.className,...M.current.enter,...M.current.enterFrom)}),$.createElement(Ul.Provider,{value:L},$.createElement(F0,{value:Oe(_,{visible:De.Open,hidden:De.Closed})|j.flags},Ve({ourProps:N,theirProps:A,defaultTag:Wb,features:q0,visible:_==="visible",name:"Transition.Child"})))}function Yb(e,t){let{show:n,appear:i=!1,unmount:r,...s}=e,o=w.useRef(null),l=Qe(o,t);ar();let a=$l();if(n===void 0&&a!==null&&(n=(a&De.Open)===De.Open),![!0,!1].includes(n))throw new Error("A is used but it is missing a `show={true | false}` prop.");let[u,c]=w.useState(n?"visible":"hidden"),d=W0(()=>{c("hidden")}),[f,p]=w.useState(!0),h=w.useRef([n]);Fe(()=>{f!==!1&&h.current[h.current.length-1]!==n&&(h.current.push(n),p(!1))},[h,n]);let g=w.useMemo(()=>({show:n,appear:i,initial:f}),[n,i,f]);w.useEffect(()=>{if(n)c("visible");else if(!Vl(d))c("hidden");else{let x=o.current;if(!x)return;let _=x.getBoundingClientRect();_.x===0&&_.y===0&&_.width===0&&_.height===0&&c("hidden")}},[n,d]);let v={unmount:r},y=H(()=>{var x;f&&p(!1),(x=e.beforeEnter)==null||x.call(e)}),m=H(()=>{var x;f&&p(!1),(x=e.beforeLeave)==null||x.call(e)});return $.createElement(Ul.Provider,{value:d},$.createElement(Hl.Provider,{value:g},Ve({ourProps:{...v,as:w.Fragment,children:$.createElement(Y0,{ref:l,...v,...s,beforeEnter:y,beforeLeave:m})},theirProps:{},defaultTag:w.Fragment,features:q0,visible:u==="visible",name:"Transition"})))}function Kb(e,t){let n=w.useContext(Hl)!==null,i=$l()!==null;return $.createElement($.Fragment,null,!n&&i?$.createElement(rc,{ref:t,...e}):$.createElement(Y0,{ref:t,...e}))}let rc=Ie(Yb),Y0=Ie(qb),Qb=Ie(Kb),Wr=Object.assign(rc,{Child:Qb,Root:rc});function Xb({title:e,items:t,setTitle:n}){return b.jsx(ri,{as:"div",className:"relative inline-block text-left",children:({open:i})=>b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"transition-all duration-300",children:b.jsxs(ri.Button,{className:"bg-bg-text px-4 py-2 rounded-lg font-semibold flex",children:[e,b.jsx(Xi.Icon,{className:`ml-2 ${i?"rotate-180":""}`,path:E0,size:1})]})}),b.jsx(Wr,{as:w.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:b.jsx(ri.Items,{className:"absolute right-0 mt-2 w-32 origin-top-right divide-y divide-gray-100 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",children:b.jsx("div",{className:"p-2",children:t.map(r=>b.jsx(ri.Item,{children:({active:s})=>b.jsx("button",{className:`${s||r===e?"bg-bg-primary text-primary":"text-black"} group flex w-full items-center rounded-md px-2 py-2 mb-1 text-sm`,onClick:()=>n(r),children:r})},r))})})})]})})}function Ed({title:e,isBack:t=!1,children:n}){const[i,r]=w.useState("English"),s=Tc();return b.jsxs("div",{className:"base-frame",children:[b.jsxs("div",{className:"header flex-none",children:[b.jsx("h2",{className:"text-2xl font-bold",children:e}),t?b.jsxs("button",{className:"btn-primary text-text bg-bg-text flex items-center gap-2 pl-3",onClick:()=>s(-1),children:[b.jsx(Gi,{path:Mw,size:.8}),"back"]}):b.jsxs("div",{className:"header__lang",children:[b.jsx(Gi,{path:Rw,size:1.34,color:"var(--color-text)",className:"mr-2"}),b.jsx(Xb,{title:i,setTitle:r,items:["English"]})]})]}),b.jsx("div",{className:"divider mb-6"}),b.jsx("div",{className:"contain",children:n})]})}/*! +`));let d=u.props,f=typeof(d==null?void 0:d.className)=="function"?(...h)=>Zu(d==null?void 0:d.className(...h),l.className):Zu(d==null?void 0:d.className,l.className),p=f?{className:f}:{};return w.cloneElement(u,Object.assign({},D0(u.props,vh(Fa(l,["ref"]))),c,a,Xw(u.ref,a.ref),p))}return w.createElement(r,Object.assign({},Fa(l,["ref"]),r!==w.Fragment&&a,r!==w.Fragment&&c),u)}function Xw(...e){return{ref:e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}}function D0(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let i of e)for(let r in i)r.startsWith("on")&&typeof i[r]=="function"?(n[r]!=null||(n[r]=[]),n[r].push(i[r])):t[r]=i[r];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(i=>[i,void 0])));for(let i in n)Object.assign(t,{[i](r,...s){let o=n[i];for(let l of o){if((r instanceof Event||(r==null?void 0:r.nativeEvent)instanceof Event)&&r.defaultPrevented)return;l(r,...s)}}});return t}function Ie(e){var t;return Object.assign(w.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function vh(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Fa(e,t=[]){let n=Object.assign({},e);for(let i of t)i in n&&delete n[i];return n}function N0(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let i=(t==null?void 0:t.getAttribute("disabled"))==="";return i&&Gw(n)?!1:i}function Gw(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}let Jw="div";var sl=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(sl||{});function Zw(e,t){let{features:n=1,...i}=e,r={ref:t,"aria-hidden":(n&2)===2?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(n&4)===4&&(n&2)!==2&&{display:"none"}}};return We({ourProps:r,theirProps:i,slot:{},defaultTag:Jw,name:"Hidden"})}let ec=Ie(Zw),_d=w.createContext(null);_d.displayName="OpenClosedContext";var De=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(De||{});function Bl(){return w.useContext(_d)}function F0({value:e,children:t}){return B.createElement(_d.Provider,{value:e},t)}var Pe=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(Pe||{});function bd(e,t){let n=w.useRef([]),i=H(e);w.useEffect(()=>{let r=[...n.current];for(let[s,o]of t.entries())if(n.current[s]!==o){let l=i(t,r);return n.current=t,l}},[i,...t])}function xh(e){return[e.screenX,e.screenY]}function e_(){let e=w.useRef([-1,-1]);return{wasMoved(t){let n=xh(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=xh(t)}}}function t_(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}var Rr=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Rr||{});function n_(){let e=w.useRef(0);return M0("keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function Os(){let e=w.useRef(!1);return Fe(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function cr(...e){return w.useMemo(()=>$l(...e),[...e])}function A0(e,t,n,i){let r=tn(n);w.useEffect(()=>{e=e??window;function s(o){r.current(o)}return e.addEventListener(t,s,i),()=>e.removeEventListener(t,s,i)},[e,t,i])}function i_(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}function I0(e){let t=H(e),n=w.useRef(!1);w.useEffect(()=>(n.current=!1,()=>{n.current=!0,zl(()=>{n.current&&t()})}),[t])}function j0(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let t=new Set;for(let n of e.current)n.current instanceof HTMLElement&&t.add(n.current);return t}let r_="div";var z0=(e=>(e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.RestoreFocus=16]="RestoreFocus",e[e.All=30]="All",e))(z0||{});function s_(e,t){let n=w.useRef(null),i=Qe(n,t),{initialFocus:r,containers:s,features:o=30,...l}=e;ur()||(o=1);let a=cr(n);a_({ownerDocument:a},!!(o&16));let u=u_({ownerDocument:a,container:n,initialFocus:r},!!(o&2));c_({ownerDocument:a,container:n,containers:s,previousActiveElement:u},!!(o&8));let c=n_(),d=H(g=>{let v=n.current;v&&(y=>y())(()=>{Oe(c.current,{[Rr.Forwards]:()=>{Vr(v,Kt.First,{skipElements:[g.relatedTarget]})},[Rr.Backwards]:()=>{Vr(v,Kt.Last,{skipElements:[g.relatedTarget]})}})})}),f=Ts(),p=w.useRef(!1),h={ref:i,onKeyDown(g){g.key=="Tab"&&(p.current=!0,f.requestAnimationFrame(()=>{p.current=!1}))},onBlur(g){let v=j0(s);n.current instanceof HTMLElement&&v.add(n.current);let y=g.relatedTarget;y instanceof HTMLElement&&y.dataset.headlessuiFocusGuard!=="true"&&($0(v,y)||(p.current?Vr(n.current,Oe(c.current,{[Rr.Forwards]:()=>Kt.Next,[Rr.Backwards]:()=>Kt.Previous})|Kt.WrapAround,{relativeTo:g.target}):g.target instanceof HTMLElement&&Nn(g.target)))}};return B.createElement(B.Fragment,null,!!(o&4)&&B.createElement(ec,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:d,features:sl.Focusable}),We({ourProps:h,theirProps:l,defaultTag:r_,name:"FocusTrap"}),!!(o&4)&&B.createElement(ec,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:d,features:sl.Focusable}))}let o_=Ie(s_),wr=Object.assign(o_,{features:z0}),vn=[];i_(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&vn[0]!==t.target&&(vn.unshift(t.target),vn=vn.filter(n=>n!=null&&n.isConnected),vn.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function l_(e=!0){let t=w.useRef(vn.slice());return bd(([n],[i])=>{i===!0&&n===!1&&zl(()=>{t.current.splice(0)}),i===!1&&n===!0&&(t.current=vn.slice())},[e,vn,t]),H(()=>{var n;return(n=t.current.find(i=>i!=null&&i.isConnected))!=null?n:null})}function a_({ownerDocument:e},t){let n=l_(t);bd(()=>{t||(e==null?void 0:e.activeElement)===(e==null?void 0:e.body)&&Nn(n())},[t]),I0(()=>{t&&Nn(n())})}function u_({ownerDocument:e,container:t,initialFocus:n},i){let r=w.useRef(null),s=Os();return bd(()=>{if(!i)return;let o=t.current;o&&zl(()=>{if(!s.current)return;let l=e==null?void 0:e.activeElement;if(n!=null&&n.current){if((n==null?void 0:n.current)===l){r.current=l;return}}else if(o.contains(l)){r.current=l;return}n!=null&&n.current?Nn(n.current):Vr(o,Kt.First)===C0.Error&&console.warn("There are no focusable elements inside the "),r.current=e==null?void 0:e.activeElement})},[i]),r}function c_({ownerDocument:e,container:t,containers:n,previousActiveElement:i},r){let s=Os();A0(e==null?void 0:e.defaultView,"focus",o=>{if(!r||!s.current)return;let l=j0(n);t.current instanceof HTMLElement&&l.add(t.current);let a=i.current;if(!a)return;let u=o.target;u&&u instanceof HTMLElement?$0(l,u)?(i.current=u,Nn(u)):(o.preventDefault(),o.stopPropagation(),Nn(a)):Nn(i.current)},!0)}function $0(e,t){for(let n of e)if(n.contains(t))return!0;return!1}let B0=w.createContext(!1);function d_(){return w.useContext(B0)}function tc(e){return B.createElement(B0.Provider,{value:e.force},e.children)}function f_(e){let t=d_(),n=w.useContext(H0),i=cr(e),[r,s]=w.useState(()=>{if(!t&&n!==null||en.isServer)return null;let o=i==null?void 0:i.getElementById("headlessui-portal-root");if(o)return o;if(i===null)return null;let l=i.createElement("div");return l.setAttribute("id","headlessui-portal-root"),i.body.appendChild(l)});return w.useEffect(()=>{r!==null&&(i!=null&&i.body.contains(r)||i==null||i.body.appendChild(r))},[r,i]),w.useEffect(()=>{t||n!==null&&s(n.current)},[n,s,t]),r}let h_=w.Fragment;function p_(e,t){let n=e,i=w.useRef(null),r=Qe(qw(c=>{i.current=c}),t),s=cr(i),o=f_(i),[l]=w.useState(()=>{var c;return en.isServer?null:(c=s==null?void 0:s.createElement("div"))!=null?c:null}),a=w.useContext(nc),u=ur();return Fe(()=>{!o||!l||o.contains(l)||(l.setAttribute("data-headlessui-portal",""),o.appendChild(l))},[o,l]),Fe(()=>{if(l&&a)return a.register(l)},[a,l]),I0(()=>{var c;!o||!l||(l instanceof Node&&o.contains(l)&&o.removeChild(l),o.childNodes.length<=0&&((c=o.parentElement)==null||c.removeChild(o)))}),u?!o||!l?null:S0.createPortal(We({ourProps:{ref:r},theirProps:n,defaultTag:h_,name:"Portal"}),l):null}let m_=w.Fragment,H0=w.createContext(null);function g_(e,t){let{target:n,...i}=e,r={ref:Qe(t)};return B.createElement(H0.Provider,{value:n},We({ourProps:r,theirProps:i,defaultTag:m_,name:"Popover.Group"}))}let nc=w.createContext(null);function y_(){let e=w.useContext(nc),t=w.useRef([]),n=H(s=>(t.current.push(s),e&&e.register(s),()=>i(s))),i=H(s=>{let o=t.current.indexOf(s);o!==-1&&t.current.splice(o,1),e&&e.unregister(s)}),r=w.useMemo(()=>({register:n,unregister:i,portals:t}),[n,i,t]);return[t,w.useMemo(()=>function({children:s}){return B.createElement(nc.Provider,{value:r},s)},[r])]}let v_=Ie(p_),x_=Ie(g_),ic=Object.assign(v_,{Group:x_}),U0=w.createContext(null);function W0(){let e=w.useContext(U0);if(e===null){let t=new Error("You used a component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,W0),t}return e}function w_(){let[e,t]=w.useState([]);return[e.length>0?e.join(" "):void 0,w.useMemo(()=>function(n){let i=H(s=>(t(o=>[...o,s]),()=>t(o=>{let l=o.slice(),a=l.indexOf(s);return a!==-1&&l.splice(a,1),l}))),r=w.useMemo(()=>({register:i,slot:n.slot,name:n.name,props:n.props}),[i,n.slot,n.name,n.props]);return B.createElement(U0.Provider,{value:r},n.children)},[t])]}let __="p";function b_(e,t){let n=cn(),{id:i=`headlessui-description-${n}`,...r}=e,s=W0(),o=Qe(t);Fe(()=>s.register(i),[i,s.register]);let l={ref:o,...s.props,id:i};return We({ourProps:l,theirProps:r,slot:s.slot||{},defaultTag:__,name:s.name||"Description"})}let S_=Ie(b_),k_=Object.assign(S_,{}),Sd=w.createContext(()=>{});Sd.displayName="StackContext";var rc=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(rc||{});function E_(){return w.useContext(Sd)}function C_({children:e,onUpdate:t,type:n,element:i,enabled:r}){let s=E_(),o=H((...l)=>{t==null||t(...l),s(...l)});return Fe(()=>{let l=r===void 0||r===!0;return l&&o(0,n,i),()=>{l&&o(1,n,i)}},[o,n,i,r]),B.createElement(Sd.Provider,{value:o},e)}function P_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}const T_=typeof Object.is=="function"?Object.is:P_,{useState:O_,useEffect:M_,useLayoutEffect:L_,useDebugValue:R_}=Do;function D_(e,t,n){const i=t(),[{inst:r},s]=O_({inst:{value:i,getSnapshot:t}});return L_(()=>{r.value=i,r.getSnapshot=t,Aa(r)&&s({inst:r})},[e,i,t]),M_(()=>(Aa(r)&&s({inst:r}),e(()=>{Aa(r)&&s({inst:r})})),[e]),R_(i),i}function Aa(e){const t=e.getSnapshot,n=e.value;try{const i=t();return!T_(n,i)}catch{return!0}}function N_(e,t,n){return t()}const F_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",A_=!F_,I_=A_?N_:D_,j_="useSyncExternalStore"in Do?(e=>e.useSyncExternalStore)(Do):I_;function z_(e){return j_(e.subscribe,e.getSnapshot,e.getSnapshot)}function $_(e,t){let n=e(),i=new Set;return{getSnapshot(){return n},subscribe(r){return i.add(r),()=>i.delete(r)},dispatch(r,...s){let o=t[r].call(n,...s);o&&(n=o,i.forEach(l=>l()))}}}function B_(){let e;return{before({doc:t}){var n;let i=t.documentElement;e=((n=t.defaultView)!=null?n:window).innerWidth-i.clientWidth},after({doc:t,d:n}){let i=t.documentElement,r=i.clientWidth-i.offsetWidth,s=e-r;n.style(i,"paddingRight",`${s}px`)}}}function H_(){if(!t_())return{};let e;return{before(){e=window.pageYOffset},after({doc:t,d:n,meta:i}){function r(o){return i.containers.flatMap(l=>l()).some(l=>l.contains(o))}n.style(t.body,"marginTop",`-${e}px`),window.scrollTo(0,0);let s=null;n.addEventListener(t,"click",o=>{if(o.target instanceof HTMLElement)try{let l=o.target.closest("a");if(!l)return;let{hash:a}=new URL(l.href),u=t.querySelector(a);u&&!r(u)&&(s=u)}catch{}},!0),n.addEventListener(t,"touchmove",o=>{o.target instanceof HTMLElement&&!r(o.target)&&o.preventDefault()},{passive:!1}),n.add(()=>{window.scrollTo(0,window.pageYOffset+e),s&&s.isConnected&&(s.scrollIntoView({block:"nearest"}),s=null)})}}}function U_(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function W_(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let ii=$_(()=>new Map,{PUSH(e,t){var n;let i=(n=this.get(e))!=null?n:{doc:e,count:0,d:$t(),meta:new Set};return i.count++,i.meta.add(t),this.set(e,i),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let i={doc:e,d:t,meta:W_(n)},r=[H_(),B_(),U_()];r.forEach(({before:s})=>s==null?void 0:s(i)),r.forEach(({after:s})=>s==null?void 0:s(i))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});ii.subscribe(()=>{let e=ii.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let i=t.get(n.doc)==="hidden",r=n.count!==0;(r&&!i||!r&&i)&&ii.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&ii.dispatch("TEARDOWN",n)}});function V_(e,t,n){let i=z_(ii),r=e?i.get(e):void 0,s=r?r.count>0:!1;return Fe(()=>{if(!(!e||!t))return ii.dispatch("PUSH",e,n),()=>ii.dispatch("POP",e,n)},[t,e]),s}let Ia=new Map,_r=new Map;function wh(e,t=!0){Fe(()=>{var n;if(!t)return;let i=typeof e=="function"?e():e.current;if(!i)return;function r(){var o;if(!i)return;let l=(o=_r.get(i))!=null?o:1;if(l===1?_r.delete(i):_r.set(i,l-1),l!==1)return;let a=Ia.get(i);a&&(a["aria-hidden"]===null?i.removeAttribute("aria-hidden"):i.setAttribute("aria-hidden",a["aria-hidden"]),i.inert=a.inert,Ia.delete(i))}let s=(n=_r.get(i))!=null?n:0;return _r.set(i,s+1),s!==0||(Ia.set(i,{"aria-hidden":i.getAttribute("aria-hidden"),inert:i.inert}),i.setAttribute("aria-hidden","true"),i.inert=!0),r},[e,t])}function q_({defaultContainers:e=[],portals:t}={}){let n=w.useRef(null),i=cr(n),r=H(()=>{var s;let o=[];for(let l of e)l!==null&&(l instanceof HTMLElement?o.push(l):"current"in l&&l.current instanceof HTMLElement&&o.push(l.current));if(t!=null&&t.current)for(let l of t.current)o.push(l);for(let l of(s=i==null?void 0:i.querySelectorAll("html > *, body > *"))!=null?s:[])l!==document.body&&l!==document.head&&l instanceof HTMLElement&&l.id!=="headlessui-portal-root"&&(l.contains(n.current)||o.some(a=>l.contains(a))||o.push(l));return o});return{resolveContainers:r,contains:H(s=>r().some(o=>o.contains(s))),mainTreeNodeRef:n,MainTreeNode:w.useMemo(()=>function(){return B.createElement(ec,{features:sl.Hidden,ref:n})},[n])}}var Y_=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Y_||{}),K_=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(K_||{});let Q_={[0](e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},ol=w.createContext(null);ol.displayName="DialogContext";function Ms(e){let t=w.useContext(ol);if(t===null){let n=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Ms),n}return t}function X_(e,t,n=()=>[document.body]){V_(e,t,i=>{var r;return{containers:[...(r=i.containers)!=null?r:[],n]}})}function G_(e,t){return Oe(t.type,Q_,e,t)}let J_="div",Z_=Ji.RenderStrategy|Ji.Static;function eb(e,t){var n;let i=cn(),{id:r=`headlessui-dialog-${i}`,open:s,onClose:o,initialFocus:l,__demoMode:a=!1,...u}=e,[c,d]=w.useState(0),f=Bl();s===void 0&&f!==null&&(s=(f&De.Open)===De.Open);let p=w.useRef(null),h=Qe(p,t),g=cr(p),v=e.hasOwnProperty("open")||f!==null,y=e.hasOwnProperty("onClose");if(!v&&!y)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!v)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!y)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(typeof s!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${s}`);if(typeof o!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${o}`);let m=s?0:1,[x,_]=w.useReducer(G_,{titleId:null,descriptionId:null,panelRef:w.createRef()}),S=H(()=>o(!1)),C=H(le=>_({type:0,id:le})),E=ur()?a?!1:m===0:!1,k=c>1,L=w.useContext(ol)!==null,[M,R]=y_(),{resolveContainers:N,mainTreeNodeRef:$,MainTreeNode:X}=q_({portals:M,defaultContainers:[(n=x.panelRef.current)!=null?n:p.current]}),j=k?"parent":"leaf",U=f!==null?(f&De.Closing)===De.Closing:!1,G=(()=>L||U?!1:E)(),O=w.useCallback(()=>{var le,ht;return(ht=Array.from((le=g==null?void 0:g.querySelectorAll("body > *"))!=null?le:[]).find(Le=>Le.id==="headlessui-portal-root"?!1:Le.contains($.current)&&Le instanceof HTMLElement))!=null?ht:null},[$]);wh(O,G);let A=(()=>k?!0:E)(),F=w.useCallback(()=>{var le,ht;return(ht=Array.from((le=g==null?void 0:g.querySelectorAll("[data-headlessui-portal]"))!=null?le:[]).find(Le=>Le.contains($.current)&&Le instanceof HTMLElement))!=null?ht:null},[$]);wh(F,A);let z=(()=>!(!E||k))();L0(N,S,z);let W=(()=>!(k||m!==0))();A0(g==null?void 0:g.defaultView,"keydown",le=>{W&&(le.defaultPrevented||le.key===Pe.Escape&&(le.preventDefault(),le.stopPropagation(),S()))});let Ce=(()=>!(U||m!==0||L))();X_(g,Ce,N),w.useEffect(()=>{if(m!==0||!p.current)return;let le=new ResizeObserver(ht=>{for(let Le of ht){let Wn=Le.target.getBoundingClientRect();Wn.x===0&&Wn.y===0&&Wn.width===0&&Wn.height===0&&S()}});return le.observe(p.current),()=>le.disconnect()},[m,p,S]);let[de,ge]=w_(),ve=w.useMemo(()=>[{dialogState:m,close:S,setTitleId:C},x],[m,x,S,C]),fe=w.useMemo(()=>({open:m===0}),[m]),Un={ref:h,id:r,role:"dialog","aria-modal":m===0?!0:void 0,"aria-labelledby":x.titleId,"aria-describedby":de};return B.createElement(C_,{type:"Dialog",enabled:m===0,element:p,onUpdate:H((le,ht)=>{ht==="Dialog"&&Oe(le,{[rc.Add]:()=>d(Le=>Le+1),[rc.Remove]:()=>d(Le=>Le-1)})})},B.createElement(tc,{force:!0},B.createElement(ic,null,B.createElement(ol.Provider,{value:ve},B.createElement(ic.Group,{target:p},B.createElement(tc,{force:!1},B.createElement(ge,{slot:fe,name:"Dialog.Description"},B.createElement(wr,{initialFocus:l,containers:N,features:E?Oe(j,{parent:wr.features.RestoreFocus,leaf:wr.features.All&~wr.features.FocusLock}):wr.features.None},B.createElement(R,null,We({ourProps:Un,theirProps:u,slot:fe,defaultTag:J_,features:Z_,visible:m===0,name:"Dialog"}))))))))),B.createElement(X,null))}let tb="div";function nb(e,t){let n=cn(),{id:i=`headlessui-dialog-overlay-${n}`,...r}=e,[{dialogState:s,close:o}]=Ms("Dialog.Overlay"),l=Qe(t),a=H(c=>{if(c.target===c.currentTarget){if(N0(c.currentTarget))return c.preventDefault();c.preventDefault(),c.stopPropagation(),o()}}),u=w.useMemo(()=>({open:s===0}),[s]);return We({ourProps:{ref:l,id:i,"aria-hidden":!0,onClick:a},theirProps:r,slot:u,defaultTag:tb,name:"Dialog.Overlay"})}let ib="div";function rb(e,t){let n=cn(),{id:i=`headlessui-dialog-backdrop-${n}`,...r}=e,[{dialogState:s},o]=Ms("Dialog.Backdrop"),l=Qe(t);w.useEffect(()=>{if(o.panelRef.current===null)throw new Error("A component is being used, but a component is missing.")},[o.panelRef]);let a=w.useMemo(()=>({open:s===0}),[s]);return B.createElement(tc,{force:!0},B.createElement(ic,null,We({ourProps:{ref:l,id:i,"aria-hidden":!0},theirProps:r,slot:a,defaultTag:ib,name:"Dialog.Backdrop"})))}let sb="div";function ob(e,t){let n=cn(),{id:i=`headlessui-dialog-panel-${n}`,...r}=e,[{dialogState:s},o]=Ms("Dialog.Panel"),l=Qe(t,o.panelRef),a=w.useMemo(()=>({open:s===0}),[s]),u=H(c=>{c.stopPropagation()});return We({ourProps:{ref:l,id:i,onClick:u},theirProps:r,slot:a,defaultTag:sb,name:"Dialog.Panel"})}let lb="h2";function ab(e,t){let n=cn(),{id:i=`headlessui-dialog-title-${n}`,...r}=e,[{dialogState:s,setTitleId:o}]=Ms("Dialog.Title"),l=Qe(t);w.useEffect(()=>(o(i),()=>o(null)),[i,o]);let a=w.useMemo(()=>({open:s===0}),[s]);return We({ourProps:{ref:l,id:i},theirProps:r,slot:a,defaultTag:lb,name:"Dialog.Title"})}let ub=Ie(eb),cb=Ie(rb),db=Ie(ob),fb=Ie(nb),hb=Ie(ab),_h=Object.assign(ub,{Backdrop:cb,Panel:db,Overlay:fb,Title:hb,Description:k_}),bh=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function Sh(e){var t,n;let i=(t=e.innerText)!=null?t:"",r=e.cloneNode(!0);if(!(r instanceof HTMLElement))return i;let s=!1;for(let l of r.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))l.remove(),s=!0;let o=s?(n=r.innerText)!=null?n:"":i;return bh.test(o)&&(o=o.replace(bh,"")),o}function pb(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let i=n.split(" ").map(r=>{let s=document.getElementById(r);if(s){let o=s.getAttribute("aria-label");return typeof o=="string"?o.trim():Sh(s).trim()}return null}).filter(Boolean);if(i.length>0)return i.join(", ")}return Sh(e).trim()}function mb(e){let t=w.useRef(""),n=w.useRef("");return H(()=>{let i=e.current;if(!i)return"";let r=i.innerText;if(t.current===r)return n.current;let s=pb(i).trim().toLowerCase();return t.current=r,n.current=s,s})}var gb=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(gb||{}),yb=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(yb||{}),vb=(e=>(e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem",e))(vb||{});function ja(e,t=n=>n){let n=e.activeItemIndex!==null?e.items[e.activeItemIndex]:null,i=O0(t(e.items.slice()),s=>s.dataRef.current.domRef.current),r=n?i.indexOf(n):null;return r===-1&&(r=null),{items:i,activeItemIndex:r}}let xb={[1](e){return e.menuState===1?e:{...e,activeItemIndex:null,menuState:1}},[0](e){return e.menuState===0?e:{...e,__demoMode:!1,menuState:0}},[2]:(e,t)=>{var n;let i=ja(e),r=Qw(t,{resolveItems:()=>i.items,resolveActiveIndex:()=>i.activeItemIndex,resolveId:s=>s.id,resolveDisabled:s=>s.dataRef.current.disabled});return{...e,...i,searchQuery:"",activeItemIndex:r,activationTrigger:(n=t.trigger)!=null?n:1}},[3]:(e,t)=>{let n=e.searchQuery!==""?0:1,i=e.searchQuery+t.value.toLowerCase(),r=(e.activeItemIndex!==null?e.items.slice(e.activeItemIndex+n).concat(e.items.slice(0,e.activeItemIndex+n)):e.items).find(o=>{var l;return((l=o.dataRef.current.textValue)==null?void 0:l.startsWith(i))&&!o.dataRef.current.disabled}),s=r?e.items.indexOf(r):-1;return s===-1||s===e.activeItemIndex?{...e,searchQuery:i}:{...e,searchQuery:i,activeItemIndex:s,activationTrigger:1}},[4](e){return e.searchQuery===""?e:{...e,searchQuery:"",searchActiveItemIndex:null}},[5]:(e,t)=>{let n=ja(e,i=>[...i,{id:t.id,dataRef:t.dataRef}]);return{...e,...n}},[6]:(e,t)=>{let n=ja(e,i=>{let r=i.findIndex(s=>s.id===t.id);return r!==-1&&i.splice(r,1),i});return{...e,...n,activationTrigger:1}}},kd=w.createContext(null);kd.displayName="MenuContext";function Hl(e){let t=w.useContext(kd);if(t===null){let n=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Hl),n}return t}function wb(e,t){return Oe(t.type,xb,e,t)}let _b=w.Fragment;function bb(e,t){let{__demoMode:n=!1,...i}=e,r=w.useReducer(wb,{__demoMode:n,menuState:n?0:1,buttonRef:w.createRef(),itemsRef:w.createRef(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:s,itemsRef:o,buttonRef:l},a]=r,u=Qe(t);L0([l,o],(p,h)=>{var g;a({type:1}),wd(h,xd.Loose)||(p.preventDefault(),(g=l.current)==null||g.focus())},s===0);let c=H(()=>{a({type:1})}),d=w.useMemo(()=>({open:s===0,close:c}),[s,c]),f={ref:u};return B.createElement(kd.Provider,{value:r},B.createElement(F0,{value:Oe(s,{[0]:De.Open,[1]:De.Closed})},We({ourProps:f,theirProps:i,slot:d,defaultTag:_b,name:"Menu"})))}let Sb="button";function kb(e,t){var n;let i=cn(),{id:r=`headlessui-menu-button-${i}`,...s}=e,[o,l]=Hl("Menu.Button"),a=Qe(o.buttonRef,t),u=Ts(),c=H(g=>{switch(g.key){case Pe.Space:case Pe.Enter:case Pe.ArrowDown:g.preventDefault(),g.stopPropagation(),l({type:0}),u.nextFrame(()=>l({type:2,focus:Tt.First}));break;case Pe.ArrowUp:g.preventDefault(),g.stopPropagation(),l({type:0}),u.nextFrame(()=>l({type:2,focus:Tt.Last}));break}}),d=H(g=>{switch(g.key){case Pe.Space:g.preventDefault();break}}),f=H(g=>{if(N0(g.currentTarget))return g.preventDefault();e.disabled||(o.menuState===0?(l({type:1}),u.nextFrame(()=>{var v;return(v=o.buttonRef.current)==null?void 0:v.focus({preventScroll:!0})})):(g.preventDefault(),l({type:0})))}),p=w.useMemo(()=>({open:o.menuState===0}),[o]),h={ref:a,id:r,type:Vw(e,o.buttonRef),"aria-haspopup":"menu","aria-controls":(n=o.itemsRef.current)==null?void 0:n.id,"aria-expanded":e.disabled?void 0:o.menuState===0,onKeyDown:c,onKeyUp:d,onClick:f};return We({ourProps:h,theirProps:s,slot:p,defaultTag:Sb,name:"Menu.Button"})}let Eb="div",Cb=Ji.RenderStrategy|Ji.Static;function Pb(e,t){var n,i;let r=cn(),{id:s=`headlessui-menu-items-${r}`,...o}=e,[l,a]=Hl("Menu.Items"),u=Qe(l.itemsRef,t),c=cr(l.itemsRef),d=Ts(),f=Bl(),p=(()=>f!==null?(f&De.Open)===De.Open:l.menuState===0)();w.useEffect(()=>{let m=l.itemsRef.current;m&&l.menuState===0&&m!==(c==null?void 0:c.activeElement)&&m.focus({preventScroll:!0})},[l.menuState,l.itemsRef,c]),Yw({container:l.itemsRef.current,enabled:l.menuState===0,accept(m){return m.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:m.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(m){m.setAttribute("role","none")}});let h=H(m=>{var x,_;switch(d.dispose(),m.key){case Pe.Space:if(l.searchQuery!=="")return m.preventDefault(),m.stopPropagation(),a({type:3,value:m.key});case Pe.Enter:if(m.preventDefault(),m.stopPropagation(),a({type:1}),l.activeItemIndex!==null){let{dataRef:S}=l.items[l.activeItemIndex];(_=(x=S.current)==null?void 0:x.domRef.current)==null||_.click()}T0(l.buttonRef.current);break;case Pe.ArrowDown:return m.preventDefault(),m.stopPropagation(),a({type:2,focus:Tt.Next});case Pe.ArrowUp:return m.preventDefault(),m.stopPropagation(),a({type:2,focus:Tt.Previous});case Pe.Home:case Pe.PageUp:return m.preventDefault(),m.stopPropagation(),a({type:2,focus:Tt.First});case Pe.End:case Pe.PageDown:return m.preventDefault(),m.stopPropagation(),a({type:2,focus:Tt.Last});case Pe.Escape:m.preventDefault(),m.stopPropagation(),a({type:1}),$t().nextFrame(()=>{var S;return(S=l.buttonRef.current)==null?void 0:S.focus({preventScroll:!0})});break;case Pe.Tab:m.preventDefault(),m.stopPropagation(),a({type:1}),$t().nextFrame(()=>{Ww(l.buttonRef.current,m.shiftKey?Kt.Previous:Kt.Next)});break;default:m.key.length===1&&(a({type:3,value:m.key}),d.setTimeout(()=>a({type:4}),350));break}}),g=H(m=>{switch(m.key){case Pe.Space:m.preventDefault();break}}),v=w.useMemo(()=>({open:l.menuState===0}),[l]),y={"aria-activedescendant":l.activeItemIndex===null||(n=l.items[l.activeItemIndex])==null?void 0:n.id,"aria-labelledby":(i=l.buttonRef.current)==null?void 0:i.id,id:s,onKeyDown:h,onKeyUp:g,role:"menu",tabIndex:0,ref:u};return We({ourProps:y,theirProps:o,slot:v,defaultTag:Eb,features:Cb,visible:p,name:"Menu.Items"})}let Tb=w.Fragment;function Ob(e,t){let n=cn(),{id:i=`headlessui-menu-item-${n}`,disabled:r=!1,...s}=e,[o,l]=Hl("Menu.Item"),a=o.activeItemIndex!==null?o.items[o.activeItemIndex].id===i:!1,u=w.useRef(null),c=Qe(t,u);Fe(()=>{if(o.__demoMode||o.menuState!==0||!a||o.activationTrigger===0)return;let S=$t();return S.requestAnimationFrame(()=>{var C,E;(E=(C=u.current)==null?void 0:C.scrollIntoView)==null||E.call(C,{block:"nearest"})}),S.dispose},[o.__demoMode,u,a,o.menuState,o.activationTrigger,o.activeItemIndex]);let d=mb(u),f=w.useRef({disabled:r,domRef:u,get textValue(){return d()}});Fe(()=>{f.current.disabled=r},[f,r]),Fe(()=>(l({type:5,id:i,dataRef:f}),()=>l({type:6,id:i})),[f,i]);let p=H(()=>{l({type:1})}),h=H(S=>{if(r)return S.preventDefault();l({type:1}),T0(o.buttonRef.current)}),g=H(()=>{if(r)return l({type:2,focus:Tt.Nothing});l({type:2,focus:Tt.Specific,id:i})}),v=e_(),y=H(S=>v.update(S)),m=H(S=>{v.wasMoved(S)&&(r||a||l({type:2,focus:Tt.Specific,id:i,trigger:0}))}),x=H(S=>{v.wasMoved(S)&&(r||a&&l({type:2,focus:Tt.Nothing}))}),_=w.useMemo(()=>({active:a,disabled:r,close:p}),[a,r,p]);return We({ourProps:{id:i,ref:c,role:"menuitem",tabIndex:r===!0?void 0:-1,"aria-disabled":r===!0?!0:void 0,disabled:void 0,onClick:h,onFocus:g,onPointerEnter:y,onMouseEnter:y,onPointerMove:m,onMouseMove:m,onPointerLeave:x,onMouseLeave:x},theirProps:s,slot:_,defaultTag:Tb,name:"Menu.Item"})}let Mb=Ie(bb),Lb=Ie(kb),Rb=Ie(Pb),Db=Ie(Ob),ri=Object.assign(Mb,{Button:Lb,Items:Rb,Item:Db});function Nb(e=0){let[t,n]=w.useState(e),i=Os(),r=w.useCallback(a=>{i.current&&n(u=>u|a)},[t,i]),s=w.useCallback(a=>!!(t&a),[t]),o=w.useCallback(a=>{i.current&&n(u=>u&~a)},[n,i]),l=w.useCallback(a=>{i.current&&n(u=>u^a)},[n]);return{flags:t,addFlag:r,hasFlag:s,removeFlag:o,toggleFlag:l}}function Fb(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function za(e,...t){e&&t.length>0&&e.classList.add(...t)}function $a(e,...t){e&&t.length>0&&e.classList.remove(...t)}function Ab(e,t){let n=$t();if(!e)return n.dispose;let{transitionDuration:i,transitionDelay:r}=getComputedStyle(e),[s,o]=[i,r].map(a=>{let[u=0]=a.split(",").filter(Boolean).map(c=>c.includes("ms")?parseFloat(c):parseFloat(c)*1e3).sort((c,d)=>d-c);return u}),l=s+o;if(l!==0){n.group(u=>{u.setTimeout(()=>{t(),u.dispose()},l),u.addEventListener(e,"transitionrun",c=>{c.target===c.currentTarget&&u.dispose()})});let a=n.addEventListener(e,"transitionend",u=>{u.target===u.currentTarget&&(t(),a())})}else t();return n.add(()=>t()),n.dispose}function Ib(e,t,n,i){let r=n?"enter":"leave",s=$t(),o=i!==void 0?Fb(i):()=>{};r==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let l=Oe(r,{enter:()=>t.enter,leave:()=>t.leave}),a=Oe(r,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),u=Oe(r,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return $a(e,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),za(e,...l,...u),s.nextFrame(()=>{$a(e,...u),za(e,...a),Ab(e,()=>($a(e,...l),za(e,...t.entered),o()))}),s.dispose}function jb({container:e,direction:t,classes:n,onStart:i,onStop:r}){let s=Os(),o=Ts(),l=tn(t);Fe(()=>{let a=$t();o.add(a.dispose);let u=e.current;if(u&&l.current!=="idle"&&s.current)return a.dispose(),i.current(l.current),a.add(Ib(u,n.current,l.current==="enter",()=>{a.dispose(),r.current(l.current)})),a.dispose},[t])}function Vn(e=""){return e.split(" ").filter(t=>t.trim().length>1)}let Ul=w.createContext(null);Ul.displayName="TransitionContext";var zb=(e=>(e.Visible="visible",e.Hidden="hidden",e))(zb||{});function $b(){let e=w.useContext(Ul);if(e===null)throw new Error("A is used but it is missing a parent or .");return e}function Bb(){let e=w.useContext(Wl);if(e===null)throw new Error("A is used but it is missing a parent or .");return e}let Wl=w.createContext(null);Wl.displayName="NestingContext";function Vl(e){return"children"in e?Vl(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function V0(e,t){let n=tn(e),i=w.useRef([]),r=Os(),s=Ts(),o=H((p,h=Gt.Hidden)=>{let g=i.current.findIndex(({el:v})=>v===p);g!==-1&&(Oe(h,{[Gt.Unmount](){i.current.splice(g,1)},[Gt.Hidden](){i.current[g].state="hidden"}}),s.microTask(()=>{var v;!Vl(i)&&r.current&&((v=n.current)==null||v.call(n))}))}),l=H(p=>{let h=i.current.find(({el:g})=>g===p);return h?h.state!=="visible"&&(h.state="visible"):i.current.push({el:p,state:"visible"}),()=>o(p,Gt.Unmount)}),a=w.useRef([]),u=w.useRef(Promise.resolve()),c=w.useRef({enter:[],leave:[],idle:[]}),d=H((p,h,g)=>{a.current.splice(0),t&&(t.chains.current[h]=t.chains.current[h].filter(([v])=>v!==p)),t==null||t.chains.current[h].push([p,new Promise(v=>{a.current.push(v)})]),t==null||t.chains.current[h].push([p,new Promise(v=>{Promise.all(c.current[h].map(([y,m])=>m)).then(()=>v())})]),h==="enter"?u.current=u.current.then(()=>t==null?void 0:t.wait.current).then(()=>g(h)):g(h)}),f=H((p,h,g)=>{Promise.all(c.current[h].splice(0).map(([v,y])=>y)).then(()=>{var v;(v=a.current.shift())==null||v()}).then(()=>g(h))});return w.useMemo(()=>({children:i,register:l,unregister:o,onStart:d,onStop:f,wait:u,chains:c}),[l,o,i,d,f,c,u])}function Hb(){}let Ub=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function kh(e){var t;let n={};for(let i of Ub)n[i]=(t=e[i])!=null?t:Hb;return n}function Wb(e){let t=w.useRef(kh(e));return w.useEffect(()=>{t.current=kh(e)},[e]),t}let Vb="div",q0=Ji.RenderStrategy;function qb(e,t){let{beforeEnter:n,afterEnter:i,beforeLeave:r,afterLeave:s,enter:o,enterFrom:l,enterTo:a,entered:u,leave:c,leaveFrom:d,leaveTo:f,...p}=e,h=w.useRef(null),g=Qe(h,t),v=p.unmount?Gt.Unmount:Gt.Hidden,{show:y,appear:m,initial:x}=$b(),[_,S]=w.useState(y?"visible":"hidden"),C=Bb(),{register:E,unregister:k}=C,L=w.useRef(null);w.useEffect(()=>E(h),[E,h]),w.useEffect(()=>{if(v===Gt.Hidden&&h.current){if(y&&_!=="visible"){S("visible");return}return Oe(_,{hidden:()=>k(h),visible:()=>E(h)})}},[_,h,E,k,y,v]);let M=tn({enter:Vn(o),enterFrom:Vn(l),enterTo:Vn(a),entered:Vn(u),leave:Vn(c),leaveFrom:Vn(d),leaveTo:Vn(f)}),R=Wb({beforeEnter:n,afterEnter:i,beforeLeave:r,afterLeave:s}),N=ur();w.useEffect(()=>{if(N&&_==="visible"&&h.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[h,_,N]);let $=x&&!m,X=(()=>!N||$||L.current===y?"idle":y?"enter":"leave")(),j=Nb(0),U=H(z=>Oe(z,{enter:()=>{j.addFlag(De.Opening),R.current.beforeEnter()},leave:()=>{j.addFlag(De.Closing),R.current.beforeLeave()},idle:()=>{}})),G=H(z=>Oe(z,{enter:()=>{j.removeFlag(De.Opening),R.current.afterEnter()},leave:()=>{j.removeFlag(De.Closing),R.current.afterLeave()},idle:()=>{}})),O=V0(()=>{S("hidden"),k(h)},C);jb({container:h,classes:M,direction:X,onStart:tn(z=>{O.onStart(h,z,U)}),onStop:tn(z=>{O.onStop(h,z,G),z==="leave"&&!Vl(O)&&(S("hidden"),k(h))})}),w.useEffect(()=>{$&&(v===Gt.Hidden?L.current=null:L.current=y)},[y,$,_]);let A=p,F={ref:g};return m&&y&&x&&(A={...A,className:Zu(p.className,...M.current.enter,...M.current.enterFrom)}),B.createElement(Wl.Provider,{value:O},B.createElement(F0,{value:Oe(_,{visible:De.Open,hidden:De.Closed})|j.flags},We({ourProps:F,theirProps:A,defaultTag:Vb,features:q0,visible:_==="visible",name:"Transition.Child"})))}function Yb(e,t){let{show:n,appear:i=!1,unmount:r,...s}=e,o=w.useRef(null),l=Qe(o,t);ur();let a=Bl();if(n===void 0&&a!==null&&(n=(a&De.Open)===De.Open),![!0,!1].includes(n))throw new Error("A is used but it is missing a `show={true | false}` prop.");let[u,c]=w.useState(n?"visible":"hidden"),d=V0(()=>{c("hidden")}),[f,p]=w.useState(!0),h=w.useRef([n]);Fe(()=>{f!==!1&&h.current[h.current.length-1]!==n&&(h.current.push(n),p(!1))},[h,n]);let g=w.useMemo(()=>({show:n,appear:i,initial:f}),[n,i,f]);w.useEffect(()=>{if(n)c("visible");else if(!Vl(d))c("hidden");else{let x=o.current;if(!x)return;let _=x.getBoundingClientRect();_.x===0&&_.y===0&&_.width===0&&_.height===0&&c("hidden")}},[n,d]);let v={unmount:r},y=H(()=>{var x;f&&p(!1),(x=e.beforeEnter)==null||x.call(e)}),m=H(()=>{var x;f&&p(!1),(x=e.beforeLeave)==null||x.call(e)});return B.createElement(Wl.Provider,{value:d},B.createElement(Ul.Provider,{value:g},We({ourProps:{...v,as:w.Fragment,children:B.createElement(Y0,{ref:l,...v,...s,beforeEnter:y,beforeLeave:m})},theirProps:{},defaultTag:w.Fragment,features:q0,visible:u==="visible",name:"Transition"})))}function Kb(e,t){let n=w.useContext(Ul)!==null,i=Bl()!==null;return B.createElement(B.Fragment,null,!n&&i?B.createElement(sc,{ref:t,...e}):B.createElement(Y0,{ref:t,...e}))}let sc=Ie(Yb),Y0=Ie(qb),Qb=Ie(Kb),qr=Object.assign(sc,{Child:Qb,Root:sc});function Xb({title:e,items:t,setTitle:n}){return b.jsx(ri,{as:"div",className:"relative inline-block text-left",children:({open:i})=>b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"transition-all duration-300",children:b.jsxs(ri.Button,{className:"bg-bg-text px-4 py-2 rounded-lg font-semibold flex",children:[e,b.jsx(Xi.Icon,{className:`ml-2 ${i?"rotate-180":""}`,path:E0,size:1})]})}),b.jsx(qr,{as:w.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:b.jsx(ri.Items,{className:"absolute right-0 mt-2 w-32 origin-top-right divide-y divide-gray-100 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",children:b.jsx("div",{className:"p-2",children:t.map(r=>b.jsx(ri.Item,{children:({active:s})=>b.jsx("button",{className:`${s||r===e?"bg-bg-primary text-primary":"text-black"} group flex w-full items-center rounded-md px-2 py-2 mb-1 text-sm`,onClick:()=>n(r),children:r})},r))})})})]})})}function Ed({title:e,isBack:t=!1,children:n}){const[i,r]=w.useState("English"),s=or();return b.jsxs("div",{className:"base-frame",children:[b.jsxs("div",{className:"header flex-none",children:[b.jsx("h2",{className:"text-2xl font-bold",children:e}),t?b.jsxs("button",{className:"btn-primary text-text bg-bg-text flex items-center gap-2 pl-3",onClick:()=>s(-1),children:[b.jsx(Gi,{path:Mw,size:.8}),"back"]}):b.jsxs("div",{className:"header__lang",children:[b.jsx(Gi,{path:Rw,size:1.34,color:"var(--color-text)",className:"mr-2"}),b.jsx(Xb,{title:i,setTitle:r,items:["English"]})]})]}),b.jsx("div",{className:"divider mb-6"}),b.jsx("div",{className:"contain",children:n})]})}/*! * @kurkle/color v0.3.2 * https://github.com/kurkle/color#readme * (c) 2023 Jukka Kurkela * Released under the MIT License - */function Ms(e){return e+.5|0}const bn=(e,t,n)=>Math.max(Math.min(e,n),t);function Rr(e){return bn(Ms(e*2.55),0,255)}function Fn(e){return bn(Ms(e*255),0,255)}function Yt(e){return bn(Ms(e/2.55)/100,0,1)}function Eh(e){return bn(Ms(e*100),0,100)}const pt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},sc=[..."0123456789ABCDEF"],Gb=e=>sc[e&15],Jb=e=>sc[(e&240)>>4]+sc[e&15],Js=e=>(e&240)>>4===(e&15),Zb=e=>Js(e.r)&&Js(e.g)&&Js(e.b)&&Js(e.a);function eS(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&pt[e[1]]*17,g:255&pt[e[2]]*17,b:255&pt[e[3]]*17,a:t===5?pt[e[4]]*17:255}:(t===7||t===9)&&(n={r:pt[e[1]]<<4|pt[e[2]],g:pt[e[3]]<<4|pt[e[4]],b:pt[e[5]]<<4|pt[e[6]],a:t===9?pt[e[7]]<<4|pt[e[8]]:255})),n}const tS=(e,t)=>e<255?t(e):"";function nS(e){var t=Zb(e)?Gb:Jb;return e?"#"+t(e.r)+t(e.g)+t(e.b)+tS(e.a,t):void 0}const iS=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function K0(e,t,n){const i=t*Math.min(n,1-n),r=(s,o=(s+e/30)%12)=>n-i*Math.max(Math.min(o-3,9-o,1),-1);return[r(0),r(8),r(4)]}function rS(e,t,n){const i=(r,s=(r+e/60)%6)=>n-n*t*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function sS(e,t,n){const i=K0(e,1,.5);let r;for(t+n>1&&(r=1/(t+n),t*=r,n*=r),r=0;r<3;r++)i[r]*=1-t-n,i[r]+=t;return i}function oS(e,t,n,i,r){return e===r?(t-n)/i+(t.5?c/(2-s-o):c/(s+o),a=oS(n,i,r,c,s),a=a*60+.5),[a|0,u||0,l]}function Pd(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(Fn)}function Td(e,t,n){return Pd(K0,e,t,n)}function lS(e,t,n){return Pd(sS,e,t,n)}function aS(e,t,n){return Pd(rS,e,t,n)}function Q0(e){return(e%360+360)%360}function uS(e){const t=iS.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?Rr(+t[5]):Fn(+t[5]));const r=Q0(+t[2]),s=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?i=lS(r,s,o):t[1]==="hsv"?i=aS(r,s,o):i=Td(r,s,o),{r:i[0],g:i[1],b:i[2],a:n}}function cS(e,t){var n=Cd(e);n[0]=Q0(n[0]+t),n=Td(n),e.r=n[0],e.g=n[1],e.b=n[2]}function dS(e){if(!e)return;const t=Cd(e),n=t[0],i=Eh(t[1]),r=Eh(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${r}%, ${Yt(e.a)})`:`hsl(${n}, ${i}%, ${r}%)`}const Ch={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Ph={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function fS(){const e={},t=Object.keys(Ph),n=Object.keys(Ch);let i,r,s,o,l;for(i=0;i>16&255,s>>8&255,s&255]}return e}let Zs;function hS(e){Zs||(Zs=fS(),Zs.transparent=[0,0,0,0]);const t=Zs[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const pS=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function mS(e){const t=pS.exec(e);let n=255,i,r,s;if(t){if(t[7]!==i){const o=+t[7];n=t[8]?Rr(o):bn(o*255,0,255)}return i=+t[1],r=+t[3],s=+t[5],i=255&(t[2]?Rr(i):bn(i,0,255)),r=255&(t[4]?Rr(r):bn(r,0,255)),s=255&(t[6]?Rr(s):bn(s,0,255)),{r:i,g:r,b:s,a:n}}}function gS(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Yt(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const $a=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,_i=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function yS(e,t,n){const i=_i(Yt(e.r)),r=_i(Yt(e.g)),s=_i(Yt(e.b));return{r:Fn($a(i+n*(_i(Yt(t.r))-i))),g:Fn($a(r+n*(_i(Yt(t.g))-r))),b:Fn($a(s+n*(_i(Yt(t.b))-s))),a:e.a+n*(t.a-e.a)}}function eo(e,t,n){if(e){let i=Cd(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=Td(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function X0(e,t){return e&&Object.assign(t||{},e)}function Th(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=Fn(e[3]))):(t=X0(e,{r:0,g:0,b:0,a:1}),t.a=Fn(t.a)),t}function vS(e){return e.charAt(0)==="r"?mS(e):uS(e)}class gs{constructor(t){if(t instanceof gs)return t;const n=typeof t;let i;n==="object"?i=Th(t):n==="string"&&(i=eS(t)||hS(t)||vS(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=X0(this._rgb);return t&&(t.a=Yt(t.a)),t}set rgb(t){this._rgb=Th(t)}rgbString(){return this._valid?gS(this._rgb):void 0}hexString(){return this._valid?nS(this._rgb):void 0}hslString(){return this._valid?dS(this._rgb):void 0}mix(t,n){if(t){const i=this.rgb,r=t.rgb;let s;const o=n===s?.5:n,l=2*o-1,a=i.a-r.a,u=((l*a===-1?l:(l+a)/(1+l*a))+1)/2;s=1-u,i.r=255&u*i.r+s*r.r+.5,i.g=255&u*i.g+s*r.g+.5,i.b=255&u*i.b+s*r.b+.5,i.a=o*i.a+(1-o)*r.a,this.rgb=i}return this}interpolate(t,n){return t&&(this._rgb=yS(this._rgb,t._rgb,n)),this}clone(){return new gs(this.rgb)}alpha(t){return this._rgb.a=Fn(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=Ms(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return eo(this._rgb,2,t),this}darken(t){return eo(this._rgb,2,-t),this}saturate(t){return eo(this._rgb,1,t),this}desaturate(t){return eo(this._rgb,1,-t),this}rotate(t){return cS(this._rgb,t),this}}/*! + */function Ls(e){return e+.5|0}const bn=(e,t,n)=>Math.max(Math.min(e,n),t);function Dr(e){return bn(Ls(e*2.55),0,255)}function Fn(e){return bn(Ls(e*255),0,255)}function Yt(e){return bn(Ls(e/2.55)/100,0,1)}function Eh(e){return bn(Ls(e*100),0,100)}const pt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},oc=[..."0123456789ABCDEF"],Gb=e=>oc[e&15],Jb=e=>oc[(e&240)>>4]+oc[e&15],Zs=e=>(e&240)>>4===(e&15),Zb=e=>Zs(e.r)&&Zs(e.g)&&Zs(e.b)&&Zs(e.a);function eS(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&pt[e[1]]*17,g:255&pt[e[2]]*17,b:255&pt[e[3]]*17,a:t===5?pt[e[4]]*17:255}:(t===7||t===9)&&(n={r:pt[e[1]]<<4|pt[e[2]],g:pt[e[3]]<<4|pt[e[4]],b:pt[e[5]]<<4|pt[e[6]],a:t===9?pt[e[7]]<<4|pt[e[8]]:255})),n}const tS=(e,t)=>e<255?t(e):"";function nS(e){var t=Zb(e)?Gb:Jb;return e?"#"+t(e.r)+t(e.g)+t(e.b)+tS(e.a,t):void 0}const iS=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function K0(e,t,n){const i=t*Math.min(n,1-n),r=(s,o=(s+e/30)%12)=>n-i*Math.max(Math.min(o-3,9-o,1),-1);return[r(0),r(8),r(4)]}function rS(e,t,n){const i=(r,s=(r+e/60)%6)=>n-n*t*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function sS(e,t,n){const i=K0(e,1,.5);let r;for(t+n>1&&(r=1/(t+n),t*=r,n*=r),r=0;r<3;r++)i[r]*=1-t-n,i[r]+=t;return i}function oS(e,t,n,i,r){return e===r?(t-n)/i+(t.5?c/(2-s-o):c/(s+o),a=oS(n,i,r,c,s),a=a*60+.5),[a|0,u||0,l]}function Pd(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(Fn)}function Td(e,t,n){return Pd(K0,e,t,n)}function lS(e,t,n){return Pd(sS,e,t,n)}function aS(e,t,n){return Pd(rS,e,t,n)}function Q0(e){return(e%360+360)%360}function uS(e){const t=iS.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?Dr(+t[5]):Fn(+t[5]));const r=Q0(+t[2]),s=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?i=lS(r,s,o):t[1]==="hsv"?i=aS(r,s,o):i=Td(r,s,o),{r:i[0],g:i[1],b:i[2],a:n}}function cS(e,t){var n=Cd(e);n[0]=Q0(n[0]+t),n=Td(n),e.r=n[0],e.g=n[1],e.b=n[2]}function dS(e){if(!e)return;const t=Cd(e),n=t[0],i=Eh(t[1]),r=Eh(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${r}%, ${Yt(e.a)})`:`hsl(${n}, ${i}%, ${r}%)`}const Ch={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Ph={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function fS(){const e={},t=Object.keys(Ph),n=Object.keys(Ch);let i,r,s,o,l;for(i=0;i>16&255,s>>8&255,s&255]}return e}let eo;function hS(e){eo||(eo=fS(),eo.transparent=[0,0,0,0]);const t=eo[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const pS=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function mS(e){const t=pS.exec(e);let n=255,i,r,s;if(t){if(t[7]!==i){const o=+t[7];n=t[8]?Dr(o):bn(o*255,0,255)}return i=+t[1],r=+t[3],s=+t[5],i=255&(t[2]?Dr(i):bn(i,0,255)),r=255&(t[4]?Dr(r):bn(r,0,255)),s=255&(t[6]?Dr(s):bn(s,0,255)),{r:i,g:r,b:s,a:n}}}function gS(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Yt(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Ba=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,_i=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function yS(e,t,n){const i=_i(Yt(e.r)),r=_i(Yt(e.g)),s=_i(Yt(e.b));return{r:Fn(Ba(i+n*(_i(Yt(t.r))-i))),g:Fn(Ba(r+n*(_i(Yt(t.g))-r))),b:Fn(Ba(s+n*(_i(Yt(t.b))-s))),a:e.a+n*(t.a-e.a)}}function to(e,t,n){if(e){let i=Cd(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=Td(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function X0(e,t){return e&&Object.assign(t||{},e)}function Th(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=Fn(e[3]))):(t=X0(e,{r:0,g:0,b:0,a:1}),t.a=Fn(t.a)),t}function vS(e){return e.charAt(0)==="r"?mS(e):uS(e)}class ys{constructor(t){if(t instanceof ys)return t;const n=typeof t;let i;n==="object"?i=Th(t):n==="string"&&(i=eS(t)||hS(t)||vS(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=X0(this._rgb);return t&&(t.a=Yt(t.a)),t}set rgb(t){this._rgb=Th(t)}rgbString(){return this._valid?gS(this._rgb):void 0}hexString(){return this._valid?nS(this._rgb):void 0}hslString(){return this._valid?dS(this._rgb):void 0}mix(t,n){if(t){const i=this.rgb,r=t.rgb;let s;const o=n===s?.5:n,l=2*o-1,a=i.a-r.a,u=((l*a===-1?l:(l+a)/(1+l*a))+1)/2;s=1-u,i.r=255&u*i.r+s*r.r+.5,i.g=255&u*i.g+s*r.g+.5,i.b=255&u*i.b+s*r.b+.5,i.a=o*i.a+(1-o)*r.a,this.rgb=i}return this}interpolate(t,n){return t&&(this._rgb=yS(this._rgb,t._rgb,n)),this}clone(){return new ys(this.rgb)}alpha(t){return this._rgb.a=Fn(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=Ls(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return to(this._rgb,2,t),this}darken(t){return to(this._rgb,2,-t),this}saturate(t){return to(this._rgb,1,t),this}desaturate(t){return to(this._rgb,1,-t),this}rotate(t){return cS(this._rgb,t),this}}/*! * Chart.js v4.3.0 * https://www.chartjs.org * (c) 2023 Chart.js Contributors * Released under the MIT License - */function Ht(){}const xS=(()=>{let e=0;return()=>e++})();function ie(e){return e===null||typeof e>"u"}function oe(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function K(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function pe(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function rt(e,t){return pe(e)?e:t}function W(e,t){return typeof e>"u"?t:e}const wS=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function ee(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function X(e,t,n,i){let r,s,o;if(oe(e))if(s=e.length,i)for(r=s-1;r>=0;r--)t.call(n,e[r],r);else for(r=0;re,x:e=>e.x,y:e=>e.y};function SS(e){const t=e.split("."),n=[];let i="";for(const r of t)i+=r,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function kS(e){const t=SS(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function al(e,t){return(Oh[t]||(Oh[t]=kS(t)))(e)}function Od(e){return e.charAt(0).toUpperCase()+e.slice(1)}const ul=e=>typeof e<"u",jn=e=>typeof e=="function",Mh=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function ES(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Ee=Math.PI,ut=2*Ee,CS=ut+Ee,cl=Number.POSITIVE_INFINITY,PS=Ee/180,et=Ee/2,qn=Ee/4,Lh=Ee*2/3,Sn=Math.log10,Zi=Math.sign;function Yr(e,t,n){return Math.abs(e-t)r-s).pop(),t}function vs(e){return!isNaN(parseFloat(e))&&isFinite(e)}function OS(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function J0(e,t,n){let i,r,s;for(i=0,r=e.length;ia&&u=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function Ld(e,t,n){n=n||(o=>e[o]1;)s=r+i>>1,n(s)?r=s:i=s;return{lo:r,hi:i}}const si=(e,t,n,i)=>Ld(e,n,i?r=>{const s=e[r][t];return se[r][t]Ld(e,n,i=>e[i][t]>=n);function NS(e,t,n){let i=0,r=e.length;for(;ii&&e[r-1]>n;)r--;return i>0||r{const i="_onData"+Od(n),r=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...s){const o=r.apply(this,s);return e._chartjs.listeners.forEach(l=>{typeof l[i]=="function"&&l[i](...s)}),o}})})}function Nh(e,t){const n=e._chartjs;if(!n)return;const i=n.listeners,r=i.indexOf(t);r!==-1&&i.splice(r,1),!(i.length>0)&&(ey.forEach(s=>{delete e[s]}),delete e._chartjs)}function AS(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const ty=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function ny(e,t){let n=[],i=!1;return function(...r){n=r,i||(i=!0,ty.call(window,()=>{i=!1,e.apply(t,n)}))}}function IS(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const Rd=e=>e==="start"?"left":e==="end"?"right":"center",$e=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,jS=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function zS(e,t,n){const i=t.length;let r=0,s=i;if(e._sorted){const{iScale:o,_parsed:l}=e,a=o.axis,{min:u,max:c,minDefined:d,maxDefined:f}=o.getUserBounds();d&&(r=vt(Math.min(si(l,o.axis,u).lo,n?i:si(t,a,o.getPixelForValue(u)).lo),0,i-1)),f?s=vt(Math.max(si(l,o.axis,c,!0).hi+1,n?0:si(t,a,o.getPixelForValue(c),!0).hi+1),r,i)-r:s=i-r}return{start:r,count:s}}function $S(e){const{xScale:t,yScale:n,_scaleRanges:i}=e,r={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!i)return e._scaleRanges=r,!0;const s=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,r),s}const to=e=>e===0||e===1,Fh=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*ut/n)),Ah=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*ut/n)+1,Kr={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*et)+1,easeOutSine:e=>Math.sin(e*et),easeInOutSine:e=>-.5*(Math.cos(Ee*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>to(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>to(e)?e:Fh(e,.075,.3),easeOutElastic:e=>to(e)?e:Ah(e,.075,.3),easeInOutElastic(e){return to(e)?e:e<.5?.5*Fh(e*2,.1125,.45):.5+.5*Ah(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Kr.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Kr.easeInBounce(e*2)*.5:Kr.easeOutBounce(e*2-1)*.5+.5};function Dd(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Ih(e){return Dd(e)?e:new gs(e)}function Ba(e){return Dd(e)?e:new gs(e).saturate(.5).darken(.1).hexString()}const BS=["x","y","borderWidth","radius","tension"],HS=["color","borderColor","backgroundColor"];function US(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:HS},numbers:{type:"number",properties:BS}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function VS(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const jh=new Map;function WS(e,t){t=t||{};const n=e+JSON.stringify(t);let i=jh.get(n);return i||(i=new Intl.NumberFormat(e,t),jh.set(n,i)),i}function Nd(e,t,n){return WS(t,n).format(e)}const iy={values(e){return oe(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const i=this.chart.options.locale;let r,s=e;if(n.length>1){const u=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(u<1e-4||u>1e15)&&(r="scientific"),s=qS(e,n)}const o=Sn(Math.abs(s)),l=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),a={notation:r,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(a,this.options.ticks.format),Nd(e,i,a)},logarithmic(e,t,n){if(e===0)return"0";const i=n[t].significand||e/Math.pow(10,Math.floor(Sn(e)));return[1,2,3,5,10,15].includes(i)||t>.8*n.length?iy.numeric.call(this,e,t,n):""}};function qS(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var Wl={formatters:iy};function YS(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Wl.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const mi=Object.create(null),lc=Object.create(null);function Qr(e,t){if(!t)return e;const n=t.split(".");for(let i=0,r=n.length;ii.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,r)=>Ba(r.backgroundColor),this.hoverBorderColor=(i,r)=>Ba(r.borderColor),this.hoverColor=(i,r)=>Ba(r.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return Ha(this,t,n)}get(t){return Qr(this,t)}describe(t,n){return Ha(lc,t,n)}override(t,n){return Ha(mi,t,n)}route(t,n,i,r){const s=Qr(this,t),o=Qr(this,i),l="_"+n;Object.defineProperties(s,{[l]:{value:s[n],writable:!0},[n]:{enumerable:!0,get(){const a=this[l],u=o[r];return K(a)?Object.assign({},u,a):W(a,u)},set(a){this[l]=a}}})}apply(t){t.forEach(n=>n(this))}}var me=new KS({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[US,VS,YS]);function QS(e){return!e||ie(e.size)||ie(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function dl(e,t,n,i,r){let s=t[r];return s||(s=t[r]=e.measureText(r).width,n.push(r)),s>i&&(i=s),i}function XS(e,t,n,i){i=i||{};let r=i.data=i.data||{},s=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(r=i.data={},s=i.garbageCollect=[],i.font=t),e.save(),e.font=t;let o=0;const l=n.length;let a,u,c,d,f;for(a=0;an.length){for(a=0;a0&&e.stroke()}}function Jt(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.xt.top-n&&e.y0&&s.strokeColor!=="";let a,u;for(e.save(),e.font=r.string,ZS(e,s),a=0;a+e||0;function sy(e,t){const n={},i=K(t),r=i?Object.keys(t):t,s=K(e)?i?o=>W(e[o],e[t[o]]):o=>e[o]:()=>e;for(const o of r)n[o]=sk(s(o));return n}function ok(e){return sy(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Bi(e){return sy(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Ue(e){const t=ok(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Se(e,t){e=e||{},t=t||me.font;let n=W(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=W(e.style,t.style);i&&!(""+i).match(ik)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:W(e.family,t.family),lineHeight:rk(W(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:W(e.weight,t.weight),string:""};return r.string=QS(r),r}function no(e,t,n,i){let r=!0,s,o,l;for(s=0,o=e.length;sn&&l===0?0:l+a;return{min:o(i,-Math.abs(s)),max:o(r,s)}}function Hn(e,t){return Object.assign(Object.create(e),t)}function Fd(e,t=[""],n,i,r=()=>e[0]){const s=n||e;typeof i>"u"&&(i=uy("_fallback",e));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:s,_fallback:i,_getTarget:r,override:l=>Fd([l,...e],t,s,i)};return new Proxy(o,{deleteProperty(l,a){return delete l[a],delete l._keys,delete e[0][a],!0},get(l,a){return ly(l,a,()=>mk(a,t,e,l))},getOwnPropertyDescriptor(l,a){return Reflect.getOwnPropertyDescriptor(l._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(l,a){return Bh(l).includes(a)},ownKeys(l){return Bh(l)},set(l,a,u){const c=l._storage||(l._storage=r());return l[a]=c[a]=u,delete l._keys,!0}})}function er(e,t,n,i){const r={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:oy(e,i),setContext:s=>er(e,s,n,i),override:s=>er(e.override(s),t,n,i)};return new Proxy(r,{deleteProperty(s,o){return delete s[o],delete e[o],!0},get(s,o,l){return ly(s,o,()=>uk(s,o,l))},getOwnPropertyDescriptor(s,o){return s._descriptors.allKeys?Reflect.has(e,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,o)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(s,o){return Reflect.has(e,o)},ownKeys(){return Reflect.ownKeys(e)},set(s,o,l){return e[o]=l,delete s[o],!0}})}function oy(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:r=t.allKeys}=e;return{allKeys:r,scriptable:n,indexable:i,isScriptable:jn(n)?n:()=>n,isIndexable:jn(i)?i:()=>i}}const ak=(e,t)=>e?e+Od(t):t,Ad=(e,t)=>K(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function ly(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const i=n();return e[t]=i,i}function uk(e,t,n){const{_proxy:i,_context:r,_subProxy:s,_descriptors:o}=e;let l=i[t];return jn(l)&&o.isScriptable(t)&&(l=ck(t,l,e,n)),oe(l)&&l.length&&(l=dk(t,l,e,o.isIndexable)),Ad(t,l)&&(l=er(l,r,s&&s[t],o)),l}function ck(e,t,n,i){const{_proxy:r,_context:s,_subProxy:o,_stack:l}=n;if(l.has(e))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+e);l.add(e);let a=t(s,o||i);return l.delete(e),Ad(e,a)&&(a=Id(r._scopes,r,e,a)),a}function dk(e,t,n,i){const{_proxy:r,_context:s,_subProxy:o,_descriptors:l}=n;if(typeof s.index<"u"&&i(e))return t[s.index%t.length];if(K(t[0])){const a=t,u=r._scopes.filter(c=>c!==a);t=[];for(const c of a){const d=Id(u,r,e,c);t.push(er(d,s,o&&o[e],l))}}return t}function ay(e,t,n){return jn(e)?e(t,n):e}const fk=(e,t)=>e===!0?t:typeof e=="string"?al(t,e):void 0;function hk(e,t,n,i,r){for(const s of t){const o=fk(n,s);if(o){e.add(o);const l=ay(o._fallback,n,r);if(typeof l<"u"&&l!==n&&l!==i)return l}else if(o===!1&&typeof i<"u"&&n!==i)return null}return!1}function Id(e,t,n,i){const r=t._rootScopes,s=ay(t._fallback,n,i),o=[...e,...r],l=new Set;l.add(i);let a=$h(l,o,n,s||n,i);return a===null||typeof s<"u"&&s!==n&&(a=$h(l,o,s,a,i),a===null)?!1:Fd(Array.from(l),[""],r,s,()=>pk(t,n,i))}function $h(e,t,n,i,r){for(;n;)n=hk(e,t,n,i,r);return n}function pk(e,t,n){const i=e._getTarget();t in i||(i[t]={});const r=i[t];return oe(r)&&K(n)?n:r||{}}function mk(e,t,n,i){let r;for(const s of t)if(r=uy(ak(s,e),n),typeof r<"u")return Ad(e,r)?Id(n,i,e,r):r}function uy(e,t){for(const n of t){if(!n)continue;const i=n[e];if(typeof i<"u")return i}}function Bh(e){let t=e._keys;return t||(t=e._keys=gk(e._scopes)),t}function gk(e){const t=new Set;for(const n of e)for(const i of Object.keys(n).filter(r=>!r.startsWith("_")))t.add(i);return Array.from(t)}const yk=Number.EPSILON||1e-14,tr=(e,t)=>te==="x"?"y":"x";function vk(e,t,n,i){const r=e.skip?t:e,s=t,o=n.skip?t:n,l=oc(s,r),a=oc(o,s);let u=l/(l+a),c=a/(l+a);u=isNaN(u)?0:u,c=isNaN(c)?0:c;const d=i*u,f=i*c;return{previous:{x:s.x-d*(o.x-r.x),y:s.y-d*(o.y-r.y)},next:{x:s.x+f*(o.x-r.x),y:s.y+f*(o.y-r.y)}}}function xk(e,t,n){const i=e.length;let r,s,o,l,a,u=tr(e,0);for(let c=0;c!u.skip)),t.cubicInterpolationMode==="monotone")_k(e,r);else{let u=i?e[e.length-1]:e[0];for(s=0,o=e.length;se.ownerDocument.defaultView.getComputedStyle(e,null);function kk(e,t){return Kl(e).getPropertyValue(t)}const Ek=["top","right","bottom","left"];function ui(e,t,n){const i={};n=n?"-"+n:"";for(let r=0;r<4;r++){const s=Ek[r];i[s]=parseFloat(e[t+"-"+s+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Ck=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function Pk(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:r,offsetY:s}=i;let o=!1,l,a;if(Ck(r,s,e.target))l=r,a=s;else{const u=t.getBoundingClientRect();l=i.clientX-u.left,a=i.clientY-u.top,o=!0}return{x:l,y:a,box:o}}function Jn(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,r=Kl(n),s=r.boxSizing==="border-box",o=ui(r,"padding"),l=ui(r,"border","width"),{x:a,y:u,box:c}=Pk(e,n),d=o.left+(c&&l.left),f=o.top+(c&&l.top);let{width:p,height:h}=t;return s&&(p-=o.width+l.width,h-=o.height+l.height),{x:Math.round((a-d)/p*n.width/i),y:Math.round((u-f)/h*n.height/i)}}function Tk(e,t,n){let i,r;if(t===void 0||n===void 0){const s=jd(e);if(!s)t=e.clientWidth,n=e.clientHeight;else{const o=s.getBoundingClientRect(),l=Kl(s),a=ui(l,"border","width"),u=ui(l,"padding");t=o.width-u.width-a.width,n=o.height-u.height-a.height,i=hl(l.maxWidth,s,"clientWidth"),r=hl(l.maxHeight,s,"clientHeight")}}return{width:t,height:n,maxWidth:i||cl,maxHeight:r||cl}}const ro=e=>Math.round(e*10)/10;function Ok(e,t,n,i){const r=Kl(e),s=ui(r,"margin"),o=hl(r.maxWidth,e,"clientWidth")||cl,l=hl(r.maxHeight,e,"clientHeight")||cl,a=Tk(e,t,n);let{width:u,height:c}=a;if(r.boxSizing==="content-box"){const f=ui(r,"border","width"),p=ui(r,"padding");u-=p.width+f.width,c-=p.height+f.height}return u=Math.max(0,u-s.width),c=Math.max(0,i?u/i:c-s.height),u=ro(Math.min(u,o,a.maxWidth)),c=ro(Math.min(c,l,a.maxHeight)),u&&!c&&(c=ro(u/2)),(t!==void 0||n!==void 0)&&i&&a.height&&c>a.height&&(c=a.height,u=ro(Math.floor(c*i))),{width:u,height:c}}function Hh(e,t,n){const i=t||1,r=Math.floor(e.height*i),s=Math.floor(e.width*i);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const o=e.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${e.height}px`,o.style.width=`${e.width}px`),e.currentDevicePixelRatio!==i||o.height!==r||o.width!==s?(e.currentDevicePixelRatio=i,o.height=r,o.width=s,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Mk=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return e}();function Uh(e,t){const n=kk(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Zn(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function Lk(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:i==="middle"?n<.5?e.y:t.y:i==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function Rk(e,t,n,i){const r={x:e.cp2x,y:e.cp2y},s={x:t.cp1x,y:t.cp1y},o=Zn(e,r,n),l=Zn(r,s,n),a=Zn(s,t,n),u=Zn(o,l,n),c=Zn(l,a,n);return Zn(u,c,n)}const Dk=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,i){return n-i},leftForLtr(n,i){return n-i}}},Nk=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Hi(e,t,n){return e?Dk(t,n):Nk()}function fy(e,t){let n,i;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)}function hy(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function py(e){return e==="angle"?{between:Z0,compare:LS,normalize:ot}:{between:Ni,compare:(t,n)=>t-n,normalize:t=>t}}function Vh({start:e,end:t,count:n,loop:i,style:r}){return{start:e%n,end:t%n,loop:i&&(t-e+1)%n===0,style:r}}function Fk(e,t,n){const{property:i,start:r,end:s}=n,{between:o,normalize:l}=py(i),a=t.length;let{start:u,end:c,loop:d}=e,f,p;if(d){for(u+=a,c+=a,f=0,p=a;fa(r,x,y)&&l(r,x)!==0,S=()=>l(s,y)===0||a(s,x,y),k=()=>g||_(),C=()=>!g||S();for(let E=c,T=c;E<=d;++E)m=t[E%o],!m.skip&&(y=u(m[i]),y!==x&&(g=a(y,r,s),v===null&&k()&&(v=l(y,r)===0?E:T),v!==null&&C()&&(h.push(Vh({start:v,end:E,loop:f,count:o,style:p})),v=null),T=E,x=y));return v!==null&&h.push(Vh({start:v,end:d,loop:f,count:o,style:p})),h}function gy(e,t){const n=[],i=e.segments;for(let r=0;rr&&e[s%t].skip;)s--;return s%=t,{start:r,end:s}}function Ik(e,t,n,i){const r=e.length,s=[];let o=t,l=e[t],a;for(a=t+1;a<=n;++a){const u=e[a%r];u.skip||u.stop?l.skip||(i=!1,s.push({start:t%r,end:(a-1)%r,loop:i}),t=o=u.stop?a:null):(o=a,l.skip&&(t=a)),l=u}return o!==null&&s.push({start:t%r,end:o%r,loop:i}),s}function jk(e,t){const n=e.points,i=e.options.spanGaps,r=n.length;if(!r)return[];const s=!!e._loop,{start:o,end:l}=Ak(n,r,s,i);if(i===!0)return Wh(e,[{start:o,end:l,loop:s}],n,t);const a=l{let e=0;return()=>e++})();function ie(e){return e===null||typeof e>"u"}function oe(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function K(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function pe(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function rt(e,t){return pe(e)?e:t}function V(e,t){return typeof e>"u"?t:e}const wS=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function ee(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function J(e,t,n,i){let r,s,o;if(oe(e))if(s=e.length,i)for(r=s-1;r>=0;r--)t.call(n,e[r],r);else for(r=0;re,x:e=>e.x,y:e=>e.y};function SS(e){const t=e.split("."),n=[];let i="";for(const r of t)i+=r,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function kS(e){const t=SS(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function ul(e,t){return(Oh[t]||(Oh[t]=kS(t)))(e)}function Od(e){return e.charAt(0).toUpperCase()+e.slice(1)}const cl=e=>typeof e<"u",jn=e=>typeof e=="function",Mh=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function ES(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Ee=Math.PI,ut=2*Ee,CS=ut+Ee,dl=Number.POSITIVE_INFINITY,PS=Ee/180,et=Ee/2,qn=Ee/4,Lh=Ee*2/3,Sn=Math.log10,Zi=Math.sign;function Kr(e,t,n){return Math.abs(e-t)r-s).pop(),t}function xs(e){return!isNaN(parseFloat(e))&&isFinite(e)}function OS(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function J0(e,t,n){let i,r,s;for(i=0,r=e.length;ia&&u=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function Ld(e,t,n){n=n||(o=>e[o]1;)s=r+i>>1,n(s)?r=s:i=s;return{lo:r,hi:i}}const si=(e,t,n,i)=>Ld(e,n,i?r=>{const s=e[r][t];return se[r][t]Ld(e,n,i=>e[i][t]>=n);function NS(e,t,n){let i=0,r=e.length;for(;ii&&e[r-1]>n;)r--;return i>0||r{const i="_onData"+Od(n),r=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...s){const o=r.apply(this,s);return e._chartjs.listeners.forEach(l=>{typeof l[i]=="function"&&l[i](...s)}),o}})})}function Nh(e,t){const n=e._chartjs;if(!n)return;const i=n.listeners,r=i.indexOf(t);r!==-1&&i.splice(r,1),!(i.length>0)&&(ey.forEach(s=>{delete e[s]}),delete e._chartjs)}function AS(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const ty=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function ny(e,t){let n=[],i=!1;return function(...r){n=r,i||(i=!0,ty.call(window,()=>{i=!1,e.apply(t,n)}))}}function IS(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const Rd=e=>e==="start"?"left":e==="end"?"right":"center",$e=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,jS=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function zS(e,t,n){const i=t.length;let r=0,s=i;if(e._sorted){const{iScale:o,_parsed:l}=e,a=o.axis,{min:u,max:c,minDefined:d,maxDefined:f}=o.getUserBounds();d&&(r=vt(Math.min(si(l,o.axis,u).lo,n?i:si(t,a,o.getPixelForValue(u)).lo),0,i-1)),f?s=vt(Math.max(si(l,o.axis,c,!0).hi+1,n?0:si(t,a,o.getPixelForValue(c),!0).hi+1),r,i)-r:s=i-r}return{start:r,count:s}}function $S(e){const{xScale:t,yScale:n,_scaleRanges:i}=e,r={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!i)return e._scaleRanges=r,!0;const s=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,r),s}const no=e=>e===0||e===1,Fh=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*ut/n)),Ah=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*ut/n)+1,Qr={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*et)+1,easeOutSine:e=>Math.sin(e*et),easeInOutSine:e=>-.5*(Math.cos(Ee*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>no(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>no(e)?e:Fh(e,.075,.3),easeOutElastic:e=>no(e)?e:Ah(e,.075,.3),easeInOutElastic(e){return no(e)?e:e<.5?.5*Fh(e*2,.1125,.45):.5+.5*Ah(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Qr.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Qr.easeInBounce(e*2)*.5:Qr.easeOutBounce(e*2-1)*.5+.5};function Dd(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Ih(e){return Dd(e)?e:new ys(e)}function Ha(e){return Dd(e)?e:new ys(e).saturate(.5).darken(.1).hexString()}const BS=["x","y","borderWidth","radius","tension"],HS=["color","borderColor","backgroundColor"];function US(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:HS},numbers:{type:"number",properties:BS}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function WS(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const jh=new Map;function VS(e,t){t=t||{};const n=e+JSON.stringify(t);let i=jh.get(n);return i||(i=new Intl.NumberFormat(e,t),jh.set(n,i)),i}function Nd(e,t,n){return VS(t,n).format(e)}const iy={values(e){return oe(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const i=this.chart.options.locale;let r,s=e;if(n.length>1){const u=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(u<1e-4||u>1e15)&&(r="scientific"),s=qS(e,n)}const o=Sn(Math.abs(s)),l=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),a={notation:r,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(a,this.options.ticks.format),Nd(e,i,a)},logarithmic(e,t,n){if(e===0)return"0";const i=n[t].significand||e/Math.pow(10,Math.floor(Sn(e)));return[1,2,3,5,10,15].includes(i)||t>.8*n.length?iy.numeric.call(this,e,t,n):""}};function qS(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var ql={formatters:iy};function YS(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:ql.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const mi=Object.create(null),ac=Object.create(null);function Xr(e,t){if(!t)return e;const n=t.split(".");for(let i=0,r=n.length;ii.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,r)=>Ha(r.backgroundColor),this.hoverBorderColor=(i,r)=>Ha(r.borderColor),this.hoverColor=(i,r)=>Ha(r.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return Ua(this,t,n)}get(t){return Xr(this,t)}describe(t,n){return Ua(ac,t,n)}override(t,n){return Ua(mi,t,n)}route(t,n,i,r){const s=Xr(this,t),o=Xr(this,i),l="_"+n;Object.defineProperties(s,{[l]:{value:s[n],writable:!0},[n]:{enumerable:!0,get(){const a=this[l],u=o[r];return K(a)?Object.assign({},u,a):V(a,u)},set(a){this[l]=a}}})}apply(t){t.forEach(n=>n(this))}}var me=new KS({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[US,WS,YS]);function QS(e){return!e||ie(e.size)||ie(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function fl(e,t,n,i,r){let s=t[r];return s||(s=t[r]=e.measureText(r).width,n.push(r)),s>i&&(i=s),i}function XS(e,t,n,i){i=i||{};let r=i.data=i.data||{},s=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(r=i.data={},s=i.garbageCollect=[],i.font=t),e.save(),e.font=t;let o=0;const l=n.length;let a,u,c,d,f;for(a=0;an.length){for(a=0;a0&&e.stroke()}}function Jt(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.xt.top-n&&e.y0&&s.strokeColor!=="";let a,u;for(e.save(),e.font=r.string,ZS(e,s),a=0;a+e||0;function sy(e,t){const n={},i=K(t),r=i?Object.keys(t):t,s=K(e)?i?o=>V(e[o],e[t[o]]):o=>e[o]:()=>e;for(const o of r)n[o]=sk(s(o));return n}function ok(e){return sy(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Bi(e){return sy(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Ue(e){const t=ok(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Se(e,t){e=e||{},t=t||me.font;let n=V(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=V(e.style,t.style);i&&!(""+i).match(ik)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:V(e.family,t.family),lineHeight:rk(V(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:V(e.weight,t.weight),string:""};return r.string=QS(r),r}function io(e,t,n,i){let r=!0,s,o,l;for(s=0,o=e.length;sn&&l===0?0:l+a;return{min:o(i,-Math.abs(s)),max:o(r,s)}}function Hn(e,t){return Object.assign(Object.create(e),t)}function Fd(e,t=[""],n,i,r=()=>e[0]){const s=n||e;typeof i>"u"&&(i=uy("_fallback",e));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:s,_fallback:i,_getTarget:r,override:l=>Fd([l,...e],t,s,i)};return new Proxy(o,{deleteProperty(l,a){return delete l[a],delete l._keys,delete e[0][a],!0},get(l,a){return ly(l,a,()=>mk(a,t,e,l))},getOwnPropertyDescriptor(l,a){return Reflect.getOwnPropertyDescriptor(l._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(l,a){return Bh(l).includes(a)},ownKeys(l){return Bh(l)},set(l,a,u){const c=l._storage||(l._storage=r());return l[a]=c[a]=u,delete l._keys,!0}})}function er(e,t,n,i){const r={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:oy(e,i),setContext:s=>er(e,s,n,i),override:s=>er(e.override(s),t,n,i)};return new Proxy(r,{deleteProperty(s,o){return delete s[o],delete e[o],!0},get(s,o,l){return ly(s,o,()=>uk(s,o,l))},getOwnPropertyDescriptor(s,o){return s._descriptors.allKeys?Reflect.has(e,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,o)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(s,o){return Reflect.has(e,o)},ownKeys(){return Reflect.ownKeys(e)},set(s,o,l){return e[o]=l,delete s[o],!0}})}function oy(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:r=t.allKeys}=e;return{allKeys:r,scriptable:n,indexable:i,isScriptable:jn(n)?n:()=>n,isIndexable:jn(i)?i:()=>i}}const ak=(e,t)=>e?e+Od(t):t,Ad=(e,t)=>K(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function ly(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const i=n();return e[t]=i,i}function uk(e,t,n){const{_proxy:i,_context:r,_subProxy:s,_descriptors:o}=e;let l=i[t];return jn(l)&&o.isScriptable(t)&&(l=ck(t,l,e,n)),oe(l)&&l.length&&(l=dk(t,l,e,o.isIndexable)),Ad(t,l)&&(l=er(l,r,s&&s[t],o)),l}function ck(e,t,n,i){const{_proxy:r,_context:s,_subProxy:o,_stack:l}=n;if(l.has(e))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+e);l.add(e);let a=t(s,o||i);return l.delete(e),Ad(e,a)&&(a=Id(r._scopes,r,e,a)),a}function dk(e,t,n,i){const{_proxy:r,_context:s,_subProxy:o,_descriptors:l}=n;if(typeof s.index<"u"&&i(e))return t[s.index%t.length];if(K(t[0])){const a=t,u=r._scopes.filter(c=>c!==a);t=[];for(const c of a){const d=Id(u,r,e,c);t.push(er(d,s,o&&o[e],l))}}return t}function ay(e,t,n){return jn(e)?e(t,n):e}const fk=(e,t)=>e===!0?t:typeof e=="string"?ul(t,e):void 0;function hk(e,t,n,i,r){for(const s of t){const o=fk(n,s);if(o){e.add(o);const l=ay(o._fallback,n,r);if(typeof l<"u"&&l!==n&&l!==i)return l}else if(o===!1&&typeof i<"u"&&n!==i)return null}return!1}function Id(e,t,n,i){const r=t._rootScopes,s=ay(t._fallback,n,i),o=[...e,...r],l=new Set;l.add(i);let a=$h(l,o,n,s||n,i);return a===null||typeof s<"u"&&s!==n&&(a=$h(l,o,s,a,i),a===null)?!1:Fd(Array.from(l),[""],r,s,()=>pk(t,n,i))}function $h(e,t,n,i,r){for(;n;)n=hk(e,t,n,i,r);return n}function pk(e,t,n){const i=e._getTarget();t in i||(i[t]={});const r=i[t];return oe(r)&&K(n)?n:r||{}}function mk(e,t,n,i){let r;for(const s of t)if(r=uy(ak(s,e),n),typeof r<"u")return Ad(e,r)?Id(n,i,e,r):r}function uy(e,t){for(const n of t){if(!n)continue;const i=n[e];if(typeof i<"u")return i}}function Bh(e){let t=e._keys;return t||(t=e._keys=gk(e._scopes)),t}function gk(e){const t=new Set;for(const n of e)for(const i of Object.keys(n).filter(r=>!r.startsWith("_")))t.add(i);return Array.from(t)}const yk=Number.EPSILON||1e-14,tr=(e,t)=>te==="x"?"y":"x";function vk(e,t,n,i){const r=e.skip?t:e,s=t,o=n.skip?t:n,l=lc(s,r),a=lc(o,s);let u=l/(l+a),c=a/(l+a);u=isNaN(u)?0:u,c=isNaN(c)?0:c;const d=i*u,f=i*c;return{previous:{x:s.x-d*(o.x-r.x),y:s.y-d*(o.y-r.y)},next:{x:s.x+f*(o.x-r.x),y:s.y+f*(o.y-r.y)}}}function xk(e,t,n){const i=e.length;let r,s,o,l,a,u=tr(e,0);for(let c=0;c!u.skip)),t.cubicInterpolationMode==="monotone")_k(e,r);else{let u=i?e[e.length-1]:e[0];for(s=0,o=e.length;se.ownerDocument.defaultView.getComputedStyle(e,null);function kk(e,t){return Ql(e).getPropertyValue(t)}const Ek=["top","right","bottom","left"];function ui(e,t,n){const i={};n=n?"-"+n:"";for(let r=0;r<4;r++){const s=Ek[r];i[s]=parseFloat(e[t+"-"+s+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Ck=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function Pk(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:r,offsetY:s}=i;let o=!1,l,a;if(Ck(r,s,e.target))l=r,a=s;else{const u=t.getBoundingClientRect();l=i.clientX-u.left,a=i.clientY-u.top,o=!0}return{x:l,y:a,box:o}}function Jn(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,r=Ql(n),s=r.boxSizing==="border-box",o=ui(r,"padding"),l=ui(r,"border","width"),{x:a,y:u,box:c}=Pk(e,n),d=o.left+(c&&l.left),f=o.top+(c&&l.top);let{width:p,height:h}=t;return s&&(p-=o.width+l.width,h-=o.height+l.height),{x:Math.round((a-d)/p*n.width/i),y:Math.round((u-f)/h*n.height/i)}}function Tk(e,t,n){let i,r;if(t===void 0||n===void 0){const s=jd(e);if(!s)t=e.clientWidth,n=e.clientHeight;else{const o=s.getBoundingClientRect(),l=Ql(s),a=ui(l,"border","width"),u=ui(l,"padding");t=o.width-u.width-a.width,n=o.height-u.height-a.height,i=pl(l.maxWidth,s,"clientWidth"),r=pl(l.maxHeight,s,"clientHeight")}}return{width:t,height:n,maxWidth:i||dl,maxHeight:r||dl}}const so=e=>Math.round(e*10)/10;function Ok(e,t,n,i){const r=Ql(e),s=ui(r,"margin"),o=pl(r.maxWidth,e,"clientWidth")||dl,l=pl(r.maxHeight,e,"clientHeight")||dl,a=Tk(e,t,n);let{width:u,height:c}=a;if(r.boxSizing==="content-box"){const f=ui(r,"border","width"),p=ui(r,"padding");u-=p.width+f.width,c-=p.height+f.height}return u=Math.max(0,u-s.width),c=Math.max(0,i?u/i:c-s.height),u=so(Math.min(u,o,a.maxWidth)),c=so(Math.min(c,l,a.maxHeight)),u&&!c&&(c=so(u/2)),(t!==void 0||n!==void 0)&&i&&a.height&&c>a.height&&(c=a.height,u=so(Math.floor(c*i))),{width:u,height:c}}function Hh(e,t,n){const i=t||1,r=Math.floor(e.height*i),s=Math.floor(e.width*i);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const o=e.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${e.height}px`,o.style.width=`${e.width}px`),e.currentDevicePixelRatio!==i||o.height!==r||o.width!==s?(e.currentDevicePixelRatio=i,o.height=r,o.width=s,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Mk=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return e}();function Uh(e,t){const n=kk(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Zn(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function Lk(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:i==="middle"?n<.5?e.y:t.y:i==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function Rk(e,t,n,i){const r={x:e.cp2x,y:e.cp2y},s={x:t.cp1x,y:t.cp1y},o=Zn(e,r,n),l=Zn(r,s,n),a=Zn(s,t,n),u=Zn(o,l,n),c=Zn(l,a,n);return Zn(u,c,n)}const Dk=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,i){return n-i},leftForLtr(n,i){return n-i}}},Nk=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Hi(e,t,n){return e?Dk(t,n):Nk()}function fy(e,t){let n,i;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)}function hy(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function py(e){return e==="angle"?{between:Z0,compare:LS,normalize:ot}:{between:Ni,compare:(t,n)=>t-n,normalize:t=>t}}function Wh({start:e,end:t,count:n,loop:i,style:r}){return{start:e%n,end:t%n,loop:i&&(t-e+1)%n===0,style:r}}function Fk(e,t,n){const{property:i,start:r,end:s}=n,{between:o,normalize:l}=py(i),a=t.length;let{start:u,end:c,loop:d}=e,f,p;if(d){for(u+=a,c+=a,f=0,p=a;fa(r,x,y)&&l(r,x)!==0,S=()=>l(s,y)===0||a(s,x,y),C=()=>g||_(),E=()=>!g||S();for(let k=c,L=c;k<=d;++k)m=t[k%o],!m.skip&&(y=u(m[i]),y!==x&&(g=a(y,r,s),v===null&&C()&&(v=l(y,r)===0?k:L),v!==null&&E()&&(h.push(Wh({start:v,end:k,loop:f,count:o,style:p})),v=null),L=k,x=y));return v!==null&&h.push(Wh({start:v,end:d,loop:f,count:o,style:p})),h}function gy(e,t){const n=[],i=e.segments;for(let r=0;rr&&e[s%t].skip;)s--;return s%=t,{start:r,end:s}}function Ik(e,t,n,i){const r=e.length,s=[];let o=t,l=e[t],a;for(a=t+1;a<=n;++a){const u=e[a%r];u.skip||u.stop?l.skip||(i=!1,s.push({start:t%r,end:(a-1)%r,loop:i}),t=o=u.stop?a:null):(o=a,l.skip&&(t=a)),l=u}return o!==null&&s.push({start:t%r,end:o%r,loop:i}),s}function jk(e,t){const n=e.points,i=e.options.spanGaps,r=n.length;if(!r)return[];const s=!!e._loop,{start:o,end:l}=Ak(n,r,s,i);if(i===!0)return Vh(e,[{start:o,end:l,loop:s}],n,t);const a=ll({chart:t,initial:n.initial,numSteps:o,currentStep:Math.min(i-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=ty.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,r)=>{if(!i.running||!i.items.length)return;const s=i.items;let o=s.length-1,l=!1,a;for(;o>=0;--o)a=s[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(t),l=!0):(s[o]=s[s.length-1],s.pop());l&&(r.draw(),this._notify(r,i,t,"progress")),s.length||(i.running=!1,this._notify(r,i,t,"complete"),i.initial=!1),n+=s.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((i,r)=>Math.max(i,r._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const i=n.items;let r=i.length-1;for(;r>=0;--r)i[r].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Ut=new Bk;const Yh="transparent",Hk={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=Ih(e||Yh),r=i.valid&&Ih(t||Yh);return r&&r.valid?r.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class Uk{constructor(t,n,i,r){const s=n[i];r=no([t.to,r,s,t.from]);const o=no([t.from,s,r]);this._active=!0,this._fn=t.fn||Hk[t.type||typeof o],this._easing=Kr[t.easing]||Kr.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=i,this._from=o,this._to=r,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);const r=this._target[this._prop],s=i-this._start,o=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=no([t.to,n,r,t.from]),this._from=no([t.from,r,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,i=this._duration,r=this._prop,s=this._from,o=this._loop,l=this._to;let a;if(this._active=s!==l&&(o||n1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[r]=this._fn(s,l,a)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){const n=t?"res":"rej",i=this._promises||[];for(let r=0;r{const s=t[r];if(!K(s))return;const o={};for(const l of n)o[l]=s[l];(oe(s.properties)&&s.properties||[r]).forEach(l=>{(l===r||!i.has(l))&&i.set(l,o)})})}_animateOptions(t,n){const i=n.options,r=Wk(t,i);if(!r)return[];const s=this._createAnimations(r,i);return i.$shared&&Vk(t.options.$animations,i).then(()=>{t.options=i},()=>{}),s}_createAnimations(t,n){const i=this._properties,r=[],s=t.$animations||(t.$animations={}),o=Object.keys(n),l=Date.now();let a;for(a=o.length-1;a>=0;--a){const u=o[a];if(u.charAt(0)==="$")continue;if(u==="options"){r.push(...this._animateOptions(t,n));continue}const c=n[u];let d=s[u];const f=i.get(u);if(d)if(f&&d.active()){d.update(f,c,l);continue}else d.cancel();if(!f||!f.duration){t[u]=c;continue}s[u]=d=new Uk(f,t,u,c),r.push(d)}return r}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return Ut.add(this._chart,i),!0}}function Vk(e,t){const n=[],i=Object.keys(t);for(let r=0;r0||!n&&s<0)return r.index}return null}function Jh(e,t){const{chart:n,_cachedMeta:i}=e,r=n._stacks||(n._stacks={}),{iScale:s,vScale:o,index:l}=i,a=s.axis,u=o.axis,c=Qk(s,o,i),d=t.length;let f;for(let p=0;pn[i].axis===t).shift()}function Jk(e,t){return Hn(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Zk(e,t,n){return Hn(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function _r(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const r of t){const s=r._stacks;if(!s||s[i]===void 0||s[i][n]===void 0)return;delete s[i][n],s[i]._visualValues!==void 0&&s[i]._visualValues[n]!==void 0&&delete s[i]._visualValues[n]}}}const Va=e=>e==="reset"||e==="none",Zh=(e,t)=>t?e:Object.assign({},e),e2=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:vy(n,!0),values:null};class Xr{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Xh(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&_r(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),r=(d,f,p,h)=>d==="x"?f:d==="r"?h:p,s=n.xAxisID=W(i.xAxisID,Ua(t,"x")),o=n.yAxisID=W(i.yAxisID,Ua(t,"y")),l=n.rAxisID=W(i.rAxisID,Ua(t,"r")),a=n.indexAxis,u=n.iAxisID=r(a,s,o,l),c=n.vAxisID=r(a,o,s,l);n.xScale=this.getScaleForId(s),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(l),n.iScale=this.getScaleForId(u),n.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Nh(this._data,this),t._stacked&&_r(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(K(n))this._data=Kk(n);else if(i!==n){if(i){Nh(i,this);const r=this._cachedMeta;_r(r),r._parsed=[]}n&&Object.isExtensible(n)&&FS(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,i=this.getDataset();let r=!1;this._dataCheck();const s=n._stacked;n._stacked=Xh(n.vScale,n),n.stack!==i.stack&&(r=!0,_r(n),n.stack=i.stack),this._resyncElements(t),(r||s!==n._stacked)&&Jh(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:i,_data:r}=this,{iScale:s,_stacked:o}=i,l=s.axis;let a=t===0&&n===r.length?!0:i._sorted,u=t>0&&i._parsed[t-1],c,d,f;if(this._parsing===!1)i._parsed=r,i._sorted=!0,f=r;else{oe(r[t])?f=this.parseArrayData(i,r,t,n):K(r[t])?f=this.parseObjectData(i,r,t,n):f=this.parsePrimitiveData(i,r,t,n);const p=()=>d[l]===null||u&&d[l]g||d=0;--f)if(!h()){this.updateRangeFromParsed(u,t,p,a);break}}return u}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let r,s,o;for(r=0,s=n.length;r=0&&tthis.getContext(i,r,n),g=u.resolveNamedOptions(f,p,h,d);return g.$shared&&(g.$shared=a,s[o]=Object.freeze(Zh(g,a))),g}_resolveAnimations(t,n,i){const r=this.chart,s=this._cachedDataOpts,o=`animation-${n}`,l=s[o];if(l)return l;let a;if(r.options.animation!==!1){const c=this.chart.config,d=c.datasetAnimationScopeKeys(this._type,n),f=c.getOptionScopes(this.getDataset(),d);a=c.createResolver(f,this.getContext(t,i,n))}const u=new yy(r,a&&a.animations);return a&&a._cacheable&&(s[o]=Object.freeze(u)),u}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Va(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const i=this.resolveDataElementOptions(t,n),r=this._sharedOptions,s=this.getSharedOptions(i),o=this.includeOptions(n,s)||s!==r;return this.updateSharedOptions(s,n,i),{sharedOptions:s,includeOptions:o}}updateElement(t,n,i,r){Va(r)?Object.assign(t,i):this._resolveAnimations(n,r).update(t,i)}updateSharedOptions(t,n,i){t&&!Va(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,r){t.active=r;const s=this.getStyle(n,r);this._resolveAnimations(n,i,r).update(t,{options:!r&&this.getSharedOptions(s)||s})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,i=this._cachedMeta.data;for(const[l,a,u]of this._syncList)this[l](a,u);this._syncList=[];const r=i.length,s=n.length,o=Math.min(s,r);o&&this.parse(0,o),s>r?this._insertElements(r,s-r,t):s{for(u.length+=n,l=u.length-1;l>=o;l--)u[l]=u[l-n]};for(a(s),l=t;l0&&this.getParsed(n-1);for(let S=0;S=m){C.skip=!0;continue}const E=this.getParsed(S),T=ie(E[p]),M=C[f]=o.getPixelForValue(E[f],S),R=C[p]=s||T?l.getBasePixel():l.getPixelForValue(a?this.applyStack(l,E,a):E[p],S);C.skip=isNaN(M)||isNaN(R)||T,C.stop=S>0&&Math.abs(E[f]-_[f])>v,g&&(C.parsed=E,C.raw=u.data[S]),d&&(C.options=c||this.resolveDataElementOptions(S,k.active?"active":r)),y||this.updateElement(k,S,C,r),_=E}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,r=t.data||[];if(!r.length)return i;const s=r[0].size(this.resolveDataElementOptions(0)),o=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(i,s,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}I(Eo,"id","line"),I(Eo,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),I(Eo,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function Kn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class zd{constructor(t){I(this,"options");this.options=t||{}}static override(t){Object.assign(zd.prototype,t)}init(){}formats(){return Kn()}parse(){return Kn()}format(){return Kn()}add(){return Kn()}diff(){return Kn()}startOf(){return Kn()}endOf(){return Kn()}}var t2={_date:zd};function n2(e,t,n,i){const{controller:r,data:s,_sorted:o}=e,l=r._cachedMeta.iScale;if(l&&t===l.axis&&t!=="r"&&o&&s.length){const a=l._reversePixels?DS:si;if(i){if(r._sharedOptions){const u=s[0],c=typeof u.getRange=="function"&&u.getRange(t);if(c){const d=a(s,t,n-c),f=a(s,t,n+c);return{lo:d.lo,hi:f.hi}}}}else return a(s,t,n)}return{lo:0,hi:s.length-1}}function Ls(e,t,n,i,r){const s=e.getSortedVisibleDatasetMetas(),o=n[t];for(let l=0,a=s.length;l{a[o](t[n],r)&&(s.push({element:a,datasetIndex:u,index:c}),l=l||a.inRange(t.x,t.y,r))}),i&&!l?[]:s}var o2={evaluateInteractionItems:Ls,modes:{index(e,t,n,i){const r=Jn(t,e),s=n.axis||"x",o=n.includeInvisible||!1,l=n.intersect?Wa(e,r,s,i,o):qa(e,r,s,!1,i,o),a=[];return l.length?(e.getSortedVisibleDatasetMetas().forEach(u=>{const c=l[0].index,d=u.data[c];d&&!d.skip&&a.push({element:d,datasetIndex:u.index,index:c})}),a):[]},dataset(e,t,n,i){const r=Jn(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;let l=n.intersect?Wa(e,r,s,i,o):qa(e,r,s,!1,i,o);if(l.length>0){const a=l[0].datasetIndex,u=e.getDatasetMeta(a).data;l=[];for(let c=0;cn.pos===t)}function tp(e,t){return e.filter(n=>xy.indexOf(n.pos)===-1&&n.box.axis===t)}function Sr(e,t){return e.sort((n,i)=>{const r=t?i:n,s=t?n:i;return r.weight===s.weight?r.index-s.index:r.weight-s.weight})}function l2(e){const t=[];let n,i,r,s,o,l;for(n=0,i=(e||[]).length;nu.box.fullSize),!0),i=Sr(br(t,"left"),!0),r=Sr(br(t,"right")),s=Sr(br(t,"top"),!0),o=Sr(br(t,"bottom")),l=tp(t,"x"),a=tp(t,"y");return{fullSize:n,leftAndTop:i.concat(s),rightAndBottom:r.concat(a).concat(o).concat(l),chartArea:br(t,"chartArea"),vertical:i.concat(r).concat(a),horizontal:s.concat(o).concat(l)}}function np(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function wy(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function d2(e,t,n,i){const{pos:r,box:s}=n,o=e.maxPadding;if(!K(r)){n.size&&(e[r]-=n.size);const d=i[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?s.height:s.width),n.size=d.size/d.count,e[r]+=n.size}s.getPadding&&wy(o,s.getPadding());const l=Math.max(0,t.outerWidth-np(o,e,"left","right")),a=Math.max(0,t.outerHeight-np(o,e,"top","bottom")),u=l!==e.w,c=a!==e.h;return e.w=l,e.h=a,n.horizontal?{same:u,other:c}:{same:c,other:u}}function f2(e){const t=e.maxPadding;function n(i){const r=Math.max(t[i]-e[i],0);return e[i]+=r,r}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function h2(e,t){const n=t.maxPadding;function i(r){const s={left:0,top:0,right:0,bottom:0};return r.forEach(o=>{s[o]=Math.max(t[o],n[o])}),s}return i(e?["left","right"]:["top","bottom"])}function Dr(e,t,n,i){const r=[];let s,o,l,a,u,c;for(s=0,o=e.length,u=0;s{typeof g.beforeLayout=="function"&&g.beforeLayout()});const c=a.reduce((g,v)=>v.box.options&&v.box.options.display===!1?g:g+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:r,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/c,hBoxMaxHeight:o/2}),f=Object.assign({},r);wy(f,Ue(i));const p=Object.assign({maxPadding:f,w:s,h:o,x:r.left,y:r.top},r),h=u2(a.concat(u),d);Dr(l.fullSize,p,d,h),Dr(a,p,d,h),Dr(u,p,d,h)&&Dr(a,p,d,h),f2(p),ip(l.leftAndTop,p,d,h),p.x+=p.w,p.y+=p.h,ip(l.rightAndBottom,p,d,h),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},X(l.chartArea,g=>{const v=g.box;Object.assign(v,e.chartArea),v.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class _y{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,r){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,r?Math.floor(n/r):i)}}isAttached(t){return!0}updateConfig(t){}}class p2 extends _y{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Co="$chartjs",m2={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},rp=e=>e===null||e==="";function g2(e,t){const n=e.style,i=e.getAttribute("height"),r=e.getAttribute("width");if(e[Co]={initial:{height:i,width:r,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",rp(r)){const s=Uh(e,"width");s!==void 0&&(e.width=s)}if(rp(i))if(e.style.height==="")e.height=e.width/(t||2);else{const s=Uh(e,"height");s!==void 0&&(e.height=s)}return e}const by=Mk?{passive:!0}:!1;function y2(e,t,n){e.addEventListener(t,n,by)}function v2(e,t,n){e.canvas.removeEventListener(t,n,by)}function x2(e,t){const n=m2[e.type]||e.type,{x:i,y:r}=Jn(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:r!==void 0?r:null}}function pl(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function w2(e,t,n){const i=e.canvas,r=new MutationObserver(s=>{let o=!1;for(const l of s)o=o||pl(l.addedNodes,i),o=o&&!pl(l.removedNodes,i);o&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}function _2(e,t,n){const i=e.canvas,r=new MutationObserver(s=>{let o=!1;for(const l of s)o=o||pl(l.removedNodes,i),o=o&&!pl(l.addedNodes,i);o&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}const xs=new Map;let sp=0;function Sy(){const e=window.devicePixelRatio;e!==sp&&(sp=e,xs.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function b2(e,t){xs.size||window.addEventListener("resize",Sy),xs.set(e,t)}function S2(e){xs.delete(e),xs.size||window.removeEventListener("resize",Sy)}function k2(e,t,n){const i=e.canvas,r=i&&jd(i);if(!r)return;const s=ny((l,a)=>{const u=r.clientWidth;n(l,a),u{const a=l[0],u=a.contentRect.width,c=a.contentRect.height;u===0&&c===0||s(u,c)});return o.observe(r),b2(e,s),o}function Ya(e,t,n){n&&n.disconnect(),t==="resize"&&S2(e)}function E2(e,t,n){const i=e.canvas,r=ny(s=>{e.ctx!==null&&n(x2(s,e))},e);return y2(i,t,r),r}class C2 extends _y{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(g2(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[Co])return!1;const i=n[Co].initial;["height","width"].forEach(s=>{const o=i[s];ie(o)?n.removeAttribute(s):n.setAttribute(s,o)});const r=i.style||{};return Object.keys(r).forEach(s=>{n.style[s]=r[s]}),n.width=n.width,delete n[Co],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const r=t.$proxies||(t.$proxies={}),o={attach:w2,detach:_2,resize:k2}[n]||E2;r[n]=o(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),r=i[n];if(!r)return;({attach:Ya,detach:Ya,resize:Ya}[n]||v2)(t,n,r),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,r){return Ok(t,n,i,r)}isAttached(t){const n=jd(t);return!!(n&&n.isConnected)}}function P2(e){return!dy()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?p2:C2}class an{constructor(){I(this,"x");I(this,"y");I(this,"active",!1);I(this,"options");I(this,"$animations")}tooltipPosition(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return vs(this.x)&&vs(this.y)}getProps(t,n){const i=this.$animations;if(!n||!i)return this;const r={};return t.forEach(s=>{r[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),r}}I(an,"defaults",{}),I(an,"defaultRoutes");function T2(e,t){const n=e.options.ticks,i=O2(e),r=Math.min(n.maxTicksLimit||i,i),s=n.major.enabled?L2(t):[],o=s.length,l=s[0],a=s[o-1],u=[];if(o>r)return R2(t,u,s,o/r),u;const c=M2(s,t,r);if(o>0){let d,f;const p=o>1?Math.round((a-l)/(o-1)):null;for(oo(t,u,c,ie(p)?0:l-p,l),d=0,f=o-1;dr)return a}return Math.max(r,1)}function L2(e){const t=[];let n,i;for(n=0,i=e.length;ne==="left"?"right":e==="right"?"left":e,op=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,lp=(e,t)=>Math.min(t||e,e);function ap(e,t){const n=[],i=e.length/t,r=e.length;let s=0;for(;so+l)))return a}function A2(e,t){X(e,n=>{const i=n.gc,r=i.length/2;let s;if(r>t){for(s=0;si?i:n,i=r&&n>i?n:i,{min:rt(n,rt(i,n)),max:rt(i,rt(n,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){ee(this.options.beforeUpdate,[this])}update(t,n,i){const{beginAtZero:r,grace:s,ticks:o}=this.options,l=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=lk(this,s,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=l=s||i<=1||!this.isHorizontal()){this.labelRotation=r;return}const c=this._getLabelSizes(),d=c.widest.width,f=c.highest.height,p=vt(this.chart.width-d,0,this.maxWidth);l=t.offset?this.maxWidth/i:p/(i-1),d+6>l&&(l=p/(i-(t.offset?.5:1)),a=this.maxHeight-kr(t.grid)-n.padding-up(t.title,this.chart.options.font),u=Math.sqrt(d*d+f*f),o=Md(Math.min(Math.asin(vt((c.highest.height+6)/l,-1,1)),Math.asin(vt(a/u,-1,1))-Math.asin(vt(f/u,-1,1)))),o=Math.max(r,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){ee(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ee(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:r,grid:s}}=this,o=this._isVisible(),l=this.isHorizontal();if(o){const a=up(r,n.options.font);if(l?(t.width=this.maxWidth,t.height=kr(s)+a):(t.height=this.maxHeight,t.width=kr(s)+a),i.display&&this.ticks.length){const{first:u,last:c,widest:d,highest:f}=this._getLabelSizes(),p=i.padding*2,h=kn(this.labelRotation),g=Math.cos(h),v=Math.sin(h);if(l){const y=i.mirror?0:v*d.width+g*f.height;t.height=Math.min(this.maxHeight,t.height+y+p)}else{const y=i.mirror?0:g*d.width+v*f.height;t.width=Math.min(this.maxWidth,t.width+y+p)}this._calculatePadding(u,c,v,g)}}this._handleMargins(),l?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,i,r){const{ticks:{align:s,padding:o},position:l}=this.options,a=this.labelRotation!==0,u=l!=="top"&&this.axis==="x";if(this.isHorizontal()){const c=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,p=0;a?u?(f=r*t.width,p=i*n.height):(f=i*t.height,p=r*n.width):s==="start"?p=n.width:s==="end"?f=t.width:s!=="inner"&&(f=t.width/2,p=n.width/2),this.paddingLeft=Math.max((f-c+o)*this.width/(this.width-c),0),this.paddingRight=Math.max((p-d+o)*this.width/(this.width-d),0)}else{let c=n.height/2,d=t.height/2;s==="start"?(c=0,d=t.height):s==="end"&&(c=n.height,d=0),this.paddingTop=c+o,this.paddingBottom=d+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){ee(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,i;for(n=0,i=t.length;n({width:o[T]||0,height:l[T]||0});return{first:E(0),last:E(n-1),widest:E(k),highest:E(C),widths:o,heights:l}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return RS(this._alignToPixels?Yn(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&tl*r?l/i:a/r:a*r0}_computeGridLineItems(t){const n=this.axis,i=this.chart,r=this.options,{grid:s,position:o,border:l}=r,a=s.offset,u=this.isHorizontal(),d=this.ticks.length+(a?1:0),f=kr(s),p=[],h=l.setContext(this.getContext()),g=h.display?h.width:0,v=g/2,y=function(U){return Yn(i,U,g)};let m,x,_,S,k,C,E,T,M,R,F,B;if(o==="top")m=y(this.bottom),C=this.bottom-f,T=m-v,R=y(t.top)+v,B=t.bottom;else if(o==="bottom")m=y(this.top),R=t.top,B=y(t.bottom)-v,C=m+v,T=this.top+f;else if(o==="left")m=y(this.right),k=this.right-f,E=m-v,M=y(t.left)+v,F=t.right;else if(o==="right")m=y(this.left),M=t.left,F=y(t.right)-v,k=m+v,E=this.left+f;else if(n==="x"){if(o==="center")m=y((t.top+t.bottom)/2+.5);else if(K(o)){const U=Object.keys(o)[0],Z=o[U];m=y(this.chart.scales[U].getPixelForValue(Z))}R=t.top,B=t.bottom,C=m+v,T=C+f}else if(n==="y"){if(o==="center")m=y((t.left+t.right)/2);else if(K(o)){const U=Object.keys(o)[0],Z=o[U];m=y(this.chart.scales[U].getPixelForValue(Z))}k=m-v,E=k-f,M=t.left,F=t.right}const J=W(r.ticks.maxTicksLimit,d),j=Math.max(1,Math.ceil(d/J));for(x=0;xs.value===t);return r>=0?n.setContext(this.getContext(r)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,o;const l=(a,u,c)=>{!c.width||!c.color||(i.save(),i.lineWidth=c.width,i.strokeStyle=c.color,i.setLineDash(c.borderDash||[]),i.lineDashOffset=c.borderDashOffset,i.beginPath(),i.moveTo(a.x,a.y),i.lineTo(u.x,u.y),i.stroke(),i.restore())};if(n.display)for(s=0,o=r.length;s{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",r=[];let s,o;for(s=0,o=n.length;s{const i=n.split("."),r=i.pop(),s=[e].concat(i).join("."),o=t[n].split("."),l=o.pop(),a=o.join(".");me.route(s,r,a,l)})}function U2(e){return"id"in e&&"defaults"in e}class V2{constructor(){this.controllers=new lo(Xr,"datasets",!0),this.elements=new lo(an,"elements"),this.plugins=new lo(Object,"plugins"),this.scales=new lo(xi,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,i){[...n].forEach(r=>{const s=i||this._getRegistryForType(r);i||s.isForType(r)||s===this.plugins&&r.id?this._exec(t,s,r):X(r,o=>{const l=i||this._getRegistryForType(o);this._exec(t,l,o)})})}_exec(t,n,i){const r=Od(t);ee(i["before"+r],[],i),n[t](i),ee(i["after"+r],[],i)}_getRegistryForType(t){for(let n=0;ns.filter(l=>!o.some(a=>l.plugin.id===a.plugin.id));this._notify(r(n,i),t,"stop"),this._notify(r(i,n),t,"start")}}function q2(e){const t={},n=[],i=Object.keys(Ft.plugins.items);for(let s=0;s1&&cp(e[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function dp(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function Z2(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(i=>i.xAxisID===e||i.yAxisID===e);if(n.length)return dp(e,"x",n[0])||dp(e,"y",n[0])}return{}}function eE(e,t){const n=mi[e.type]||{scales:{}},i=t.scales||{},r=uc(e.type,t),s=Object.create(null);return Object.keys(i).forEach(o=>{const l=i[o];if(!K(l))return console.error(`Invalid scale configuration for scale: ${o}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const a=cc(o,l,Z2(o,e),me.scales[l.type]),u=G2(a,r),c=n.scales||{};s[o]=qr(Object.create(null),[{axis:a},l,c[a],c[u]])}),e.data.datasets.forEach(o=>{const l=o.type||e.type,a=o.indexAxis||uc(l,t),c=(mi[l]||{}).scales||{};Object.keys(c).forEach(d=>{const f=X2(d,a),p=o[f+"AxisID"]||f;s[p]=s[p]||Object.create(null),qr(s[p],[{axis:f},i[p],c[d]])})}),Object.keys(s).forEach(o=>{const l=s[o];qr(l,[me.scales[l.type],me.scale])}),s}function ky(e){const t=e.options||(e.options={});t.plugins=W(t.plugins,{}),t.scales=eE(e,t)}function Ey(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function tE(e){return e=e||{},e.data=Ey(e.data),ky(e),e}const fp=new Map,Cy=new Set;function ao(e,t){let n=fp.get(e);return n||(n=t(),fp.set(e,n),Cy.add(n)),n}const Er=(e,t,n)=>{const i=al(t,n);i!==void 0&&e.add(i)};class nE{constructor(t){this._config=tE(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Ey(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),ky(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ao(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return ao(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return ao(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return ao(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let r=i.get(t);return(!r||n)&&(r=new Map,i.set(t,r)),r}getOptionScopes(t,n,i){const{options:r,type:s}=this,o=this._cachedScopes(t,i),l=o.get(n);if(l)return l;const a=new Set;n.forEach(c=>{t&&(a.add(t),c.forEach(d=>Er(a,t,d))),c.forEach(d=>Er(a,r,d)),c.forEach(d=>Er(a,mi[s]||{},d)),c.forEach(d=>Er(a,me,d)),c.forEach(d=>Er(a,lc,d))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),Cy.has(n)&&o.set(n,u),u}chartOptionScopes(){const{options:t,type:n}=this;return[t,mi[n]||{},me.datasets[n]||{},{type:n},me,lc]}resolveNamedOptions(t,n,i,r=[""]){const s={$shared:!0},{resolver:o,subPrefixes:l}=hp(this._resolverCache,t,r);let a=o;if(rE(o,n)){s.$shared=!1,i=jn(i)?i():i;const u=this.createResolver(t,i,l);a=er(o,i,u)}for(const u of n)s[u]=a[u];return s}createResolver(t,n,i=[""],r){const{resolver:s}=hp(this._resolverCache,t,i);return K(n)?er(s,n,void 0,r):s}}function hp(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const r=n.join();let s=i.get(r);return s||(s={resolver:Fd(t,n),subPrefixes:n.filter(l=>!l.toLowerCase().includes("hover"))},i.set(r,s)),s}const iE=e=>K(e)&&Object.getOwnPropertyNames(e).reduce((t,n)=>t||jn(e[n]),!1);function rE(e,t){const{isScriptable:n,isIndexable:i}=oy(e);for(const r of t){const s=n(r),o=i(r),l=(o||s)&&e[r];if(s&&(jn(l)||iE(l))||o&&oe(l))return!0}return!1}var sE="4.3.0";const oE=["top","bottom","left","right","chartArea"];function pp(e,t){return e==="top"||e==="bottom"||oE.indexOf(e)===-1&&t==="x"}function mp(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function gp(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),ee(n&&n.onComplete,[e],t)}function lE(e){const t=e.chart,n=t.options.animation;ee(n&&n.onProgress,[e],t)}function Py(e){return dy()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Po={},yp=e=>{const t=Py(e);return Object.values(Po).filter(n=>n.canvas===t).pop()};function aE(e,t,n){const i=Object.keys(e);for(const r of i){const s=+r;if(s>=t){const o=e[r];delete e[r],(n>0||s>t)&&(e[s+n]=o)}}}function uE(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}function cE(e){const{xScale:t,yScale:n}=e;if(t&&n)return{left:t.left,right:t.right,top:n.top,bottom:n.bottom}}var hn;let Ql=(hn=class{static register(...t){Ft.add(...t),vp()}static unregister(...t){Ft.remove(...t),vp()}constructor(t,n){const i=this.config=new nE(n),r=Py(t),s=yp(r);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||P2(r)),this.platform.updateConfig(i);const l=this.platform.acquireContext(r,o.aspectRatio),a=l&&l.canvas,u=a&&a.height,c=a&&a.width;if(this.id=xS(),this.ctx=l,this.canvas=a,this.width=c,this.height=u,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new W2,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=IS(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],Po[this.id]=this,!l||!a){console.error("Failed to create chart: can't acquire context from the given item");return}Ut.listen(this,"complete",gp),Ut.listen(this,"progress",lE),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:r,_aspectRatio:s}=this;return ie(t)?n&&s?s:r?i/r:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Ft}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Hh(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return zh(this.canvas,this.ctx),this}stop(){return Ut.stop(this),this}resize(t,n){Ut.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const i=this.options,r=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(r,t,n,s),l=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Hh(this,l,!0)&&(this.notifyPlugins("resize",{size:o}),ee(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};X(n,(i,r)=>{i.id=r})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,r=Object.keys(i).reduce((o,l)=>(o[l]=!1,o),{});let s=[];n&&(s=s.concat(Object.keys(n).map(o=>{const l=n[o],a=cc(o,l),u=a==="r",c=a==="x";return{options:l,dposition:u?"chartArea":c?"bottom":"left",dtype:u?"radialLinear":c?"category":"linear"}}))),X(s,o=>{const l=o.options,a=l.id,u=cc(a,l),c=W(l.type,o.dtype);(l.position===void 0||pp(l.position,u)!==pp(o.dposition))&&(l.position=o.dposition),r[a]=!0;let d=null;if(a in i&&i[a].type===c)d=i[a];else{const f=Ft.getScale(c);d=new f({id:a,type:c,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(l,t)}),X(r,(o,l)=>{o||delete i[l]}),X(i,o=>{xt.configure(this,o,o.options),xt.addBox(this,o)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((r,s)=>r.index-s.index),i>n){for(let r=n;rn.length&&delete this._stacks,t.forEach((i,r)=>{n.filter(s=>s===i._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let i,r;for(this._removeUnreferencedMetasets(),i=0,r=n.length;i{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,c=this.data.datasets.length;u{u.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(mp("z","_idx"));const{_active:l,_lastEvent:a}=this;a?this._eventHandler(a,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){X(this.scales,t=>{xt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Mh(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:r,count:s}of n){const o=i==="_removeElements"?-s:s;aE(t,r,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=s=>new Set(t.filter(o=>o[0]===s).map((o,l)=>l+","+o.splice(1).join(","))),r=i(0);for(let s=1;ss.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;xt.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],X(this.boxes,r=>{i&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,s)=>{r._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,i=t._clip,r=!i.disabled,s=cE(t)||this.chartArea,o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(r&&ql(n,{left:i.left===!1?0:s.left-i.left,right:i.right===!1?this.width:s.right+i.right,top:i.top===!1?0:s.top-i.top,bottom:i.bottom===!1?this.height:s.bottom+i.bottom}),t.controller.draw(),r&&Yl(n),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return Jt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,r){const s=o2.modes[n];return typeof s=="function"?s(this,t,i,r):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let r=i.filter(s=>s&&s._dataset===n).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},i.push(r)),r}getContext(){return this.$context||(this.$context=Hn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){const i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){const r=i?"show":"hide",s=this.getDatasetMeta(t),o=s.controller._resolveAnimations(void 0,r);ul(n)?(s.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(s,{visible:i}),this.update(l=>l.datasetIndex===t?r:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),Ut.remove(this),t=0,n=this.data.datasets.length;t{n.addEventListener(this,s,o),t[s]=o},r=(s,o,l)=>{s.offsetX=o,s.offsetY=l,this._eventHandler(s)};X(this.options.events,s=>i(s,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,i=(a,u)=>{n.addEventListener(this,a,u),t[a]=u},r=(a,u)=>{t[a]&&(n.removeEventListener(this,a,u),delete t[a])},s=(a,u)=>{this.canvas&&this.resize(a,u)};let o;const l=()=>{r("attach",l),this.attached=!0,this.resize(),i("resize",s),i("detach",o)};o=()=>{this.attached=!1,r("resize",s),this._stop(),this._resize(0,0),i("attach",l)},n.isAttached(this.canvas)?l():o()}unbindEvents(){X(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},X(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const r=i?"set":"remove";let s,o,l,a;for(n==="dataset"&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+r+"DatasetHoverStyle"]()),l=0,a=t.length;l{const l=this.getDatasetMeta(s);if(!l)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:l.data[o],index:o}});!ol(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,i){const r=this.options.hover,s=(a,u)=>a.filter(c=>!u.some(d=>c.datasetIndex===d.datasetIndex&&c.index===d.index)),o=s(n,t),l=i?t:s(t,n);o.length&&this.updateHoverStyle(o,r.mode,!1),l.length&&r.mode&&this.updateHoverStyle(l,r.mode,!0)}_eventHandler(t,n){const i={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},r=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,r)===!1)return;const s=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,r),(s||i.changed)&&this.render(),this}_handleEvent(t,n,i){const{_active:r=[],options:s}=this,o=n,l=this._getActiveElements(t,r,i,o),a=ES(t),u=uE(t,this._lastEvent,i,a);i&&(this._lastEvent=null,ee(s.onHover,[t,l,this],this),a&&ee(s.onClick,[t,l,this],this));const c=!ol(l,r);return(c||n)&&(this._active=l,this._updateHoverStyles(l,r,n)),this._lastEvent=u,c}_getActiveElements(t,n,i,r){if(t.type==="mouseout")return[];if(!i)return n;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,r)}},I(hn,"defaults",me),I(hn,"instances",Po),I(hn,"overrides",mi),I(hn,"registry",Ft),I(hn,"version",sE),I(hn,"getChart",yp),hn);function vp(){return X(Ql.instances,e=>e._plugins.invalidate())}function Ty(e,t,n=t){e.lineCap=W(n.borderCapStyle,t.borderCapStyle),e.setLineDash(W(n.borderDash,t.borderDash)),e.lineDashOffset=W(n.borderDashOffset,t.borderDashOffset),e.lineJoin=W(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=W(n.borderWidth,t.borderWidth),e.strokeStyle=W(n.borderColor,t.borderColor)}function dE(e,t,n){e.lineTo(n.x,n.y)}function fE(e){return e.stepped?GS:e.tension||e.cubicInterpolationMode==="monotone"?JS:dE}function Oy(e,t,n={}){const i=e.length,{start:r=0,end:s=i-1}=n,{start:o,end:l}=t,a=Math.max(r,o),u=Math.min(s,l),c=rl&&s>l;return{count:i,start:a,loop:t.loop,ilen:u(o+(u?l-_:_))%s,x=()=>{g!==v&&(e.lineTo(c,v),e.lineTo(c,g),e.lineTo(c,y))};for(a&&(p=r[m(0)],e.moveTo(p.x,p.y)),f=0;f<=l;++f){if(p=r[m(f)],p.skip)continue;const _=p.x,S=p.y,k=_|0;k===h?(Sv&&(v=S),c=(d*c+_)/++d):(x(),e.lineTo(_,S),h=k,d=0,g=v=S),y=S}x()}function dc(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?pE:hE}function mE(e){return e.stepped?Lk:e.tension||e.cubicInterpolationMode==="monotone"?Rk:Zn}function gE(e,t,n,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,n,i)&&r.closePath()),Ty(e,t.options),e.stroke(r)}function yE(e,t,n,i){const{segments:r,options:s}=t,o=dc(t);for(const l of r)Ty(e,s,l.style),e.beginPath(),o(e,t,l,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const vE=typeof Path2D=="function";function xE(e,t,n,i){vE&&!t.options.segment?gE(e,t,n,i):yE(e,t,n,i)}class En extends an{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const r=i.spanGaps?this._loop:this._fullLoop;Sk(this._points,i,t,r,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=jk(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){const i=this.options,r=t[n],s=this.points,o=gy(this,{property:n,start:r,end:r});if(!o.length)return;const l=[],a=mE(i);let u,c;for(u=0,c=o.length;ut!=="borderDash"&&t!=="fill"});function xp(e,t,n,i){const r=e.options,{[n]:s}=e.getProps([n],i);return Math.abs(t-s){l=$d(o,l,r);const a=r[o],u=r[l];i!==null?(s.push({x:a.x,y:i}),s.push({x:u.x,y:i})):n!==null&&(s.push({x:n,y:a.y}),s.push({x:n,y:u.y}))}),s}function $d(e,t,n){for(;t>e;t--){const i=n[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function wp(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function My(e,t){let n=[],i=!1;return oe(e)?(i=!0,n=e):n=_E(e,t),n.length?new En({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function _p(e){return e&&e.fill!==!1}function bE(e,t,n){let r=e[t].fill;const s=[t];let o;if(!n)return r;for(;r!==!1&&s.indexOf(r)===-1;){if(!pe(r))return r;if(o=e[r],!o)return!1;if(o.visible)return r;s.push(r),r=o.fill}return!1}function SE(e,t,n){const i=PE(e);if(K(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return pe(r)&&Math.floor(r)===r?kE(i[0],t,r,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function kE(e,t,n,i){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=i?!1:n}function EE(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:K(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function CE(e,t,n){let i;return e==="start"?i=n:e==="end"?i=t.options.reverse?t.min:t.max:K(e)?i=e.value:i=t.getBaseValue(),i}function PE(e){const t=e.options,n=t.fill;let i=W(n&&n.target,n);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function TE(e){const{scale:t,index:n,line:i}=e,r=[],s=i.segments,o=i.points,l=OE(t,n);l.push(My({x:null,y:t.bottom},i));for(let a=0;a=0;--o){const l=r[o].$filler;l&&(l.line.updateControlPoints(s,l.axis),i&&l.fill&&Ka(e.ctx,l,s))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const i=e.getSortedVisibleDatasetMetas();for(let r=i.length-1;r>=0;--r){const s=i[r].$filler;_p(s)&&Ka(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,n){const i=t.meta.$filler;!_p(i)||n.drawTime!=="beforeDatasetDraw"||Ka(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Ep=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}},$E=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Cp extends an{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,i){this.maxWidth=t,this.maxHeight=n,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=ee(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,r)=>t.sort(i,r,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,r=Se(i.font),s=r.size,o=this._computeTitleHeight(),{boxWidth:l,itemHeight:a}=Ep(i,s);let u,c;n.font=r.string,this.isHorizontal()?(u=this.maxWidth,c=this._fitRows(o,s,l,a)+10):(c=this.maxHeight,u=this._fitCols(o,r,l,a)+10),this.width=Math.min(u,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,r){const{ctx:s,maxWidth:o,options:{labels:{padding:l}}}=this,a=this.legendHitBoxes=[],u=this.lineWidths=[0],c=r+l;let d=t;s.textAlign="left",s.textBaseline="middle";let f=-1,p=-c;return this.legendItems.forEach((h,g)=>{const v=i+n/2+s.measureText(h.text).width;(g===0||u[u.length-1]+v+2*l>o)&&(d+=c,u[u.length-(g>0?0:1)]=0,p+=c,f++),a[g]={left:0,top:p,row:f,width:v,height:r},u[u.length-1]+=v+l}),d}_fitCols(t,n,i,r){const{ctx:s,maxHeight:o,options:{labels:{padding:l}}}=this,a=this.legendHitBoxes=[],u=this.columnSizes=[],c=o-t;let d=l,f=0,p=0,h=0,g=0;return this.legendItems.forEach((v,y)=>{const{itemWidth:m,itemHeight:x}=BE(i,n,s,v,r);y>0&&p+x+2*l>c&&(d+=f+l,u.push({width:f,height:p}),h+=f+l,g++,f=p=0),a[y]={left:h,top:p,col:g,width:m,height:x},f=Math.max(f,m),p+=x+l}),d+=f,u.push({width:f,height:p}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:r},rtl:s}}=this,o=Hi(s,this.left,this.width);if(this.isHorizontal()){let l=0,a=$e(i,this.left+r,this.right-this.lineWidths[l]);for(const u of n)l!==u.row&&(l=u.row,a=$e(i,this.left+r,this.right-this.lineWidths[l])),u.top+=this.top+t+r,u.left=o.leftForLtr(o.x(a),u.width),a+=u.width+r}else{let l=0,a=$e(i,this.top+t+r,this.bottom-this.columnSizes[l].height);for(const u of n)u.col!==l&&(l=u.col,a=$e(i,this.top+t+r,this.bottom-this.columnSizes[l].height)),u.top=a,u.left+=this.left+r,u.left=o.leftForLtr(o.x(u.left),u.width),a+=u.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;ql(t,this),this._draw(),Yl(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:r}=this,{align:s,labels:o}=t,l=me.color,a=Hi(t.rtl,this.left,this.width),u=Se(o.font),{padding:c}=o,d=u.size,f=d/2;let p;this.drawTitle(),r.textAlign=a.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=u.string;const{boxWidth:h,boxHeight:g,itemHeight:v}=Ep(o,d),y=function(k,C,E){if(isNaN(h)||h<=0||isNaN(g)||g<0)return;r.save();const T=W(E.lineWidth,1);if(r.fillStyle=W(E.fillStyle,l),r.lineCap=W(E.lineCap,"butt"),r.lineDashOffset=W(E.lineDashOffset,0),r.lineJoin=W(E.lineJoin,"miter"),r.lineWidth=T,r.strokeStyle=W(E.strokeStyle,l),r.setLineDash(W(E.lineDash,[])),o.usePointStyle){const M={radius:g*Math.SQRT2/2,pointStyle:E.pointStyle,rotation:E.rotation,borderWidth:T},R=a.xPlus(k,h/2),F=C+f;ry(r,M,R,F,o.pointStyleWidth&&h)}else{const M=C+Math.max((d-g)/2,0),R=a.leftForLtr(k,h),F=Bi(E.borderRadius);r.beginPath(),Object.values(F).some(B=>B!==0)?fl(r,{x:R,y:M,w:h,h:g,radius:F}):r.rect(R,M,h,g),r.fill(),T!==0&&r.stroke()}r.restore()},m=function(k,C,E){gi(r,E.text,k,C+v/2,u,{strikethrough:E.hidden,textAlign:a.textAlign(E.textAlign)})},x=this.isHorizontal(),_=this._computeTitleHeight();x?p={x:$e(s,this.left+c,this.right-i[0]),y:this.top+c+_,line:0}:p={x:this.left+c,y:$e(s,this.top+_+c,this.bottom-n[0].height),line:0},fy(this.ctx,t.textDirection);const S=v+c;this.legendItems.forEach((k,C)=>{r.strokeStyle=k.fontColor,r.fillStyle=k.fontColor;const E=r.measureText(k.text).width,T=a.textAlign(k.textAlign||(k.textAlign=o.textAlign)),M=h+f+E;let R=p.x,F=p.y;a.setWidth(this.width),x?C>0&&R+M+c>this.right&&(F=p.y+=S,p.line++,R=p.x=$e(s,this.left+c,this.right-i[p.line])):C>0&&F+S>this.bottom&&(R=p.x=R+n[p.line].width+c,p.line++,F=p.y=$e(s,this.top+_+c,this.bottom-n[p.line].height));const B=a.x(R);if(y(B,F,k),R=jS(T,R+h+f,x?R+M:this.right,t.rtl),m(a.x(R),F,k),x)p.x+=M+c;else if(typeof k.text!="string"){const J=u.lineHeight;p.y+=Ry(k,J)}else p.y+=S}),hy(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=Se(n.font),r=Ue(n.padding);if(!n.display)return;const s=Hi(t.rtl,this.left,this.width),o=this.ctx,l=n.position,a=i.size/2,u=r.top+a;let c,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),c=this.top+u,d=$e(t.align,d,this.right-f);else{const h=this.columnSizes.reduce((g,v)=>Math.max(g,v.height),0);c=u+$e(t.align,this.top,this.bottom-h-t.labels.padding-this._computeTitleHeight())}const p=$e(l,d,d+f);o.textAlign=s.textAlign(Rd(l)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=i.string,gi(o,n.text,p,c,i)}_computeTitleHeight(){const t=this.options.title,n=Se(t.font),i=Ue(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,r,s;if(Ni(t,this.left,this.right)&&Ni(n,this.top,this.bottom)){for(s=this.legendHitBoxes,i=0;is.length>o.length?s:o)),t+n.size/2+i.measureText(r).width}function UE(e,t,n){let i=e;return typeof t.text!="string"&&(i=Ry(t,n)),i}function Ry(e,t){const n=e.text?e.text.length+.5:0;return t*n}function VE(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var WE={id:"legend",_element:Cp,start(e,t,n){const i=e.legend=new Cp({ctx:e.ctx,options:n,chart:e});xt.configure(e,i,n),xt.addBox(e,i)},stop(e){xt.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const i=e.legend;xt.configure(e,i,n),i.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const i=t.datasetIndex,r=n.chart;r.isDatasetVisible(i)?(r.hide(i),t.hidden=!0):(r.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:r,color:s,useBorderRadius:o,borderRadius:l}}=e.legend.options;return e._getSortedDatasetMetas().map(a=>{const u=a.controller.getStyle(n?0:void 0),c=Ue(u.borderWidth);return{text:t[a.index].label,fillStyle:u.backgroundColor,fontColor:s,hidden:!a.visible,lineCap:u.borderCapStyle,lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:u.borderColor,pointStyle:i||u.pointStyle,rotation:u.rotation,textAlign:r||u.textAlign,borderRadius:o&&(l||u.borderRadius),datasetIndex:a.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class Dy extends an{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const r=oe(i.text)?i.text.length:1;this._padding=Ue(i.padding);const s=r*Se(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:i,bottom:r,right:s,options:o}=this,l=o.align;let a=0,u,c,d;return this.isHorizontal()?(c=$e(l,i,s),d=n+t,u=s-i):(o.position==="left"?(c=i+t,d=$e(l,r,n),a=Ee*-.5):(c=s-t,d=$e(l,n,r),a=Ee*.5),u=r-n),{titleX:c,titleY:d,maxWidth:u,rotation:a}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const i=Se(n.font),s=i.lineHeight/2+this._padding.top,{titleX:o,titleY:l,maxWidth:a,rotation:u}=this._drawArgs(s);gi(t,n.text,0,0,i,{color:n.color,maxWidth:a,rotation:u,textAlign:Rd(n.align),textBaseline:"middle",translation:[o,l]})}}function qE(e,t){const n=new Dy({ctx:e.ctx,options:t,chart:e});xt.configure(e,n,t),xt.addBox(e,n),e.titleBlock=n}var YE={id:"title",_element:Dy,start(e,t,n){qE(e,n)},stop(e){const t=e.titleBlock;xt.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;xt.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Nr={average(e){if(!e.length)return!1;let t,n,i=0,r=0,s=0;for(t=0,n=e.length;tl({chart:t,initial:n.initial,numSteps:o,currentStep:Math.min(i-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=ty.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,r)=>{if(!i.running||!i.items.length)return;const s=i.items;let o=s.length-1,l=!1,a;for(;o>=0;--o)a=s[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(t),l=!0):(s[o]=s[s.length-1],s.pop());l&&(r.draw(),this._notify(r,i,t,"progress")),s.length||(i.running=!1,this._notify(r,i,t,"complete"),i.initial=!1),n+=s.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((i,r)=>Math.max(i,r._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const i=n.items;let r=i.length-1;for(;r>=0;--r)i[r].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Ut=new Bk;const Yh="transparent",Hk={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=Ih(e||Yh),r=i.valid&&Ih(t||Yh);return r&&r.valid?r.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class Uk{constructor(t,n,i,r){const s=n[i];r=io([t.to,r,s,t.from]);const o=io([t.from,s,r]);this._active=!0,this._fn=t.fn||Hk[t.type||typeof o],this._easing=Qr[t.easing]||Qr.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=i,this._from=o,this._to=r,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);const r=this._target[this._prop],s=i-this._start,o=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=io([t.to,n,r,t.from]),this._from=io([t.from,r,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,i=this._duration,r=this._prop,s=this._from,o=this._loop,l=this._to;let a;if(this._active=s!==l&&(o||n1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[r]=this._fn(s,l,a)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){const n=t?"res":"rej",i=this._promises||[];for(let r=0;r{const s=t[r];if(!K(s))return;const o={};for(const l of n)o[l]=s[l];(oe(s.properties)&&s.properties||[r]).forEach(l=>{(l===r||!i.has(l))&&i.set(l,o)})})}_animateOptions(t,n){const i=n.options,r=Vk(t,i);if(!r)return[];const s=this._createAnimations(r,i);return i.$shared&&Wk(t.options.$animations,i).then(()=>{t.options=i},()=>{}),s}_createAnimations(t,n){const i=this._properties,r=[],s=t.$animations||(t.$animations={}),o=Object.keys(n),l=Date.now();let a;for(a=o.length-1;a>=0;--a){const u=o[a];if(u.charAt(0)==="$")continue;if(u==="options"){r.push(...this._animateOptions(t,n));continue}const c=n[u];let d=s[u];const f=i.get(u);if(d)if(f&&d.active()){d.update(f,c,l);continue}else d.cancel();if(!f||!f.duration){t[u]=c;continue}s[u]=d=new Uk(f,t,u,c),r.push(d)}return r}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return Ut.add(this._chart,i),!0}}function Wk(e,t){const n=[],i=Object.keys(t);for(let r=0;r0||!n&&s<0)return r.index}return null}function Jh(e,t){const{chart:n,_cachedMeta:i}=e,r=n._stacks||(n._stacks={}),{iScale:s,vScale:o,index:l}=i,a=s.axis,u=o.axis,c=Qk(s,o,i),d=t.length;let f;for(let p=0;pn[i].axis===t).shift()}function Jk(e,t){return Hn(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Zk(e,t,n){return Hn(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function br(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const r of t){const s=r._stacks;if(!s||s[i]===void 0||s[i][n]===void 0)return;delete s[i][n],s[i]._visualValues!==void 0&&s[i]._visualValues[n]!==void 0&&delete s[i]._visualValues[n]}}}const Va=e=>e==="reset"||e==="none",Zh=(e,t)=>t?e:Object.assign({},e),e2=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:vy(n,!0),values:null};class Gr{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Xh(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&br(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),r=(d,f,p,h)=>d==="x"?f:d==="r"?h:p,s=n.xAxisID=V(i.xAxisID,Wa(t,"x")),o=n.yAxisID=V(i.yAxisID,Wa(t,"y")),l=n.rAxisID=V(i.rAxisID,Wa(t,"r")),a=n.indexAxis,u=n.iAxisID=r(a,s,o,l),c=n.vAxisID=r(a,o,s,l);n.xScale=this.getScaleForId(s),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(l),n.iScale=this.getScaleForId(u),n.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Nh(this._data,this),t._stacked&&br(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(K(n))this._data=Kk(n);else if(i!==n){if(i){Nh(i,this);const r=this._cachedMeta;br(r),r._parsed=[]}n&&Object.isExtensible(n)&&FS(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,i=this.getDataset();let r=!1;this._dataCheck();const s=n._stacked;n._stacked=Xh(n.vScale,n),n.stack!==i.stack&&(r=!0,br(n),n.stack=i.stack),this._resyncElements(t),(r||s!==n._stacked)&&Jh(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:i,_data:r}=this,{iScale:s,_stacked:o}=i,l=s.axis;let a=t===0&&n===r.length?!0:i._sorted,u=t>0&&i._parsed[t-1],c,d,f;if(this._parsing===!1)i._parsed=r,i._sorted=!0,f=r;else{oe(r[t])?f=this.parseArrayData(i,r,t,n):K(r[t])?f=this.parseObjectData(i,r,t,n):f=this.parsePrimitiveData(i,r,t,n);const p=()=>d[l]===null||u&&d[l]g||d=0;--f)if(!h()){this.updateRangeFromParsed(u,t,p,a);break}}return u}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let r,s,o;for(r=0,s=n.length;r=0&&tthis.getContext(i,r,n),g=u.resolveNamedOptions(f,p,h,d);return g.$shared&&(g.$shared=a,s[o]=Object.freeze(Zh(g,a))),g}_resolveAnimations(t,n,i){const r=this.chart,s=this._cachedDataOpts,o=`animation-${n}`,l=s[o];if(l)return l;let a;if(r.options.animation!==!1){const c=this.chart.config,d=c.datasetAnimationScopeKeys(this._type,n),f=c.getOptionScopes(this.getDataset(),d);a=c.createResolver(f,this.getContext(t,i,n))}const u=new yy(r,a&&a.animations);return a&&a._cacheable&&(s[o]=Object.freeze(u)),u}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Va(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const i=this.resolveDataElementOptions(t,n),r=this._sharedOptions,s=this.getSharedOptions(i),o=this.includeOptions(n,s)||s!==r;return this.updateSharedOptions(s,n,i),{sharedOptions:s,includeOptions:o}}updateElement(t,n,i,r){Va(r)?Object.assign(t,i):this._resolveAnimations(n,r).update(t,i)}updateSharedOptions(t,n,i){t&&!Va(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,r){t.active=r;const s=this.getStyle(n,r);this._resolveAnimations(n,i,r).update(t,{options:!r&&this.getSharedOptions(s)||s})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,i=this._cachedMeta.data;for(const[l,a,u]of this._syncList)this[l](a,u);this._syncList=[];const r=i.length,s=n.length,o=Math.min(s,r);o&&this.parse(0,o),s>r?this._insertElements(r,s-r,t):s{for(u.length+=n,l=u.length-1;l>=o;l--)u[l]=u[l-n]};for(a(s),l=t;l0&&this.getParsed(n-1);for(let S=0;S=m){E.skip=!0;continue}const k=this.getParsed(S),L=ie(k[p]),M=E[f]=o.getPixelForValue(k[f],S),R=E[p]=s||L?l.getBasePixel():l.getPixelForValue(a?this.applyStack(l,k,a):k[p],S);E.skip=isNaN(M)||isNaN(R)||L,E.stop=S>0&&Math.abs(k[f]-_[f])>v,g&&(E.parsed=k,E.raw=u.data[S]),d&&(E.options=c||this.resolveDataElementOptions(S,C.active?"active":r)),y||this.updateElement(C,S,E,r),_=k}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,r=t.data||[];if(!r.length)return i;const s=r[0].size(this.resolveDataElementOptions(0)),o=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(i,s,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}I(Co,"id","line"),I(Co,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),I(Co,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function Kn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class zd{constructor(t){I(this,"options");this.options=t||{}}static override(t){Object.assign(zd.prototype,t)}init(){}formats(){return Kn()}parse(){return Kn()}format(){return Kn()}add(){return Kn()}diff(){return Kn()}startOf(){return Kn()}endOf(){return Kn()}}var t2={_date:zd};function n2(e,t,n,i){const{controller:r,data:s,_sorted:o}=e,l=r._cachedMeta.iScale;if(l&&t===l.axis&&t!=="r"&&o&&s.length){const a=l._reversePixels?DS:si;if(i){if(r._sharedOptions){const u=s[0],c=typeof u.getRange=="function"&&u.getRange(t);if(c){const d=a(s,t,n-c),f=a(s,t,n+c);return{lo:d.lo,hi:f.hi}}}}else return a(s,t,n)}return{lo:0,hi:s.length-1}}function Rs(e,t,n,i,r){const s=e.getSortedVisibleDatasetMetas(),o=n[t];for(let l=0,a=s.length;l{a[o](t[n],r)&&(s.push({element:a,datasetIndex:u,index:c}),l=l||a.inRange(t.x,t.y,r))}),i&&!l?[]:s}var o2={evaluateInteractionItems:Rs,modes:{index(e,t,n,i){const r=Jn(t,e),s=n.axis||"x",o=n.includeInvisible||!1,l=n.intersect?qa(e,r,s,i,o):Ya(e,r,s,!1,i,o),a=[];return l.length?(e.getSortedVisibleDatasetMetas().forEach(u=>{const c=l[0].index,d=u.data[c];d&&!d.skip&&a.push({element:d,datasetIndex:u.index,index:c})}),a):[]},dataset(e,t,n,i){const r=Jn(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;let l=n.intersect?qa(e,r,s,i,o):Ya(e,r,s,!1,i,o);if(l.length>0){const a=l[0].datasetIndex,u=e.getDatasetMeta(a).data;l=[];for(let c=0;cn.pos===t)}function tp(e,t){return e.filter(n=>xy.indexOf(n.pos)===-1&&n.box.axis===t)}function kr(e,t){return e.sort((n,i)=>{const r=t?i:n,s=t?n:i;return r.weight===s.weight?r.index-s.index:r.weight-s.weight})}function l2(e){const t=[];let n,i,r,s,o,l;for(n=0,i=(e||[]).length;nu.box.fullSize),!0),i=kr(Sr(t,"left"),!0),r=kr(Sr(t,"right")),s=kr(Sr(t,"top"),!0),o=kr(Sr(t,"bottom")),l=tp(t,"x"),a=tp(t,"y");return{fullSize:n,leftAndTop:i.concat(s),rightAndBottom:r.concat(a).concat(o).concat(l),chartArea:Sr(t,"chartArea"),vertical:i.concat(r).concat(a),horizontal:s.concat(o).concat(l)}}function np(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function wy(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function d2(e,t,n,i){const{pos:r,box:s}=n,o=e.maxPadding;if(!K(r)){n.size&&(e[r]-=n.size);const d=i[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?s.height:s.width),n.size=d.size/d.count,e[r]+=n.size}s.getPadding&&wy(o,s.getPadding());const l=Math.max(0,t.outerWidth-np(o,e,"left","right")),a=Math.max(0,t.outerHeight-np(o,e,"top","bottom")),u=l!==e.w,c=a!==e.h;return e.w=l,e.h=a,n.horizontal?{same:u,other:c}:{same:c,other:u}}function f2(e){const t=e.maxPadding;function n(i){const r=Math.max(t[i]-e[i],0);return e[i]+=r,r}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function h2(e,t){const n=t.maxPadding;function i(r){const s={left:0,top:0,right:0,bottom:0};return r.forEach(o=>{s[o]=Math.max(t[o],n[o])}),s}return i(e?["left","right"]:["top","bottom"])}function Nr(e,t,n,i){const r=[];let s,o,l,a,u,c;for(s=0,o=e.length,u=0;s{typeof g.beforeLayout=="function"&&g.beforeLayout()});const c=a.reduce((g,v)=>v.box.options&&v.box.options.display===!1?g:g+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:r,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/c,hBoxMaxHeight:o/2}),f=Object.assign({},r);wy(f,Ue(i));const p=Object.assign({maxPadding:f,w:s,h:o,x:r.left,y:r.top},r),h=u2(a.concat(u),d);Nr(l.fullSize,p,d,h),Nr(a,p,d,h),Nr(u,p,d,h)&&Nr(a,p,d,h),f2(p),ip(l.leftAndTop,p,d,h),p.x+=p.w,p.y+=p.h,ip(l.rightAndBottom,p,d,h),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},J(l.chartArea,g=>{const v=g.box;Object.assign(v,e.chartArea),v.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class _y{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,r){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,r?Math.floor(n/r):i)}}isAttached(t){return!0}updateConfig(t){}}class p2 extends _y{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Po="$chartjs",m2={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},rp=e=>e===null||e==="";function g2(e,t){const n=e.style,i=e.getAttribute("height"),r=e.getAttribute("width");if(e[Po]={initial:{height:i,width:r,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",rp(r)){const s=Uh(e,"width");s!==void 0&&(e.width=s)}if(rp(i))if(e.style.height==="")e.height=e.width/(t||2);else{const s=Uh(e,"height");s!==void 0&&(e.height=s)}return e}const by=Mk?{passive:!0}:!1;function y2(e,t,n){e.addEventListener(t,n,by)}function v2(e,t,n){e.canvas.removeEventListener(t,n,by)}function x2(e,t){const n=m2[e.type]||e.type,{x:i,y:r}=Jn(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:r!==void 0?r:null}}function ml(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function w2(e,t,n){const i=e.canvas,r=new MutationObserver(s=>{let o=!1;for(const l of s)o=o||ml(l.addedNodes,i),o=o&&!ml(l.removedNodes,i);o&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}function _2(e,t,n){const i=e.canvas,r=new MutationObserver(s=>{let o=!1;for(const l of s)o=o||ml(l.removedNodes,i),o=o&&!ml(l.addedNodes,i);o&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}const ws=new Map;let sp=0;function Sy(){const e=window.devicePixelRatio;e!==sp&&(sp=e,ws.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function b2(e,t){ws.size||window.addEventListener("resize",Sy),ws.set(e,t)}function S2(e){ws.delete(e),ws.size||window.removeEventListener("resize",Sy)}function k2(e,t,n){const i=e.canvas,r=i&&jd(i);if(!r)return;const s=ny((l,a)=>{const u=r.clientWidth;n(l,a),u{const a=l[0],u=a.contentRect.width,c=a.contentRect.height;u===0&&c===0||s(u,c)});return o.observe(r),b2(e,s),o}function Ka(e,t,n){n&&n.disconnect(),t==="resize"&&S2(e)}function E2(e,t,n){const i=e.canvas,r=ny(s=>{e.ctx!==null&&n(x2(s,e))},e);return y2(i,t,r),r}class C2 extends _y{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(g2(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[Po])return!1;const i=n[Po].initial;["height","width"].forEach(s=>{const o=i[s];ie(o)?n.removeAttribute(s):n.setAttribute(s,o)});const r=i.style||{};return Object.keys(r).forEach(s=>{n.style[s]=r[s]}),n.width=n.width,delete n[Po],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const r=t.$proxies||(t.$proxies={}),o={attach:w2,detach:_2,resize:k2}[n]||E2;r[n]=o(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),r=i[n];if(!r)return;({attach:Ka,detach:Ka,resize:Ka}[n]||v2)(t,n,r),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,r){return Ok(t,n,i,r)}isAttached(t){const n=jd(t);return!!(n&&n.isConnected)}}function P2(e){return!dy()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?p2:C2}class an{constructor(){I(this,"x");I(this,"y");I(this,"active",!1);I(this,"options");I(this,"$animations")}tooltipPosition(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return xs(this.x)&&xs(this.y)}getProps(t,n){const i=this.$animations;if(!n||!i)return this;const r={};return t.forEach(s=>{r[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),r}}I(an,"defaults",{}),I(an,"defaultRoutes");function T2(e,t){const n=e.options.ticks,i=O2(e),r=Math.min(n.maxTicksLimit||i,i),s=n.major.enabled?L2(t):[],o=s.length,l=s[0],a=s[o-1],u=[];if(o>r)return R2(t,u,s,o/r),u;const c=M2(s,t,r);if(o>0){let d,f;const p=o>1?Math.round((a-l)/(o-1)):null;for(lo(t,u,c,ie(p)?0:l-p,l),d=0,f=o-1;dr)return a}return Math.max(r,1)}function L2(e){const t=[];let n,i;for(n=0,i=e.length;ne==="left"?"right":e==="right"?"left":e,op=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,lp=(e,t)=>Math.min(t||e,e);function ap(e,t){const n=[],i=e.length/t,r=e.length;let s=0;for(;so+l)))return a}function A2(e,t){J(e,n=>{const i=n.gc,r=i.length/2;let s;if(r>t){for(s=0;si?i:n,i=r&&n>i?n:i,{min:rt(n,rt(i,n)),max:rt(i,rt(n,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){ee(this.options.beforeUpdate,[this])}update(t,n,i){const{beginAtZero:r,grace:s,ticks:o}=this.options,l=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=lk(this,s,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=l=s||i<=1||!this.isHorizontal()){this.labelRotation=r;return}const c=this._getLabelSizes(),d=c.widest.width,f=c.highest.height,p=vt(this.chart.width-d,0,this.maxWidth);l=t.offset?this.maxWidth/i:p/(i-1),d+6>l&&(l=p/(i-(t.offset?.5:1)),a=this.maxHeight-Er(t.grid)-n.padding-up(t.title,this.chart.options.font),u=Math.sqrt(d*d+f*f),o=Md(Math.min(Math.asin(vt((c.highest.height+6)/l,-1,1)),Math.asin(vt(a/u,-1,1))-Math.asin(vt(f/u,-1,1)))),o=Math.max(r,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){ee(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ee(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:r,grid:s}}=this,o=this._isVisible(),l=this.isHorizontal();if(o){const a=up(r,n.options.font);if(l?(t.width=this.maxWidth,t.height=Er(s)+a):(t.height=this.maxHeight,t.width=Er(s)+a),i.display&&this.ticks.length){const{first:u,last:c,widest:d,highest:f}=this._getLabelSizes(),p=i.padding*2,h=kn(this.labelRotation),g=Math.cos(h),v=Math.sin(h);if(l){const y=i.mirror?0:v*d.width+g*f.height;t.height=Math.min(this.maxHeight,t.height+y+p)}else{const y=i.mirror?0:g*d.width+v*f.height;t.width=Math.min(this.maxWidth,t.width+y+p)}this._calculatePadding(u,c,v,g)}}this._handleMargins(),l?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,i,r){const{ticks:{align:s,padding:o},position:l}=this.options,a=this.labelRotation!==0,u=l!=="top"&&this.axis==="x";if(this.isHorizontal()){const c=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,p=0;a?u?(f=r*t.width,p=i*n.height):(f=i*t.height,p=r*n.width):s==="start"?p=n.width:s==="end"?f=t.width:s!=="inner"&&(f=t.width/2,p=n.width/2),this.paddingLeft=Math.max((f-c+o)*this.width/(this.width-c),0),this.paddingRight=Math.max((p-d+o)*this.width/(this.width-d),0)}else{let c=n.height/2,d=t.height/2;s==="start"?(c=0,d=t.height):s==="end"&&(c=n.height,d=0),this.paddingTop=c+o,this.paddingBottom=d+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){ee(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,i;for(n=0,i=t.length;n({width:o[L]||0,height:l[L]||0});return{first:k(0),last:k(n-1),widest:k(C),highest:k(E),widths:o,heights:l}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return RS(this._alignToPixels?Yn(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&tl*r?l/i:a/r:a*r0}_computeGridLineItems(t){const n=this.axis,i=this.chart,r=this.options,{grid:s,position:o,border:l}=r,a=s.offset,u=this.isHorizontal(),d=this.ticks.length+(a?1:0),f=Er(s),p=[],h=l.setContext(this.getContext()),g=h.display?h.width:0,v=g/2,y=function(U){return Yn(i,U,g)};let m,x,_,S,C,E,k,L,M,R,N,$;if(o==="top")m=y(this.bottom),E=this.bottom-f,L=m-v,R=y(t.top)+v,$=t.bottom;else if(o==="bottom")m=y(this.top),R=t.top,$=y(t.bottom)-v,E=m+v,L=this.top+f;else if(o==="left")m=y(this.right),C=this.right-f,k=m-v,M=y(t.left)+v,N=t.right;else if(o==="right")m=y(this.left),M=t.left,N=y(t.right)-v,C=m+v,k=this.left+f;else if(n==="x"){if(o==="center")m=y((t.top+t.bottom)/2+.5);else if(K(o)){const U=Object.keys(o)[0],G=o[U];m=y(this.chart.scales[U].getPixelForValue(G))}R=t.top,$=t.bottom,E=m+v,L=E+f}else if(n==="y"){if(o==="center")m=y((t.left+t.right)/2);else if(K(o)){const U=Object.keys(o)[0],G=o[U];m=y(this.chart.scales[U].getPixelForValue(G))}C=m-v,k=C-f,M=t.left,N=t.right}const X=V(r.ticks.maxTicksLimit,d),j=Math.max(1,Math.ceil(d/X));for(x=0;xs.value===t);return r>=0?n.setContext(this.getContext(r)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,o;const l=(a,u,c)=>{!c.width||!c.color||(i.save(),i.lineWidth=c.width,i.strokeStyle=c.color,i.setLineDash(c.borderDash||[]),i.lineDashOffset=c.borderDashOffset,i.beginPath(),i.moveTo(a.x,a.y),i.lineTo(u.x,u.y),i.stroke(),i.restore())};if(n.display)for(s=0,o=r.length;s{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",r=[];let s,o;for(s=0,o=n.length;s{const i=n.split("."),r=i.pop(),s=[e].concat(i).join("."),o=t[n].split("."),l=o.pop(),a=o.join(".");me.route(s,r,a,l)})}function U2(e){return"id"in e&&"defaults"in e}class W2{constructor(){this.controllers=new ao(Gr,"datasets",!0),this.elements=new ao(an,"elements"),this.plugins=new ao(Object,"plugins"),this.scales=new ao(xi,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,i){[...n].forEach(r=>{const s=i||this._getRegistryForType(r);i||s.isForType(r)||s===this.plugins&&r.id?this._exec(t,s,r):J(r,o=>{const l=i||this._getRegistryForType(o);this._exec(t,l,o)})})}_exec(t,n,i){const r=Od(t);ee(i["before"+r],[],i),n[t](i),ee(i["after"+r],[],i)}_getRegistryForType(t){for(let n=0;ns.filter(l=>!o.some(a=>l.plugin.id===a.plugin.id));this._notify(r(n,i),t,"stop"),this._notify(r(i,n),t,"start")}}function q2(e){const t={},n=[],i=Object.keys(Ft.plugins.items);for(let s=0;s1&&cp(e[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function dp(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function Z2(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(i=>i.xAxisID===e||i.yAxisID===e);if(n.length)return dp(e,"x",n[0])||dp(e,"y",n[0])}return{}}function eE(e,t){const n=mi[e.type]||{scales:{}},i=t.scales||{},r=cc(e.type,t),s=Object.create(null);return Object.keys(i).forEach(o=>{const l=i[o];if(!K(l))return console.error(`Invalid scale configuration for scale: ${o}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const a=dc(o,l,Z2(o,e),me.scales[l.type]),u=G2(a,r),c=n.scales||{};s[o]=Yr(Object.create(null),[{axis:a},l,c[a],c[u]])}),e.data.datasets.forEach(o=>{const l=o.type||e.type,a=o.indexAxis||cc(l,t),c=(mi[l]||{}).scales||{};Object.keys(c).forEach(d=>{const f=X2(d,a),p=o[f+"AxisID"]||f;s[p]=s[p]||Object.create(null),Yr(s[p],[{axis:f},i[p],c[d]])})}),Object.keys(s).forEach(o=>{const l=s[o];Yr(l,[me.scales[l.type],me.scale])}),s}function ky(e){const t=e.options||(e.options={});t.plugins=V(t.plugins,{}),t.scales=eE(e,t)}function Ey(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function tE(e){return e=e||{},e.data=Ey(e.data),ky(e),e}const fp=new Map,Cy=new Set;function uo(e,t){let n=fp.get(e);return n||(n=t(),fp.set(e,n),Cy.add(n)),n}const Cr=(e,t,n)=>{const i=ul(t,n);i!==void 0&&e.add(i)};class nE{constructor(t){this._config=tE(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Ey(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),ky(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return uo(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return uo(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return uo(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return uo(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let r=i.get(t);return(!r||n)&&(r=new Map,i.set(t,r)),r}getOptionScopes(t,n,i){const{options:r,type:s}=this,o=this._cachedScopes(t,i),l=o.get(n);if(l)return l;const a=new Set;n.forEach(c=>{t&&(a.add(t),c.forEach(d=>Cr(a,t,d))),c.forEach(d=>Cr(a,r,d)),c.forEach(d=>Cr(a,mi[s]||{},d)),c.forEach(d=>Cr(a,me,d)),c.forEach(d=>Cr(a,ac,d))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),Cy.has(n)&&o.set(n,u),u}chartOptionScopes(){const{options:t,type:n}=this;return[t,mi[n]||{},me.datasets[n]||{},{type:n},me,ac]}resolveNamedOptions(t,n,i,r=[""]){const s={$shared:!0},{resolver:o,subPrefixes:l}=hp(this._resolverCache,t,r);let a=o;if(rE(o,n)){s.$shared=!1,i=jn(i)?i():i;const u=this.createResolver(t,i,l);a=er(o,i,u)}for(const u of n)s[u]=a[u];return s}createResolver(t,n,i=[""],r){const{resolver:s}=hp(this._resolverCache,t,i);return K(n)?er(s,n,void 0,r):s}}function hp(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const r=n.join();let s=i.get(r);return s||(s={resolver:Fd(t,n),subPrefixes:n.filter(l=>!l.toLowerCase().includes("hover"))},i.set(r,s)),s}const iE=e=>K(e)&&Object.getOwnPropertyNames(e).reduce((t,n)=>t||jn(e[n]),!1);function rE(e,t){const{isScriptable:n,isIndexable:i}=oy(e);for(const r of t){const s=n(r),o=i(r),l=(o||s)&&e[r];if(s&&(jn(l)||iE(l))||o&&oe(l))return!0}return!1}var sE="4.3.0";const oE=["top","bottom","left","right","chartArea"];function pp(e,t){return e==="top"||e==="bottom"||oE.indexOf(e)===-1&&t==="x"}function mp(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function gp(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),ee(n&&n.onComplete,[e],t)}function lE(e){const t=e.chart,n=t.options.animation;ee(n&&n.onProgress,[e],t)}function Py(e){return dy()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const To={},yp=e=>{const t=Py(e);return Object.values(To).filter(n=>n.canvas===t).pop()};function aE(e,t,n){const i=Object.keys(e);for(const r of i){const s=+r;if(s>=t){const o=e[r];delete e[r],(n>0||s>t)&&(e[s+n]=o)}}}function uE(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}function cE(e){const{xScale:t,yScale:n}=e;if(t&&n)return{left:t.left,right:t.right,top:n.top,bottom:n.bottom}}var hn;let Xl=(hn=class{static register(...t){Ft.add(...t),vp()}static unregister(...t){Ft.remove(...t),vp()}constructor(t,n){const i=this.config=new nE(n),r=Py(t),s=yp(r);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||P2(r)),this.platform.updateConfig(i);const l=this.platform.acquireContext(r,o.aspectRatio),a=l&&l.canvas,u=a&&a.height,c=a&&a.width;if(this.id=xS(),this.ctx=l,this.canvas=a,this.width=c,this.height=u,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new V2,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=IS(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],To[this.id]=this,!l||!a){console.error("Failed to create chart: can't acquire context from the given item");return}Ut.listen(this,"complete",gp),Ut.listen(this,"progress",lE),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:r,_aspectRatio:s}=this;return ie(t)?n&&s?s:r?i/r:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Ft}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Hh(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return zh(this.canvas,this.ctx),this}stop(){return Ut.stop(this),this}resize(t,n){Ut.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const i=this.options,r=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(r,t,n,s),l=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Hh(this,l,!0)&&(this.notifyPlugins("resize",{size:o}),ee(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};J(n,(i,r)=>{i.id=r})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,r=Object.keys(i).reduce((o,l)=>(o[l]=!1,o),{});let s=[];n&&(s=s.concat(Object.keys(n).map(o=>{const l=n[o],a=dc(o,l),u=a==="r",c=a==="x";return{options:l,dposition:u?"chartArea":c?"bottom":"left",dtype:u?"radialLinear":c?"category":"linear"}}))),J(s,o=>{const l=o.options,a=l.id,u=dc(a,l),c=V(l.type,o.dtype);(l.position===void 0||pp(l.position,u)!==pp(o.dposition))&&(l.position=o.dposition),r[a]=!0;let d=null;if(a in i&&i[a].type===c)d=i[a];else{const f=Ft.getScale(c);d=new f({id:a,type:c,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(l,t)}),J(r,(o,l)=>{o||delete i[l]}),J(i,o=>{xt.configure(this,o,o.options),xt.addBox(this,o)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((r,s)=>r.index-s.index),i>n){for(let r=n;rn.length&&delete this._stacks,t.forEach((i,r)=>{n.filter(s=>s===i._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let i,r;for(this._removeUnreferencedMetasets(),i=0,r=n.length;i{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,c=this.data.datasets.length;u{u.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(mp("z","_idx"));const{_active:l,_lastEvent:a}=this;a?this._eventHandler(a,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){J(this.scales,t=>{xt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Mh(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:r,count:s}of n){const o=i==="_removeElements"?-s:s;aE(t,r,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=s=>new Set(t.filter(o=>o[0]===s).map((o,l)=>l+","+o.splice(1).join(","))),r=i(0);for(let s=1;ss.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;xt.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],J(this.boxes,r=>{i&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,s)=>{r._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,i=t._clip,r=!i.disabled,s=cE(t)||this.chartArea,o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(r&&Yl(n,{left:i.left===!1?0:s.left-i.left,right:i.right===!1?this.width:s.right+i.right,top:i.top===!1?0:s.top-i.top,bottom:i.bottom===!1?this.height:s.bottom+i.bottom}),t.controller.draw(),r&&Kl(n),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return Jt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,r){const s=o2.modes[n];return typeof s=="function"?s(this,t,i,r):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let r=i.filter(s=>s&&s._dataset===n).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},i.push(r)),r}getContext(){return this.$context||(this.$context=Hn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){const i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){const r=i?"show":"hide",s=this.getDatasetMeta(t),o=s.controller._resolveAnimations(void 0,r);cl(n)?(s.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(s,{visible:i}),this.update(l=>l.datasetIndex===t?r:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),Ut.remove(this),t=0,n=this.data.datasets.length;t{n.addEventListener(this,s,o),t[s]=o},r=(s,o,l)=>{s.offsetX=o,s.offsetY=l,this._eventHandler(s)};J(this.options.events,s=>i(s,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,i=(a,u)=>{n.addEventListener(this,a,u),t[a]=u},r=(a,u)=>{t[a]&&(n.removeEventListener(this,a,u),delete t[a])},s=(a,u)=>{this.canvas&&this.resize(a,u)};let o;const l=()=>{r("attach",l),this.attached=!0,this.resize(),i("resize",s),i("detach",o)};o=()=>{this.attached=!1,r("resize",s),this._stop(),this._resize(0,0),i("attach",l)},n.isAttached(this.canvas)?l():o()}unbindEvents(){J(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},J(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const r=i?"set":"remove";let s,o,l,a;for(n==="dataset"&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+r+"DatasetHoverStyle"]()),l=0,a=t.length;l{const l=this.getDatasetMeta(s);if(!l)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:l.data[o],index:o}});!ll(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,i){const r=this.options.hover,s=(a,u)=>a.filter(c=>!u.some(d=>c.datasetIndex===d.datasetIndex&&c.index===d.index)),o=s(n,t),l=i?t:s(t,n);o.length&&this.updateHoverStyle(o,r.mode,!1),l.length&&r.mode&&this.updateHoverStyle(l,r.mode,!0)}_eventHandler(t,n){const i={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},r=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,r)===!1)return;const s=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,r),(s||i.changed)&&this.render(),this}_handleEvent(t,n,i){const{_active:r=[],options:s}=this,o=n,l=this._getActiveElements(t,r,i,o),a=ES(t),u=uE(t,this._lastEvent,i,a);i&&(this._lastEvent=null,ee(s.onHover,[t,l,this],this),a&&ee(s.onClick,[t,l,this],this));const c=!ll(l,r);return(c||n)&&(this._active=l,this._updateHoverStyles(l,r,n)),this._lastEvent=u,c}_getActiveElements(t,n,i,r){if(t.type==="mouseout")return[];if(!i)return n;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,r)}},I(hn,"defaults",me),I(hn,"instances",To),I(hn,"overrides",mi),I(hn,"registry",Ft),I(hn,"version",sE),I(hn,"getChart",yp),hn);function vp(){return J(Xl.instances,e=>e._plugins.invalidate())}function Ty(e,t,n=t){e.lineCap=V(n.borderCapStyle,t.borderCapStyle),e.setLineDash(V(n.borderDash,t.borderDash)),e.lineDashOffset=V(n.borderDashOffset,t.borderDashOffset),e.lineJoin=V(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=V(n.borderWidth,t.borderWidth),e.strokeStyle=V(n.borderColor,t.borderColor)}function dE(e,t,n){e.lineTo(n.x,n.y)}function fE(e){return e.stepped?GS:e.tension||e.cubicInterpolationMode==="monotone"?JS:dE}function Oy(e,t,n={}){const i=e.length,{start:r=0,end:s=i-1}=n,{start:o,end:l}=t,a=Math.max(r,o),u=Math.min(s,l),c=rl&&s>l;return{count:i,start:a,loop:t.loop,ilen:u(o+(u?l-_:_))%s,x=()=>{g!==v&&(e.lineTo(c,v),e.lineTo(c,g),e.lineTo(c,y))};for(a&&(p=r[m(0)],e.moveTo(p.x,p.y)),f=0;f<=l;++f){if(p=r[m(f)],p.skip)continue;const _=p.x,S=p.y,C=_|0;C===h?(Sv&&(v=S),c=(d*c+_)/++d):(x(),e.lineTo(_,S),h=C,d=0,g=v=S),y=S}x()}function fc(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?pE:hE}function mE(e){return e.stepped?Lk:e.tension||e.cubicInterpolationMode==="monotone"?Rk:Zn}function gE(e,t,n,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,n,i)&&r.closePath()),Ty(e,t.options),e.stroke(r)}function yE(e,t,n,i){const{segments:r,options:s}=t,o=fc(t);for(const l of r)Ty(e,s,l.style),e.beginPath(),o(e,t,l,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const vE=typeof Path2D=="function";function xE(e,t,n,i){vE&&!t.options.segment?gE(e,t,n,i):yE(e,t,n,i)}class En extends an{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const r=i.spanGaps?this._loop:this._fullLoop;Sk(this._points,i,t,r,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=jk(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){const i=this.options,r=t[n],s=this.points,o=gy(this,{property:n,start:r,end:r});if(!o.length)return;const l=[],a=mE(i);let u,c;for(u=0,c=o.length;ut!=="borderDash"&&t!=="fill"});function xp(e,t,n,i){const r=e.options,{[n]:s}=e.getProps([n],i);return Math.abs(t-s){l=$d(o,l,r);const a=r[o],u=r[l];i!==null?(s.push({x:a.x,y:i}),s.push({x:u.x,y:i})):n!==null&&(s.push({x:n,y:a.y}),s.push({x:n,y:u.y}))}),s}function $d(e,t,n){for(;t>e;t--){const i=n[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function wp(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function My(e,t){let n=[],i=!1;return oe(e)?(i=!0,n=e):n=_E(e,t),n.length?new En({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function _p(e){return e&&e.fill!==!1}function bE(e,t,n){let r=e[t].fill;const s=[t];let o;if(!n)return r;for(;r!==!1&&s.indexOf(r)===-1;){if(!pe(r))return r;if(o=e[r],!o)return!1;if(o.visible)return r;s.push(r),r=o.fill}return!1}function SE(e,t,n){const i=PE(e);if(K(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return pe(r)&&Math.floor(r)===r?kE(i[0],t,r,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function kE(e,t,n,i){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=i?!1:n}function EE(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:K(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function CE(e,t,n){let i;return e==="start"?i=n:e==="end"?i=t.options.reverse?t.min:t.max:K(e)?i=e.value:i=t.getBaseValue(),i}function PE(e){const t=e.options,n=t.fill;let i=V(n&&n.target,n);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function TE(e){const{scale:t,index:n,line:i}=e,r=[],s=i.segments,o=i.points,l=OE(t,n);l.push(My({x:null,y:t.bottom},i));for(let a=0;a=0;--o){const l=r[o].$filler;l&&(l.line.updateControlPoints(s,l.axis),i&&l.fill&&Qa(e.ctx,l,s))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const i=e.getSortedVisibleDatasetMetas();for(let r=i.length-1;r>=0;--r){const s=i[r].$filler;_p(s)&&Qa(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,n){const i=t.meta.$filler;!_p(i)||n.drawTime!=="beforeDatasetDraw"||Qa(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Ep=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}},$E=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Cp extends an{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,i){this.maxWidth=t,this.maxHeight=n,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=ee(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,r)=>t.sort(i,r,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,r=Se(i.font),s=r.size,o=this._computeTitleHeight(),{boxWidth:l,itemHeight:a}=Ep(i,s);let u,c;n.font=r.string,this.isHorizontal()?(u=this.maxWidth,c=this._fitRows(o,s,l,a)+10):(c=this.maxHeight,u=this._fitCols(o,r,l,a)+10),this.width=Math.min(u,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,r){const{ctx:s,maxWidth:o,options:{labels:{padding:l}}}=this,a=this.legendHitBoxes=[],u=this.lineWidths=[0],c=r+l;let d=t;s.textAlign="left",s.textBaseline="middle";let f=-1,p=-c;return this.legendItems.forEach((h,g)=>{const v=i+n/2+s.measureText(h.text).width;(g===0||u[u.length-1]+v+2*l>o)&&(d+=c,u[u.length-(g>0?0:1)]=0,p+=c,f++),a[g]={left:0,top:p,row:f,width:v,height:r},u[u.length-1]+=v+l}),d}_fitCols(t,n,i,r){const{ctx:s,maxHeight:o,options:{labels:{padding:l}}}=this,a=this.legendHitBoxes=[],u=this.columnSizes=[],c=o-t;let d=l,f=0,p=0,h=0,g=0;return this.legendItems.forEach((v,y)=>{const{itemWidth:m,itemHeight:x}=BE(i,n,s,v,r);y>0&&p+x+2*l>c&&(d+=f+l,u.push({width:f,height:p}),h+=f+l,g++,f=p=0),a[y]={left:h,top:p,col:g,width:m,height:x},f=Math.max(f,m),p+=x+l}),d+=f,u.push({width:f,height:p}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:r},rtl:s}}=this,o=Hi(s,this.left,this.width);if(this.isHorizontal()){let l=0,a=$e(i,this.left+r,this.right-this.lineWidths[l]);for(const u of n)l!==u.row&&(l=u.row,a=$e(i,this.left+r,this.right-this.lineWidths[l])),u.top+=this.top+t+r,u.left=o.leftForLtr(o.x(a),u.width),a+=u.width+r}else{let l=0,a=$e(i,this.top+t+r,this.bottom-this.columnSizes[l].height);for(const u of n)u.col!==l&&(l=u.col,a=$e(i,this.top+t+r,this.bottom-this.columnSizes[l].height)),u.top=a,u.left+=this.left+r,u.left=o.leftForLtr(o.x(u.left),u.width),a+=u.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Yl(t,this),this._draw(),Kl(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:r}=this,{align:s,labels:o}=t,l=me.color,a=Hi(t.rtl,this.left,this.width),u=Se(o.font),{padding:c}=o,d=u.size,f=d/2;let p;this.drawTitle(),r.textAlign=a.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=u.string;const{boxWidth:h,boxHeight:g,itemHeight:v}=Ep(o,d),y=function(C,E,k){if(isNaN(h)||h<=0||isNaN(g)||g<0)return;r.save();const L=V(k.lineWidth,1);if(r.fillStyle=V(k.fillStyle,l),r.lineCap=V(k.lineCap,"butt"),r.lineDashOffset=V(k.lineDashOffset,0),r.lineJoin=V(k.lineJoin,"miter"),r.lineWidth=L,r.strokeStyle=V(k.strokeStyle,l),r.setLineDash(V(k.lineDash,[])),o.usePointStyle){const M={radius:g*Math.SQRT2/2,pointStyle:k.pointStyle,rotation:k.rotation,borderWidth:L},R=a.xPlus(C,h/2),N=E+f;ry(r,M,R,N,o.pointStyleWidth&&h)}else{const M=E+Math.max((d-g)/2,0),R=a.leftForLtr(C,h),N=Bi(k.borderRadius);r.beginPath(),Object.values(N).some($=>$!==0)?hl(r,{x:R,y:M,w:h,h:g,radius:N}):r.rect(R,M,h,g),r.fill(),L!==0&&r.stroke()}r.restore()},m=function(C,E,k){gi(r,k.text,C,E+v/2,u,{strikethrough:k.hidden,textAlign:a.textAlign(k.textAlign)})},x=this.isHorizontal(),_=this._computeTitleHeight();x?p={x:$e(s,this.left+c,this.right-i[0]),y:this.top+c+_,line:0}:p={x:this.left+c,y:$e(s,this.top+_+c,this.bottom-n[0].height),line:0},fy(this.ctx,t.textDirection);const S=v+c;this.legendItems.forEach((C,E)=>{r.strokeStyle=C.fontColor,r.fillStyle=C.fontColor;const k=r.measureText(C.text).width,L=a.textAlign(C.textAlign||(C.textAlign=o.textAlign)),M=h+f+k;let R=p.x,N=p.y;a.setWidth(this.width),x?E>0&&R+M+c>this.right&&(N=p.y+=S,p.line++,R=p.x=$e(s,this.left+c,this.right-i[p.line])):E>0&&N+S>this.bottom&&(R=p.x=R+n[p.line].width+c,p.line++,N=p.y=$e(s,this.top+_+c,this.bottom-n[p.line].height));const $=a.x(R);if(y($,N,C),R=jS(L,R+h+f,x?R+M:this.right,t.rtl),m(a.x(R),N,C),x)p.x+=M+c;else if(typeof C.text!="string"){const X=u.lineHeight;p.y+=Ry(C,X)}else p.y+=S}),hy(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=Se(n.font),r=Ue(n.padding);if(!n.display)return;const s=Hi(t.rtl,this.left,this.width),o=this.ctx,l=n.position,a=i.size/2,u=r.top+a;let c,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),c=this.top+u,d=$e(t.align,d,this.right-f);else{const h=this.columnSizes.reduce((g,v)=>Math.max(g,v.height),0);c=u+$e(t.align,this.top,this.bottom-h-t.labels.padding-this._computeTitleHeight())}const p=$e(l,d,d+f);o.textAlign=s.textAlign(Rd(l)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=i.string,gi(o,n.text,p,c,i)}_computeTitleHeight(){const t=this.options.title,n=Se(t.font),i=Ue(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,r,s;if(Ni(t,this.left,this.right)&&Ni(n,this.top,this.bottom)){for(s=this.legendHitBoxes,i=0;is.length>o.length?s:o)),t+n.size/2+i.measureText(r).width}function UE(e,t,n){let i=e;return typeof t.text!="string"&&(i=Ry(t,n)),i}function Ry(e,t){const n=e.text?e.text.length+.5:0;return t*n}function WE(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var VE={id:"legend",_element:Cp,start(e,t,n){const i=e.legend=new Cp({ctx:e.ctx,options:n,chart:e});xt.configure(e,i,n),xt.addBox(e,i)},stop(e){xt.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const i=e.legend;xt.configure(e,i,n),i.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const i=t.datasetIndex,r=n.chart;r.isDatasetVisible(i)?(r.hide(i),t.hidden=!0):(r.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:r,color:s,useBorderRadius:o,borderRadius:l}}=e.legend.options;return e._getSortedDatasetMetas().map(a=>{const u=a.controller.getStyle(n?0:void 0),c=Ue(u.borderWidth);return{text:t[a.index].label,fillStyle:u.backgroundColor,fontColor:s,hidden:!a.visible,lineCap:u.borderCapStyle,lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:u.borderColor,pointStyle:i||u.pointStyle,rotation:u.rotation,textAlign:r||u.textAlign,borderRadius:o&&(l||u.borderRadius),datasetIndex:a.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class Dy extends an{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const r=oe(i.text)?i.text.length:1;this._padding=Ue(i.padding);const s=r*Se(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:i,bottom:r,right:s,options:o}=this,l=o.align;let a=0,u,c,d;return this.isHorizontal()?(c=$e(l,i,s),d=n+t,u=s-i):(o.position==="left"?(c=i+t,d=$e(l,r,n),a=Ee*-.5):(c=s-t,d=$e(l,n,r),a=Ee*.5),u=r-n),{titleX:c,titleY:d,maxWidth:u,rotation:a}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const i=Se(n.font),s=i.lineHeight/2+this._padding.top,{titleX:o,titleY:l,maxWidth:a,rotation:u}=this._drawArgs(s);gi(t,n.text,0,0,i,{color:n.color,maxWidth:a,rotation:u,textAlign:Rd(n.align),textBaseline:"middle",translation:[o,l]})}}function qE(e,t){const n=new Dy({ctx:e.ctx,options:t,chart:e});xt.configure(e,n,t),xt.addBox(e,n),e.titleBlock=n}var YE={id:"title",_element:Dy,start(e,t,n){qE(e,n)},stop(e){const t=e.titleBlock;xt.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;xt.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Fr={average(e){if(!e.length)return!1;let t,n,i=0,r=0,s=0;for(t=0,n=e.length;t-1?e.split(` -`):e}function KE(e,t){const{element:n,datasetIndex:i,index:r}=t,s=e.getDatasetMeta(i).controller,{label:o,value:l}=s.getLabelAndValue(r);return{chart:e,label:o,parsed:s.getParsed(r),raw:e.data.datasets[i].data[r],formattedValue:l,dataset:s.getDataset(),dataIndex:r,datasetIndex:i,element:n}}function Pp(e,t){const n=e.chart.ctx,{body:i,footer:r,title:s}=e,{boxWidth:o,boxHeight:l}=t,a=Se(t.bodyFont),u=Se(t.titleFont),c=Se(t.footerFont),d=s.length,f=r.length,p=i.length,h=Ue(t.padding);let g=h.height,v=0,y=i.reduce((_,S)=>_+S.before.length+S.lines.length+S.after.length,0);if(y+=e.beforeBody.length+e.afterBody.length,d&&(g+=d*u.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),y){const _=t.displayColors?Math.max(l,a.lineHeight):a.lineHeight;g+=p*_+(y-p)*a.lineHeight+(y-1)*t.bodySpacing}f&&(g+=t.footerMarginTop+f*c.lineHeight+(f-1)*t.footerSpacing);let m=0;const x=function(_){v=Math.max(v,n.measureText(_).width+m)};return n.save(),n.font=u.string,X(e.title,x),n.font=a.string,X(e.beforeBody.concat(e.afterBody),x),m=t.displayColors?o+2+t.boxPadding:0,X(i,_=>{X(_.before,x),X(_.lines,x),X(_.after,x)}),m=0,n.font=c.string,X(e.footer,x),n.restore(),v+=h.width,{width:v,height:g}}function QE(e,t){const{y:n,height:i}=t;return ne.height-i/2?"bottom":"center"}function XE(e,t,n,i){const{x:r,width:s}=i,o=n.caretSize+n.caretPadding;if(e==="left"&&r+s+o>t.width||e==="right"&&r-s-o<0)return!0}function GE(e,t,n,i){const{x:r,width:s}=n,{width:o,chartArea:{left:l,right:a}}=e;let u="center";return i==="center"?u=r<=(l+a)/2?"left":"right":r<=s/2?u="left":r>=o-s/2&&(u="right"),XE(u,e,t,n)&&(u="center"),u}function Tp(e,t,n){const i=n.yAlign||t.yAlign||QE(e,n);return{xAlign:n.xAlign||t.xAlign||GE(e,t,n,i),yAlign:i}}function JE(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function ZE(e,t,n){let{y:i,height:r}=e;return t==="top"?i+=n:t==="bottom"?i-=r+n:i-=r/2,i}function Op(e,t,n,i){const{caretSize:r,caretPadding:s,cornerRadius:o}=e,{xAlign:l,yAlign:a}=n,u=r+s,{topLeft:c,topRight:d,bottomLeft:f,bottomRight:p}=Bi(o);let h=JE(t,l);const g=ZE(t,a,u);return a==="center"?l==="left"?h+=u:l==="right"&&(h-=u):l==="left"?h-=Math.max(c,f)+r:l==="right"&&(h+=Math.max(d,p)+r),{x:vt(h,0,i.width-t.width),y:vt(g,0,i.height-t.height)}}function uo(e,t,n){const i=Ue(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function Mp(e){return Dt([],Vt(e))}function eC(e,t,n){return Hn(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function Lp(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const Ny={beforeTitle:Ht,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex"u"?Ny[t].call(n,i):r}class hc extends an{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,i=this.options.setContext(this.getContext()),r=i.enabled&&n.options.animation&&i.animations,s=new yy(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=eC(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,r=Xe(i,"beforeTitle",this,t),s=Xe(i,"title",this,t),o=Xe(i,"afterTitle",this,t);let l=[];return l=Dt(l,Vt(r)),l=Dt(l,Vt(s)),l=Dt(l,Vt(o)),l}getBeforeBody(t,n){return Mp(Xe(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,r=[];return X(t,s=>{const o={before:[],lines:[],after:[]},l=Lp(i,s);Dt(o.before,Vt(Xe(l,"beforeLabel",this,s))),Dt(o.lines,Xe(l,"label",this,s)),Dt(o.after,Vt(Xe(l,"afterLabel",this,s))),r.push(o)}),r}getAfterBody(t,n){return Mp(Xe(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,r=Xe(i,"beforeFooter",this,t),s=Xe(i,"footer",this,t),o=Xe(i,"afterFooter",this,t);let l=[];return l=Dt(l,Vt(r)),l=Dt(l,Vt(s)),l=Dt(l,Vt(o)),l}_createItems(t){const n=this._active,i=this.chart.data,r=[],s=[],o=[];let l=[],a,u;for(a=0,u=n.length;at.filter(c,d,f,i))),t.itemSort&&(l=l.sort((c,d)=>t.itemSort(c,d,i))),X(l,c=>{const d=Lp(t.callbacks,c);r.push(Xe(d,"labelColor",this,c)),s.push(Xe(d,"labelPointStyle",this,c)),o.push(Xe(d,"labelTextColor",this,c))}),this.labelColors=r,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=l,l}update(t,n){const i=this.options.setContext(this.getContext()),r=this._active;let s,o=[];if(!r.length)this.opacity!==0&&(s={opacity:0});else{const l=Nr[i.position].call(this,r,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const a=this._size=Pp(this,i),u=Object.assign({},l,a),c=Tp(this.chart,i,u),d=Op(i,u,c,this.chart);this.xAlign=c.xAlign,this.yAlign=c.yAlign,s={opacity:1,x:d.x,y:d.y,width:a.width,height:a.height,caretX:l.x,caretY:l.y}}this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,r){const s=this.getCaretPosition(t,i,r);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(t,n,i){const{xAlign:r,yAlign:s}=this,{caretSize:o,cornerRadius:l}=i,{topLeft:a,topRight:u,bottomLeft:c,bottomRight:d}=Bi(l),{x:f,y:p}=t,{width:h,height:g}=n;let v,y,m,x,_,S;return s==="center"?(_=p+g/2,r==="left"?(v=f,y=v-o,x=_+o,S=_-o):(v=f+h,y=v+o,x=_-o,S=_+o),m=v):(r==="left"?y=f+Math.max(a,c)+o:r==="right"?y=f+h-Math.max(u,d)-o:y=this.caretX,s==="top"?(x=p,_=x-o,v=y-o,m=y+o):(x=p+g,_=x+o,v=y+o,m=y-o),S=x),{x1:v,x2:y,x3:m,y1:x,y2:_,y3:S}}drawTitle(t,n,i){const r=this.title,s=r.length;let o,l,a;if(s){const u=Hi(i.rtl,this.x,this.width);for(t.x=uo(this,i.titleAlign,i),n.textAlign=u.textAlign(i.titleAlign),n.textBaseline="middle",o=Se(i.titleFont),l=i.titleSpacing,n.fillStyle=i.titleColor,n.font=o.string,a=0;am!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,fl(t,{x:g,y:h,w:u,h:a,radius:y}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),fl(t,{x:v,y:h+1,w:u-2,h:a-2,radius:y}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(g,h,u,a),t.strokeRect(g,h,u,a),t.fillStyle=o.backgroundColor,t.fillRect(v,h+1,u-2,a-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:r}=this,{bodySpacing:s,bodyAlign:o,displayColors:l,boxHeight:a,boxWidth:u,boxPadding:c}=i,d=Se(i.bodyFont);let f=d.lineHeight,p=0;const h=Hi(i.rtl,this.x,this.width),g=function(E){n.fillText(E,h.x(t.x+p),t.y+f/2),t.y+=f+s},v=h.textAlign(o);let y,m,x,_,S,k,C;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,t.x=uo(this,v,i),n.fillStyle=i.bodyColor,X(this.beforeBody,g),p=l&&v!=="right"?o==="center"?u/2+c:u+2+c:0,_=0,k=r.length;_0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,r=i&&i.x,s=i&&i.y;if(r||s){const o=Nr[t.position].call(this,this._active,this._eventPosition);if(!o)return;const l=this._size=Pp(this,t),a=Object.assign({},o,this._size),u=Tp(n,t,a),c=Op(t,a,u,n);(r._to!==c.x||s._to!==c.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=l.width,this.height=l.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const r={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Ue(n.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&l&&(t.save(),t.globalAlpha=i,this.drawBackground(s,t,r,n),fy(t,n.textDirection),s.y+=o.top,this.drawTitle(s,t,n),this.drawBody(s,t,n),this.drawFooter(s,t,n),hy(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const i=this._active,r=t.map(({datasetIndex:l,index:a})=>{const u=this.chart.getDatasetMeta(l);if(!u)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:u.data[a],index:a}}),s=!ol(i,r),o=this._positionChanged(r,n);(s||o)&&(this._active=r,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,s=this._active||[],o=this._getActiveElements(t,s,n,i),l=this._positionChanged(o,t),a=n||!ol(o,s)||l;return a&&(this._active=o,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),a}_getActiveElements(t,n,i,r){const s=this.options;if(t.type==="mouseout")return[];if(!r)return n;const o=this.chart.getElementsAtEventForMode(t,s.mode,s,i);return s.reverse&&o.reverse(),o}_positionChanged(t,n){const{caretX:i,caretY:r,options:s}=this,o=Nr[s.position].call(this,t,n);return o!==!1&&(i!==o.x||r!==o.y)}}I(hc,"positioners",Nr);var tC={id:"tooltip",_element:hc,positioners:Nr,afterInit(e,t,n){n&&(e.tooltip=new hc({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Ny},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const nC=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function iC(e,t,n,i){const r=e.indexOf(t);if(r===-1)return nC(e,t,n,i);const s=e.lastIndexOf(t);return r!==s?n:r}const rC=(e,t)=>e===null?null:vt(Math.round(e),0,t);function Rp(e){const t=this.getLabels();return e>=0&&en.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}I(pc,"id","category"),I(pc,"defaults",{ticks:{callback:Rp}});function sC(e,t){const n=[],{bounds:r,step:s,min:o,max:l,precision:a,count:u,maxTicks:c,maxDigits:d,includeBounds:f}=e,p=s||1,h=c-1,{min:g,max:v}=t,y=!ie(o),m=!ie(l),x=!ie(u),_=(v-g)/(d+1);let S=Rh((v-g)/h/p)*p,k,C,E,T;if(S<1e-14&&!y&&!m)return[{value:g},{value:v}];T=Math.ceil(v/S)-Math.floor(g/S),T>h&&(S=Rh(T*S/h/p)*p),ie(a)||(k=Math.pow(10,a),S=Math.ceil(S*k)/k),r==="ticks"?(C=Math.floor(g/S)*S,E=Math.ceil(v/S)*S):(C=g,E=v),y&&m&&s&&OS((l-o)/s,S/1e3)?(T=Math.round(Math.min((l-o)/S,c)),S=(l-o)/T,C=o,E=l):x?(C=y?o:C,E=m?l:E,T=u-1,S=(E-C)/T):(T=(E-C)/S,Yr(T,Math.round(T),S/1e3)?T=Math.round(T):T=Math.ceil(T));const M=Math.max(Dh(S),Dh(C));k=Math.pow(10,ie(a)?M:a),C=Math.round(C*k)/k,E=Math.round(E*k)/k;let R=0;for(y&&(f&&C!==o?(n.push({value:o}),Cl)break;n.push({value:F})}return m&&f&&E!==l?n.length&&Yr(n[n.length-1].value,l,Dp(l,_,e))?n[n.length-1].value=l:n.push({value:l}):(!m||E===l)&&n.push({value:E}),n}function Dp(e,t,{horizontal:n,minRotation:i}){const r=kn(i),s=(n?Math.sin(r):Math.cos(r))||.001,o=.75*t*(""+e).length;return Math.min(t/s,o)}class ml extends xi{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return ie(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:r,max:s}=this;const o=a=>r=n?r:a,l=a=>s=i?s:a;if(t){const a=Zi(r),u=Zi(s);a<0&&u<0?l(0):a>0&&u>0&&o(0)}if(r===s){let a=s===0?1:Math.abs(s*.05);l(s+a),t||o(r-a)}this.min=r,this.max=s}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:i}=t,r;return i?(r=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),n=n||11),n&&(r=Math.min(n,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const r={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},s=this._range||this,o=sC(r,s);return t.bounds==="ticks"&&J0(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let n=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const r=(i-n)/Math.max(t.length-1,1)/2;n-=r,i+=r}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return Nd(t,this.chart.options.locale,this.options.ticks.format)}}class mc extends ml{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=pe(t)?t:0,this.max=pe(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=kn(this.options.ticks.minRotation),r=(t?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,s.lineHeight/r))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}I(mc,"id","linear"),I(mc,"defaults",{ticks:{callback:Wl.formatters.numeric}});const ws=e=>Math.floor(Sn(e)),Qn=(e,t)=>Math.pow(10,ws(e)+t);function Np(e){return e/Math.pow(10,ws(e))===1}function Fp(e,t,n){const i=Math.pow(10,n),r=Math.floor(e/i);return Math.ceil(t/i)-r}function oC(e,t){const n=t-e;let i=ws(n);for(;Fp(e,t,i)>10;)i++;for(;Fp(e,t,i)<10;)i--;return Math.min(i,ws(e))}function lC(e,{min:t,max:n}){t=rt(e.min,t);const i=[],r=ws(t);let s=oC(t,n),o=s<0?Math.pow(10,Math.abs(s)):1;const l=Math.pow(10,s),a=r>s?Math.pow(10,r):0,u=Math.round((t-a)*o)/o,c=Math.floor((t-a)/l/10)*l*10;let d=Math.floor((u-c)/Math.pow(10,s)),f=rt(e.min,Math.round((a+c+d*Math.pow(10,s))*o)/o);for(;f=10?d=d<15?15:20:d++,d>=20&&(s++,d=2,o=s>=0?1:o),f=Math.round((a+c+d*Math.pow(10,s))*o)/o;const p=rt(e.max,f);return i.push({value:p,major:Np(p),significand:d}),i}class Ap extends xi{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const i=ml.prototype.parse.apply(this,[t,n]);if(i===0){this._zero=!0;return}return pe(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=pe(t)?Math.max(0,t):null,this.max=pe(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!pe(this._userMin)&&(this.min=t===Qn(this.min,0)?Qn(this.min,-1):Qn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let i=this.min,r=this.max;const s=l=>i=t?i:l,o=l=>r=n?r:l;i===r&&(i<=0?(s(1),o(10)):(s(Qn(i,-1)),o(Qn(r,1)))),i<=0&&s(Qn(r,-1)),r<=0&&o(Qn(i,1)),this.min=i,this.max=r}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},i=lC(n,this);return t.bounds==="ticks"&&J0(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":Nd(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Sn(t),this._valueRange=Sn(this.max)-Sn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Sn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}I(Ap,"id","logarithmic"),I(Ap,"defaults",{ticks:{callback:Wl.formatters.logarithmic,major:{enabled:!0}}});function gc(e){const t=e.ticks;if(t.display&&e.display){const n=Ue(t.backdropPadding);return W(t.font&&t.font.size,me.font.size)+n.height}return 0}function aC(e,t,n){return n=oe(n)?n:[n],{w:XS(e,t.string,n),h:n.length*t.lineHeight}}function Ip(e,t,n,i,r){return e===i||e===r?{start:t-n/2,end:t+n/2}:er?{start:t-n,end:t}:{start:t,end:t+n}}function uC(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),i=[],r=[],s=e._pointLabels.length,o=e.options.pointLabels,l=o.centerPointLabels?Ee/s:0;for(let a=0;at.r&&(l=(i.end-t.r)/s,e.r=Math.max(e.r,t.r+l)),r.startt.b&&(a=(r.end-t.b)/o,e.b=Math.max(e.b,t.b+a))}function dC(e,t,n){const i=e.drawingArea,{extra:r,additionalAngle:s,padding:o,size:l}=n,a=e.getPointPosition(t,i+r+o,s),u=Math.round(Md(ot(a.angle+et))),c=gC(a.y,l.h,u),d=pC(u),f=mC(a.x,l.w,d);return{visible:!0,x:a.x,y:c,textAlign:d,left:f,top:c,right:f+l.w,bottom:c+l.h}}function fC(e,t){if(!t)return!0;const{left:n,top:i,right:r,bottom:s}=e;return!(Jt({x:n,y:i},t)||Jt({x:n,y:s},t)||Jt({x:r,y:i},t)||Jt({x:r,y:s},t))}function hC(e,t,n){const i=[],r=e._pointLabels.length,s=e.options,{centerPointLabels:o,display:l}=s.pointLabels,a={extra:gc(s)/2,additionalAngle:o?Ee/r:0};let u;for(let c=0;c270||n<90)&&(e-=t),e}function yC(e,t,n){const{left:i,top:r,right:s,bottom:o}=n,{backdropColor:l}=t;if(!ie(l)){const a=Bi(t.borderRadius),u=Ue(t.backdropPadding);e.fillStyle=l;const c=i-u.left,d=r-u.top,f=s-i+u.width,p=o-r+u.height;Object.values(a).some(h=>h!==0)?(e.beginPath(),fl(e,{x:c,y:d,w:f,h:p,radius:a}),e.fill()):e.fillRect(c,d,f,p)}}function vC(e,t){const{ctx:n,options:{pointLabels:i}}=e;for(let r=t-1;r>=0;r--){const s=e._pointLabelItems[r];if(!s.visible)continue;const o=i.setContext(e.getPointLabelContext(r));yC(n,o,s);const l=Se(o.font),{x:a,y:u,textAlign:c}=s;gi(n,e._pointLabels[r],a,u+l.lineHeight/2,l,{color:o.color,textAlign:c,textBaseline:"middle"})}}function Fy(e,t,n,i){const{ctx:r}=e;if(n)r.arc(e.xCenter,e.yCenter,t,0,ut);else{let s=e.getPointPosition(0,t);r.moveTo(s.x,s.y);for(let o=1;o{const r=ee(this.options.pointLabels.callback,[n,i],this);return r||r===0?r:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?uC(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,r){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,r))}getIndexAngle(t){const n=ut/(this._pointLabels.length||1),i=this.options.startAngle||0;return ot(t*n+kn(i))}getDistanceFromCenterForValue(t){if(ie(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(ie(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t{if(d!==0){a=this.getDistanceFromCenterForValue(c.value);const f=this.getContext(d),p=r.setContext(f),h=s.setContext(f);xC(this,p,a,o,h)}}),i.display){for(t.save(),l=o-1;l>=0;l--){const c=i.setContext(this.getPointLabelContext(l)),{color:d,lineWidth:f}=c;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,a=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),u=this.getPointPosition(l,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(u.x,u.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;const r=this.getIndexAngle(0);let s,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(r),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((l,a)=>{if(a===0&&!n.reverse)return;const u=i.setContext(this.getContext(a)),c=Se(u.font);if(s=this.getDistanceFromCenterForValue(this.ticks[a].value),u.showLabelBackdrop){t.font=c.string,o=t.measureText(l.label).width,t.fillStyle=u.backdropColor;const d=Ue(u.backdropPadding);t.fillRect(-o/2-d.left,-s-c.size/2-d.top,o+d.width,c.size+d.height)}gi(t,l.label,0,-s,c,{color:u.color})}),t.restore()}drawTitle(){}}I(co,"id","radialLinear"),I(co,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Wl.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),I(co,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),I(co,"descriptors",{angleLines:{_fallback:"grid"}});const Xl={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Je=Object.keys(Xl);function _C(e,t){return e-t}function jp(e,t){if(ie(t))return null;const n=e._adapter,{parser:i,round:r,isoWeekday:s}=e._parseOpts;let o=t;return typeof i=="function"&&(o=i(o)),pe(o)||(o=typeof i=="string"?n.parse(o,i):n.parse(o)),o===null?null:(r&&(o=r==="week"&&(vs(s)||s===!0)?n.startOf(o,"isoWeek",s):n.startOf(o,r)),+o)}function zp(e,t,n,i){const r=Je.length;for(let s=Je.indexOf(e);s=Je.indexOf(n);s--){const o=Je[s];if(Xl[o].common&&e._adapter.diff(r,i,o)>=t-1)return o}return Je[n?Je.indexOf(n):0]}function SC(e){for(let t=Je.indexOf(e)+1,n=Je.length;t=t?n[i]:n[r];e[s]=!0}}function kC(e,t,n,i){const r=e._adapter,s=+r.startOf(t[0].value,i),o=t[t.length-1].value;let l,a;for(l=s;l<=o;l=+r.add(l,1,i))a=n[l],a>=0&&(t[a].major=!0);return t}function Bp(e,t,n){const i=[],r={},s=t.length;let o,l;for(o=0;o+t.value))}initOffsets(t=[]){let n=0,i=0,r,s;this.options.offset&&t.length&&(r=this.getDecimalForValue(t[0]),t.length===1?n=1-r:n=(this.getDecimalForValue(t[1])-r)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?i=s:i=(s-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=vt(n,0,o),i=vt(i,0,o),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,r=this.options,s=r.time,o=s.unit||zp(s.minUnit,n,i,this._getLabelCapacity(n)),l=W(r.ticks.stepSize,1),a=o==="week"?s.isoWeekday:!1,u=vs(a)||a===!0,c={};let d=n,f,p;if(u&&(d=+t.startOf(d,"isoWeek",a)),d=+t.startOf(d,u?"day":o),t.diff(i,n,o)>1e5*l)throw new Error(n+" and "+i+" are too far apart with stepSize of "+l+" "+o);const h=r.ticks.source==="data"&&this.getDataTimestamps();for(f=d,p=0;fg-v).map(g=>+g)}getLabelForValue(t){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){const r=this.options.time.displayFormats,s=this._unit,o=n||r[s];return this._adapter.format(t,o)}_tickFormatFunction(t,n,i,r){const s=this.options,o=s.ticks.callback;if(o)return ee(o,[t,n,i],this);const l=s.time.displayFormats,a=this._unit,u=this._majorUnit,c=a&&l[a],d=u&&l[u],f=i[n],p=u&&d&&f&&f.major;return this._adapter.format(t,r||(p?d:c))}generateTickLabels(t){let n,i,r;for(n=0,i=t.length;n0?l:1}getDataTimestamps(){let t=this._cache.data||[],n,i;if(t.length)return t;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(n=0,i=r.length;n=e[i].pos&&t<=e[r].pos&&({lo:i,hi:r}=si(e,"pos",t)),{pos:s,time:l}=e[i],{pos:o,time:a}=e[r]):(t>=e[i].time&&t<=e[r].time&&({lo:i,hi:r}=si(e,"time",t)),{time:s,pos:l}=e[i],{time:o,pos:a}=e[r]);const u=o-s;return u?l+(a-l)*(t-s)/u:l}class Hp extends gl{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=fo(n,this.min),this._tableRange=fo(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,r=[],s=[];let o,l,a,u,c;for(o=0,l=t.length;o=n&&u<=i&&r.push(u);if(r.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(o=0,l=r.length;o2&&arguments[2]!==void 0?arguments[2]:Ay;const i=[];e.datasets=t.map(r=>{const s=e.datasets.find(o=>o[n]===r[n]);return!s||!r.data||i.includes(s)?{...r}:(i.push(s),Object.assign(s,r),s)})}function CC(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ay;const n={labels:[],datasets:[]};return Iy(n,e.labels),jy(n,e.datasets,t),n}function PC(e,t){const{height:n=150,width:i=300,redraw:r=!1,datasetIdKey:s,type:o,data:l,options:a,plugins:u=[],fallbackContent:c,updateMode:d,...f}=e,p=w.useRef(null),h=w.useRef(),g=()=>{p.current&&(h.current=new Ql(p.current,{type:o,data:CC(l,s),options:a&&{...a},plugins:u}),Up(t,h.current))},v=()=>{Up(t,null),h.current&&(h.current.destroy(),h.current=null)};return w.useEffect(()=>{!r&&h.current&&a&&EC(h.current,a)},[r,a]),w.useEffect(()=>{!r&&h.current&&Iy(h.current.config.data,l.labels)},[r,l.labels]),w.useEffect(()=>{!r&&h.current&&l.datasets&&jy(h.current.config.data,l.datasets,s)},[r,l.datasets]),w.useEffect(()=>{h.current&&(r?(v(),setTimeout(g)):h.current.update(d))},[r,a,l.labels,l.datasets,d]),w.useEffect(()=>{h.current&&(v(),setTimeout(g))},[o]),w.useEffect(()=>(g(),()=>v()),[]),$.createElement("canvas",Object.assign({ref:p,role:"img",height:n,width:i},f),c)}const TC=w.forwardRef(PC);function OC(e,t){return Ql.register(t),w.forwardRef((n,i)=>$.createElement(TC,Object.assign({},n,{ref:i,type:e})))}const MC=OC("line",Eo),LC={responsive:!0,animation:!1,font:{family:"Inter"},interaction:{mode:"index",intersect:!1},plugins:{legend:{title:{font:{family:"Inter"}}},tooltip:{bodyFont:{family:"Inter"},padding:{x:20,y:12}}},scales:{y:{suggestedMin:0,beginAtZero:!0,max:100,ticks:{stepSize:10}}}};function zy({datasets:e,labels:t}){Ql.register(pc,mc,To,En,YE,tC,zE,WE);const n=(r,s)=>{const l=r.chart.ctx.createLinearGradient(0,0,0,250);return l.addColorStop(0,s),l.addColorStop(1,"transparent"),l},i=(r,s)=>{r=r.replace("#","");const o=parseInt(r.slice(0,2),16),l=parseInt(r.slice(2,4),16),a=parseInt(r.slice(4,6),16);return`rgba(${o}, ${l}, ${a}, ${s})`};return b.jsx(b.Fragment,{children:b.jsx(MC,{className:"!h-[256px] mx-auto w-full",options:LC,data:{labels:t,datasets:e.map(r=>({fill:!0,label:r.label,data:r.data,pointBackgroundColor:r.color,borderColor:r.color,backgroundColor:s=>n(s,i(r.color,.2))}))}})})}function RC(){const[e,t]=w.useState({labels:["","","","","",""],data:[0,0,0,0,0,0],data1:[0,0,0,0,0,0],data2:[0,0,0,0,0,0]}),[n,i]=w.useState({currentTime:"",allCrawlers:0,activeCrawlers:0,deactiveCrawlers:0,totalRequests:0,successfullRequests:0,failedRequests:0});w.useEffect(()=>{r(),s()},[]);const r=()=>{fetch("http://127.0.0.1:8001/dashboard/crawlers").then(o=>{const a=o.body.getReader(),u=()=>{a.read().then(({value:c,done:d})=>{if(d){console.log("Stream finished");return}const f=new TextDecoder().decode(c);try{const p=JSON.parse(f);let h=new Date(p.data.time).toLocaleString();i(g=>({...g,currentTime:h,allCrawlers:p.data.all_crawlers,activeCrawlers:p.data.active_crawlers,deactiveCrawlers:p.data.deactive_crawlers}))}catch(p){console.log(p)}u()}).catch(c=>{console.error(c)})};u()}).catch(o=>{console.error(o)})},s=()=>{fetch("http://127.0.0.1:8001/dashboard/chart").then(o=>{const a=o.body.getReader(),u=()=>{a.read().then(({value:c,done:d})=>{if(d){console.log("Stream finished");return}const f=new TextDecoder().decode(c);try{const p=JSON.parse(f);let h=p.data.time.split("T")[1],g=Math.floor(+h.split(":")[2]);h=h.split(":")[0]+":"+h.split(":")[1]+":"+g,t(v=>{const y=[...v.data,p.data.all_requests],m=[...v.data1,p.data.successful_requests],x=[...v.data2,p.data.failed_requests],_=[...v.labels,h];return y.splice(0,1),m.splice(0,1),x.splice(0,1),_.splice(0,1),{data:y,data1:m,data2:x,labels:_}}),i(v=>({...v,totalRequests:p.data.all_requests,successfullRequests:p.data.successful_requests,failedRequests:p.data.failed_requests}))}catch(p){console.log(p)}u()}).catch(c=>{console.error(c)})};u()}).catch(o=>{console.error(o)})};return b.jsx("div",{id:"index",children:b.jsxs(Ed,{title:"Dashboard",children:[b.jsxs("div",{className:"flex flex-col xl:flex-row gap-8 mb-8",children:[b.jsxs("div",{className:"main-card w-full xl:w-2/5 py-5 px-6",children:[b.jsx("h3",{className:"text-xl font-semibold",children:"Overview"}),b.jsx("div",{className:"divider my-3"}),b.jsxs("div",{className:"flex flex-col xl:justify-around h-4/5",children:[b.jsxs("div",{className:"spider-details-row mt-2",children:[b.jsx("h4",{children:"current time : "}),b.jsx("h5",{children:n.currentTime})]}),b.jsxs("div",{className:"spider-details-row",children:[b.jsx("h4",{children:"all crawlers : "}),b.jsx("h5",{children:n.allCrawlers})]}),b.jsxs("div",{className:"spider-details-row",children:[b.jsx("h4",{children:"active crawlers : "}),b.jsx("h5",{children:n.activeCrawlers})]}),b.jsxs("div",{className:"spider-details-row",children:[b.jsx("h4",{children:"deactive crawlers : "}),b.jsx("h5",{children:n.deactiveCrawlers})]}),b.jsxs("div",{className:"spider-details-row",children:[b.jsx("h4",{children:"total requests :"}),b.jsx("h5",{children:n.totalRequests})]}),b.jsxs("div",{className:"spider-details-row",children:[b.jsx("h4",{children:"successfull requests : "}),b.jsx("h5",{children:n.successfullRequests})]}),b.jsxs("div",{className:"spider-details-row mb-0",children:[b.jsx("h4",{children:"failed requests : "}),b.jsx("h5",{children:n.failedRequests})]})]})]}),b.jsxs("div",{className:"main-card w-full xl:w-3/5 py-5 px-6",children:[b.jsx("h3",{className:"text-xl font-semibold",children:"request per second"}),b.jsx("div",{className:"divider my-3"}),b.jsx(zy,{datasets:[{color:"#1b59f8",label:"total",data:e.data},{color:"#b91c1c",label:"failed",data:e.data1},{color:"#059669",label:"successfull",data:e.data2}],labels:e.labels})]})]}),b.jsx("div",{className:"mb-16"})]})})}function $y(e,t){return function(){return e.apply(t,arguments)}}const{toString:DC}=Object.prototype,{getPrototypeOf:Bd}=Object,Gl=(e=>t=>{const n=DC.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Bt=e=>(e=e.toLowerCase(),t=>Gl(t)===e),Jl=e=>t=>typeof t===e,{isArray:cr}=Array,_s=Jl("undefined");function NC(e){return e!==null&&!_s(e)&&e.constructor!==null&&!_s(e.constructor)&&_t(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const By=Bt("ArrayBuffer");function FC(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&By(e.buffer),t}const AC=Jl("string"),_t=Jl("function"),Hy=Jl("number"),Zl=e=>e!==null&&typeof e=="object",IC=e=>e===!0||e===!1,Oo=e=>{if(Gl(e)!=="object")return!1;const t=Bd(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},jC=Bt("Date"),zC=Bt("File"),$C=Bt("Blob"),BC=Bt("FileList"),HC=e=>Zl(e)&&_t(e.pipe),UC=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||_t(e.append)&&((t=Gl(e))==="formdata"||t==="object"&&_t(e.toString)&&e.toString()==="[object FormData]"))},VC=Bt("URLSearchParams"),WC=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Rs(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let i,r;if(typeof e!="object"&&(e=[e]),cr(e))for(i=0,r=e.length;i0;)if(r=n[i],t===r.toLowerCase())return r;return null}const Vy=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Wy=e=>!_s(e)&&e!==Vy;function yc(){const{caseless:e}=Wy(this)&&this||{},t={},n=(i,r)=>{const s=e&&Uy(t,r)||r;Oo(t[s])&&Oo(i)?t[s]=yc(t[s],i):Oo(i)?t[s]=yc({},i):cr(i)?t[s]=i.slice():t[s]=i};for(let i=0,r=arguments.length;i(Rs(t,(r,s)=>{n&&_t(r)?e[s]=$y(r,n):e[s]=r},{allOwnKeys:i}),e),YC=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),KC=(e,t,n,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},QC=(e,t,n,i)=>{let r,s,o;const l={};if(t=t||{},e==null)return t;do{for(r=Object.getOwnPropertyNames(e),s=r.length;s-- >0;)o=r[s],(!i||i(o,e,t))&&!l[o]&&(t[o]=e[o],l[o]=!0);e=n!==!1&&Bd(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},XC=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const i=e.indexOf(t,n);return i!==-1&&i===n},GC=e=>{if(!e)return null;if(cr(e))return e;let t=e.length;if(!Hy(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},JC=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Bd(Uint8Array)),ZC=(e,t)=>{const i=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=i.next())&&!r.done;){const s=r.value;t.call(e,s[0],s[1])}},eP=(e,t)=>{let n;const i=[];for(;(n=e.exec(t))!==null;)i.push(n);return i},tP=Bt("HTMLFormElement"),nP=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,r){return i.toUpperCase()+r}),Vp=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),iP=Bt("RegExp"),qy=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),i={};Rs(n,(r,s)=>{let o;(o=t(r,s,e))!==!1&&(i[s]=o||r)}),Object.defineProperties(e,i)},rP=e=>{qy(e,(t,n)=>{if(_t(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const i=e[n];if(_t(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},sP=(e,t)=>{const n={},i=r=>{r.forEach(s=>{n[s]=!0})};return cr(e)?i(e):i(String(e).split(t)),n},oP=()=>{},lP=(e,t)=>(e=+e,Number.isFinite(e)?e:t),Qa="abcdefghijklmnopqrstuvwxyz",Wp="0123456789",Yy={DIGIT:Wp,ALPHA:Qa,ALPHA_DIGIT:Qa+Qa.toUpperCase()+Wp},aP=(e=16,t=Yy.ALPHA_DIGIT)=>{let n="";const{length:i}=t;for(;e--;)n+=t[Math.random()*i|0];return n};function uP(e){return!!(e&&_t(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const cP=e=>{const t=new Array(10),n=(i,r)=>{if(Zl(i)){if(t.indexOf(i)>=0)return;if(!("toJSON"in i)){t[r]=i;const s=cr(i)?[]:{};return Rs(i,(o,l)=>{const a=n(o,r+1);!_s(a)&&(s[l]=a)}),t[r]=void 0,s}}return i};return n(e,0)},dP=Bt("AsyncFunction"),fP=e=>e&&(Zl(e)||_t(e))&&_t(e.then)&&_t(e.catch),P={isArray:cr,isArrayBuffer:By,isBuffer:NC,isFormData:UC,isArrayBufferView:FC,isString:AC,isNumber:Hy,isBoolean:IC,isObject:Zl,isPlainObject:Oo,isUndefined:_s,isDate:jC,isFile:zC,isBlob:$C,isRegExp:iP,isFunction:_t,isStream:HC,isURLSearchParams:VC,isTypedArray:JC,isFileList:BC,forEach:Rs,merge:yc,extend:qC,trim:WC,stripBOM:YC,inherits:KC,toFlatObject:QC,kindOf:Gl,kindOfTest:Bt,endsWith:XC,toArray:GC,forEachEntry:ZC,matchAll:eP,isHTMLForm:tP,hasOwnProperty:Vp,hasOwnProp:Vp,reduceDescriptors:qy,freezeMethods:rP,toObjectSet:sP,toCamelCase:nP,noop:oP,toFiniteNumber:lP,findKey:Uy,global:Vy,isContextDefined:Wy,ALPHABET:Yy,generateString:aP,isSpecCompliantForm:uP,toJSONObject:cP,isAsyncFn:dP,isThenable:fP};function Y(e,t,n,i,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),i&&(this.request=i),r&&(this.response=r)}P.inherits(Y,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:P.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Ky=Y.prototype,Qy={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Qy[e]={value:e}});Object.defineProperties(Y,Qy);Object.defineProperty(Ky,"isAxiosError",{value:!0});Y.from=(e,t,n,i,r,s)=>{const o=Object.create(Ky);return P.toFlatObject(e,o,function(a){return a!==Error.prototype},l=>l!=="isAxiosError"),Y.call(o,e.message,t,n,i,r),o.cause=e,o.name=e.name,s&&Object.assign(o,s),o};const hP=null;function vc(e){return P.isPlainObject(e)||P.isArray(e)}function Xy(e){return P.endsWith(e,"[]")?e.slice(0,-2):e}function qp(e,t,n){return e?e.concat(t).map(function(r,s){return r=Xy(r),!n&&s?"["+r+"]":r}).join(n?".":""):t}function pP(e){return P.isArray(e)&&!e.some(vc)}const mP=P.toFlatObject(P,{},null,function(t){return/^is[A-Z]/.test(t)});function ea(e,t,n){if(!P.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=P.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,v){return!P.isUndefined(v[g])});const i=n.metaTokens,r=n.visitor||c,s=n.dots,o=n.indexes,a=(n.Blob||typeof Blob<"u"&&Blob)&&P.isSpecCompliantForm(t);if(!P.isFunction(r))throw new TypeError("visitor must be a function");function u(h){if(h===null)return"";if(P.isDate(h))return h.toISOString();if(!a&&P.isBlob(h))throw new Y("Blob is not supported. Use a Buffer instead.");return P.isArrayBuffer(h)||P.isTypedArray(h)?a&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function c(h,g,v){let y=h;if(h&&!v&&typeof h=="object"){if(P.endsWith(g,"{}"))g=i?g:g.slice(0,-2),h=JSON.stringify(h);else if(P.isArray(h)&&pP(h)||(P.isFileList(h)||P.endsWith(g,"[]"))&&(y=P.toArray(h)))return g=Xy(g),y.forEach(function(x,_){!(P.isUndefined(x)||x===null)&&t.append(o===!0?qp([g],_,s):o===null?g:g+"[]",u(x))}),!1}return vc(h)?!0:(t.append(qp(v,g,s),u(h)),!1)}const d=[],f=Object.assign(mP,{defaultVisitor:c,convertValue:u,isVisitable:vc});function p(h,g){if(!P.isUndefined(h)){if(d.indexOf(h)!==-1)throw Error("Circular reference detected in "+g.join("."));d.push(h),P.forEach(h,function(y,m){(!(P.isUndefined(y)||y===null)&&r.call(t,y,P.isString(m)?m.trim():m,g,f))===!0&&p(y,g?g.concat(m):[m])}),d.pop()}}if(!P.isObject(e))throw new TypeError("data must be an object");return p(e),t}function Yp(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function Hd(e,t){this._pairs=[],e&&ea(e,this,t)}const Gy=Hd.prototype;Gy.append=function(t,n){this._pairs.push([t,n])};Gy.toString=function(t){const n=t?function(i){return t.call(this,i,Yp)}:Yp;return this._pairs.map(function(r){return n(r[0])+"="+n(r[1])},"").join("&")};function gP(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Jy(e,t,n){if(!t)return e;const i=n&&n.encode||gP,r=n&&n.serialize;let s;if(r?s=r(t,n):s=P.isURLSearchParams(t)?t.toString():new Hd(t,n).toString(i),s){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class yP{constructor(){this.handlers=[]}use(t,n,i){return this.handlers.push({fulfilled:t,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){P.forEach(this.handlers,function(i){i!==null&&t(i)})}}const Kp=yP,Zy={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},vP=typeof URLSearchParams<"u"?URLSearchParams:Hd,xP=typeof FormData<"u"?FormData:null,wP=typeof Blob<"u"?Blob:null,_P=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),bP=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),It={isBrowser:!0,classes:{URLSearchParams:vP,FormData:xP,Blob:wP},isStandardBrowserEnv:_P,isStandardBrowserWebWorkerEnv:bP,protocols:["http","https","file","blob","url","data"]};function SP(e,t){return ea(e,new It.classes.URLSearchParams,Object.assign({visitor:function(n,i,r,s){return It.isNode&&P.isBuffer(n)?(this.append(i,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function kP(e){return P.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function EP(e){const t={},n=Object.keys(e);let i;const r=n.length;let s;for(i=0;i=n.length;return o=!o&&P.isArray(r)?r.length:o,a?(P.hasOwnProp(r,o)?r[o]=[r[o],i]:r[o]=i,!l):((!r[o]||!P.isObject(r[o]))&&(r[o]=[]),t(n,i,r[o],s)&&P.isArray(r[o])&&(r[o]=EP(r[o])),!l)}if(P.isFormData(e)&&P.isFunction(e.entries)){const n={};return P.forEachEntry(e,(i,r)=>{t(kP(i),r,n,0)}),n}return null}function CP(e,t,n){if(P.isString(e))try{return(t||JSON.parse)(e),P.trim(e)}catch(i){if(i.name!=="SyntaxError")throw i}return(n||JSON.stringify)(e)}const Ud={transitional:Zy,adapter:["xhr","http"],transformRequest:[function(t,n){const i=n.getContentType()||"",r=i.indexOf("application/json")>-1,s=P.isObject(t);if(s&&P.isHTMLForm(t)&&(t=new FormData(t)),P.isFormData(t))return r&&r?JSON.stringify(ev(t)):t;if(P.isArrayBuffer(t)||P.isBuffer(t)||P.isStream(t)||P.isFile(t)||P.isBlob(t))return t;if(P.isArrayBufferView(t))return t.buffer;if(P.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(s){if(i.indexOf("application/x-www-form-urlencoded")>-1)return SP(t,this.formSerializer).toString();if((l=P.isFileList(t))||i.indexOf("multipart/form-data")>-1){const a=this.env&&this.env.FormData;return ea(l?{"files[]":t}:t,a&&new a,this.formSerializer)}}return s||r?(n.setContentType("application/json",!1),CP(t)):t}],transformResponse:[function(t){const n=this.transitional||Ud.transitional,i=n&&n.forcedJSONParsing,r=this.responseType==="json";if(t&&P.isString(t)&&(i&&!this.responseType||r)){const o=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(l){if(o)throw l.name==="SyntaxError"?Y.from(l,Y.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:It.classes.FormData,Blob:It.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};P.forEach(["delete","get","head","post","put","patch"],e=>{Ud.headers[e]={}});const Vd=Ud,PP=P.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),TP=e=>{const t={};let n,i,r;return e&&e.split(` -`).forEach(function(o){r=o.indexOf(":"),n=o.substring(0,r).trim().toLowerCase(),i=o.substring(r+1).trim(),!(!n||t[n]&&PP[n])&&(n==="set-cookie"?t[n]?t[n].push(i):t[n]=[i]:t[n]=t[n]?t[n]+", "+i:i)}),t},Qp=Symbol("internals");function Cr(e){return e&&String(e).trim().toLowerCase()}function Mo(e){return e===!1||e==null?e:P.isArray(e)?e.map(Mo):String(e)}function OP(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=n.exec(e);)t[i[1]]=i[2];return t}const MP=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Xa(e,t,n,i,r){if(P.isFunction(i))return i.call(this,t,n);if(r&&(t=n),!!P.isString(t)){if(P.isString(i))return t.indexOf(i)!==-1;if(P.isRegExp(i))return i.test(t)}}function LP(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,i)=>n.toUpperCase()+i)}function RP(e,t){const n=P.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(e,i+n,{value:function(r,s,o){return this[i].call(this,t,r,s,o)},configurable:!0})})}class ta{constructor(t){t&&this.set(t)}set(t,n,i){const r=this;function s(l,a,u){const c=Cr(a);if(!c)throw new Error("header name must be a non-empty string");const d=P.findKey(r,c);(!d||r[d]===void 0||u===!0||u===void 0&&r[d]!==!1)&&(r[d||a]=Mo(l))}const o=(l,a)=>P.forEach(l,(u,c)=>s(u,c,a));return P.isPlainObject(t)||t instanceof this.constructor?o(t,n):P.isString(t)&&(t=t.trim())&&!MP(t)?o(TP(t),n):t!=null&&s(n,t,i),this}get(t,n){if(t=Cr(t),t){const i=P.findKey(this,t);if(i){const r=this[i];if(!n)return r;if(n===!0)return OP(r);if(P.isFunction(n))return n.call(this,r,i);if(P.isRegExp(n))return n.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Cr(t),t){const i=P.findKey(this,t);return!!(i&&this[i]!==void 0&&(!n||Xa(this,this[i],i,n)))}return!1}delete(t,n){const i=this;let r=!1;function s(o){if(o=Cr(o),o){const l=P.findKey(i,o);l&&(!n||Xa(i,i[l],l,n))&&(delete i[l],r=!0)}}return P.isArray(t)?t.forEach(s):s(t),r}clear(t){const n=Object.keys(this);let i=n.length,r=!1;for(;i--;){const s=n[i];(!t||Xa(this,this[s],s,t,!0))&&(delete this[s],r=!0)}return r}normalize(t){const n=this,i={};return P.forEach(this,(r,s)=>{const o=P.findKey(i,s);if(o){n[o]=Mo(r),delete n[s];return}const l=t?LP(s):String(s).trim();l!==s&&delete n[s],n[l]=Mo(r),i[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return P.forEach(this,(i,r)=>{i!=null&&i!==!1&&(n[r]=t&&P.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` -`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const i=new this(t);return n.forEach(r=>i.set(r)),i}static accessor(t){const i=(this[Qp]=this[Qp]={accessors:{}}).accessors,r=this.prototype;function s(o){const l=Cr(o);i[l]||(RP(r,o),i[l]=!0)}return P.isArray(t)?t.forEach(s):s(t),this}}ta.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);P.reduceDescriptors(ta.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(i){this[n]=i}}});P.freezeMethods(ta);const nn=ta;function Ga(e,t){const n=this||Vd,i=t||n,r=nn.from(i.headers);let s=i.data;return P.forEach(e,function(l){s=l.call(n,s,r.normalize(),t?t.status:void 0)}),r.normalize(),s}function tv(e){return!!(e&&e.__CANCEL__)}function Ds(e,t,n){Y.call(this,e??"canceled",Y.ERR_CANCELED,t,n),this.name="CanceledError"}P.inherits(Ds,Y,{__CANCEL__:!0});function DP(e,t,n){const i=n.config.validateStatus;!n.status||!i||i(n.status)?e(n):t(new Y("Request failed with status code "+n.status,[Y.ERR_BAD_REQUEST,Y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const NP=It.isStandardBrowserEnv?function(){return{write:function(n,i,r,s,o,l){const a=[];a.push(n+"="+encodeURIComponent(i)),P.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),P.isString(s)&&a.push("path="+s),P.isString(o)&&a.push("domain="+o),l===!0&&a.push("secure"),document.cookie=a.join("; ")},read:function(n){const i=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return i?decodeURIComponent(i[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function FP(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function AP(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function nv(e,t){return e&&!FP(t)?AP(e,t):t}const IP=It.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let i;function r(s){let o=s;return t&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return i=r(window.location.href),function(o){const l=P.isString(o)?r(o):o;return l.protocol===i.protocol&&l.host===i.host}}():function(){return function(){return!0}}();function jP(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function zP(e,t){e=e||10;const n=new Array(e),i=new Array(e);let r=0,s=0,o;return t=t!==void 0?t:1e3,function(a){const u=Date.now(),c=i[s];o||(o=u),n[r]=a,i[r]=u;let d=s,f=0;for(;d!==r;)f+=n[d++],d=d%e;if(r=(r+1)%e,r===s&&(s=(s+1)%e),u-o{const s=r.loaded,o=r.lengthComputable?r.total:void 0,l=s-n,a=i(l),u=s<=o;n=s;const c={loaded:s,total:o,progress:o?s/o:void 0,bytes:l,rate:a||void 0,estimated:a&&o&&u?(o-s)/a:void 0,event:r};c[t?"download":"upload"]=!0,e(c)}}const $P=typeof XMLHttpRequest<"u",BP=$P&&function(e){return new Promise(function(n,i){let r=e.data;const s=nn.from(e.headers).normalize(),o=e.responseType;let l;function a(){e.cancelToken&&e.cancelToken.unsubscribe(l),e.signal&&e.signal.removeEventListener("abort",l)}let u;P.isFormData(r)&&(It.isStandardBrowserEnv||It.isStandardBrowserWebWorkerEnv?s.setContentType(!1):s.getContentType(/^\s*multipart\/form-data/)?P.isString(u=s.getContentType())&&s.setContentType(u.replace(/^\s*(multipart\/form-data);+/,"$1")):s.setContentType("multipart/form-data"));let c=new XMLHttpRequest;if(e.auth){const h=e.auth.username||"",g=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";s.set("Authorization","Basic "+btoa(h+":"+g))}const d=nv(e.baseURL,e.url);c.open(e.method.toUpperCase(),Jy(d,e.params,e.paramsSerializer),!0),c.timeout=e.timeout;function f(){if(!c)return;const h=nn.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders()),v={data:!o||o==="text"||o==="json"?c.responseText:c.response,status:c.status,statusText:c.statusText,headers:h,config:e,request:c};DP(function(m){n(m),a()},function(m){i(m),a()},v),c=null}if("onloadend"in c?c.onloadend=f:c.onreadystatechange=function(){!c||c.readyState!==4||c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)||setTimeout(f)},c.onabort=function(){c&&(i(new Y("Request aborted",Y.ECONNABORTED,e,c)),c=null)},c.onerror=function(){i(new Y("Network Error",Y.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let g=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const v=e.transitional||Zy;e.timeoutErrorMessage&&(g=e.timeoutErrorMessage),i(new Y(g,v.clarifyTimeoutError?Y.ETIMEDOUT:Y.ECONNABORTED,e,c)),c=null},It.isStandardBrowserEnv){const h=(e.withCredentials||IP(d))&&e.xsrfCookieName&&NP.read(e.xsrfCookieName);h&&s.set(e.xsrfHeaderName,h)}r===void 0&&s.setContentType(null),"setRequestHeader"in c&&P.forEach(s.toJSON(),function(g,v){c.setRequestHeader(v,g)}),P.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),o&&o!=="json"&&(c.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&c.addEventListener("progress",Xp(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&c.upload&&c.upload.addEventListener("progress",Xp(e.onUploadProgress)),(e.cancelToken||e.signal)&&(l=h=>{c&&(i(!h||h.type?new Ds(null,e,c):h),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(l),e.signal&&(e.signal.aborted?l():e.signal.addEventListener("abort",l)));const p=jP(d);if(p&&It.protocols.indexOf(p)===-1){i(new Y("Unsupported protocol "+p+":",Y.ERR_BAD_REQUEST,e));return}c.send(r||null)})},xc={http:hP,xhr:BP};P.forEach(xc,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Gp=e=>`- ${e}`,HP=e=>P.isFunction(e)||e===null||e===!1,iv={getAdapter:e=>{e=P.isArray(e)?e:[e];const{length:t}=e;let n,i;const r={};for(let s=0;s`adapter ${l} `+(a===!1?"is not supported by the environment":"is not available in the build"));let o=t?s.length>1?`since : +`):e}function KE(e,t){const{element:n,datasetIndex:i,index:r}=t,s=e.getDatasetMeta(i).controller,{label:o,value:l}=s.getLabelAndValue(r);return{chart:e,label:o,parsed:s.getParsed(r),raw:e.data.datasets[i].data[r],formattedValue:l,dataset:s.getDataset(),dataIndex:r,datasetIndex:i,element:n}}function Pp(e,t){const n=e.chart.ctx,{body:i,footer:r,title:s}=e,{boxWidth:o,boxHeight:l}=t,a=Se(t.bodyFont),u=Se(t.titleFont),c=Se(t.footerFont),d=s.length,f=r.length,p=i.length,h=Ue(t.padding);let g=h.height,v=0,y=i.reduce((_,S)=>_+S.before.length+S.lines.length+S.after.length,0);if(y+=e.beforeBody.length+e.afterBody.length,d&&(g+=d*u.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),y){const _=t.displayColors?Math.max(l,a.lineHeight):a.lineHeight;g+=p*_+(y-p)*a.lineHeight+(y-1)*t.bodySpacing}f&&(g+=t.footerMarginTop+f*c.lineHeight+(f-1)*t.footerSpacing);let m=0;const x=function(_){v=Math.max(v,n.measureText(_).width+m)};return n.save(),n.font=u.string,J(e.title,x),n.font=a.string,J(e.beforeBody.concat(e.afterBody),x),m=t.displayColors?o+2+t.boxPadding:0,J(i,_=>{J(_.before,x),J(_.lines,x),J(_.after,x)}),m=0,n.font=c.string,J(e.footer,x),n.restore(),v+=h.width,{width:v,height:g}}function QE(e,t){const{y:n,height:i}=t;return ne.height-i/2?"bottom":"center"}function XE(e,t,n,i){const{x:r,width:s}=i,o=n.caretSize+n.caretPadding;if(e==="left"&&r+s+o>t.width||e==="right"&&r-s-o<0)return!0}function GE(e,t,n,i){const{x:r,width:s}=n,{width:o,chartArea:{left:l,right:a}}=e;let u="center";return i==="center"?u=r<=(l+a)/2?"left":"right":r<=s/2?u="left":r>=o-s/2&&(u="right"),XE(u,e,t,n)&&(u="center"),u}function Tp(e,t,n){const i=n.yAlign||t.yAlign||QE(e,n);return{xAlign:n.xAlign||t.xAlign||GE(e,t,n,i),yAlign:i}}function JE(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function ZE(e,t,n){let{y:i,height:r}=e;return t==="top"?i+=n:t==="bottom"?i-=r+n:i-=r/2,i}function Op(e,t,n,i){const{caretSize:r,caretPadding:s,cornerRadius:o}=e,{xAlign:l,yAlign:a}=n,u=r+s,{topLeft:c,topRight:d,bottomLeft:f,bottomRight:p}=Bi(o);let h=JE(t,l);const g=ZE(t,a,u);return a==="center"?l==="left"?h+=u:l==="right"&&(h-=u):l==="left"?h-=Math.max(c,f)+r:l==="right"&&(h+=Math.max(d,p)+r),{x:vt(h,0,i.width-t.width),y:vt(g,0,i.height-t.height)}}function co(e,t,n){const i=Ue(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function Mp(e){return Dt([],Wt(e))}function eC(e,t,n){return Hn(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function Lp(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const Ny={beforeTitle:Ht,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex"u"?Ny[t].call(n,i):r}class pc extends an{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,i=this.options.setContext(this.getContext()),r=i.enabled&&n.options.animation&&i.animations,s=new yy(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=eC(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,r=Xe(i,"beforeTitle",this,t),s=Xe(i,"title",this,t),o=Xe(i,"afterTitle",this,t);let l=[];return l=Dt(l,Wt(r)),l=Dt(l,Wt(s)),l=Dt(l,Wt(o)),l}getBeforeBody(t,n){return Mp(Xe(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,r=[];return J(t,s=>{const o={before:[],lines:[],after:[]},l=Lp(i,s);Dt(o.before,Wt(Xe(l,"beforeLabel",this,s))),Dt(o.lines,Xe(l,"label",this,s)),Dt(o.after,Wt(Xe(l,"afterLabel",this,s))),r.push(o)}),r}getAfterBody(t,n){return Mp(Xe(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,r=Xe(i,"beforeFooter",this,t),s=Xe(i,"footer",this,t),o=Xe(i,"afterFooter",this,t);let l=[];return l=Dt(l,Wt(r)),l=Dt(l,Wt(s)),l=Dt(l,Wt(o)),l}_createItems(t){const n=this._active,i=this.chart.data,r=[],s=[],o=[];let l=[],a,u;for(a=0,u=n.length;at.filter(c,d,f,i))),t.itemSort&&(l=l.sort((c,d)=>t.itemSort(c,d,i))),J(l,c=>{const d=Lp(t.callbacks,c);r.push(Xe(d,"labelColor",this,c)),s.push(Xe(d,"labelPointStyle",this,c)),o.push(Xe(d,"labelTextColor",this,c))}),this.labelColors=r,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=l,l}update(t,n){const i=this.options.setContext(this.getContext()),r=this._active;let s,o=[];if(!r.length)this.opacity!==0&&(s={opacity:0});else{const l=Fr[i.position].call(this,r,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const a=this._size=Pp(this,i),u=Object.assign({},l,a),c=Tp(this.chart,i,u),d=Op(i,u,c,this.chart);this.xAlign=c.xAlign,this.yAlign=c.yAlign,s={opacity:1,x:d.x,y:d.y,width:a.width,height:a.height,caretX:l.x,caretY:l.y}}this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,r){const s=this.getCaretPosition(t,i,r);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(t,n,i){const{xAlign:r,yAlign:s}=this,{caretSize:o,cornerRadius:l}=i,{topLeft:a,topRight:u,bottomLeft:c,bottomRight:d}=Bi(l),{x:f,y:p}=t,{width:h,height:g}=n;let v,y,m,x,_,S;return s==="center"?(_=p+g/2,r==="left"?(v=f,y=v-o,x=_+o,S=_-o):(v=f+h,y=v+o,x=_-o,S=_+o),m=v):(r==="left"?y=f+Math.max(a,c)+o:r==="right"?y=f+h-Math.max(u,d)-o:y=this.caretX,s==="top"?(x=p,_=x-o,v=y-o,m=y+o):(x=p+g,_=x+o,v=y+o,m=y-o),S=x),{x1:v,x2:y,x3:m,y1:x,y2:_,y3:S}}drawTitle(t,n,i){const r=this.title,s=r.length;let o,l,a;if(s){const u=Hi(i.rtl,this.x,this.width);for(t.x=co(this,i.titleAlign,i),n.textAlign=u.textAlign(i.titleAlign),n.textBaseline="middle",o=Se(i.titleFont),l=i.titleSpacing,n.fillStyle=i.titleColor,n.font=o.string,a=0;am!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,hl(t,{x:g,y:h,w:u,h:a,radius:y}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),hl(t,{x:v,y:h+1,w:u-2,h:a-2,radius:y}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(g,h,u,a),t.strokeRect(g,h,u,a),t.fillStyle=o.backgroundColor,t.fillRect(v,h+1,u-2,a-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:r}=this,{bodySpacing:s,bodyAlign:o,displayColors:l,boxHeight:a,boxWidth:u,boxPadding:c}=i,d=Se(i.bodyFont);let f=d.lineHeight,p=0;const h=Hi(i.rtl,this.x,this.width),g=function(k){n.fillText(k,h.x(t.x+p),t.y+f/2),t.y+=f+s},v=h.textAlign(o);let y,m,x,_,S,C,E;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,t.x=co(this,v,i),n.fillStyle=i.bodyColor,J(this.beforeBody,g),p=l&&v!=="right"?o==="center"?u/2+c:u+2+c:0,_=0,C=r.length;_0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,r=i&&i.x,s=i&&i.y;if(r||s){const o=Fr[t.position].call(this,this._active,this._eventPosition);if(!o)return;const l=this._size=Pp(this,t),a=Object.assign({},o,this._size),u=Tp(n,t,a),c=Op(t,a,u,n);(r._to!==c.x||s._to!==c.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=l.width,this.height=l.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const r={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Ue(n.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&l&&(t.save(),t.globalAlpha=i,this.drawBackground(s,t,r,n),fy(t,n.textDirection),s.y+=o.top,this.drawTitle(s,t,n),this.drawBody(s,t,n),this.drawFooter(s,t,n),hy(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const i=this._active,r=t.map(({datasetIndex:l,index:a})=>{const u=this.chart.getDatasetMeta(l);if(!u)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:u.data[a],index:a}}),s=!ll(i,r),o=this._positionChanged(r,n);(s||o)&&(this._active=r,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,s=this._active||[],o=this._getActiveElements(t,s,n,i),l=this._positionChanged(o,t),a=n||!ll(o,s)||l;return a&&(this._active=o,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),a}_getActiveElements(t,n,i,r){const s=this.options;if(t.type==="mouseout")return[];if(!r)return n;const o=this.chart.getElementsAtEventForMode(t,s.mode,s,i);return s.reverse&&o.reverse(),o}_positionChanged(t,n){const{caretX:i,caretY:r,options:s}=this,o=Fr[s.position].call(this,t,n);return o!==!1&&(i!==o.x||r!==o.y)}}I(pc,"positioners",Fr);var tC={id:"tooltip",_element:pc,positioners:Fr,afterInit(e,t,n){n&&(e.tooltip=new pc({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Ny},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const nC=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function iC(e,t,n,i){const r=e.indexOf(t);if(r===-1)return nC(e,t,n,i);const s=e.lastIndexOf(t);return r!==s?n:r}const rC=(e,t)=>e===null?null:vt(Math.round(e),0,t);function Rp(e){const t=this.getLabels();return e>=0&&en.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}I(mc,"id","category"),I(mc,"defaults",{ticks:{callback:Rp}});function sC(e,t){const n=[],{bounds:r,step:s,min:o,max:l,precision:a,count:u,maxTicks:c,maxDigits:d,includeBounds:f}=e,p=s||1,h=c-1,{min:g,max:v}=t,y=!ie(o),m=!ie(l),x=!ie(u),_=(v-g)/(d+1);let S=Rh((v-g)/h/p)*p,C,E,k,L;if(S<1e-14&&!y&&!m)return[{value:g},{value:v}];L=Math.ceil(v/S)-Math.floor(g/S),L>h&&(S=Rh(L*S/h/p)*p),ie(a)||(C=Math.pow(10,a),S=Math.ceil(S*C)/C),r==="ticks"?(E=Math.floor(g/S)*S,k=Math.ceil(v/S)*S):(E=g,k=v),y&&m&&s&&OS((l-o)/s,S/1e3)?(L=Math.round(Math.min((l-o)/S,c)),S=(l-o)/L,E=o,k=l):x?(E=y?o:E,k=m?l:k,L=u-1,S=(k-E)/L):(L=(k-E)/S,Kr(L,Math.round(L),S/1e3)?L=Math.round(L):L=Math.ceil(L));const M=Math.max(Dh(S),Dh(E));C=Math.pow(10,ie(a)?M:a),E=Math.round(E*C)/C,k=Math.round(k*C)/C;let R=0;for(y&&(f&&E!==o?(n.push({value:o}),El)break;n.push({value:N})}return m&&f&&k!==l?n.length&&Kr(n[n.length-1].value,l,Dp(l,_,e))?n[n.length-1].value=l:n.push({value:l}):(!m||k===l)&&n.push({value:k}),n}function Dp(e,t,{horizontal:n,minRotation:i}){const r=kn(i),s=(n?Math.sin(r):Math.cos(r))||.001,o=.75*t*(""+e).length;return Math.min(t/s,o)}class gl extends xi{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return ie(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:r,max:s}=this;const o=a=>r=n?r:a,l=a=>s=i?s:a;if(t){const a=Zi(r),u=Zi(s);a<0&&u<0?l(0):a>0&&u>0&&o(0)}if(r===s){let a=s===0?1:Math.abs(s*.05);l(s+a),t||o(r-a)}this.min=r,this.max=s}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:i}=t,r;return i?(r=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),n=n||11),n&&(r=Math.min(n,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const r={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},s=this._range||this,o=sC(r,s);return t.bounds==="ticks"&&J0(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let n=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const r=(i-n)/Math.max(t.length-1,1)/2;n-=r,i+=r}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return Nd(t,this.chart.options.locale,this.options.ticks.format)}}class gc extends gl{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=pe(t)?t:0,this.max=pe(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=kn(this.options.ticks.minRotation),r=(t?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,s.lineHeight/r))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}I(gc,"id","linear"),I(gc,"defaults",{ticks:{callback:ql.formatters.numeric}});const _s=e=>Math.floor(Sn(e)),Qn=(e,t)=>Math.pow(10,_s(e)+t);function Np(e){return e/Math.pow(10,_s(e))===1}function Fp(e,t,n){const i=Math.pow(10,n),r=Math.floor(e/i);return Math.ceil(t/i)-r}function oC(e,t){const n=t-e;let i=_s(n);for(;Fp(e,t,i)>10;)i++;for(;Fp(e,t,i)<10;)i--;return Math.min(i,_s(e))}function lC(e,{min:t,max:n}){t=rt(e.min,t);const i=[],r=_s(t);let s=oC(t,n),o=s<0?Math.pow(10,Math.abs(s)):1;const l=Math.pow(10,s),a=r>s?Math.pow(10,r):0,u=Math.round((t-a)*o)/o,c=Math.floor((t-a)/l/10)*l*10;let d=Math.floor((u-c)/Math.pow(10,s)),f=rt(e.min,Math.round((a+c+d*Math.pow(10,s))*o)/o);for(;f=10?d=d<15?15:20:d++,d>=20&&(s++,d=2,o=s>=0?1:o),f=Math.round((a+c+d*Math.pow(10,s))*o)/o;const p=rt(e.max,f);return i.push({value:p,major:Np(p),significand:d}),i}class Ap extends xi{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const i=gl.prototype.parse.apply(this,[t,n]);if(i===0){this._zero=!0;return}return pe(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=pe(t)?Math.max(0,t):null,this.max=pe(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!pe(this._userMin)&&(this.min=t===Qn(this.min,0)?Qn(this.min,-1):Qn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let i=this.min,r=this.max;const s=l=>i=t?i:l,o=l=>r=n?r:l;i===r&&(i<=0?(s(1),o(10)):(s(Qn(i,-1)),o(Qn(r,1)))),i<=0&&s(Qn(r,-1)),r<=0&&o(Qn(i,1)),this.min=i,this.max=r}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},i=lC(n,this);return t.bounds==="ticks"&&J0(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":Nd(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Sn(t),this._valueRange=Sn(this.max)-Sn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Sn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}I(Ap,"id","logarithmic"),I(Ap,"defaults",{ticks:{callback:ql.formatters.logarithmic,major:{enabled:!0}}});function yc(e){const t=e.ticks;if(t.display&&e.display){const n=Ue(t.backdropPadding);return V(t.font&&t.font.size,me.font.size)+n.height}return 0}function aC(e,t,n){return n=oe(n)?n:[n],{w:XS(e,t.string,n),h:n.length*t.lineHeight}}function Ip(e,t,n,i,r){return e===i||e===r?{start:t-n/2,end:t+n/2}:er?{start:t-n,end:t}:{start:t,end:t+n}}function uC(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),i=[],r=[],s=e._pointLabels.length,o=e.options.pointLabels,l=o.centerPointLabels?Ee/s:0;for(let a=0;at.r&&(l=(i.end-t.r)/s,e.r=Math.max(e.r,t.r+l)),r.startt.b&&(a=(r.end-t.b)/o,e.b=Math.max(e.b,t.b+a))}function dC(e,t,n){const i=e.drawingArea,{extra:r,additionalAngle:s,padding:o,size:l}=n,a=e.getPointPosition(t,i+r+o,s),u=Math.round(Md(ot(a.angle+et))),c=gC(a.y,l.h,u),d=pC(u),f=mC(a.x,l.w,d);return{visible:!0,x:a.x,y:c,textAlign:d,left:f,top:c,right:f+l.w,bottom:c+l.h}}function fC(e,t){if(!t)return!0;const{left:n,top:i,right:r,bottom:s}=e;return!(Jt({x:n,y:i},t)||Jt({x:n,y:s},t)||Jt({x:r,y:i},t)||Jt({x:r,y:s},t))}function hC(e,t,n){const i=[],r=e._pointLabels.length,s=e.options,{centerPointLabels:o,display:l}=s.pointLabels,a={extra:yc(s)/2,additionalAngle:o?Ee/r:0};let u;for(let c=0;c270||n<90)&&(e-=t),e}function yC(e,t,n){const{left:i,top:r,right:s,bottom:o}=n,{backdropColor:l}=t;if(!ie(l)){const a=Bi(t.borderRadius),u=Ue(t.backdropPadding);e.fillStyle=l;const c=i-u.left,d=r-u.top,f=s-i+u.width,p=o-r+u.height;Object.values(a).some(h=>h!==0)?(e.beginPath(),hl(e,{x:c,y:d,w:f,h:p,radius:a}),e.fill()):e.fillRect(c,d,f,p)}}function vC(e,t){const{ctx:n,options:{pointLabels:i}}=e;for(let r=t-1;r>=0;r--){const s=e._pointLabelItems[r];if(!s.visible)continue;const o=i.setContext(e.getPointLabelContext(r));yC(n,o,s);const l=Se(o.font),{x:a,y:u,textAlign:c}=s;gi(n,e._pointLabels[r],a,u+l.lineHeight/2,l,{color:o.color,textAlign:c,textBaseline:"middle"})}}function Fy(e,t,n,i){const{ctx:r}=e;if(n)r.arc(e.xCenter,e.yCenter,t,0,ut);else{let s=e.getPointPosition(0,t);r.moveTo(s.x,s.y);for(let o=1;o{const r=ee(this.options.pointLabels.callback,[n,i],this);return r||r===0?r:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?uC(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,r){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,r))}getIndexAngle(t){const n=ut/(this._pointLabels.length||1),i=this.options.startAngle||0;return ot(t*n+kn(i))}getDistanceFromCenterForValue(t){if(ie(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(ie(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t{if(d!==0){a=this.getDistanceFromCenterForValue(c.value);const f=this.getContext(d),p=r.setContext(f),h=s.setContext(f);xC(this,p,a,o,h)}}),i.display){for(t.save(),l=o-1;l>=0;l--){const c=i.setContext(this.getPointLabelContext(l)),{color:d,lineWidth:f}=c;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,a=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),u=this.getPointPosition(l,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(u.x,u.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;const r=this.getIndexAngle(0);let s,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(r),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((l,a)=>{if(a===0&&!n.reverse)return;const u=i.setContext(this.getContext(a)),c=Se(u.font);if(s=this.getDistanceFromCenterForValue(this.ticks[a].value),u.showLabelBackdrop){t.font=c.string,o=t.measureText(l.label).width,t.fillStyle=u.backdropColor;const d=Ue(u.backdropPadding);t.fillRect(-o/2-d.left,-s-c.size/2-d.top,o+d.width,c.size+d.height)}gi(t,l.label,0,-s,c,{color:u.color})}),t.restore()}drawTitle(){}}I(fo,"id","radialLinear"),I(fo,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ql.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),I(fo,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),I(fo,"descriptors",{angleLines:{_fallback:"grid"}});const Gl={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Je=Object.keys(Gl);function _C(e,t){return e-t}function jp(e,t){if(ie(t))return null;const n=e._adapter,{parser:i,round:r,isoWeekday:s}=e._parseOpts;let o=t;return typeof i=="function"&&(o=i(o)),pe(o)||(o=typeof i=="string"?n.parse(o,i):n.parse(o)),o===null?null:(r&&(o=r==="week"&&(xs(s)||s===!0)?n.startOf(o,"isoWeek",s):n.startOf(o,r)),+o)}function zp(e,t,n,i){const r=Je.length;for(let s=Je.indexOf(e);s=Je.indexOf(n);s--){const o=Je[s];if(Gl[o].common&&e._adapter.diff(r,i,o)>=t-1)return o}return Je[n?Je.indexOf(n):0]}function SC(e){for(let t=Je.indexOf(e)+1,n=Je.length;t=t?n[i]:n[r];e[s]=!0}}function kC(e,t,n,i){const r=e._adapter,s=+r.startOf(t[0].value,i),o=t[t.length-1].value;let l,a;for(l=s;l<=o;l=+r.add(l,1,i))a=n[l],a>=0&&(t[a].major=!0);return t}function Bp(e,t,n){const i=[],r={},s=t.length;let o,l;for(o=0;o+t.value))}initOffsets(t=[]){let n=0,i=0,r,s;this.options.offset&&t.length&&(r=this.getDecimalForValue(t[0]),t.length===1?n=1-r:n=(this.getDecimalForValue(t[1])-r)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?i=s:i=(s-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=vt(n,0,o),i=vt(i,0,o),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,r=this.options,s=r.time,o=s.unit||zp(s.minUnit,n,i,this._getLabelCapacity(n)),l=V(r.ticks.stepSize,1),a=o==="week"?s.isoWeekday:!1,u=xs(a)||a===!0,c={};let d=n,f,p;if(u&&(d=+t.startOf(d,"isoWeek",a)),d=+t.startOf(d,u?"day":o),t.diff(i,n,o)>1e5*l)throw new Error(n+" and "+i+" are too far apart with stepSize of "+l+" "+o);const h=r.ticks.source==="data"&&this.getDataTimestamps();for(f=d,p=0;fg-v).map(g=>+g)}getLabelForValue(t){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){const r=this.options.time.displayFormats,s=this._unit,o=n||r[s];return this._adapter.format(t,o)}_tickFormatFunction(t,n,i,r){const s=this.options,o=s.ticks.callback;if(o)return ee(o,[t,n,i],this);const l=s.time.displayFormats,a=this._unit,u=this._majorUnit,c=a&&l[a],d=u&&l[u],f=i[n],p=u&&d&&f&&f.major;return this._adapter.format(t,r||(p?d:c))}generateTickLabels(t){let n,i,r;for(n=0,i=t.length;n0?l:1}getDataTimestamps(){let t=this._cache.data||[],n,i;if(t.length)return t;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(n=0,i=r.length;n=e[i].pos&&t<=e[r].pos&&({lo:i,hi:r}=si(e,"pos",t)),{pos:s,time:l}=e[i],{pos:o,time:a}=e[r]):(t>=e[i].time&&t<=e[r].time&&({lo:i,hi:r}=si(e,"time",t)),{time:s,pos:l}=e[i],{time:o,pos:a}=e[r]);const u=o-s;return u?l+(a-l)*(t-s)/u:l}class Hp extends yl{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=ho(n,this.min),this._tableRange=ho(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,r=[],s=[];let o,l,a,u,c;for(o=0,l=t.length;o=n&&u<=i&&r.push(u);if(r.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(o=0,l=r.length;o2&&arguments[2]!==void 0?arguments[2]:Ay;const i=[];e.datasets=t.map(r=>{const s=e.datasets.find(o=>o[n]===r[n]);return!s||!r.data||i.includes(s)?{...r}:(i.push(s),Object.assign(s,r),s)})}function CC(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ay;const n={labels:[],datasets:[]};return Iy(n,e.labels),jy(n,e.datasets,t),n}function PC(e,t){const{height:n=150,width:i=300,redraw:r=!1,datasetIdKey:s,type:o,data:l,options:a,plugins:u=[],fallbackContent:c,updateMode:d,...f}=e,p=w.useRef(null),h=w.useRef(),g=()=>{p.current&&(h.current=new Xl(p.current,{type:o,data:CC(l,s),options:a&&{...a},plugins:u}),Up(t,h.current))},v=()=>{Up(t,null),h.current&&(h.current.destroy(),h.current=null)};return w.useEffect(()=>{!r&&h.current&&a&&EC(h.current,a)},[r,a]),w.useEffect(()=>{!r&&h.current&&Iy(h.current.config.data,l.labels)},[r,l.labels]),w.useEffect(()=>{!r&&h.current&&l.datasets&&jy(h.current.config.data,l.datasets,s)},[r,l.datasets]),w.useEffect(()=>{h.current&&(r?(v(),setTimeout(g)):h.current.update(d))},[r,a,l.labels,l.datasets,d]),w.useEffect(()=>{h.current&&(v(),setTimeout(g))},[o]),w.useEffect(()=>(g(),()=>v()),[]),B.createElement("canvas",Object.assign({ref:p,role:"img",height:n,width:i},f),c)}const TC=w.forwardRef(PC);function OC(e,t){return Xl.register(t),w.forwardRef((n,i)=>B.createElement(TC,Object.assign({},n,{ref:i,type:e})))}const MC=OC("line",Co),LC={responsive:!0,animation:!1,font:{family:"Inter"},interaction:{mode:"index",intersect:!1},plugins:{legend:{title:{font:{family:"Inter"}}},tooltip:{bodyFont:{family:"Inter"},padding:{x:20,y:12}}},scales:{y:{suggestedMin:0,beginAtZero:!0,max:100,ticks:{stepSize:10}}}};function zy({datasets:e,labels:t}){Xl.register(mc,gc,Oo,En,YE,tC,zE,VE);const n=(r,s)=>{const l=r.chart.ctx.createLinearGradient(0,0,0,250);return l.addColorStop(0,s),l.addColorStop(1,"transparent"),l},i=(r,s)=>{r=r.replace("#","");const o=parseInt(r.slice(0,2),16),l=parseInt(r.slice(2,4),16),a=parseInt(r.slice(4,6),16);return`rgba(${o}, ${l}, ${a}, ${s})`};return b.jsx(b.Fragment,{children:b.jsx(MC,{className:"!h-[256px] mx-auto w-full",options:LC,data:{labels:t,datasets:e.map(r=>({fill:!0,label:r.label,data:r.data,pointBackgroundColor:r.color,borderColor:r.color,backgroundColor:s=>n(s,i(r.color,.2))}))}})})}function RC(){const[e,t]=w.useState({labels:["","","","","",""],data:[0,0,0,0,0,0],data1:[0,0,0,0,0,0],data2:[0,0,0,0,0,0]}),[n,i]=w.useState({currentTime:"",allCrawlers:0,activeCrawlers:0,deactiveCrawlers:0,totalRequests:0,successfullRequests:0,failedRequests:0}),r=or();return w.useEffect(()=>{const s=new AbortController,o=s.signal,l=async()=>{try{const c=(await fetch("http://127.0.0.1:8001/dashboard/crawlers",{signal:o})).body.getReader();for(;;){const{done:d,value:f}=await c.read();if(d){console.log("Stream finished");break}const p=new TextDecoder().decode(f),h=JSON.parse(p),g=new Date(h.data.time).toLocaleString();i(v=>({...v,currentTime:g,allCrawlers:h.data.all_crawlers,activeCrawlers:h.data.active_crawlers,deactiveCrawlers:h.data.deactive_crawlers}))}}catch(u){console.warn("Warning in fetching overview data:",u)}},a=async()=>{try{const c=(await fetch("http://127.0.0.1:8001/dashboard/chart",{signal:o})).body.getReader();for(;;){const{done:d,value:f}=await c.read();if(d){console.log("Stream finished");break}const p=new TextDecoder().decode(f),h=JSON.parse(p);let g=h.data.time.split("T")[1],v=Math.floor(+g.split(":")[2]);g=g.split(":")[0]+":"+g.split(":")[1]+":"+v,t(y=>{const m=[...y.data,h.data.all_requests],x=[...y.data1,h.data.successful_requests],_=[...y.data2,h.data.failed_requests],S=[...y.labels,g];return m.splice(0,1),x.splice(0,1),_.splice(0,1),S.splice(0,1),{data:m,data1:x,data2:_,labels:S}}),i(y=>({...y,totalRequests:h.data.all_requests,successfulRequests:h.data.successful_requests,failedRequests:h.data.failed_requests}))}}catch(u){console.warn("Warning in fetching chart data:",u)}};return l(),a(),()=>{s.abort()}},[r]),b.jsx("div",{id:"index",children:b.jsxs(Ed,{title:"Dashboard",children:[b.jsxs("div",{className:"flex flex-col xl:flex-row gap-8 mb-8",children:[b.jsxs("div",{className:"main-card w-full xl:w-2/5 py-5 px-6",children:[b.jsx("h3",{className:"text-xl font-semibold",children:"Overview"}),b.jsx("div",{className:"divider my-3"}),b.jsxs("div",{className:"flex flex-col xl:justify-around h-4/5",children:[b.jsxs("div",{className:"spider-details-row mt-2",children:[b.jsx("h4",{children:"current time : "}),b.jsx("h5",{children:n.currentTime})]}),b.jsxs("div",{className:"spider-details-row",children:[b.jsx("h4",{children:"all crawlers : "}),b.jsx("h5",{children:n.allCrawlers})]}),b.jsxs("div",{className:"spider-details-row",children:[b.jsx("h4",{children:"active crawlers : "}),b.jsx("h5",{children:n.activeCrawlers})]}),b.jsxs("div",{className:"spider-details-row",children:[b.jsx("h4",{children:"deactive crawlers : "}),b.jsx("h5",{children:n.deactiveCrawlers})]}),b.jsxs("div",{className:"spider-details-row",children:[b.jsx("h4",{children:"total requests :"}),b.jsx("h5",{children:n.totalRequests})]}),b.jsxs("div",{className:"spider-details-row",children:[b.jsx("h4",{children:"successfull requests : "}),b.jsx("h5",{children:n.successfullRequests})]}),b.jsxs("div",{className:"spider-details-row mb-0",children:[b.jsx("h4",{children:"failed requests : "}),b.jsx("h5",{children:n.failedRequests})]})]})]}),b.jsxs("div",{className:"main-card w-full xl:w-3/5 py-5 px-6",children:[b.jsx("h3",{className:"text-xl font-semibold",children:"request per second"}),b.jsx("div",{className:"divider my-3"}),b.jsx(zy,{datasets:[{color:"#1b59f8",label:"total",data:e.data},{color:"#b91c1c",label:"failed",data:e.data1},{color:"#059669",label:"successfull",data:e.data2}],labels:e.labels})]})]}),b.jsx("div",{className:"mb-16"})]})})}function $y(e,t){return function(){return e.apply(t,arguments)}}const{toString:DC}=Object.prototype,{getPrototypeOf:Bd}=Object,Jl=(e=>t=>{const n=DC.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Bt=e=>(e=e.toLowerCase(),t=>Jl(t)===e),Zl=e=>t=>typeof t===e,{isArray:dr}=Array,bs=Zl("undefined");function NC(e){return e!==null&&!bs(e)&&e.constructor!==null&&!bs(e.constructor)&&_t(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const By=Bt("ArrayBuffer");function FC(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&By(e.buffer),t}const AC=Zl("string"),_t=Zl("function"),Hy=Zl("number"),ea=e=>e!==null&&typeof e=="object",IC=e=>e===!0||e===!1,Mo=e=>{if(Jl(e)!=="object")return!1;const t=Bd(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},jC=Bt("Date"),zC=Bt("File"),$C=Bt("Blob"),BC=Bt("FileList"),HC=e=>ea(e)&&_t(e.pipe),UC=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||_t(e.append)&&((t=Jl(e))==="formdata"||t==="object"&&_t(e.toString)&&e.toString()==="[object FormData]"))},WC=Bt("URLSearchParams"),VC=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ds(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let i,r;if(typeof e!="object"&&(e=[e]),dr(e))for(i=0,r=e.length;i0;)if(r=n[i],t===r.toLowerCase())return r;return null}const Wy=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Vy=e=>!bs(e)&&e!==Wy;function vc(){const{caseless:e}=Vy(this)&&this||{},t={},n=(i,r)=>{const s=e&&Uy(t,r)||r;Mo(t[s])&&Mo(i)?t[s]=vc(t[s],i):Mo(i)?t[s]=vc({},i):dr(i)?t[s]=i.slice():t[s]=i};for(let i=0,r=arguments.length;i(Ds(t,(r,s)=>{n&&_t(r)?e[s]=$y(r,n):e[s]=r},{allOwnKeys:i}),e),YC=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),KC=(e,t,n,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},QC=(e,t,n,i)=>{let r,s,o;const l={};if(t=t||{},e==null)return t;do{for(r=Object.getOwnPropertyNames(e),s=r.length;s-- >0;)o=r[s],(!i||i(o,e,t))&&!l[o]&&(t[o]=e[o],l[o]=!0);e=n!==!1&&Bd(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},XC=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const i=e.indexOf(t,n);return i!==-1&&i===n},GC=e=>{if(!e)return null;if(dr(e))return e;let t=e.length;if(!Hy(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},JC=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Bd(Uint8Array)),ZC=(e,t)=>{const i=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=i.next())&&!r.done;){const s=r.value;t.call(e,s[0],s[1])}},eP=(e,t)=>{let n;const i=[];for(;(n=e.exec(t))!==null;)i.push(n);return i},tP=Bt("HTMLFormElement"),nP=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,r){return i.toUpperCase()+r}),Wp=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),iP=Bt("RegExp"),qy=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),i={};Ds(n,(r,s)=>{let o;(o=t(r,s,e))!==!1&&(i[s]=o||r)}),Object.defineProperties(e,i)},rP=e=>{qy(e,(t,n)=>{if(_t(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const i=e[n];if(_t(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},sP=(e,t)=>{const n={},i=r=>{r.forEach(s=>{n[s]=!0})};return dr(e)?i(e):i(String(e).split(t)),n},oP=()=>{},lP=(e,t)=>(e=+e,Number.isFinite(e)?e:t),Xa="abcdefghijklmnopqrstuvwxyz",Vp="0123456789",Yy={DIGIT:Vp,ALPHA:Xa,ALPHA_DIGIT:Xa+Xa.toUpperCase()+Vp},aP=(e=16,t=Yy.ALPHA_DIGIT)=>{let n="";const{length:i}=t;for(;e--;)n+=t[Math.random()*i|0];return n};function uP(e){return!!(e&&_t(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const cP=e=>{const t=new Array(10),n=(i,r)=>{if(ea(i)){if(t.indexOf(i)>=0)return;if(!("toJSON"in i)){t[r]=i;const s=dr(i)?[]:{};return Ds(i,(o,l)=>{const a=n(o,r+1);!bs(a)&&(s[l]=a)}),t[r]=void 0,s}}return i};return n(e,0)},dP=Bt("AsyncFunction"),fP=e=>e&&(ea(e)||_t(e))&&_t(e.then)&&_t(e.catch),P={isArray:dr,isArrayBuffer:By,isBuffer:NC,isFormData:UC,isArrayBufferView:FC,isString:AC,isNumber:Hy,isBoolean:IC,isObject:ea,isPlainObject:Mo,isUndefined:bs,isDate:jC,isFile:zC,isBlob:$C,isRegExp:iP,isFunction:_t,isStream:HC,isURLSearchParams:WC,isTypedArray:JC,isFileList:BC,forEach:Ds,merge:vc,extend:qC,trim:VC,stripBOM:YC,inherits:KC,toFlatObject:QC,kindOf:Jl,kindOfTest:Bt,endsWith:XC,toArray:GC,forEachEntry:ZC,matchAll:eP,isHTMLForm:tP,hasOwnProperty:Wp,hasOwnProp:Wp,reduceDescriptors:qy,freezeMethods:rP,toObjectSet:sP,toCamelCase:nP,noop:oP,toFiniteNumber:lP,findKey:Uy,global:Wy,isContextDefined:Vy,ALPHABET:Yy,generateString:aP,isSpecCompliantForm:uP,toJSONObject:cP,isAsyncFn:dP,isThenable:fP};function Y(e,t,n,i,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),i&&(this.request=i),r&&(this.response=r)}P.inherits(Y,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:P.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Ky=Y.prototype,Qy={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Qy[e]={value:e}});Object.defineProperties(Y,Qy);Object.defineProperty(Ky,"isAxiosError",{value:!0});Y.from=(e,t,n,i,r,s)=>{const o=Object.create(Ky);return P.toFlatObject(e,o,function(a){return a!==Error.prototype},l=>l!=="isAxiosError"),Y.call(o,e.message,t,n,i,r),o.cause=e,o.name=e.name,s&&Object.assign(o,s),o};const hP=null;function xc(e){return P.isPlainObject(e)||P.isArray(e)}function Xy(e){return P.endsWith(e,"[]")?e.slice(0,-2):e}function qp(e,t,n){return e?e.concat(t).map(function(r,s){return r=Xy(r),!n&&s?"["+r+"]":r}).join(n?".":""):t}function pP(e){return P.isArray(e)&&!e.some(xc)}const mP=P.toFlatObject(P,{},null,function(t){return/^is[A-Z]/.test(t)});function ta(e,t,n){if(!P.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=P.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,v){return!P.isUndefined(v[g])});const i=n.metaTokens,r=n.visitor||c,s=n.dots,o=n.indexes,a=(n.Blob||typeof Blob<"u"&&Blob)&&P.isSpecCompliantForm(t);if(!P.isFunction(r))throw new TypeError("visitor must be a function");function u(h){if(h===null)return"";if(P.isDate(h))return h.toISOString();if(!a&&P.isBlob(h))throw new Y("Blob is not supported. Use a Buffer instead.");return P.isArrayBuffer(h)||P.isTypedArray(h)?a&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function c(h,g,v){let y=h;if(h&&!v&&typeof h=="object"){if(P.endsWith(g,"{}"))g=i?g:g.slice(0,-2),h=JSON.stringify(h);else if(P.isArray(h)&&pP(h)||(P.isFileList(h)||P.endsWith(g,"[]"))&&(y=P.toArray(h)))return g=Xy(g),y.forEach(function(x,_){!(P.isUndefined(x)||x===null)&&t.append(o===!0?qp([g],_,s):o===null?g:g+"[]",u(x))}),!1}return xc(h)?!0:(t.append(qp(v,g,s),u(h)),!1)}const d=[],f=Object.assign(mP,{defaultVisitor:c,convertValue:u,isVisitable:xc});function p(h,g){if(!P.isUndefined(h)){if(d.indexOf(h)!==-1)throw Error("Circular reference detected in "+g.join("."));d.push(h),P.forEach(h,function(y,m){(!(P.isUndefined(y)||y===null)&&r.call(t,y,P.isString(m)?m.trim():m,g,f))===!0&&p(y,g?g.concat(m):[m])}),d.pop()}}if(!P.isObject(e))throw new TypeError("data must be an object");return p(e),t}function Yp(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function Hd(e,t){this._pairs=[],e&&ta(e,this,t)}const Gy=Hd.prototype;Gy.append=function(t,n){this._pairs.push([t,n])};Gy.toString=function(t){const n=t?function(i){return t.call(this,i,Yp)}:Yp;return this._pairs.map(function(r){return n(r[0])+"="+n(r[1])},"").join("&")};function gP(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Jy(e,t,n){if(!t)return e;const i=n&&n.encode||gP,r=n&&n.serialize;let s;if(r?s=r(t,n):s=P.isURLSearchParams(t)?t.toString():new Hd(t,n).toString(i),s){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class yP{constructor(){this.handlers=[]}use(t,n,i){return this.handlers.push({fulfilled:t,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){P.forEach(this.handlers,function(i){i!==null&&t(i)})}}const Kp=yP,Zy={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},vP=typeof URLSearchParams<"u"?URLSearchParams:Hd,xP=typeof FormData<"u"?FormData:null,wP=typeof Blob<"u"?Blob:null,_P=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),bP=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),It={isBrowser:!0,classes:{URLSearchParams:vP,FormData:xP,Blob:wP},isStandardBrowserEnv:_P,isStandardBrowserWebWorkerEnv:bP,protocols:["http","https","file","blob","url","data"]};function SP(e,t){return ta(e,new It.classes.URLSearchParams,Object.assign({visitor:function(n,i,r,s){return It.isNode&&P.isBuffer(n)?(this.append(i,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function kP(e){return P.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function EP(e){const t={},n=Object.keys(e);let i;const r=n.length;let s;for(i=0;i=n.length;return o=!o&&P.isArray(r)?r.length:o,a?(P.hasOwnProp(r,o)?r[o]=[r[o],i]:r[o]=i,!l):((!r[o]||!P.isObject(r[o]))&&(r[o]=[]),t(n,i,r[o],s)&&P.isArray(r[o])&&(r[o]=EP(r[o])),!l)}if(P.isFormData(e)&&P.isFunction(e.entries)){const n={};return P.forEachEntry(e,(i,r)=>{t(kP(i),r,n,0)}),n}return null}function CP(e,t,n){if(P.isString(e))try{return(t||JSON.parse)(e),P.trim(e)}catch(i){if(i.name!=="SyntaxError")throw i}return(n||JSON.stringify)(e)}const Ud={transitional:Zy,adapter:["xhr","http"],transformRequest:[function(t,n){const i=n.getContentType()||"",r=i.indexOf("application/json")>-1,s=P.isObject(t);if(s&&P.isHTMLForm(t)&&(t=new FormData(t)),P.isFormData(t))return r&&r?JSON.stringify(ev(t)):t;if(P.isArrayBuffer(t)||P.isBuffer(t)||P.isStream(t)||P.isFile(t)||P.isBlob(t))return t;if(P.isArrayBufferView(t))return t.buffer;if(P.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(s){if(i.indexOf("application/x-www-form-urlencoded")>-1)return SP(t,this.formSerializer).toString();if((l=P.isFileList(t))||i.indexOf("multipart/form-data")>-1){const a=this.env&&this.env.FormData;return ta(l?{"files[]":t}:t,a&&new a,this.formSerializer)}}return s||r?(n.setContentType("application/json",!1),CP(t)):t}],transformResponse:[function(t){const n=this.transitional||Ud.transitional,i=n&&n.forcedJSONParsing,r=this.responseType==="json";if(t&&P.isString(t)&&(i&&!this.responseType||r)){const o=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(l){if(o)throw l.name==="SyntaxError"?Y.from(l,Y.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:It.classes.FormData,Blob:It.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};P.forEach(["delete","get","head","post","put","patch"],e=>{Ud.headers[e]={}});const Wd=Ud,PP=P.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),TP=e=>{const t={};let n,i,r;return e&&e.split(` +`).forEach(function(o){r=o.indexOf(":"),n=o.substring(0,r).trim().toLowerCase(),i=o.substring(r+1).trim(),!(!n||t[n]&&PP[n])&&(n==="set-cookie"?t[n]?t[n].push(i):t[n]=[i]:t[n]=t[n]?t[n]+", "+i:i)}),t},Qp=Symbol("internals");function Pr(e){return e&&String(e).trim().toLowerCase()}function Lo(e){return e===!1||e==null?e:P.isArray(e)?e.map(Lo):String(e)}function OP(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=n.exec(e);)t[i[1]]=i[2];return t}const MP=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Ga(e,t,n,i,r){if(P.isFunction(i))return i.call(this,t,n);if(r&&(t=n),!!P.isString(t)){if(P.isString(i))return t.indexOf(i)!==-1;if(P.isRegExp(i))return i.test(t)}}function LP(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,i)=>n.toUpperCase()+i)}function RP(e,t){const n=P.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(e,i+n,{value:function(r,s,o){return this[i].call(this,t,r,s,o)},configurable:!0})})}class na{constructor(t){t&&this.set(t)}set(t,n,i){const r=this;function s(l,a,u){const c=Pr(a);if(!c)throw new Error("header name must be a non-empty string");const d=P.findKey(r,c);(!d||r[d]===void 0||u===!0||u===void 0&&r[d]!==!1)&&(r[d||a]=Lo(l))}const o=(l,a)=>P.forEach(l,(u,c)=>s(u,c,a));return P.isPlainObject(t)||t instanceof this.constructor?o(t,n):P.isString(t)&&(t=t.trim())&&!MP(t)?o(TP(t),n):t!=null&&s(n,t,i),this}get(t,n){if(t=Pr(t),t){const i=P.findKey(this,t);if(i){const r=this[i];if(!n)return r;if(n===!0)return OP(r);if(P.isFunction(n))return n.call(this,r,i);if(P.isRegExp(n))return n.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Pr(t),t){const i=P.findKey(this,t);return!!(i&&this[i]!==void 0&&(!n||Ga(this,this[i],i,n)))}return!1}delete(t,n){const i=this;let r=!1;function s(o){if(o=Pr(o),o){const l=P.findKey(i,o);l&&(!n||Ga(i,i[l],l,n))&&(delete i[l],r=!0)}}return P.isArray(t)?t.forEach(s):s(t),r}clear(t){const n=Object.keys(this);let i=n.length,r=!1;for(;i--;){const s=n[i];(!t||Ga(this,this[s],s,t,!0))&&(delete this[s],r=!0)}return r}normalize(t){const n=this,i={};return P.forEach(this,(r,s)=>{const o=P.findKey(i,s);if(o){n[o]=Lo(r),delete n[s];return}const l=t?LP(s):String(s).trim();l!==s&&delete n[s],n[l]=Lo(r),i[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return P.forEach(this,(i,r)=>{i!=null&&i!==!1&&(n[r]=t&&P.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const i=new this(t);return n.forEach(r=>i.set(r)),i}static accessor(t){const i=(this[Qp]=this[Qp]={accessors:{}}).accessors,r=this.prototype;function s(o){const l=Pr(o);i[l]||(RP(r,o),i[l]=!0)}return P.isArray(t)?t.forEach(s):s(t),this}}na.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);P.reduceDescriptors(na.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(i){this[n]=i}}});P.freezeMethods(na);const nn=na;function Ja(e,t){const n=this||Wd,i=t||n,r=nn.from(i.headers);let s=i.data;return P.forEach(e,function(l){s=l.call(n,s,r.normalize(),t?t.status:void 0)}),r.normalize(),s}function tv(e){return!!(e&&e.__CANCEL__)}function Ns(e,t,n){Y.call(this,e??"canceled",Y.ERR_CANCELED,t,n),this.name="CanceledError"}P.inherits(Ns,Y,{__CANCEL__:!0});function DP(e,t,n){const i=n.config.validateStatus;!n.status||!i||i(n.status)?e(n):t(new Y("Request failed with status code "+n.status,[Y.ERR_BAD_REQUEST,Y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const NP=It.isStandardBrowserEnv?function(){return{write:function(n,i,r,s,o,l){const a=[];a.push(n+"="+encodeURIComponent(i)),P.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),P.isString(s)&&a.push("path="+s),P.isString(o)&&a.push("domain="+o),l===!0&&a.push("secure"),document.cookie=a.join("; ")},read:function(n){const i=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return i?decodeURIComponent(i[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function FP(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function AP(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function nv(e,t){return e&&!FP(t)?AP(e,t):t}const IP=It.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let i;function r(s){let o=s;return t&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return i=r(window.location.href),function(o){const l=P.isString(o)?r(o):o;return l.protocol===i.protocol&&l.host===i.host}}():function(){return function(){return!0}}();function jP(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function zP(e,t){e=e||10;const n=new Array(e),i=new Array(e);let r=0,s=0,o;return t=t!==void 0?t:1e3,function(a){const u=Date.now(),c=i[s];o||(o=u),n[r]=a,i[r]=u;let d=s,f=0;for(;d!==r;)f+=n[d++],d=d%e;if(r=(r+1)%e,r===s&&(s=(s+1)%e),u-o{const s=r.loaded,o=r.lengthComputable?r.total:void 0,l=s-n,a=i(l),u=s<=o;n=s;const c={loaded:s,total:o,progress:o?s/o:void 0,bytes:l,rate:a||void 0,estimated:a&&o&&u?(o-s)/a:void 0,event:r};c[t?"download":"upload"]=!0,e(c)}}const $P=typeof XMLHttpRequest<"u",BP=$P&&function(e){return new Promise(function(n,i){let r=e.data;const s=nn.from(e.headers).normalize(),o=e.responseType;let l;function a(){e.cancelToken&&e.cancelToken.unsubscribe(l),e.signal&&e.signal.removeEventListener("abort",l)}let u;P.isFormData(r)&&(It.isStandardBrowserEnv||It.isStandardBrowserWebWorkerEnv?s.setContentType(!1):s.getContentType(/^\s*multipart\/form-data/)?P.isString(u=s.getContentType())&&s.setContentType(u.replace(/^\s*(multipart\/form-data);+/,"$1")):s.setContentType("multipart/form-data"));let c=new XMLHttpRequest;if(e.auth){const h=e.auth.username||"",g=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";s.set("Authorization","Basic "+btoa(h+":"+g))}const d=nv(e.baseURL,e.url);c.open(e.method.toUpperCase(),Jy(d,e.params,e.paramsSerializer),!0),c.timeout=e.timeout;function f(){if(!c)return;const h=nn.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders()),v={data:!o||o==="text"||o==="json"?c.responseText:c.response,status:c.status,statusText:c.statusText,headers:h,config:e,request:c};DP(function(m){n(m),a()},function(m){i(m),a()},v),c=null}if("onloadend"in c?c.onloadend=f:c.onreadystatechange=function(){!c||c.readyState!==4||c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)||setTimeout(f)},c.onabort=function(){c&&(i(new Y("Request aborted",Y.ECONNABORTED,e,c)),c=null)},c.onerror=function(){i(new Y("Network Error",Y.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let g=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const v=e.transitional||Zy;e.timeoutErrorMessage&&(g=e.timeoutErrorMessage),i(new Y(g,v.clarifyTimeoutError?Y.ETIMEDOUT:Y.ECONNABORTED,e,c)),c=null},It.isStandardBrowserEnv){const h=(e.withCredentials||IP(d))&&e.xsrfCookieName&&NP.read(e.xsrfCookieName);h&&s.set(e.xsrfHeaderName,h)}r===void 0&&s.setContentType(null),"setRequestHeader"in c&&P.forEach(s.toJSON(),function(g,v){c.setRequestHeader(v,g)}),P.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),o&&o!=="json"&&(c.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&c.addEventListener("progress",Xp(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&c.upload&&c.upload.addEventListener("progress",Xp(e.onUploadProgress)),(e.cancelToken||e.signal)&&(l=h=>{c&&(i(!h||h.type?new Ns(null,e,c):h),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(l),e.signal&&(e.signal.aborted?l():e.signal.addEventListener("abort",l)));const p=jP(d);if(p&&It.protocols.indexOf(p)===-1){i(new Y("Unsupported protocol "+p+":",Y.ERR_BAD_REQUEST,e));return}c.send(r||null)})},wc={http:hP,xhr:BP};P.forEach(wc,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Gp=e=>`- ${e}`,HP=e=>P.isFunction(e)||e===null||e===!1,iv={getAdapter:e=>{e=P.isArray(e)?e:[e];const{length:t}=e;let n,i;const r={};for(let s=0;s`adapter ${l} `+(a===!1?"is not supported by the environment":"is not available in the build"));let o=t?s.length>1?`since : `+s.map(Gp).join(` -`):" "+Gp(s[0]):"as no adapter specified";throw new Y("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return i},adapters:xc};function Ja(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ds(null,e)}function Jp(e){return Ja(e),e.headers=nn.from(e.headers),e.data=Ga.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),iv.getAdapter(e.adapter||Vd.adapter)(e).then(function(i){return Ja(e),i.data=Ga.call(e,e.transformResponse,i),i.headers=nn.from(i.headers),i},function(i){return tv(i)||(Ja(e),i&&i.response&&(i.response.data=Ga.call(e,e.transformResponse,i.response),i.response.headers=nn.from(i.response.headers))),Promise.reject(i)})}const Zp=e=>e instanceof nn?e.toJSON():e;function nr(e,t){t=t||{};const n={};function i(u,c,d){return P.isPlainObject(u)&&P.isPlainObject(c)?P.merge.call({caseless:d},u,c):P.isPlainObject(c)?P.merge({},c):P.isArray(c)?c.slice():c}function r(u,c,d){if(P.isUndefined(c)){if(!P.isUndefined(u))return i(void 0,u,d)}else return i(u,c,d)}function s(u,c){if(!P.isUndefined(c))return i(void 0,c)}function o(u,c){if(P.isUndefined(c)){if(!P.isUndefined(u))return i(void 0,u)}else return i(void 0,c)}function l(u,c,d){if(d in t)return i(u,c);if(d in e)return i(void 0,u)}const a={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:l,headers:(u,c)=>r(Zp(u),Zp(c),!0)};return P.forEach(Object.keys(Object.assign({},e,t)),function(c){const d=a[c]||r,f=d(e[c],t[c],c);P.isUndefined(f)&&d!==l||(n[c]=f)}),n}const rv="1.5.1",Wd={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Wd[e]=function(i){return typeof i===e||"a"+(t<1?"n ":" ")+e}});const em={};Wd.transitional=function(t,n,i){function r(s,o){return"[Axios v"+rv+"] Transitional option '"+s+"'"+o+(i?". "+i:"")}return(s,o,l)=>{if(t===!1)throw new Y(r(o," has been removed"+(n?" in "+n:"")),Y.ERR_DEPRECATED);return n&&!em[o]&&(em[o]=!0,console.warn(r(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,o,l):!0}};function UP(e,t,n){if(typeof e!="object")throw new Y("options must be an object",Y.ERR_BAD_OPTION_VALUE);const i=Object.keys(e);let r=i.length;for(;r-- >0;){const s=i[r],o=t[s];if(o){const l=e[s],a=l===void 0||o(l,s,e);if(a!==!0)throw new Y("option "+s+" must be "+a,Y.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Y("Unknown option "+s,Y.ERR_BAD_OPTION)}}const wc={assertOptions:UP,validators:Wd},fn=wc.validators;class yl{constructor(t){this.defaults=t,this.interceptors={request:new Kp,response:new Kp}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=nr(this.defaults,n);const{transitional:i,paramsSerializer:r,headers:s}=n;i!==void 0&&wc.assertOptions(i,{silentJSONParsing:fn.transitional(fn.boolean),forcedJSONParsing:fn.transitional(fn.boolean),clarifyTimeoutError:fn.transitional(fn.boolean)},!1),r!=null&&(P.isFunction(r)?n.paramsSerializer={serialize:r}:wc.assertOptions(r,{encode:fn.function,serialize:fn.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&P.merge(s.common,s[n.method]);s&&P.forEach(["delete","get","head","post","put","patch","common"],h=>{delete s[h]}),n.headers=nn.concat(o,s);const l=[];let a=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(a=a&&g.synchronous,l.unshift(g.fulfilled,g.rejected))});const u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected)});let c,d=0,f;if(!a){const h=[Jp.bind(this),void 0];for(h.unshift.apply(h,l),h.push.apply(h,u),f=h.length,c=Promise.resolve(n);d{if(!i._listeners)return;let s=i._listeners.length;for(;s-- >0;)i._listeners[s](r);i._listeners=null}),this.promise.then=r=>{let s;const o=new Promise(l=>{i.subscribe(l),s=l}).then(r);return o.cancel=function(){i.unsubscribe(s)},o},t(function(s,o,l){i.reason||(i.reason=new Ds(s,o,l),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new qd(function(r){t=r}),cancel:t}}}const VP=qd;function WP(e){return function(n){return e.apply(null,n)}}function qP(e){return P.isObject(e)&&e.isAxiosError===!0}const _c={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(_c).forEach(([e,t])=>{_c[t]=e});const YP=_c;function sv(e){const t=new Lo(e),n=$y(Lo.prototype.request,t);return P.extend(n,Lo.prototype,t,{allOwnKeys:!0}),P.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return sv(nr(e,r))},n}const we=sv(Vd);we.Axios=Lo;we.CanceledError=Ds;we.CancelToken=VP;we.isCancel=tv;we.VERSION=rv;we.toFormData=ea;we.AxiosError=Y;we.Cancel=we.CanceledError;we.all=function(t){return Promise.all(t)};we.spread=WP;we.isAxiosError=qP;we.mergeConfig=nr;we.AxiosHeaders=nn;we.formToJSON=e=>ev(P.isHTMLForm(e)?new FormData(e):e);we.getAdapter=iv.getAdapter;we.HttpStatusCode=YP;we.default=we;const KP=we,Za=KP.create({baseURL:"http://127.0.0.1:8001",headers:{"Content-Type":"application/json"}});function ov(){return{getSpiders:async(i={})=>await Za({url:"/all",method:"get",params:i}),toggleTask:async i=>await Za({url:"/toggle_task",method:"post",data:i}),toggleTasks:async(i,r=!1)=>await Za({url:r?"/start_tasks":"/stop_tasks",method:"post",data:i})}}function QP({selectedSort:e,selectedState:t,onSortChange:n,onStateChange:i}){const r=[{label:"Name",value:1},{label:"State",value:2},{label:"Started at",value:3},{label:"Duration",value:4}],s=[{label:"All",value:1},{label:"Active",value:2},{label:"Paused",value:3},{label:"Finished",value:4}];return b.jsx(ri,{as:"div",className:"relative inline-block text-left z-30",children:({open:o})=>b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"transition-all duration-300",children:b.jsxs(ri.Button,{className:"bg-white border border-border text-text px-2 py-2 rounded-lg font-semibold flex items-center",children:[b.jsx(Xi.Icon,{path:Lw,size:.8,className:"mr-2"}),"Filter",b.jsx(Xi.Icon,{className:`ml-2 ${o?"rotate-180":""}`,path:E0,size:1})]})}),b.jsx(Wr,{as:w.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:b.jsx(ri.Items,{className:"absolute left-0 mt-2 w-56 origin-top-left divide-y divide-gray-100 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",children:b.jsxs("div",{className:"p-5",style:{fontFamily:"Inter"},children:[b.jsxs("h4",{className:"text-primary text-sm font-medium mb-2",children:["SORT BY :"," "]}),r.map(l=>b.jsxs("label",{className:"flex items-center justify-between cursor-pointer hover:bg-bg-primary p-1 px-2 rounded-md",children:[b.jsx("span",{className:"text-gray-800 text-sm",children:l.label}),b.jsx("input",{type:"radio",value:1,checked:e===l.value,onChange:()=>n(l.value),className:"form-radio h-4 w-4 text-primary"})]},l.value)),b.jsx("div",{className:"h-[2px] bg-border my-3"}),b.jsxs("h4",{className:"text-primary text-sm font-medium mb-2",children:["STATE :"," "]}),s.map(l=>b.jsxs("label",{className:"flex items-center justify-between cursor-pointer hover:bg-bg-primary p-1 px-2 rounded-md",children:[b.jsx("span",{className:"text-gray-800 text-sm",children:l.label}),b.jsx("input",{type:"radio",value:1,checked:t===l.value,onChange:()=>i(l.value),className:"form-radio h-4 w-4 text-primary"})]},l.value))]})})})]})})}function XP({data:e,loading:t,onSelectedIdsChange:n}){const i={Active:{text:"success",back:"bg-success"},Finished:{text:"error",back:"bg-error"},Pause:{text:"warning",back:"bg-warning"}},r=Tc(),s=(o,l)=>{o.stopPropagation(),n(a=>{const u=[...a],c=u.indexOf(l);return c!==-1?u.splice(c,1):u.push(l),[...u]})};return b.jsx("div",{className:"main-card px-4 w-full overflow-y-auto",style:{height:"calc(100vh - 200px)"},children:t?b.jsx("div",{className:"text-center mt-10",children:b.jsx(Gi,{path:Nw,size:1.5,color:"var(--color-primary)",className:"mx-auto animate-spin"})}):e&&b.jsxs("table",{className:"w-full",children:[b.jsx("thead",{className:"sticky top-0 bg-white",children:b.jsxs("tr",{children:[b.jsx("th",{className:"w-1/12 pl-5",children:b.jsx("input",{type:"checkbox",className:"h-4 w-4 accent-primary"})}),b.jsx("th",{className:"pe-4",children:"#"}),b.jsx("th",{className:"w-3/12",children:"Name"}),b.jsx("th",{className:"w-3/12",children:"Started at"}),b.jsx("th",{className:"w-2/12",children:"Duration"}),b.jsx("th",{className:"w-2/12",children:"State"})]})}),b.jsx("tbody",{children:e.map((o,l)=>b.jsxs("tr",{className:"hover:bg-bg-primary",onClick:()=>r(`/spiders/${o.id}`,{state:{data:o}}),children:[b.jsx("td",{className:"pl-5",children:b.jsx("input",{type:"checkbox",className:"h-4 w-4 accent-primary",onClick:a=>s(a,o.name)})}),b.jsx("td",{children:l+1}),b.jsx("td",{className:"pe-4",children:o.name}),b.jsx("td",{children:new Date(o.started_at).toLocaleString()}),b.jsx("td",{children:o.duration}),b.jsx("td",{children:b.jsx("span",{className:"badge",style:{color:`var(--color-${i[o.state].text})`,background:`var(--color-${i[o.state].back})`},children:o.state})})]},o.name))})]})})}function lv({isOpen:e,children:t,setIsOpen:n}){return b.jsx(b.Fragment,{children:b.jsx(Wr,{appear:!0,show:e,as:w.Fragment,children:b.jsxs(_h,{as:"div",className:"relative z-10",onClose:()=>n(!1),children:[b.jsx(Wr.Child,{as:w.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:b.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-25"})}),b.jsx("div",{className:"fixed inset-0 overflow-y-auto",children:b.jsx("div",{className:"flex min-h-full items-center justify-center p-4 text-center",children:b.jsx(Wr.Child,{as:w.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:b.jsx(_h.Panel,{className:"w-full max-w-sm transform overflow-hidden rounded-2xl bg-white p-5 text-left align-middle shadow-xl transition-all",children:t})})})})]})})})}function GP(){const[e,t]=w.useState(1),[n,i]=w.useState(1),[r,s]=w.useState(""),[o,l]=w.useState(!1),[a,u]=w.useState(!1),[c,d]=w.useState([]),{toggleTasks:f}=ov(),p=_=>{s(_.target.value)},h=_=>{u(_),l(!0)};w.useEffect(()=>{m()},[]);const[g]=w.useState(!1),[v,y]=w.useState([]),m=async()=>{try{await fetch("http://127.0.0.1:8001/crawler/list").then(_=>{const k=_.body.getReader(),C=()=>{k.read().then(({value:E,done:T})=>{if(T){console.log("Stream finished");return}const M=new TextDecoder().decode(E);try{const R=JSON.parse(M);y(R.data)}catch(R){console.log(R)}C()}).catch(E=>{console.error(E)})};C()}).catch(_=>{console.error(_)})}catch{}},x=async()=>{await f({names:c},a).then(()=>{l(!1)})};return b.jsxs("div",{id:"spiders",children:[b.jsxs(Ed,{title:"Spiders",children:[b.jsxs("div",{className:"flex justify-between mb-5",children:[b.jsxs("div",{className:"flex ml-1",children:[b.jsx(QP,{selectedSort:e,selectedState:n,onSortChange:t,onStateChange:i}),b.jsxs("div",{className:"flex p-2 border border-border bg-white rounded-lg text-text ml-5",children:[b.jsx(Xi.Icon,{path:Dw,size:1,className:"mr-2"}),b.jsx("input",{type:"text",placeholder:"Search spiders by name",value:r,onChange:p,className:"outline-none"})]})]}),b.jsxs("div",{className:"flex h-10 gap-4",children:[b.jsx("button",{className:"btn-primary bg-error text-white",onClick:()=>h(!1),children:"stop all"}),b.jsx("button",{className:"btn-primary bg-success text-white",onClick:()=>h(!0),children:"start all"})]})]}),b.jsx(XP,{data:v,loading:g,selectedIds:c,onSelectedIdsChange:d})]}),b.jsx(lv,{isOpen:o,setIsOpen:l,children:b.jsxs("div",{className:"flex flex-col items-center gap-4",children:[b.jsx(Xi.Icon,{color:"var(--color-primary)",path:k0,size:2}),b.jsx("h3",{className:"text-xl font-semibold",children:"Are you sure !"}),b.jsxs("h4",{className:"text-text text-center font-medium",children:["by performing this action spiders will be"," ",a?"started":"stopped"]}),b.jsxs("div",{className:"flex w-full gap-4",children:[b.jsx("button",{className:"btn-primary w-1/2",onClick:()=>l(!1),children:"Cancel"}),b.jsx("button",{id:"confirm-button",className:"btn-primary w-1/2 text-white bg-primary",onClick:x,children:"Confirm"})]})]})})]})}function JP(){const{toggleTask:e}=ov(),{state:t}=bl(),[n,i]=w.useState(!1),[r,s]=w.useState(!1),[o,l]=w.useState({labels:["","","","","",""],data:[0,0,0,0,0,0],data1:[0,0,0,0,0,0],data2:[0,0,0,0,0,0]}),[a,u]=w.useState({id:"",name:"",duration:"",started_at:"",failedRequest:0,succesfullRequest:0,totalRequest:0,state:"Active"}),c={Active:{text:"success",back:"bg-success"},Finished:{text:"error",back:"bg-error"},Pause:{text:"warning",back:"bg-warning"}},[d,f]=w.useState([]),p={INFO:"var(--color-primary)",ERROR:"var(--color-error)",WARNING:"var(--color-warning)"};w.useEffect(()=>{g(),h(),v()},[]);const h=()=>{fetch(`http://127.0.0.1:8001/${t.data.id}/chart`).then(m=>{const _=m.body.getReader(),S=()=>{_.read().then(({value:k,done:C})=>{if(C){console.log("Stream finished");return}const E=new TextDecoder().decode(k),T=JSON.parse(E);let M=T.data.time.split("T")[1],R=Math.floor(+M.split(":")[2]);M=M.split(":")[0]+":"+M.split(":")[1]+":"+R,l(F=>{const B=[...F.data,T.data.all_requests],J=[...F.data1,T.data.successful_requests],j=[...F.data2,T.data.failed_requests],U=[...F.labels,M];return B.splice(0,1),J.splice(0,1),j.splice(0,1),U.splice(0,1),{data:B,data1:J,data2:j,labels:U}}),u(F=>({...F,totalRequest:T.data.all_requests,succesfullRequest:T.data.successful_requests,failedRequest:T.data.failed_requests})),S()}).catch(k=>{console.error(k)})};S()}).catch(m=>{console.error(m)})},g=()=>{fetch(`http://127.0.0.1:8001/${t.data.id}/detail`).then(m=>{const _=m.body.getReader(),S=()=>{_.read().then(({value:k,done:C})=>{if(C){console.log("Stream finished");return}const E=new TextDecoder().decode(k);try{const T=JSON.parse(E);let M=new Date(T.data[0].started_at).toLocaleString();u(R=>({...R,...T.data[0],started_at:M})),T.data[0].state==="Active"?i(!0):i(!1)}catch{}S()}).catch(k=>{console.error(k)})};S()}).catch(m=>{console.error(m)})},v=()=>{fetch(`http://127.0.0.1:8001/${t.data.id}/logs`).then(m=>{const _=m.body.getReader(),S=()=>{_.read().then(({value:k,done:C})=>{if(C){console.log("Stream finished");return}const E=new TextDecoder().decode(k);try{const T=JSON.parse(E);let M=new Date(T.data.timestamp).toLocaleString();f(R=>[{id:T.data.crawler_id,date:M,message:T.data.message,type:T.data.level},...R])}catch{}S()}).catch(k=>{console.error(k)})};S()}).catch(m=>{console.error(m)})},y=async()=>{await e({name:t.data.name}).then(()=>{s(!1),i(!n)})};return b.jsxs("div",{id:"spiderDetails",children:[b.jsxs(Ed,{title:t.data.name,isBack:!0,children:[b.jsxs("div",{className:"flex flex-col xl:flex-row gap-8 w-full mb-8",children:[b.jsxs("div",{className:"main-card w-full xl:w-2/5 px-10 py-7",children:[b.jsxs("div",{className:"flex justify-between items-center",children:[b.jsx("h3",{className:"text-xl font-semibold",children:"Spider details"}),n?b.jsx("button",{className:"btn-primary text-white bg-error py-1",onClick:()=>s(!0),children:"Stop"}):b.jsx("button",{className:"btn-primary text-white bg-success py-1",onClick:()=>s(!0),children:"Start"})]}),b.jsx("div",{className:"divider my-3"}),b.jsxs("div",{className:"flex flex-col xl:justify-around h-4/5",children:[b.jsxs("div",{className:"spider-details-row",children:[b.jsx("h4",{children:"State : "}),b.jsx("span",{className:"spider-details-row__status",style:{color:`var(--color-${c[a.state].text})`,background:`var(--color-${c[a.state].back})`},children:a.state})]}),b.jsxs("div",{className:"spider-details-row",children:[b.jsx("h4",{children:"Started at : "}),b.jsx("h5",{children:a.started_at})]}),b.jsxs("div",{className:"spider-details-row",children:[b.jsx("h4",{children:"Duration : "}),b.jsx("h5",{children:a.duration})]}),b.jsxs("div",{className:"spider-details-row",children:[b.jsx("h4",{children:"Successfull requests : "}),b.jsx("h5",{children:a.succesfullRequest})]}),b.jsxs("div",{className:"spider-details-row",children:[b.jsx("h4",{children:"Failed requests : "}),b.jsx("h5",{children:a.failedRequest})]}),b.jsxs("div",{className:"spider-details-row mb-0",children:[b.jsx("h4",{children:"Total requests :"}),b.jsx("h5",{children:a.totalRequest})]})]})]}),b.jsxs("div",{className:"main-card w-full xl:w-3/5 px-10 py-7",children:[b.jsx("h3",{className:"text-xl font-semibold",children:"request per second"}),b.jsx("div",{className:"divider my-3"}),b.jsx(zy,{datasets:[{color:"#1b59f8",label:"total",data:o.data},{color:"#b91c1c",label:"failed",data:o.data1},{color:"#059669",label:"success",data:o.data2}],labels:o.labels})]})]}),b.jsxs("div",{className:"main-card w-full px-10 py-7 mb-10",children:[b.jsx("h3",{className:"text-xl font-semibold",children:"Logs"}),b.jsx("div",{className:"divider my-3"}),b.jsx("div",{className:"h-[400px] overflow-y-auto",children:d.map((m,x)=>b.jsxs("div",{className:"spider-logs-row flex-wrap lg:flex-nowrap",children:[b.jsx("h4",{className:"mr-5",children:x+1}),b.jsx("h4",{className:"mr-16",children:m.date}),b.jsx("h5",{style:{color:p[m.type]},children:m.message})]},x))})]})]}),b.jsx(lv,{isOpen:r,setIsOpen:s,children:b.jsxs("div",{className:"flex flex-col items-center gap-4",children:[b.jsx(Gi,{color:"var(--color-primary)",path:k0,size:2}),b.jsx("h3",{className:"text-xl font-semibold",children:"Are you sure !"}),b.jsx("h4",{className:"text-text text-center font-medium",children:"by performing this action spider will be started/stopped"}),b.jsxs("div",{className:"flex w-full gap-4",children:[b.jsx("button",{className:"btn-primary w-1/2",onClick:()=>s(!1),children:"Cancel"}),b.jsx("button",{id:"confirm-button",className:"btn-primary w-1/2 text-white bg-primary",onClick:y,children:"Confirm"})]})]})})]})}const av=[{path:"/",name:"Dashboard",icon:b.jsx(Gi,{path:Aw,size:1}),isShowSideBar:!0,hasChild:!1,element:b.jsx(RC,{})},{path:"/spiders",name:"Spiders",icon:b.jsx(Gi,{path:Fw,size:1}),isShowSideBar:!0,hasChild:!1,element:b.jsx(GP,{})},{path:"/spiders/:spiderName",name:"SpiderDetails",isShowSideBar:!1,hasChild:!1,element:b.jsx(JP,{})}];function ZP({children:e}){const t=bl(),n=Tc();return b.jsxs("div",{id:"default-layout",children:[b.jsxs("header",{className:"siderbar hidden sm:block flex-none",children:[b.jsx("img",{src:"/images/sidebar_logo.svg",alt:"logo"}),b.jsx("div",{className:"devider my-6"}),b.jsx("ul",{className:"side-menu",children:av.map(i=>{if(i.isShowSideBar)return b.jsxs("li",{className:`side-menu__item ${i.path===t.pathname?"active":""}`,onClick:()=>n(i.path),children:[i.icon,i.name]},i.name)})})]}),b.jsx("main",{children:e})]})}function eT(){return b.jsx("div",{id:"App",children:b.jsx(ZP,{children:b.jsx(_1,{children:av.map((e,t)=>{var n;return e.hasChild?(n=e.children)==null?void 0:n.map(i=>b.jsx(nu,{path:i.path,element:i.element},i.name)):b.jsx(nu,{path:e.path,element:e.element},t)})})})})}ru.createRoot(document.getElementById("root")).render(b.jsx(S1,{children:b.jsx(eT,{})})); +`):" "+Gp(s[0]):"as no adapter specified";throw new Y("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return i},adapters:wc};function Za(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ns(null,e)}function Jp(e){return Za(e),e.headers=nn.from(e.headers),e.data=Ja.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),iv.getAdapter(e.adapter||Wd.adapter)(e).then(function(i){return Za(e),i.data=Ja.call(e,e.transformResponse,i),i.headers=nn.from(i.headers),i},function(i){return tv(i)||(Za(e),i&&i.response&&(i.response.data=Ja.call(e,e.transformResponse,i.response),i.response.headers=nn.from(i.response.headers))),Promise.reject(i)})}const Zp=e=>e instanceof nn?e.toJSON():e;function nr(e,t){t=t||{};const n={};function i(u,c,d){return P.isPlainObject(u)&&P.isPlainObject(c)?P.merge.call({caseless:d},u,c):P.isPlainObject(c)?P.merge({},c):P.isArray(c)?c.slice():c}function r(u,c,d){if(P.isUndefined(c)){if(!P.isUndefined(u))return i(void 0,u,d)}else return i(u,c,d)}function s(u,c){if(!P.isUndefined(c))return i(void 0,c)}function o(u,c){if(P.isUndefined(c)){if(!P.isUndefined(u))return i(void 0,u)}else return i(void 0,c)}function l(u,c,d){if(d in t)return i(u,c);if(d in e)return i(void 0,u)}const a={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:l,headers:(u,c)=>r(Zp(u),Zp(c),!0)};return P.forEach(Object.keys(Object.assign({},e,t)),function(c){const d=a[c]||r,f=d(e[c],t[c],c);P.isUndefined(f)&&d!==l||(n[c]=f)}),n}const rv="1.5.1",Vd={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Vd[e]=function(i){return typeof i===e||"a"+(t<1?"n ":" ")+e}});const em={};Vd.transitional=function(t,n,i){function r(s,o){return"[Axios v"+rv+"] Transitional option '"+s+"'"+o+(i?". "+i:"")}return(s,o,l)=>{if(t===!1)throw new Y(r(o," has been removed"+(n?" in "+n:"")),Y.ERR_DEPRECATED);return n&&!em[o]&&(em[o]=!0,console.warn(r(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,o,l):!0}};function UP(e,t,n){if(typeof e!="object")throw new Y("options must be an object",Y.ERR_BAD_OPTION_VALUE);const i=Object.keys(e);let r=i.length;for(;r-- >0;){const s=i[r],o=t[s];if(o){const l=e[s],a=l===void 0||o(l,s,e);if(a!==!0)throw new Y("option "+s+" must be "+a,Y.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Y("Unknown option "+s,Y.ERR_BAD_OPTION)}}const _c={assertOptions:UP,validators:Vd},fn=_c.validators;class vl{constructor(t){this.defaults=t,this.interceptors={request:new Kp,response:new Kp}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=nr(this.defaults,n);const{transitional:i,paramsSerializer:r,headers:s}=n;i!==void 0&&_c.assertOptions(i,{silentJSONParsing:fn.transitional(fn.boolean),forcedJSONParsing:fn.transitional(fn.boolean),clarifyTimeoutError:fn.transitional(fn.boolean)},!1),r!=null&&(P.isFunction(r)?n.paramsSerializer={serialize:r}:_c.assertOptions(r,{encode:fn.function,serialize:fn.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&P.merge(s.common,s[n.method]);s&&P.forEach(["delete","get","head","post","put","patch","common"],h=>{delete s[h]}),n.headers=nn.concat(o,s);const l=[];let a=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(a=a&&g.synchronous,l.unshift(g.fulfilled,g.rejected))});const u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected)});let c,d=0,f;if(!a){const h=[Jp.bind(this),void 0];for(h.unshift.apply(h,l),h.push.apply(h,u),f=h.length,c=Promise.resolve(n);d{if(!i._listeners)return;let s=i._listeners.length;for(;s-- >0;)i._listeners[s](r);i._listeners=null}),this.promise.then=r=>{let s;const o=new Promise(l=>{i.subscribe(l),s=l}).then(r);return o.cancel=function(){i.unsubscribe(s)},o},t(function(s,o,l){i.reason||(i.reason=new Ns(s,o,l),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new qd(function(r){t=r}),cancel:t}}}const WP=qd;function VP(e){return function(n){return e.apply(null,n)}}function qP(e){return P.isObject(e)&&e.isAxiosError===!0}const bc={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(bc).forEach(([e,t])=>{bc[t]=e});const YP=bc;function sv(e){const t=new Ro(e),n=$y(Ro.prototype.request,t);return P.extend(n,Ro.prototype,t,{allOwnKeys:!0}),P.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return sv(nr(e,r))},n}const we=sv(Wd);we.Axios=Ro;we.CanceledError=Ns;we.CancelToken=WP;we.isCancel=tv;we.VERSION=rv;we.toFormData=ta;we.AxiosError=Y;we.Cancel=we.CanceledError;we.all=function(t){return Promise.all(t)};we.spread=VP;we.isAxiosError=qP;we.mergeConfig=nr;we.AxiosHeaders=nn;we.formToJSON=e=>ev(P.isHTMLForm(e)?new FormData(e):e);we.getAdapter=iv.getAdapter;we.HttpStatusCode=YP;we.default=we;const KP=we,eu=KP.create({baseURL:"http://127.0.0.1:8001",headers:{"Content-Type":"application/json"}});function ov(){return{getSpiders:async(i={})=>await eu({url:"/all",method:"get",params:i}),toggleTask:async i=>await eu({url:"/toggle_task",method:"post",data:i}),toggleTasks:async(i,r=!1)=>await eu({url:r?"/start_tasks":"/stop_tasks",method:"post",data:i})}}function QP({selectedSort:e,selectedState:t,onSortChange:n,onStateChange:i}){const r=[{label:"Name",value:1},{label:"State",value:2},{label:"Started at",value:3},{label:"Duration",value:4}],s=[{label:"All",value:1},{label:"Active",value:2},{label:"Paused",value:3},{label:"Finished",value:4}];return b.jsx(ri,{as:"div",className:"relative inline-block text-left z-30",children:({open:o})=>b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"transition-all duration-300",children:b.jsxs(ri.Button,{className:"bg-white border border-border text-text px-2 py-2 rounded-lg font-semibold flex items-center",children:[b.jsx(Xi.Icon,{path:Lw,size:.8,className:"mr-2"}),"Filter",b.jsx(Xi.Icon,{className:`ml-2 ${o?"rotate-180":""}`,path:E0,size:1})]})}),b.jsx(qr,{as:w.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:b.jsx(ri.Items,{className:"absolute left-0 mt-2 w-56 origin-top-left divide-y divide-gray-100 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",children:b.jsxs("div",{className:"p-5",style:{fontFamily:"Inter"},children:[b.jsxs("h4",{className:"text-primary text-sm font-medium mb-2",children:["SORT BY :"," "]}),r.map(l=>b.jsxs("label",{className:"flex items-center justify-between cursor-pointer hover:bg-bg-primary p-1 px-2 rounded-md",children:[b.jsx("span",{className:"text-gray-800 text-sm",children:l.label}),b.jsx("input",{type:"radio",value:1,checked:e===l.value,onChange:()=>n(l.value),className:"form-radio h-4 w-4 text-primary"})]},l.value)),b.jsx("div",{className:"h-[2px] bg-border my-3"}),b.jsxs("h4",{className:"text-primary text-sm font-medium mb-2",children:["STATE :"," "]}),s.map(l=>b.jsxs("label",{className:"flex items-center justify-between cursor-pointer hover:bg-bg-primary p-1 px-2 rounded-md",children:[b.jsx("span",{className:"text-gray-800 text-sm",children:l.label}),b.jsx("input",{type:"radio",value:1,checked:t===l.value,onChange:()=>i(l.value),className:"form-radio h-4 w-4 text-primary"})]},l.value))]})})})]})})}function XP({data:e,loading:t,onSelectedIdsChange:n}){const i={Active:{text:"success",back:"bg-success"},Finished:{text:"error",back:"bg-error"},Pause:{text:"warning",back:"bg-warning"}},r=or(),s=(o,l)=>{o.stopPropagation(),n(a=>{const u=[...a],c=u.indexOf(l);return c!==-1?u.splice(c,1):u.push(l),[...u]})};return b.jsx("div",{className:"main-card px-4 w-full overflow-y-auto",style:{height:"calc(100vh - 200px)"},children:t?b.jsx("div",{className:"text-center mt-10",children:b.jsx(Gi,{path:Nw,size:1.5,color:"var(--color-primary)",className:"mx-auto animate-spin"})}):e&&b.jsxs("table",{className:"w-full",children:[b.jsx("thead",{className:"sticky top-0 bg-white",children:b.jsxs("tr",{children:[b.jsx("th",{className:"w-1/12 pl-5",children:b.jsx("input",{type:"checkbox",className:"h-4 w-4 accent-primary"})}),b.jsx("th",{className:"pe-4",children:"#"}),b.jsx("th",{className:"w-3/12",children:"Name"}),b.jsx("th",{className:"w-3/12",children:"Started at"}),b.jsx("th",{className:"w-2/12",children:"Duration"}),b.jsx("th",{className:"w-2/12",children:"State"})]})}),b.jsx("tbody",{children:e.map((o,l)=>b.jsxs("tr",{className:"hover:bg-bg-primary",onClick:()=>r(`/spiders/${o.id}`,{state:{data:o}}),children:[b.jsx("td",{className:"pl-5",children:b.jsx("input",{type:"checkbox",className:"h-4 w-4 accent-primary",onClick:a=>s(a,o.name)})}),b.jsx("td",{children:l+1}),b.jsx("td",{className:"pe-4",children:o.name}),b.jsx("td",{children:new Date(o.started_at).toLocaleString()}),b.jsx("td",{children:o.duration}),b.jsx("td",{children:b.jsx("span",{className:"badge",style:{color:`var(--color-${i[o.state].text})`,background:`var(--color-${i[o.state].back})`},children:o.state})})]},o.name))})]})})}function lv({isOpen:e,children:t,setIsOpen:n}){return b.jsx(b.Fragment,{children:b.jsx(qr,{appear:!0,show:e,as:w.Fragment,children:b.jsxs(_h,{as:"div",className:"relative z-10",onClose:()=>n(!1),children:[b.jsx(qr.Child,{as:w.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:b.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-25"})}),b.jsx("div",{className:"fixed inset-0 overflow-y-auto",children:b.jsx("div",{className:"flex min-h-full items-center justify-center p-4 text-center",children:b.jsx(qr.Child,{as:w.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:b.jsx(_h.Panel,{className:"w-full max-w-sm transform overflow-hidden rounded-2xl bg-white p-5 text-left align-middle shadow-xl transition-all",children:t})})})})]})})})}function GP(){const e=or(),[t,n]=w.useState(1),[i,r]=w.useState(1),[s,o]=w.useState(""),[l,a]=w.useState(!1),[u,c]=w.useState(!1),[d,f]=w.useState([]),{toggleTasks:p}=ov(),h=_=>{o(_.target.value)},g=_=>{c(_),a(!0)};w.useEffect(()=>{const _=new AbortController,S=_.signal;return(async()=>{try{const k=(await fetch("http://127.0.0.1:8001/crawler/list",{signal:S})).body.getReader();for(;;){const{done:L,value:M}=await k.read();if(L){console.log("Stream finished");break}const R=new TextDecoder().decode(M),N=JSON.parse(R);m(N.data)}}catch(E){console.warn("Warning in fetching data:",E)}})(),()=>{_.abort()}},[e]);const[v]=w.useState(!1),[y,m]=w.useState([]),x=async()=>{await p({names:d},u).then(()=>{a(!1)})};return b.jsxs("div",{id:"spiders",children:[b.jsxs(Ed,{title:"Spiders",children:[b.jsxs("div",{className:"flex justify-between mb-5",children:[b.jsxs("div",{className:"flex ml-1",children:[b.jsx(QP,{selectedSort:t,selectedState:i,onSortChange:n,onStateChange:r}),b.jsxs("div",{className:"flex p-2 border border-border bg-white rounded-lg text-text ml-5",children:[b.jsx(Xi.Icon,{path:Dw,size:1,className:"mr-2"}),b.jsx("input",{type:"text",placeholder:"Search spiders by name",value:s,onChange:h,className:"outline-none"})]})]}),b.jsxs("div",{className:"flex h-10 gap-4",children:[b.jsx("button",{className:"btn-primary bg-error text-white",onClick:()=>g(!1),children:"stop all"}),b.jsx("button",{className:"btn-primary bg-success text-white",onClick:()=>g(!0),children:"start all"})]})]}),b.jsx(XP,{data:y,loading:v,selectedIds:d,onSelectedIdsChange:f})]}),b.jsx(lv,{isOpen:l,setIsOpen:a,children:b.jsxs("div",{className:"flex flex-col items-center gap-4",children:[b.jsx(Xi.Icon,{color:"var(--color-primary)",path:k0,size:2}),b.jsx("h3",{className:"text-xl font-semibold",children:"Are you sure !"}),b.jsxs("h4",{className:"text-text text-center font-medium",children:["by performing this action spiders will be"," ",u?"started":"stopped"]}),b.jsxs("div",{className:"flex w-full gap-4",children:[b.jsx("button",{className:"btn-primary w-1/2",onClick:()=>a(!1),children:"Cancel"}),b.jsx("button",{id:"confirm-button",className:"btn-primary w-1/2 text-white bg-primary",onClick:x,children:"Confirm"})]})]})})]})}function JP(){const{toggleTask:e}=ov(),{state:t}=Sl(),[n,i]=w.useState(!1),[r,s]=w.useState(!1),[o,l]=w.useState({labels:["","","","","",""],data:[0,0,0,0,0,0],data1:[0,0,0,0,0,0],data2:[0,0,0,0,0,0]}),[a,u]=w.useState({id:"",name:"",duration:"",started_at:"",failedRequest:0,succesfullRequest:0,totalRequest:0,state:"Active"}),c={Active:{text:"success",back:"bg-success"},Finished:{text:"error",back:"bg-error"},Pause:{text:"warning",back:"bg-warning"}},[d,f]=w.useState([]),p={INFO:"var(--color-primary)",ERROR:"var(--color-error)",WARNING:"var(--color-warning)"},h=or(),g=new AbortController;w.useEffect(()=>(y(),v(),m(),()=>{g.abort()}),[h]);const v=()=>{fetch(`http://127.0.0.1:8001/${t.data.id}/chart`,{signal:g.signal}).then(_=>{const C=_.body.getReader(),E=()=>{C.read().then(({value:k,done:L})=>{if(L){console.log("Stream finished");return}const M=new TextDecoder().decode(k),R=JSON.parse(M);let N=R.data.time.split("T")[1],$=Math.floor(+N.split(":")[2]);N=N.split(":")[0]+":"+N.split(":")[1]+":"+$,l(X=>{const j=[...X.data,R.data.all_requests],U=[...X.data1,R.data.successful_requests],G=[...X.data2,R.data.failed_requests],O=[...X.labels,N];return j.splice(0,1),U.splice(0,1),G.splice(0,1),O.splice(0,1),{data:j,data1:U,data2:G,labels:O}}),u(X=>({...X,totalRequest:R.data.all_requests,succesfullRequest:R.data.successful_requests,failedRequest:R.data.failed_requests})),E()}).catch(k=>{console.error(k)})};E()}).catch(_=>{console.warn(_)})},y=()=>{fetch(`http://127.0.0.1:8001/${t.data.id}/detail`,{signal:g.signal}).then(_=>{const C=_.body.getReader(),E=()=>{C.read().then(({value:k,done:L})=>{if(L){console.log("Stream finished");return}const M=new TextDecoder().decode(k);try{const R=JSON.parse(M);let N=new Date(R.data[0].started_at).toLocaleString();u($=>({...$,...R.data[0],started_at:N})),R.data[0].state==="Active"?i(!0):i(!1)}catch{}E()}).catch(k=>{console.error(k)})};E()}).catch(_=>{console.warn(_)})},m=()=>{fetch(`http://127.0.0.1:8001/${t.data.id}/logs`,{signal:g.signal}).then(_=>{const C=_.body.getReader(),E=()=>{C.read().then(({value:k,done:L})=>{if(L){console.log("Stream finished");return}const M=new TextDecoder().decode(k);try{const R=JSON.parse(M);let N=new Date(R.data.timestamp).toLocaleString();f($=>[{id:R.data.crawler_id,date:N,message:R.data.message,type:R.data.level},...$])}catch{}E()}).catch(k=>{console.error(k)})};E()}).catch(_=>{console.warn(_)})},x=async()=>{await e({name:t.data.name}).then(()=>{s(!1),i(!n)})};return b.jsxs("div",{id:"spiderDetails",children:[b.jsxs(Ed,{title:t.data.name,isBack:!0,children:[b.jsxs("div",{className:"flex flex-col xl:flex-row gap-8 w-full mb-8",children:[b.jsxs("div",{className:"main-card w-full xl:w-2/5 px-10 py-7",children:[b.jsxs("div",{className:"flex justify-between items-center",children:[b.jsx("h3",{className:"text-xl font-semibold",children:"Spider details"}),n?b.jsx("button",{className:"btn-primary text-white bg-error py-1",onClick:()=>s(!0),children:"Stop"}):b.jsx("button",{className:"btn-primary text-white bg-success py-1",onClick:()=>s(!0),children:"Start"})]}),b.jsx("div",{className:"divider my-3"}),b.jsxs("div",{className:"flex flex-col xl:justify-around h-4/5",children:[b.jsxs("div",{className:"spider-details-row",children:[b.jsx("h4",{children:"State : "}),b.jsx("span",{className:"spider-details-row__status",style:{color:`var(--color-${c[a.state].text})`,background:`var(--color-${c[a.state].back})`},children:a.state})]}),b.jsxs("div",{className:"spider-details-row",children:[b.jsx("h4",{children:"Started at : "}),b.jsx("h5",{children:a.started_at})]}),b.jsxs("div",{className:"spider-details-row",children:[b.jsx("h4",{children:"Duration : "}),b.jsx("h5",{children:a.duration})]}),b.jsxs("div",{className:"spider-details-row",children:[b.jsx("h4",{children:"Successfull requests : "}),b.jsx("h5",{children:a.succesfullRequest})]}),b.jsxs("div",{className:"spider-details-row",children:[b.jsx("h4",{children:"Failed requests : "}),b.jsx("h5",{children:a.failedRequest})]}),b.jsxs("div",{className:"spider-details-row mb-0",children:[b.jsx("h4",{children:"Total requests :"}),b.jsx("h5",{children:a.totalRequest})]})]})]}),b.jsxs("div",{className:"main-card w-full xl:w-3/5 px-10 py-7",children:[b.jsx("h3",{className:"text-xl font-semibold",children:"request per second"}),b.jsx("div",{className:"divider my-3"}),b.jsx(zy,{datasets:[{color:"#1b59f8",label:"total",data:o.data},{color:"#b91c1c",label:"failed",data:o.data1},{color:"#059669",label:"success",data:o.data2}],labels:o.labels})]})]}),b.jsxs("div",{className:"main-card w-full px-10 py-7 mb-10",children:[b.jsx("h3",{className:"text-xl font-semibold",children:"Logs"}),b.jsx("div",{className:"divider my-3"}),b.jsx("div",{className:"h-[400px] overflow-y-auto",children:d.map((_,S)=>b.jsxs("div",{className:"spider-logs-row flex-wrap lg:flex-nowrap",children:[b.jsx("h4",{className:"mr-5",children:S+1}),b.jsx("h4",{className:"mr-16",children:_.date}),b.jsx("h5",{style:{color:p[_.type]},children:_.message})]},S))})]})]}),b.jsx(lv,{isOpen:r,setIsOpen:s,children:b.jsxs("div",{className:"flex flex-col items-center gap-4",children:[b.jsx(Gi,{color:"var(--color-primary)",path:k0,size:2}),b.jsx("h3",{className:"text-xl font-semibold",children:"Are you sure !"}),b.jsx("h4",{className:"text-text text-center font-medium",children:"by performing this action spider will be started/stopped"}),b.jsxs("div",{className:"flex w-full gap-4",children:[b.jsx("button",{className:"btn-primary w-1/2",onClick:()=>s(!1),children:"Cancel"}),b.jsx("button",{id:"confirm-button",className:"btn-primary w-1/2 text-white bg-primary",onClick:x,children:"Confirm"})]})]})})]})}const av=[{path:"/",name:"Dashboard",icon:b.jsx(Gi,{path:Aw,size:1}),isShowSideBar:!0,hasChild:!1,element:b.jsx(RC,{})},{path:"/spiders",name:"Spiders",icon:b.jsx(Gi,{path:Fw,size:1}),isShowSideBar:!0,hasChild:!1,element:b.jsx(GP,{})},{path:"/spiders/:spiderName",name:"SpiderDetails",isShowSideBar:!1,hasChild:!1,element:b.jsx(JP,{})}];function ZP({children:e}){const t=Sl(),n=or();return b.jsxs("div",{id:"default-layout",children:[b.jsxs("header",{className:"siderbar hidden sm:block flex-none",children:[b.jsx("img",{src:"/images/sidebar_logo.svg",alt:"logo"}),b.jsx("div",{className:"devider my-6"}),b.jsx("ul",{className:"side-menu",children:av.map(i=>{if(i.isShowSideBar)return b.jsxs("li",{className:`side-menu__item ${i.path===t.pathname?"active":""}`,onClick:()=>n(i.path),children:[i.icon,i.name]},i.name)})})]}),b.jsx("main",{children:e})]})}function eT(){return b.jsx("div",{id:"App",children:b.jsx(ZP,{children:b.jsx(_1,{children:av.map((e,t)=>{var n;return e.hasChild?(n=e.children)==null?void 0:n.map(i=>b.jsx(iu,{path:i.path,element:i.element},i.name)):b.jsx(iu,{path:e.path,element:e.element},t)})})})})}su.createRoot(document.getElementById("root")).render(b.jsx(S1,{children:b.jsx(eT,{})})); diff --git a/frontend/dist/index.html b/frontend/dist/index.html index 3f609a1..1b17e19 100644 --- a/frontend/dist/index.html +++ b/frontend/dist/index.html @@ -5,7 +5,7 @@ Fast Crawler Panel - + diff --git a/frontend/src/pages/index.tsx b/frontend/src/pages/index.tsx index 43a3740..5470a32 100644 --- a/frontend/src/pages/index.tsx +++ b/frontend/src/pages/index.tsx @@ -1,11 +1,12 @@ import { useEffect, useState } from "react"; +import { useNavigate } from "react-router-dom"; import BaseFrame from "../components/Base/Frame"; import BaseChart from "../components/Base/Chart"; import { IOverviewData } from "../constants/types"; function index() { - const [requests, setRequest] = useState({ + const [requests, setRequests] = useState({ labels: ["", "", "", "", "", ""], data: [0, 0, 0, 0, 0, 0], data1: [0, 0, 0, 0, 0, 0], @@ -22,117 +23,98 @@ function index() { failedRequests: 0, }); + const navigate = useNavigate(); + useEffect(() => { - fetchOverviewData(); - fetchChartData(); - }, []); + const abortController = new AbortController(); + const signal = abortController.signal; + + const fetchOverviewData = async () => { + try { + const response = await fetch( + "http://127.0.0.1:8001/dashboard/crawlers", + { signal } + ); + const reader = response.body!.getReader(); + while (true) { + const { done, value } = await reader.read(); + if (done) { + console.log("Stream finished"); + break; + } + const chunkString = new TextDecoder().decode(value); + const resData = JSON.parse(chunkString); + const time = new Date(resData.data.time).toLocaleString(); + setOverviewData((prevData) => ({ + ...prevData, + currentTime: time, + allCrawlers: resData.data.all_crawlers, + activeCrawlers: resData.data.active_crawlers, + deactiveCrawlers: resData.data.deactive_crawlers, + })); + } + } catch (error) { + console.warn("Warning in fetching overview data:", error); + } + }; - const fetchOverviewData = () => { - fetch("http://127.0.0.1:8001/dashboard/crawlers") - .then((response) => { - const stream = response.body; - const reader = stream!.getReader(); - const readChunk = () => { - reader - .read() - .then(({ value, done }) => { - if (done) { - console.log("Stream finished"); - return; - } - const chunkString = new TextDecoder().decode(value); - try { - const resData = JSON.parse(chunkString); - let time = new Date(resData.data.time).toLocaleString(); - setOverviewData((prevData) => ({ - ...prevData, - currentTime: time, - allCrawlers: resData.data.all_crawlers, - activeCrawlers: resData.data.active_crawlers, - deactiveCrawlers: resData.data.deactive_crawlers, - })); - } catch (error) { - console.log(error); - } + const fetchChartData = async () => { + try { + const response = await fetch("http://127.0.0.1:8001/dashboard/chart", { + signal, + }); + const reader = response.body!.getReader(); + while (true) { + const { done, value } = await reader.read(); + if (done) { + console.log("Stream finished"); + break; + } + const chunkString = new TextDecoder().decode(value); + const resData = JSON.parse(chunkString); + let time = resData.data.time.split("T")[1]; + let second = Math.floor(+time.split(":")[2]); + time = time.split(":")[0] + ":" + time.split(":")[1] + ":" + second; - readChunk(); - }) - .catch((error) => { - console.error(error); - }); - }; - readChunk(); - }) - .catch((error) => { - console.error(error); - }); - }; + setRequests((prevData) => { + const newData = [...prevData.data, resData.data.all_requests]; + const newData1 = [ + ...prevData.data1, + resData.data.successful_requests, + ]; + const newData2 = [...prevData.data2, resData.data.failed_requests]; + const newLabels = [...prevData.labels, time]; + newData.splice(0, 1); + newData1.splice(0, 1); + newData2.splice(0, 1); + newLabels.splice(0, 1); + return { + data: newData, + data1: newData1, + data2: newData2, + labels: newLabels, + }; + }); - const fetchChartData = () => { - fetch("http://127.0.0.1:8001/dashboard/chart") - .then((response) => { - const stream = response.body; - const reader = stream!.getReader(); - const readChunk = () => { - reader - .read() - .then(({ value, done }) => { - if (done) { - console.log("Stream finished"); - return; - } - const chunkString = new TextDecoder().decode(value); - try { - const resData = JSON.parse(chunkString); - let time = resData.data.time.split("T")[1]; - let second = Math.floor(+time.split(":")[2]); - time = - time.split(":")[0] + ":" + time.split(":")[1] + ":" + second; - //@ts-ignore - setRequest((prevData) => { - const newData = [...prevData.data, resData.data.all_requests]; - const newData1 = [ - ...prevData.data1, - resData.data.successful_requests, - ]; - const newData2 = [ - ...prevData.data2, - resData.data.failed_requests, - ]; - const newLabels = [...prevData.labels, time]; - newData.splice(0, 1); - newData1.splice(0, 1); - newData2.splice(0, 1); - newLabels.splice(0, 1); - return { - data: newData, - data1: newData1, - data2: newData2, - labels: newLabels, - }; - }); - setOverviewData((prevData) => ({ - ...prevData, - totalRequests: resData.data.all_requests, - successfullRequests: resData.data.successful_requests, - failedRequests: resData.data.failed_requests, - })); - } catch (error) { - console.log(error); - } + setOverviewData((prevData) => ({ + ...prevData, + totalRequests: resData.data.all_requests, + successfulRequests: resData.data.successful_requests, + failedRequests: resData.data.failed_requests, + })); + } + } catch (error) { + console.warn("Warning in fetching chart data:", error); + } + }; + + fetchOverviewData(); + fetchChartData(); - readChunk(); - }) - .catch((error) => { - console.error(error); - }); - }; - readChunk(); - }) - .catch((error) => { - console.error(error); - }); - }; + return () => { + abortController.abort(); + }; + }, [navigate]); return (
diff --git a/frontend/src/pages/spiders/details.tsx b/frontend/src/pages/spiders/details.tsx index 905cc4e..d7664fb 100644 --- a/frontend/src/pages/spiders/details.tsx +++ b/frontend/src/pages/spiders/details.tsx @@ -1,5 +1,5 @@ import { useEffect, useState } from "react"; -import { useLocation } from "react-router-dom"; +import { useLocation, useNavigate } from "react-router-dom"; import Icon from "@mdi/react"; import { mdiInformationOutline } from "@mdi/js"; @@ -57,14 +57,23 @@ function SpiderDetailsPage() { WARNING: "var(--color-warning)", }; + const navigate = useNavigate(); + const abortController = new AbortController(); + useEffect(() => { fetchCrawlerDetails(); fetchChartData(); fetchLogsData(); - }, []); + + return () => { + abortController.abort(); + }; + }, [navigate]); const fetchChartData = () => { - fetch(`http://127.0.0.1:8001/${state.data.id}/chart`) + fetch(`http://127.0.0.1:8001/${state.data.id}/chart`, { + signal: abortController.signal, + }) .then((response) => { const stream = response.body; const reader = stream!.getReader(); @@ -120,12 +129,14 @@ function SpiderDetailsPage() { readChunk(); }) .catch((error) => { - console.error(error); + console.warn(error); }); }; const fetchCrawlerDetails = () => { - fetch(`http://127.0.0.1:8001/${state.data.id}/detail`) + fetch(`http://127.0.0.1:8001/${state.data.id}/detail`, { + signal: abortController.signal, + }) .then((response) => { const stream = response.body; const reader = stream!.getReader(); @@ -160,12 +171,14 @@ function SpiderDetailsPage() { readChunk(); }) .catch((error) => { - console.error(error); + console.warn(error); }); }; const fetchLogsData = () => { - fetch(`http://127.0.0.1:8001/${state.data.id}/logs`) + fetch(`http://127.0.0.1:8001/${state.data.id}/logs`, { + signal: abortController.signal, + }) .then((response) => { const stream = response.body; const reader = stream!.getReader(); @@ -203,7 +216,7 @@ function SpiderDetailsPage() { readChunk(); }) .catch((error) => { - console.error(error); + console.warn(error); }); }; diff --git a/frontend/src/pages/spiders/index.tsx b/frontend/src/pages/spiders/index.tsx index d7b37e1..d21966f 100644 --- a/frontend/src/pages/spiders/index.tsx +++ b/frontend/src/pages/spiders/index.tsx @@ -1,6 +1,7 @@ import { useEffect, useState } from "react"; import { Icon } from "@mdi/react"; import { mdiMagnify, mdiInformationOutline } from "@mdi/js"; +import { useNavigate } from "react-router-dom"; import { ISpiderData } from "../../constants/types"; import { useSpiderApi } from "../../api"; @@ -10,6 +11,8 @@ import SpidersDataTable from "../../components/Spiders/DataTable"; import BaseModal from "../../components/Base/Modal"; function spiders() { + const navigate = useNavigate(); + const [selectedSort, setSelectedSort] = useState(1); const [selectedState, setSelectedState] = useState(1); const [searchName, setSearchName] = useState(""); @@ -28,49 +31,39 @@ function spiders() { }; useEffect(() => { + const abortController = new AbortController(); + const signal = abortController.signal; + + const fetchOverviewData = async () => { + try { + const response = await fetch("http://127.0.0.1:8001/crawler/list", { + signal, + }); + const reader = response.body!.getReader(); + while (true) { + const { done, value } = await reader.read(); + if (done) { + console.log("Stream finished"); + break; + } + const chunkString = new TextDecoder().decode(value); + const resData = JSON.parse(chunkString); + setSpiders(resData.data); + } + } catch (error) { + console.warn("Warning in fetching data:", error); + } + }; + fetchOverviewData(); - // getSpidersData(); - }, []); + + return () => { + abortController.abort(); + }; + }, [navigate]); const [loading] = useState(false); const [spiders, setSpiders] = useState([]); - const fetchOverviewData = async () => { - try { - await fetch("http://127.0.0.1:8001/crawler/list") - .then((response) => { - const stream = response.body; - const reader = stream!.getReader(); - const readChunk = () => { - reader - .read() - .then(({ value, done }) => { - if (done) { - console.log("Stream finished"); - return; - } - const chunkString = new TextDecoder().decode(value); - try { - const resData = JSON.parse(chunkString); - // let time = new Date(resData.data.time).toLocaleString(); - // console.log(resData); - setSpiders(resData.data); - } catch (error) { - console.log(error); - } - - readChunk(); - }) - .catch((error) => { - console.error(error); - }); - }; - readChunk(); - }) - .catch((error) => { - console.error(error); - }); - } catch (error) {} - }; const toggleSpidersStatus = async () => { await toggleTasks({ names: selectedIds }, isStart).then(() => {