pulsewatch-frontend 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,13 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("react"),xd=require("react-dom");function _p(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const Q=_p(L);var Si={exports:{}},vn={};var bl;function wp(){if(bl)return vn;bl=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function s(n,i,r){var o=null;if(r!==void 0&&(o=""+r),i.key!==void 0&&(o=""+i.key),"key"in i){r={};for(var a in i)a!=="key"&&(r[a]=i[a])}else r=i;return i=r.ref,{$$typeof:e,type:n,key:o,ref:i!==void 0?i:null,props:r}}return vn.Fragment=t,vn.jsx=s,vn.jsxs=s,vn}var _n={};var yl;function Sp(){return yl||(yl=1,process.env.NODE_ENV!=="production"&&(function(){function e(M){if(M==null)return null;if(typeof M=="function")return M.$$typeof===j?null:M.displayName||M.name||null;if(typeof M=="string")return M;switch(M){case g:return"Fragment";case x:return"Profiler";case b:return"StrictMode";case P:return"Suspense";case R:return"SuspenseList";case N:return"Activity"}if(typeof M=="object")switch(typeof M.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),M.$$typeof){case m:return"Portal";case v:return M.displayName||"Context";case w:return(M._context.displayName||"Context")+".Consumer";case S:var Y=M.render;return M=M.displayName,M||(M=Y.displayName||Y.name||"",M=M!==""?"ForwardRef("+M+")":"ForwardRef"),M;case _:return Y=M.displayName||null,Y!==null?Y:e(M.type)||"Memo";case C:Y=M._payload,M=M._init;try{return e(M(Y))}catch{}}return null}function t(M){return""+M}function s(M){try{t(M);var Y=!1}catch{Y=!0}if(Y){Y=console;var B=Y.error,U=typeof Symbol=="function"&&Symbol.toStringTag&&M[Symbol.toStringTag]||M.constructor.name||"Object";return B.call(Y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",U),t(M)}}function n(M){if(M===g)return"<>";if(typeof M=="object"&&M!==null&&M.$$typeof===C)return"<...>";try{var Y=e(M);return Y?"<"+Y+">":"<...>"}catch{return"<...>"}}function i(){var M=A.A;return M===null?null:M.getOwner()}function r(){return Error("react-stack-top-frame")}function o(M){if(F.call(M,"key")){var Y=Object.getOwnPropertyDescriptor(M,"key").get;if(Y&&Y.isReactWarning)return!1}return M.key!==void 0}function a(M,Y){function B(){I||(I=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",Y))}B.isReactWarning=!0,Object.defineProperty(M,"key",{get:B,configurable:!0})}function l(){var M=e(this.type);return q[M]||(q[M]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),M=this.props.ref,M!==void 0?M:null}function c(M,Y,B,U,et,ft){var Z=B.ref;return M={$$typeof:p,type:M,key:Y,props:B,_owner:U},(Z!==void 0?Z:null)!==null?Object.defineProperty(M,"ref",{enumerable:!1,get:l}):Object.defineProperty(M,"ref",{enumerable:!1,value:null}),M._store={},Object.defineProperty(M._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(M,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(M,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:et}),Object.defineProperty(M,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ft}),Object.freeze&&(Object.freeze(M.props),Object.freeze(M)),M}function u(M,Y,B,U,et,ft){var Z=Y.children;if(Z!==void 0)if(U)if(V(Z)){for(U=0;U<Z.length;U++)d(Z[U]);Object.freeze&&Object.freeze(Z)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else d(Z);if(F.call(Y,"key")){Z=e(M);var it=Object.keys(Y).filter(function(Ot){return Ot!=="key"});U=0<it.length?"{key: someKey, "+it.join(": ..., ")+": ...}":"{key: someKey}",dt[Z+U]||(it=0<it.length?"{"+it.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
+ let props = %s;
3
+ <%s {...props} />
4
+ React keys must be passed directly to JSX without using spread:
5
+ let props = %s;
6
+ <%s key={someKey} {...props} />`,U,Z,it,Z),dt[Z+U]=!0)}if(Z=null,B!==void 0&&(s(B),Z=""+B),o(Y)&&(s(Y.key),Z=""+Y.key),"key"in Y){B={};for(var kt in Y)kt!=="key"&&(B[kt]=Y[kt])}else B=Y;return Z&&a(B,typeof M=="function"?M.displayName||M.name||"Unknown":M),c(M,Z,B,i(),et,ft)}function d(M){h(M)?M._store&&(M._store.validated=1):typeof M=="object"&&M!==null&&M.$$typeof===C&&(M._payload.status==="fulfilled"?h(M._payload.value)&&M._payload.value._store&&(M._payload.value._store.validated=1):M._store&&(M._store.validated=1))}function h(M){return typeof M=="object"&&M!==null&&M.$$typeof===p}var f=L,p=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),v=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),j=Symbol.for("react.client.reference"),A=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=Object.prototype.hasOwnProperty,V=Array.isArray,W=console.createTask?console.createTask:function(){return null};f={react_stack_bottom_frame:function(M){return M()}};var I,q={},z=f.react_stack_bottom_frame.bind(f,r)(),rt=W(n(r)),dt={};_n.Fragment=g,_n.jsx=function(M,Y,B){var U=1e4>A.recentlyCreatedOwnerStacks++;return u(M,Y,B,!1,U?Error("react-stack-top-frame"):z,U?W(n(M)):rt)},_n.jsxs=function(M,Y,B){var U=1e4>A.recentlyCreatedOwnerStacks++;return u(M,Y,B,!0,U?Error("react-stack-top-frame"):z,U?W(n(M)):rt)}})()),_n}var xl;function kp(){return xl||(xl=1,process.env.NODE_ENV==="production"?Si.exports=wp():Si.exports=Sp()),Si.exports}var y=kp();const Fo=new WeakMap,Rp=new WeakMap,lr={current:[]};let Qr=!1,Hn=0;const Fn=new Set,ki=new Map;function vd(e){for(const t of e){if(lr.current.includes(t))continue;lr.current.push(t),t.recompute();const s=Rp.get(t);if(s)for(const n of s){const i=Fo.get(n);i?.length&&vd(i)}}}function Pp(e){const t={prevVal:e.prevState,currentVal:e.state};for(const s of e.listeners)s(t)}function Ep(e){const t={prevVal:e.prevState,currentVal:e.state};for(const s of e.listeners)s(t)}function _d(e){if(Hn>0&&!ki.has(e)&&ki.set(e,e.prevState),Fn.add(e),!(Hn>0)&&!Qr)try{for(Qr=!0;Fn.size>0;){const t=Array.from(Fn);Fn.clear();for(const s of t){const n=ki.get(s)??s.prevState;s.prevState=n,Pp(s)}for(const s of t){const n=Fo.get(s);n&&(lr.current.push(s),vd(n))}for(const s of t){const n=Fo.get(s);if(n)for(const i of n)Ep(i)}}}finally{Qr=!1,lr.current=[],ki.clear()}}function Cp(e){Hn++;try{e()}finally{if(Hn--,Hn===0){const t=Fn.values().next().value;t&&_d(t)}}}function Op(e){return typeof e=="function"}class Tp{constructor(t,s){this.listeners=new Set,this.subscribe=n=>{var i,r;this.listeners.add(n);const o=(r=(i=this.options)==null?void 0:i.onSubscribe)==null?void 0:r.call(i,n,this);return()=>{this.listeners.delete(n),o?.()}},this.prevState=t,this.state=t,this.options=s}setState(t){var s,n,i;this.prevState=this.state,(s=this.options)!=null&&s.updateFn?this.state=this.options.updateFn(this.prevState)(t):Op(t)?this.state=t(this.prevState):this.state=t,(i=(n=this.options)==null?void 0:n.onUpdate)==null||i.call(n),_d(this)}}const us="__TSR_index",vl="popstate",_l="beforeunload";function Mp(e){let t=e.getLocation();const s=new Set,n=o=>{t=e.getLocation(),s.forEach(a=>a({location:t,action:o}))},i=o=>{e.notifyOnIndexChange??!0?n(o):t=e.getLocation()},r=async({task:o,navigateOpts:a,...l})=>{if(a?.ignoreBlocker??!1){o();return}const u=e.getBlockers?.()??[],d=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&u.length&&d)for(const h of u){const f=cr(l.path,l.state);if(await h.blockerFn({currentLocation:t,nextLocation:f,action:l.type})){e.onBlocked?.();return}}o()};return{get location(){return t},get length(){return e.getLength()},subscribers:s,subscribe:o=>(s.add(o),()=>{s.delete(o)}),push:(o,a,l)=>{const c=t.state[us];a=wl(c+1,a),r({task:()=>{e.pushState(o,a),n({type:"PUSH"})},navigateOpts:l,type:"PUSH",path:o,state:a})},replace:(o,a,l)=>{const c=t.state[us];a=wl(c,a),r({task:()=>{e.replaceState(o,a),n({type:"REPLACE"})},navigateOpts:l,type:"REPLACE",path:o,state:a})},go:(o,a)=>{r({task:()=>{e.go(o),i({type:"GO",index:o})},navigateOpts:a,type:"GO"})},back:o=>{r({task:()=>{e.back(o?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:o,type:"BACK"})},forward:o=>{r({task:()=>{e.forward(o?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:o,type:"FORWARD"})},canGoBack:()=>t.state[us]!==0,createHref:o=>e.createHref(o),block:o=>{if(!e.setBlockers)return()=>{};const a=e.getBlockers?.()??[];return e.setBlockers([...a,o]),()=>{const l=e.getBlockers?.()??[];e.setBlockers?.(l.filter(c=>c!==o))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:n}}function wl(e,t){t||(t={});const s=_a();return{...t,key:s,__TSR_key:s,[us]:e}}function Ap(e){const t=typeof document<"u"?window:void 0,s=t.history.pushState,n=t.history.replaceState;let i=[];const r=()=>i,o=_=>i=_,a=(_=>_),l=(()=>cr(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const _=_a();t.history.replaceState({[us]:0,key:_,__TSR_key:_},"")}let c=l(),u,d=!1,h=!1,f=!1,p=!1;const m=()=>c;let g,b;const x=()=>{g&&(R._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,"",g.href),R._ignoreSubscribers=!1,g=void 0,b=void 0,u=void 0)},w=(_,C,N)=>{const j=a(C);b||(u=c),c=cr(C,N),g={href:j,state:N,isPush:g?.isPush||_==="push"},b||(b=Promise.resolve().then(()=>x()))},v=_=>{c=l(),R.notify({type:_})},S=async()=>{if(h){h=!1;return}const _=l(),C=_.state[us]-c.state[us],N=C===1,j=C===-1,A=!N&&!j||d;d=!1;const F=A?"GO":j?"BACK":"FORWARD",V=A?{type:"GO",index:C}:{type:j?"BACK":"FORWARD"};if(f)f=!1;else{const W=r();if(typeof document<"u"&&W.length){for(const I of W)if(await I.blockerFn({currentLocation:c,nextLocation:_,action:F})){h=!0,t.history.go(1),R.notify(V);return}}}c=l(),R.notify(V)},P=_=>{if(p){p=!1;return}let C=!1;const N=r();if(typeof document<"u"&&N.length)for(const j of N){const A=j.enableBeforeUnload??!0;if(A===!0){C=!0;break}if(typeof A=="function"&&A()===!0){C=!0;break}}if(C)return _.preventDefault(),_.returnValue=""},R=Mp({getLocation:m,getLength:()=>t.history.length,pushState:(_,C)=>w("push",_,C),replaceState:(_,C)=>w("replace",_,C),back:_=>(_&&(f=!0),p=!0,t.history.back()),forward:_=>{_&&(f=!0),p=!0,t.history.forward()},go:_=>{d=!0,t.history.go(_)},createHref:_=>a(_),flush:x,destroy:()=>{t.history.pushState=s,t.history.replaceState=n,t.removeEventListener(_l,P,{capture:!0}),t.removeEventListener(vl,S)},onBlocked:()=>{u&&c!==u&&(c=u)},getBlockers:r,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(_l,P,{capture:!0}),t.addEventListener(vl,S),t.history.pushState=function(..._){const C=s.apply(t.history,_);return R._ignoreSubscribers||v("PUSH"),C},t.history.replaceState=function(..._){const C=n.apply(t.history,_);return R._ignoreSubscribers||v("REPLACE"),C},R}function Lp(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function cr(e,t){const s=Lp(e),n=s.indexOf("#"),i=s.indexOf("?"),r=_a();return{href:s,pathname:s.substring(0,n>0?i>0?Math.min(n,i):n:i>0?i:s.length),hash:n>-1?s.substring(n):"",search:i>-1?s.slice(i,n===-1?void 0:n):"",state:t||{[us]:0,key:r,__TSR_key:r}}}function _a(){return(Math.random()+1).toString(36).substring(7)}const Dp=!1;function Un(e){let t;return Cp(()=>{t=e()}),t}function Xn(e){return e[e.length-1]}function Np(e){return typeof e=="function"}function is(e,t){return Np(e)?e(t):e}const Fp=Object.prototype.hasOwnProperty,Sl=Object.prototype.propertyIsEnumerable;function Zt(e,t,s=0){if(e===t)return e;if(s>500)return t;const n=t,i=Pl(e)&&Pl(n);if(!i&&!(ur(e)&&ur(n)))return n;const r=i?e:kl(e);if(!r)return n;const o=i?n:kl(n);if(!o)return n;const a=r.length,l=o.length,c=i?new Array(l):{};let u=0;for(let d=0;d<l;d++){const h=i?d:o[d],f=e[h],p=n[h];if(f===p){c[h]=f,(i?d<a:Fp.call(e,h))&&u++;continue}if(f===null||p===null||typeof f!="object"||typeof p!="object"){c[h]=p;continue}const m=Zt(f,p,s+1);c[h]=m,m===f&&u++}return a===l&&u===a?e:c}function kl(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!Sl.call(e,i))return!1;const s=Object.getOwnPropertySymbols(e);if(s.length===0)return t;const n=t;for(const i of s){if(!Sl.call(e,i))return!1;n.push(i)}return n}function ur(e){if(!Rl(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const s=t.prototype;return!(!Rl(s)||!s.hasOwnProperty("isPrototypeOf"))}function Rl(e){return Object.prototype.toString.call(e)==="[object Object]"}function Pl(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ns(e,t,s){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0,i=e.length;n<i;n++)if(!Ns(e[n],t[n],s))return!1;return!0}if(ur(e)&&ur(t)){const n=s?.ignoreUndefined??!0;if(s?.partial){for(const o in t)if((!n||t[o]!==void 0)&&!Ns(e[o],t[o],s))return!1;return!0}let i=0;if(!n)i=Object.keys(e).length;else for(const o in e)e[o]!==void 0&&i++;let r=0;for(const o in t)if((!n||t[o]!==void 0)&&(r++,r>i||!Ns(e[o],t[o],s)))return!1;return i===r}return!1}function an(e){let t,s;const n=new Promise((i,r)=>{t=i,s=r});return n.status="pending",n.resolve=i=>{n.status="resolved",n.value=i,t(i),e?.(i)},n.reject=i=>{n.status="rejected",s(i)},n}function nn(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function El(e,t){for(let s=e.length-1;s>=0;s--){const n=e[s];if(t(n))return n}}function Ip(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function Cl(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,s=>{try{return decodeURI(s)}catch{return s}})}return Ip(t)}const wd=["http:","https:","mailto:","tel:"];function dr(e){if(!e)return!1;try{const t=new URL(e);return!wd.includes(t.protocol)}catch{return!1}}function wn(e,t){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return e;const s=/%25|%5C/gi;let n=0,i="",r;for(;(r=s.exec(e))!==null;)i+=Cl(e.slice(n,r.index))+r[0],n=s.lastIndex;return i=i+Cl(n?e.slice(n):e),i.startsWith("//")&&(i="/"+i.replace(/^\/+/,"")),i}function jp(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var Bp=process.env.NODE_ENV==="production",Jr="Invariant failed";function Qe(e,t){if(!e){if(Bp)throw new Error(Jr);var s=typeof t=="function"?t():t,n=s?"".concat(Jr,": ").concat(s):Jr;throw new Error(n)}}function hr(e){const t=new Map;let s,n;const i=r=>{r.next&&(r.prev?(r.prev.next=r.next,r.next.prev=r.prev,r.next=void 0,n&&(n.next=r,r.prev=n)):(r.next.prev=void 0,s=r.next,r.next=void 0,n&&(r.prev=n,n.next=r)),n=r)};return{get(r){const o=t.get(r);if(o)return i(o),o.value},set(r,o){if(t.size>=e&&s){const l=s;t.delete(l.key),l.next&&(s=l.next,l.next.prev=void 0),l===n&&(n=void 0)}const a=t.get(r);if(a)a.value=o,i(a);else{const l={key:r,value:o,prev:n};n&&(n.next=l),n=l,s||(s=l),t.set(r,l)}},clear(){t.clear(),s=void 0,n=void 0}}}const ln=0,Vs=1,zs=2,Qn=3,Ts=4,Sd=5;function Vp(e){const t=e.indexOf("{");if(t===-1)return null;const s=e.indexOf("}",t);return s===-1||t+1>=e.length?null:[t,s]}function wa(e,t,s=new Uint16Array(6)){const n=e.indexOf("/",t),i=n===-1?e.length:n,r=e.substring(t,i);if(!r||!r.includes("$"))return s[0]=ln,s[1]=t,s[2]=t,s[3]=i,s[4]=i,s[5]=i,s;if(r==="$"){const a=e.length;return s[0]=zs,s[1]=t,s[2]=t,s[3]=a,s[4]=a,s[5]=a,s}if(r.charCodeAt(0)===36)return s[0]=Vs,s[1]=t,s[2]=t+1,s[3]=i,s[4]=i,s[5]=i,s;const o=Vp(r);if(o){const[a,l]=o,c=r.charCodeAt(a+1);if(c===45){if(a+2<r.length&&r.charCodeAt(a+2)===36){const u=a+3,d=l;if(u<d)return s[0]=Qn,s[1]=t+a,s[2]=t+u,s[3]=t+d,s[4]=t+l+1,s[5]=i,s}}else if(c===36){const u=a+1,d=a+2;return d===l?(s[0]=zs,s[1]=t+a,s[2]=t+u,s[3]=t+d,s[4]=t+l+1,s[5]=e.length,s):(s[0]=Vs,s[1]=t+a,s[2]=t+d,s[3]=t+l,s[4]=t+l+1,s[5]=i,s)}}return s[0]=ln,s[1]=t,s[2]=t,s[3]=i,s[4]=i,s[5]=i,s}function Mr(e,t,s,n,i,r,o){o?.(s);let a=n;{const l=s.fullPath??s.from,c=l.length,u=s.options?.caseSensitive??e,d=!!(s.options?.params?.parse&&s.options?.skipRouteOnParseError?.params);for(;a<c;){const f=wa(l,a,t);let p;const m=a,g=f[5];switch(a=g+1,r++,f[0]){case ln:{const x=l.substring(f[2],f[3]);if(u){const w=i.static?.get(x);if(w)p=w;else{i.static??=new Map;const v=Ms(s.fullPath??s.from);v.parent=i,v.depth=r,p=v,i.static.set(x,v)}}else{const w=x.toLowerCase(),v=i.staticInsensitive?.get(w);if(v)p=v;else{i.staticInsensitive??=new Map;const S=Ms(s.fullPath??s.from);S.parent=i,S.depth=r,p=S,i.staticInsensitive.set(w,S)}}break}case Vs:{const x=l.substring(m,f[1]),w=l.substring(f[4],g),v=u&&!!(x||w),S=x?v?x:x.toLowerCase():void 0,P=w?v?w:w.toLowerCase():void 0,R=!d&&i.dynamic?.find(_=>!_.skipOnParamError&&_.caseSensitive===v&&_.prefix===S&&_.suffix===P);if(R)p=R;else{const _=to(Vs,s.fullPath??s.from,v,S,P);p=_,_.depth=r,_.parent=i,i.dynamic??=[],i.dynamic.push(_)}break}case Qn:{const x=l.substring(m,f[1]),w=l.substring(f[4],g),v=u&&!!(x||w),S=x?v?x:x.toLowerCase():void 0,P=w?v?w:w.toLowerCase():void 0,R=!d&&i.optional?.find(_=>!_.skipOnParamError&&_.caseSensitive===v&&_.prefix===S&&_.suffix===P);if(R)p=R;else{const _=to(Qn,s.fullPath??s.from,v,S,P);p=_,_.parent=i,_.depth=r,i.optional??=[],i.optional.push(_)}break}case zs:{const x=l.substring(m,f[1]),w=l.substring(f[4],g),v=u&&!!(x||w),S=x?v?x:x.toLowerCase():void 0,P=w?v?w:w.toLowerCase():void 0,R=to(zs,s.fullPath??s.from,v,S,P);p=R,R.parent=i,R.depth=r,i.wildcard??=[],i.wildcard.push(R)}}i=p}if(d&&s.children&&!s.isRoot&&s.id&&s.id.charCodeAt(s.id.lastIndexOf("/")+1)===95){const f=Ms(s.fullPath??s.from);f.kind=Sd,f.parent=i,r++,f.depth=r,i.pathless??=[],i.pathless.push(f),i=f}const h=(s.path||!s.children)&&!s.isRoot;if(h&&l.endsWith("/")){const f=Ms(s.fullPath??s.from);f.kind=Ts,f.parent=i,r++,f.depth=r,i.index=f,i=f}i.parse=s.options?.params?.parse??null,i.skipOnParamError=d,i.parsingPriority=s.options?.skipRouteOnParseError?.priority??0,h&&!i.route&&(i.route=s,i.fullPath=s.fullPath??s.from)}if(s.children)for(const l of s.children)Mr(e,t,l,a,i,r,o)}function Zr(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function ss(e){if(e.pathless)for(const t of e.pathless)ss(t);if(e.static)for(const t of e.static.values())ss(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())ss(t);if(e.dynamic?.length){e.dynamic.sort(Zr);for(const t of e.dynamic)ss(t)}if(e.optional?.length){e.optional.sort(Zr);for(const t of e.optional)ss(t)}if(e.wildcard?.length){e.wildcard.sort(Zr);for(const t of e.wildcard)ss(t)}}function Ms(e){return{kind:ln,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function to(e,t,s,n,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:s,prefix:n,suffix:i}}function zp(e,t){const s=Ms("/"),n=new Uint16Array(6);for(const i of e)Mr(!1,n,i,1,s,0);ss(s),t.masksTree=s,t.flatCache=hr(1e3)}function Hp(e,t){e||="/";const s=t.flatCache.get(e);if(s)return s;const n=Sa(e,t.masksTree);return t.flatCache.set(e,n),n}function Up(e,t,s,n,i){e||="/",n||="/";const r=t?`case\0${e}`:e;let o=i.singleCache.get(r);if(!o){o=Ms("/");const a=new Uint16Array(6);Mr(t,a,{from:e},1,o,0),i.singleCache.set(r,o)}return Sa(n,o,s)}function Wp(e,t,s=!1){const n=s?e:`nofuzz\0${e}`,i=t.matchCache.get(n);if(i!==void 0)return i;e||="/";let r;try{r=Sa(e,t.segmentTree,s)}catch(o){if(o instanceof URIError)r=null;else throw o}return r&&(r.branch=Kp(r.route)),t.matchCache.set(n,r),r}function $p(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function qp(e,t=!1,s){const n=Ms(e.fullPath),i=new Uint16Array(6),r={},o={};let a=0;return Mr(t,i,e,1,n,0,c=>{if(s?.(c,a),Qe(!(c.id in r),`Duplicate routes found with id: ${String(c.id)}`),r[c.id]=c,a!==0&&c.path){const u=$p(c.fullPath);(!o[u]||c.fullPath.endsWith("/"))&&(o[u]=c)}a++}),ss(n),{processedTree:{segmentTree:n,singleCache:hr(1e3),matchCache:hr(1e3),flatCache:null,masksTree:null},routesById:r,routesByPath:o}}function Sa(e,t,s=!1){const n=e.split("/"),i=Gp(e,n,t,s);if(!i)return null;const[r]=kd(e,n,i);return{route:i.node.route,rawParams:r,parsedParams:i.parsedParams}}function kd(e,t,s){const n=Yp(s.node);let i=null;const r={};let o=s.extract?.part??0,a=s.extract?.node??0,l=s.extract?.path??0,c=s.extract?.segment??0;for(;a<n.length;o++,a++,l++,c++){const u=n[a];if(u.kind===Ts)break;if(u.kind===Sd){c--,o--,l--;continue}const d=t[o],h=l;if(d&&(l+=d.length),u.kind===Vs){i??=s.node.fullPath.split("/");const f=i[c],p=u.prefix?.length??0;if(f.charCodeAt(p)===123){const g=u.suffix?.length??0,b=f.substring(p+2,f.length-g-1),x=d.substring(p,d.length-g);r[b]=decodeURIComponent(x)}else{const g=f.substring(1);r[g]=decodeURIComponent(d)}}else if(u.kind===Qn){if(s.skipped&1<<a){o--,l=h-1;continue}i??=s.node.fullPath.split("/");const f=i[c],p=u.prefix?.length??0,m=u.suffix?.length??0,g=f.substring(p+3,f.length-m-1),b=u.suffix||u.prefix?d.substring(p,d.length-m):d;b&&(r[g]=decodeURIComponent(b))}else if(u.kind===zs){const f=u,p=e.substring(h+(f.prefix?.length??0),e.length-(f.suffix?.length??0)),m=decodeURIComponent(p);r["*"]=m,r._splat=m;break}}return s.rawParams&&Object.assign(r,s.rawParams),[r,{part:o,node:a,path:l,segment:c}]}function Kp(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Yp(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Gp(e,t,s,n){if(e==="/"&&s.index)return{node:s.index,skipped:0};const i=!Xn(t),r=i&&e!=="/",o=t.length-(i?1:0),a=[{node:s,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let l=null,c=null,u=null;for(;a.length;){const d=a.pop(),{node:h,index:f,skipped:p,depth:m,statics:g,dynamics:b,optionals:x}=d;let{extract:w,rawParams:v,parsedParams:S}=d;if(h.skipOnParamError){if(!eo(e,t,d))continue;v=d.rawParams,w=d.extract,S=d.parsedParams}n&&h.route&&h.kind!==Ts&&Sn(c,d)&&(c=d);const P=f===o;if(P&&(h.route&&!r&&Sn(u,d)&&(u=d),!h.optional&&!h.wildcard&&!h.index&&!h.pathless))continue;const R=P?void 0:t[f];let _;if(P&&h.index){const C={node:h.index,index:f,skipped:p,depth:m+1,statics:g,dynamics:b,optionals:x,extract:w,rawParams:v,parsedParams:S};let N=!0;if(h.index.skipOnParamError&&(eo(e,t,C)||(N=!1)),N){if(g===o&&!b&&!x&&!p)return C;Sn(u,C)&&(u=C)}}if(h.wildcard&&Sn(l,d))for(const C of h.wildcard){const{prefix:N,suffix:j}=C;if(N&&(P||!(C.caseSensitive?R:_??=R.toLowerCase()).startsWith(N)))continue;if(j){if(P)continue;const F=t.slice(f).join("/").slice(-j.length);if((C.caseSensitive?F:F.toLowerCase())!==j)continue}const A={node:C,index:o,skipped:p,depth:m,statics:g,dynamics:b,optionals:x,extract:w,rawParams:v,parsedParams:S};if(!(C.skipOnParamError&&!eo(e,t,A))){l=A;break}}if(h.optional){const C=p|1<<m,N=m+1;for(let j=h.optional.length-1;j>=0;j--){const A=h.optional[j];a.push({node:A,index:f,skipped:C,depth:N,statics:g,dynamics:b,optionals:x,extract:w,rawParams:v,parsedParams:S})}if(!P)for(let j=h.optional.length-1;j>=0;j--){const A=h.optional[j],{prefix:F,suffix:V}=A;if(F||V){const W=A.caseSensitive?R:_??=R.toLowerCase();if(F&&!W.startsWith(F)||V&&!W.endsWith(V))continue}a.push({node:A,index:f+1,skipped:p,depth:N,statics:g,dynamics:b,optionals:x+1,extract:w,rawParams:v,parsedParams:S})}}if(!P&&h.dynamic&&R)for(let C=h.dynamic.length-1;C>=0;C--){const N=h.dynamic[C],{prefix:j,suffix:A}=N;if(j||A){const F=N.caseSensitive?R:_??=R.toLowerCase();if(j&&!F.startsWith(j)||A&&!F.endsWith(A))continue}a.push({node:N,index:f+1,skipped:p,depth:m+1,statics:g,dynamics:b+1,optionals:x,extract:w,rawParams:v,parsedParams:S})}if(!P&&h.staticInsensitive){const C=h.staticInsensitive.get(_??=R.toLowerCase());C&&a.push({node:C,index:f+1,skipped:p,depth:m+1,statics:g+1,dynamics:b,optionals:x,extract:w,rawParams:v,parsedParams:S})}if(!P&&h.static){const C=h.static.get(R);C&&a.push({node:C,index:f+1,skipped:p,depth:m+1,statics:g+1,dynamics:b,optionals:x,extract:w,rawParams:v,parsedParams:S})}if(h.pathless){const C=m+1;for(let N=h.pathless.length-1;N>=0;N--){const j=h.pathless[N];a.push({node:j,index:f,skipped:p,depth:C,statics:g,dynamics:b,optionals:x,extract:w,rawParams:v,parsedParams:S})}}}if(u&&l)return Sn(l,u)?u:l;if(u)return u;if(l)return l;if(n&&c){let d=c.index;for(let f=0;f<c.index;f++)d+=t[f].length;const h=d===e.length?"/":e.slice(d);return c.rawParams??={},c.rawParams["**"]=decodeURIComponent(h),c}return null}function eo(e,t,s){try{const[n,i]=kd(e,t,s);s.rawParams=n,s.extract=i;const r=s.node.parse(n);return s.parsedParams=Object.assign({},s.parsedParams,r),!0}catch{return null}}function Sn(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Ts)>(e.node.kind===Ts)||t.node.kind===Ts==(e.node.kind===Ts)&&t.depth>e.depth))):!0}function Xi(e){return ka(e.filter(t=>t!==void 0).join("/"))}function ka(e){return e.replace(/\/{2,}/g,"/")}function Rd(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function qe(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function Pd(e){return qe(Rd(e))}function fr(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function Xp(e,t,s){return fr(e,s)===fr(t,s)}function Qp({base:e,to:t,trailingSlash:s="never",cache:n}){const i=t.startsWith("/"),r=!i&&t===".";let o;if(n){o=i?t:r?e:e+"\0"+t;const d=n.get(o);if(d)return d}let a;if(r)a=e.split("/");else if(i)a=t.split("/");else{for(a=e.split("/");a.length>1&&Xn(a)==="";)a.pop();const d=t.split("/");for(let h=0,f=d.length;h<f;h++){const p=d[h];p===""?h?h===f-1&&a.push(p):a=[p]:p===".."?a.pop():p==="."||a.push(p)}}a.length>1&&(Xn(a)===""?s==="never"&&a.pop():s==="always"&&a.push(""));let l,c="";for(let d=0;d<a.length;d++){d>0&&(c+="/");const h=a[d];if(!h)continue;l=wa(h,0,l);const f=l[0];if(f===ln){c+=h;continue}const p=l[5],m=h.substring(0,l[1]),g=h.substring(l[4],p),b=h.substring(l[2],l[3]);f===Vs?c+=m||g?`${m}{$${b}}${g}`:`$${b}`:f===zs?c+=m||g?`${m}{$}${g}`:"$":c+=`${m}{-$${b}}${g}`}c=ka(c);const u=c||"/";return o&&n&&n.set(o,u),u}function Jp(e){const t=new Map(e.map(i=>[encodeURIComponent(i),i])),s=Array.from(t.keys()).map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),n=new RegExp(s,"g");return i=>i.replace(n,r=>t.get(r)??r)}function so(e,t,s){const n=t[e];return typeof n!="string"?n:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(n)?n:n.split("/").map(i=>Ol(i,s)).join("/"):Ol(n,s)}function no({path:e,params:t,decoder:s,server:n}){let i=!1;const r={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:r,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:r,isMissingParams:i};const o=e.length;let a=0,l,c="";for(;a<o;){const d=a;l=wa(e,d,l);const h=l[5];if(a=h+1,d===h)continue;const f=l[0];if(f===ln){c+="/"+e.substring(d,h);continue}if(f===zs){const p=t._splat;r._splat=p,r["*"]=p;const m=e.substring(d,l[1]),g=e.substring(l[4],h);if(!p){i=!0,(m||g)&&(c+="/"+m+g);continue}const b=so("_splat",t,s);c+="/"+m+b+g;continue}if(f===Vs){const p=e.substring(l[2],l[3]);!i&&!(p in t)&&(i=!0),r[p]=t[p];const m=e.substring(d,l[1]),g=e.substring(l[4],h),b=so(p,t,s)??"undefined";c+="/"+m+b+g;continue}if(f===Qn){const p=e.substring(l[2],l[3]),m=t[p];if(m==null)continue;r[p]=m;const g=e.substring(d,l[1]),b=e.substring(l[4],h),x=so(p,t,s)??"";c+="/"+g+x+b;continue}}return e.endsWith("/")&&(c+="/"),{usedParams:r,interpolatedPath:c||"/",isMissingParams:i}}function Ol(e,t){const s=encodeURIComponent(e);return t?.(s)??s}function ce(e){return!!e?.isNotFound}function Zp(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const Io="tsr-scroll-restoration-v1_3",tm=(e,t)=>{let s;return(...n)=>{s||(s=setTimeout(()=>{e(...n),s=null},t))}};function em(){const e=Zp();if(!e)return null;const t=e.getItem(Io);let s=t?JSON.parse(t):{};return{state:s,set:n=>{s=is(n,s)||s;try{e.setItem(Io,JSON.stringify(s))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Ri=em(),sm=e=>e.state.__TSR_key||e.href;function nm(e){const t=[];let s;for(;s=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(s.children,e)+1})`),e=s;return`${t.reverse().join(" > ")}`.toLowerCase()}let pr=!1;function im({storageKey:e,key:t,behavior:s,shouldScrollRestoration:n,scrollToTopSelectors:i,location:r}){let o;try{o=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(c){console.error(c);return}const a=t||window.history.state?.__TSR_key,l=o[a];pr=!0;t:{if(n&&l&&Object.keys(l).length>0){for(const d in l){const h=l[d];if(d==="window")window.scrollTo({top:h.scrollY,left:h.scrollX,behavior:s});else if(d){const f=document.querySelector(d);f&&(f.scrollLeft=h.scrollX,f.scrollTop=h.scrollY)}}break t}const c=(r??window.location).hash.split("#",2)[1];if(c){const d=window.history.state?.__hashScrollIntoViewOptions??!0;if(d){const h=document.getElementById(c);h&&h.scrollIntoView(d)}break t}const u={top:0,left:0,behavior:s};if(window.scrollTo(u),i)for(const d of i){if(d==="window")continue;const h=typeof d=="function"?d():document.querySelector(d);h&&h.scrollTo(u)}}pr=!1}function rm(e,t){if(!Ri||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Ri))return;e.isScrollRestorationSetup=!0,pr=!1;const n=e.options.getScrollRestorationKey||sm;window.history.scrollRestoration="manual";const i=r=>{if(pr||!e.isScrollRestoring)return;let o="";if(r.target===document||r.target===window)o="window";else{const l=r.target.getAttribute("data-scroll-restoration-id");l?o=`[data-scroll-restoration-id="${l}"]`:o=nm(r.target)}const a=n(e.state.location);Ri.set(l=>{const c=l[a]||={},u=c[o]||={};if(o==="window")u.scrollX=window.scrollX||0,u.scrollY=window.scrollY||0;else if(o){const d=document.querySelector(o);d&&(u.scrollX=d.scrollLeft||0,u.scrollY=d.scrollTop||0)}return l})};typeof document<"u"&&document.addEventListener("scroll",tm(i,100),!0),e.subscribe("onRendered",r=>{const o=n(r.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(im({storageKey:Io,key:o,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Ri.set(a=>(a[o]||={},a)))})}function om(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const s=document.getElementById(e.state.location.hash);s&&s.scrollIntoView(t)}}}function am(e,t=String){const s=new URLSearchParams;for(const n in e){const i=e[n];i!==void 0&&s.set(n,t(i))}return s.toString()}function io(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function lm(e){const t=new URLSearchParams(e),s={};for(const[n,i]of t.entries()){const r=s[n];r==null?s[n]=io(i):Array.isArray(r)?r.push(io(i)):s[n]=[r,io(i)]}return s}const cm=dm(JSON.parse),um=hm(JSON.stringify,JSON.parse);function dm(e){return t=>{t[0]==="?"&&(t=t.substring(1));const s=lm(t);for(const n in s){const i=s[n];if(typeof i=="string")try{s[n]=e(i)}catch{}}return s}}function hm(e,t){const s=typeof t=="function";function n(i){if(typeof i=="object"&&i!==null)try{return e(i)}catch{}else if(s&&typeof i=="string")try{return t(i),e(i)}catch{}return i}return i=>{const r=am(i,n);return r?`?${r}`:""}}const fe="__root__";function Ed(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&typeof e.href=="string"&&dr(e.href))throw new Error(`Redirect blocked: unsafe protocol in href "${e.href}". Only ${wd.join(", ")} protocols are allowed.`);if(!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const s=new Response(null,{status:e.statusCode,headers:t});if(s.options=e,e.throw)throw s;return s}function ge(e){return e instanceof Response&&!!e.options}const Qi=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Ar=(e,t)=>!!(e.preload&&!e.router.state.matches.some(s=>s.id===t)),rn=(e,t,s=!0)=>{const n={...e.router.options.context??{}},i=s?t:t-1;for(let r=0;r<=i;r++){const o=e.matches[r];if(!o)continue;const a=e.router.getMatch(o.id);a&&Object.assign(n,a.__routeContext,a.__beforeLoadContext)}return n},Cd=(e,t)=>{const s=e.router.routesById[t.routeId??""]??e.router.routeTree;!s.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(s.options.notFoundComponent=e.router.options.defaultNotFoundComponent),Qe(s.options.notFoundComponent,"No notFoundComponent found. Please set a notFoundComponent on your route or provide a defaultNotFoundComponent to the router.");const n=e.matches.find(i=>i.routeId===s.id);Qe(n,"Could not find match for route: "+s.id),e.updateMatch(n.id,i=>({...i,status:"notFound",error:t,isFetching:!1})),t.routerCode==="BEFORE_LOAD"&&s.parentRoute&&(t.routeId=s.parentRoute.id,Cd(e,t))},rs=(e,t,s)=>{if(!(!ge(s)&&!ce(s))){if(ge(s)&&s.redirectHandled&&!s.options.reloadDocument)throw s;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;const n=ge(s)?"redirected":"notFound";t._nonReactive.error=s,e.updateMatch(t.id,i=>({...i,status:n,context:rn(e,t.index),isFetching:!1,error:s})),ce(s)&&!s.routeId&&(s.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw ge(s)?(e.rendered=!0,s.options._fromLocation=e.location,s.redirectHandled=!0,s=e.router.resolveRedirect(s),s):(Cd(e,s),s)}},Od=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,kn=(e,t,s,n)=>{const{id:i,routeId:r}=e.matches[t],o=e.router.looseRoutesById[r];if(s instanceof Promise)throw s;s.routerCode=n,e.firstBadMatchIndex??=t,rs(e,e.router.getMatch(i),s);try{o.options.onError?.(s)}catch(a){s=a,rs(e,e.router.getMatch(i),s)}e.updateMatch(i,a=>(a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,a._nonReactive.loadPromise?.resolve(),{...a,error:s,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},Td=(e,t,s,n)=>{if(n._nonReactive.pendingTimeout!==void 0)return;const i=s.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!Ar(e,t)&&(s.options.loader||s.options.beforeLoad||Ld(s))&&typeof i=="number"&&i!==1/0&&(s.options.pendingComponent??e.router.options?.defaultPendingComponent))){const o=setTimeout(()=>{Qi(e)},i);n._nonReactive.pendingTimeout=o}},fm=(e,t,s)=>{const n=e.router.getMatch(t);if(!n._nonReactive.beforeLoadPromise&&!n._nonReactive.loaderPromise)return;Td(e,t,s,n);const i=()=>{const r=e.router.getMatch(t);r.preload&&(r.status==="redirected"||r.status==="notFound")&&rs(e,r,r.error)};return n._nonReactive.beforeLoadPromise?n._nonReactive.beforeLoadPromise.then(i):i()},pm=(e,t,s,n)=>{const i=e.router.getMatch(t),r=i._nonReactive.loadPromise;i._nonReactive.loadPromise=an(()=>{r?.resolve()});const{paramsError:o,searchError:a}=i;o&&kn(e,s,o,"PARSE_PARAMS"),a&&kn(e,s,a,"VALIDATE_SEARCH"),Td(e,t,n,i);const l=new AbortController;let c=!1;const u=()=>{c||(c=!0,e.updateMatch(t,v=>({...v,isFetching:"beforeLoad",fetchCount:v.fetchCount+1,abortController:l})))},d=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,v=>({...v,isFetching:!1}))};if(!n.options.beforeLoad){Un(()=>{u(),d()});return}i._nonReactive.beforeLoadPromise=an();const h={...rn(e,s,!1),...i.__routeContext},{search:f,params:p,cause:m}=i,g=Ar(e,t),b={search:f,abortController:l,params:p,preload:g,context:h,location:e.location,navigate:v=>e.router.navigate({...v,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:g?"preload":m,matches:e.matches,...e.router.options.additionalContext},x=v=>{if(v===void 0){Un(()=>{u(),d()});return}(ge(v)||ce(v))&&(u(),kn(e,s,v,"BEFORE_LOAD")),Un(()=>{u(),e.updateMatch(t,S=>({...S,__beforeLoadContext:v})),d()})};let w;try{if(w=n.options.beforeLoad(b),nn(w))return u(),w.catch(v=>{kn(e,s,v,"BEFORE_LOAD")}).then(x)}catch(v){u(),kn(e,s,v,"BEFORE_LOAD")}x(w)},mm=(e,t)=>{const{id:s,routeId:n}=e.matches[t],i=e.router.looseRoutesById[n],r=()=>a(),o=()=>pm(e,s,t,i),a=()=>{if(Od(e,s))return;const l=fm(e,s,i);return nn(l)?l.then(o):o()};return r()},gm=(e,t,s)=>{const n=e.router.getMatch(t);if(!n||!s.options.head&&!s.options.scripts&&!s.options.headers)return;const i={ssr:e.router.options.ssr,matches:e.matches,match:n,params:n.params,loaderData:n.loaderData};return Promise.all([s.options.head?.(i),s.options.scripts?.(i),s.options.headers?.(i)]).then(([r,o,a])=>{const l=r?.meta,c=r?.links,u=r?.scripts,d=r?.styles;return{meta:l,links:c,headScripts:u,headers:a,scripts:o,styles:d}})},Md=(e,t,s,n)=>{const i=e.matchPromises[s-1],{params:r,loaderDeps:o,abortController:a,cause:l}=e.router.getMatch(t),c=rn(e,s),u=Ar(e,t);return{params:r,deps:o,preload:!!u,parentMatchPromise:i,abortController:a,context:c,location:e.location,navigate:d=>e.router.navigate({...d,_fromLocation:e.location}),cause:u?"preload":l,route:n,...e.router.options.additionalContext}},Tl=async(e,t,s,n)=>{try{const i=e.router.getMatch(t);try{(!(Dp??e.router.isServer)||i.ssr===!0)&&Ad(n);const r=n.options.loader?.(Md(e,t,s,n)),o=n.options.loader&&nn(r);if((o||n._lazyPromise||n._componentsPromise||n.options.head||n.options.scripts||n.options.headers||i._nonReactive.minPendingPromise)&&e.updateMatch(t,c=>({...c,isFetching:"loader"})),n.options.loader){const c=o?await r:r;rs(e,e.router.getMatch(t),c),c!==void 0&&e.updateMatch(t,u=>({...u,loaderData:c}))}n._lazyPromise&&await n._lazyPromise;const l=i._nonReactive.minPendingPromise;l&&await l,n._componentsPromise&&await n._componentsPromise,e.updateMatch(t,c=>({...c,error:void 0,context:rn(e,s),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(r){let o=r;if(o?.name==="AbortError"){e.updateMatch(t,l=>({...l,status:l.status==="pending"?"success":l.status,isFetching:!1,context:rn(e,s)}));return}const a=i._nonReactive.minPendingPromise;a&&await a,ce(r)&&await n.options.notFoundComponent?.preload?.(),rs(e,e.router.getMatch(t),r);try{n.options.onError?.(r)}catch(l){o=l,rs(e,e.router.getMatch(t),l)}e.updateMatch(t,l=>({...l,error:o,context:rn(e,s),status:"error",isFetching:!1}))}}catch(i){const r=e.router.getMatch(t);r&&(r._nonReactive.loaderPromise=void 0),rs(e,r,i)}},bm=async(e,t)=>{const{id:s,routeId:n}=e.matches[t];let i=!1,r=!1;const o=e.router.looseRoutesById[n];if(!Od(e,s)){const c=e.router.getMatch(s);if(c._nonReactive.loaderPromise){if(c.status==="success"&&!e.sync&&!c.preload)return c;await c._nonReactive.loaderPromise;const u=e.router.getMatch(s),d=u._nonReactive.error||u.error;d&&rs(e,u,d)}else{const u=Date.now()-c.updatedAt,d=Ar(e,s),h=d?o.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:o.options.staleTime??e.router.options.defaultStaleTime??0,f=o.options.shouldReload,p=typeof f=="function"?f(Md(e,s,t,o)):f,m=!!d&&!e.router.state.matches.some(w=>w.id===s),g=e.router.getMatch(s);g._nonReactive.loaderPromise=an(),m!==g.preload&&e.updateMatch(s,w=>({...w,preload:m}));const{status:b,invalid:x}=g;i=b==="success"&&(x||(p??u>h)),d&&o.options.preload===!1||(i&&!e.sync?(r=!0,(async()=>{try{await Tl(e,s,t,o);const w=e.router.getMatch(s);w._nonReactive.loaderPromise?.resolve(),w._nonReactive.loadPromise?.resolve(),w._nonReactive.loaderPromise=void 0}catch(w){ge(w)&&await e.router.navigate(w.options)}})()):(b!=="success"||i&&e.sync)&&await Tl(e,s,t,o))}}const a=e.router.getMatch(s);r||(a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loadPromise?.resolve()),clearTimeout(a._nonReactive.pendingTimeout),a._nonReactive.pendingTimeout=void 0,r||(a._nonReactive.loaderPromise=void 0),a._nonReactive.dehydrated=void 0;const l=r?a.isFetching:!1;return l!==a.isFetching||a.invalid!==!1?(e.updateMatch(s,c=>({...c,isFetching:l,invalid:!1})),e.router.getMatch(s)):a};async function Ml(e){const t=Object.assign(e,{matchPromises:[]});t.router.state.matches.some(s=>s._forcePending)&&Qi(t);try{for(let a=0;a<t.matches.length;a++){const l=mm(t,a);nn(l)&&await l}const s=t.firstBadMatchIndex??t.matches.length;for(let a=0;a<s;a++)t.matchPromises.push(bm(t,a));const i=(await Promise.allSettled(t.matchPromises)).filter(a=>a.status==="rejected").map(a=>a.reason);let r;for(const a of i){if(ge(a))throw a;!r&&ce(a)&&(r=a)}for(const a of t.matches){const{id:l,routeId:c}=a,u=t.router.looseRoutesById[c];try{const d=gm(t,l,u);if(d){const h=await d;t.updateMatch(l,f=>({...f,...h}))}}catch(d){console.error(`Error executing head for route ${c}:`,d)}}if(r)throw r;const o=Qi(t);nn(o)&&await o}catch(s){if(ce(s)&&!t.preload){const n=Qi(t);throw nn(n)&&await n,s}if(ge(s))throw s}return t.matches}async function Ad(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:s,...n}=t.options;Object.assign(e.options,n),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const s=[];for(const n of Dd){const i=e.options[n]?.preload;i&&s.push(i())}if(s.length)return Promise.all(s).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function Ld(e){for(const t of Dd)if(e.options[t]?.preload)return!0;return!1}const Dd=["component","errorComponent","pendingComponent","notFoundComponent"];function ym(e){return{input:({url:t})=>{for(const s of e)t=jo(s,t);return t},output:({url:t})=>{for(let s=e.length-1;s>=0;s--)t=Nd(e[s],t);return t}}}function xm(e){const t=Pd(e.basepath),s=`/${t}`,n=`${s}/`,i=e.caseSensitive?s:s.toLowerCase(),r=e.caseSensitive?n:n.toLowerCase();return{input:({url:o})=>{const a=e.caseSensitive?o.pathname:o.pathname.toLowerCase();return a===i?o.pathname="/":a.startsWith(r)&&(o.pathname=o.pathname.slice(s.length)),o},output:({url:o})=>(o.pathname=Xi(["/",t,o.pathname]),o)}}function jo(e,t){const s=e?.input?.({url:t});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return t}function Nd(e,t){const s=e?.output?.({url:t});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return t}function Fs(e){const t=e.resolvedLocation,s=e.location,n=t?.pathname!==s.pathname,i=t?.href!==s.href,r=t?.hash!==s.hash;return{fromLocation:t,toLocation:s,pathChanged:n,hrefChanged:i,hashChanged:r}}class vm{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=s=>s(),this.update=s=>{s.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const n=this.options,i=this.basepath??n?.basepath??"/",r=this.basepath===void 0,o=n?.rewrite;if(this.options={...n,...s},this.isServer=this.options.isServer??typeof document>"u",this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Jp(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Ap()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let h;this.resolvePathCache=hr(1e3),h=this.buildRouteTree(),this.setRoutes(h)}!this.__store&&this.latestLocation&&(this.__store=new Tp(wm(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(h=>!["redirected"].includes(h.status))}}}),rm(this));let a=!1;const l=this.options.basepath??"/",c=this.options.rewrite;if(r||i!==l||o!==c){this.basepath=l;const h=[],f=Pd(l);f&&f!=="/"&&h.push(xm({basepath:l})),c&&h.push(c),this.rewrite=h.length===0?void 0:h.length===1?h[0]:ym(h),this.history&&this.updateLatestLocation(),a=!0}a&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const s=qp(this.routeTree,this.options.caseSensitive,(n,i)=>{n.init({originalIndex:i})});return this.options.routeMasks&&zp(this.options.routeMasks,s.processedTree),s},this.subscribe=(s,n)=>{const i={eventType:s,fn:n};return this.subscribers.add(i),()=>{this.subscribers.delete(i)}},this.emit=s=>{this.subscribers.forEach(n=>{n.eventType===s.type&&n.fn(s)})},this.parseLocation=(s,n)=>{const i=({pathname:l,search:c,hash:u,href:d,state:h})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(l)){const x=this.options.parseSearch(c),w=this.options.stringifySearch(x);return{href:l+w+u,publicHref:d,pathname:wn(l),external:!1,searchStr:w,search:Zt(n?.search,x),hash:wn(u.slice(1)),state:Zt(n?.state,h)}}const f=new URL(d,this.origin),p=jo(this.rewrite,f),m=this.options.parseSearch(p.search),g=this.options.stringifySearch(m);return p.search=g,{href:p.href.replace(p.origin,""),publicHref:d,pathname:wn(p.pathname),external:!!this.rewrite&&p.origin!==this.origin,searchStr:g,search:Zt(n?.search,m),hash:wn(p.hash.slice(1)),state:Zt(n?.state,h)}},r=i(s),{__tempLocation:o,__tempKey:a}=r.state;if(o&&(!a||a===this.tempLocationKey)){const l=i(o);return l.state.key=r.state.key,l.state.__TSR_key=r.state.__TSR_key,delete l.state.__tempLocation,{...l,maskedLocation:r}}return r},this.resolvePathWithBase=(s,n)=>Qp({base:s,to:ka(n),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(s,n,i)=>typeof s=="string"?this.matchRoutesInternal({pathname:s,search:n},i):this.matchRoutesInternal(s,n),this.getMatchedRoutes=s=>Sm({pathname:s,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=s=>{const n=this.getMatch(s);n&&(n.abortController.abort(),clearTimeout(n._nonReactive.pendingTimeout),n._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const s=this.state.matches.filter(r=>r.status==="pending"),n=this.state.matches.filter(r=>r.isFetching==="loader");new Set([...this.state.pendingMatches??[],...s,...n]).forEach(r=>{this.cancelMatch(r.id)})},this.buildLocation=s=>{const n=(r={})=>{const o=r._fromLocation||this.pendingBuiltLocation||this.latestLocation,a=this.matchRoutesLightweight(o);if(r.from&&process.env.NODE_ENV!=="production"&&r._isNavigate){const F=this.getMatchedRoutes(r.from).matchedRoutes,V=El(a.matchedRoutes,I=>Ll(I.fullPath,r.from)),W=El(F,I=>Ll(I.fullPath,a.fullPath));!V&&!W&&console.warn(`Could not find match for from: ${r.from}`)}const l=r.unsafeRelative==="path"?o.pathname:r.from??a.fullPath,c=this.resolvePathWithBase(l,"."),u=a.search,d={...a.params},h=r.to?this.resolvePathWithBase(c,`${r.to}`):this.resolvePathWithBase(c,"."),f=r.params===!1||r.params===null?{}:(r.params??!0)===!0?d:Object.assign(d,is(r.params,d)),p=no({path:h,params:f,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath,m=this.getMatchedRoutes(p);let g=m.matchedRoutes;(m.foundRoute?m.foundRoute.path!=="/"&&m.routeParams["**"]:qe(p))&&this.options.notFoundRoute&&(g=[...g,this.options.notFoundRoute]);let x=!1;if(Object.keys(f).length>0)for(const F of g){const V=F.options.params?.stringify??F.options.stringifyParams;V&&(x=!0,Object.assign(f,V(f)))}const w=s.leaveParams?h:wn(x?no({path:h,params:f,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath:p);let v=u;if(s._includeValidateSearch&&this.options.search?.strict){const F={};g.forEach(V=>{if(V.options.validateSearch)try{Object.assign(F,Ji(V.options.validateSearch,{...F,...v}))}catch{}}),v=F}v=km({search:v,dest:r,destRoutes:g,_includeValidateSearch:s._includeValidateSearch}),v=Zt(u,v);const S=this.options.stringifySearch(v),P=r.hash===!0?o.hash:r.hash?is(r.hash,o.hash):void 0,R=P?`#${P}`:"";let _=r.state===!0?o.state:r.state?is(r.state,o.state):{};_=Zt(o.state,_);const C=`${w}${S}${R}`;let N,j,A=!1;if(this.rewrite){const F=new URL(C,this.origin),V=Nd(this.rewrite,F);N=F.href.replace(F.origin,""),V.origin!==this.origin?(j=V.href,A=!0):j=V.pathname+V.search+V.hash}else N=jp(C),j=N;return{publicHref:j,href:N,pathname:w,search:v,searchStr:S,state:_,hash:P??"",external:A,unmaskOnReload:r.unmaskOnReload}},i=(r={},o)=>{const a=n(r);let l=o?n(o):void 0;if(!l){const c={};if(this.options.routeMasks){const u=Hp(a.pathname,this.processedTree);if(u){Object.assign(c,u.rawParams);const{from:d,params:h,...f}=u.route,p=h===!1||h===null?{}:(h??!0)===!0?c:Object.assign(c,is(h,c));o={from:s.from,...f,params:p},l=n(o)}}}return l&&(a.maskedLocation=l),a};return s.mask?i(s,{from:s.from,...s.mask}):i(s)},this.commitLocation=async({viewTransition:s,ignoreBlocker:n,...i})=>{const r=()=>{const l=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];l.forEach(u=>{i.state[u]=this.latestLocation.state[u]});const c=Ns(i.state,this.latestLocation.state);return l.forEach(u=>{delete i.state[u]}),c},o=qe(this.latestLocation.href)===qe(i.href),a=this.commitLocationPromise;if(this.commitLocationPromise=an(()=>{a?.resolve()}),o&&r())this.load();else{let{maskedLocation:l,hashScrollIntoView:c,...u}=i;l&&(u={...l,state:{...l.state,__tempKey:void 0,__tempLocation:{...u,search:u.searchStr,state:{...u.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(u.unmaskOnReload??this.options.unmaskOnReload??!1)&&(u.state.__tempKey=this.tempLocationKey)),u.state.__hashScrollIntoViewOptions=c??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=s,this.history[i.replace?"replace":"push"](u.publicHref,u.state,{ignoreBlocker:n})}return this.resetNextScroll=i.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:s,resetScroll:n,hashScrollIntoView:i,viewTransition:r,ignoreBlocker:o,href:a,...l}={})=>{if(a){const d=this.history.location.state.__TSR_index,h=cr(a,{__TSR_index:s?d:d+1}),f=new URL(h.pathname,this.origin),p=jo(this.rewrite,f);l.to=p.pathname,l.search=this.options.parseSearch(h.search),l.hash=h.hash.slice(1)}const c=this.buildLocation({...l,_includeValidateSearch:!0});this.pendingBuiltLocation=c;const u=this.commitLocation({...c,viewTransition:r,replace:s,resetScroll:n,hashScrollIntoView:i,ignoreBlocker:o});return Promise.resolve().then(()=>{this.pendingBuiltLocation===c&&(this.pendingBuiltLocation=void 0)}),u},this.navigate=async({to:s,reloadDocument:n,href:i,publicHref:r,...o})=>{let a=!1;if(i)try{new URL(`${i}`),a=!0}catch{}if(a&&!n&&(n=!0),n){if(s!==void 0||!i){const c=this.buildLocation({to:s,...o});i=i??c.publicHref,r=r??c.publicHref}const l=!a&&r?r:i;if(dr(l))return process.env.NODE_ENV!=="production"&&console.warn(`Blocked navigation to dangerous protocol: ${l}`),Promise.resolve();if(!o.ignoreBlocker){const u=this.history.getBlockers?.()??[];for(const d of u)if(d?.blockerFn&&await d.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return o.replace?window.location.replace(l):window.location.href=l,Promise.resolve()}return this.buildAndCommitLocation({...o,href:i,to:s,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const s=this.matchRoutes(this.latestLocation);this.__store.setState(n=>({...n,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:s,cachedMatches:n.cachedMatches.filter(i=>!s.some(r=>r.id===i.id))}))},this.load=async s=>{let n,i,r;for(r=new Promise(a=>{this.startTransition(async()=>{try{this.beforeLoad();const l=this.latestLocation,c=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Fs({resolvedLocation:c,location:l})}),this.emit({type:"onBeforeLoad",...Fs({resolvedLocation:c,location:l})}),await Ml({router:this,sync:s?.sync,matches:this.state.pendingMatches,location:l,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let u=[],d=[],h=[];Un(()=>{this.__store.setState(f=>{const p=f.matches,m=f.pendingMatches||f.matches;return u=p.filter(g=>!m.some(b=>b.id===g.id)),d=m.filter(g=>!p.some(b=>b.id===g.id)),h=m.filter(g=>p.some(b=>b.id===g.id)),{...f,isLoading:!1,loadedAt:Date.now(),matches:m,pendingMatches:void 0,cachedMatches:[...f.cachedMatches,...u.filter(g=>g.status!=="error"&&g.status!=="notFound")]}}),this.clearExpiredCache()}),[[u,"onLeave"],[d,"onEnter"],[h,"onStay"]].forEach(([f,p])=>{f.forEach(m=>{this.looseRoutesById[m.routeId].options[p]?.(m)})})})})}})}catch(l){ge(l)?(n=l,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):ce(l)&&(i=l),this.__store.setState(c=>({...c,statusCode:n?n.status:i?404:c.matches.some(u=>u.status==="error")?500:200,redirect:n}))}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),a()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let o;this.hasNotFoundMatch()?o=404:this.__store.state.matches.some(a=>a.status==="error")&&(o=500),o!==void 0&&this.__store.setState(a=>({...a,statusCode:o}))},this.startViewTransition=s=>{const n=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,n&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let i;if(typeof n=="object"&&this.isViewTransitionTypesSupported){const r=this.latestLocation,o=this.state.resolvedLocation,a=typeof n.types=="function"?n.types(Fs({resolvedLocation:o,location:r})):n.types;if(a===!1){s();return}i={update:s,types:a}}else i=s;document.startViewTransition(i)}else s()},this.updateMatch=(s,n)=>{this.startTransition(()=>{const i=this.state.pendingMatches?.some(r=>r.id===s)?"pendingMatches":this.state.matches.some(r=>r.id===s)?"matches":this.state.cachedMatches.some(r=>r.id===s)?"cachedMatches":"";i&&this.__store.setState(r=>({...r,[i]:r[i]?.map(o=>o.id===s?n(o):o)}))})},this.getMatch=s=>{const n=i=>i.id===s;return this.state.cachedMatches.find(n)??this.state.pendingMatches?.find(n)??this.state.matches.find(n)},this.invalidate=s=>{const n=i=>s?.filter?.(i)??!0?{...i,invalid:!0,...s?.forcePending||i.status==="error"||i.status==="notFound"?{status:"pending",error:void 0}:void 0}:i;return this.__store.setState(i=>({...i,matches:i.matches.map(n),cachedMatches:i.cachedMatches.map(n),pendingMatches:i.pendingMatches?.map(n)})),this.shouldViewTransition=!1,this.load({sync:s?.sync})},this.getParsedLocationHref=s=>s.publicHref||"/",this.resolveRedirect=s=>{const n=s.headers.get("Location");if(!s.options.href||s.options._builtLocation){const i=s.options._builtLocation??this.buildLocation(s.options),r=this.getParsedLocationHref(i);s.options.href=r,s.headers.set("Location",r)}else if(n)try{const i=new URL(n);if(this.origin&&i.origin===this.origin){const r=i.pathname+i.search+i.hash;s.options.href=r,s.headers.set("Location",r)}}catch{}return s.headers.get("Location")||s.headers.set("Location",s.options.href),s},this.clearCache=s=>{const n=s?.filter;n!==void 0?this.__store.setState(i=>({...i,cachedMatches:i.cachedMatches.filter(r=>!n(r))})):this.__store.setState(i=>({...i,cachedMatches:[]}))},this.clearExpiredCache=()=>{const s=n=>{const i=this.looseRoutesById[n.routeId];if(!i.options.loader)return!0;const r=(n.preload?i.options.preloadGcTime??this.options.defaultPreloadGcTime:i.options.gcTime??this.options.defaultGcTime)??300*1e3;return n.status==="error"?!0:Date.now()-n.updatedAt>=r};this.clearCache({filter:s})},this.loadRouteChunk=Ad,this.preloadRoute=async s=>{const n=this.buildLocation(s);let i=this.matchRoutes(n,{throwOnError:!0,preload:!0,dest:s});const r=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(a=>a.id)),o=new Set([...r,...this.state.cachedMatches.map(a=>a.id)]);Un(()=>{i.forEach(a=>{o.has(a.id)||this.__store.setState(l=>({...l,cachedMatches:[...l.cachedMatches,a]}))})});try{return i=await Ml({router:this,matches:i,location:n,preload:!0,updateMatch:(a,l)=>{r.has(a)?i=i.map(c=>c.id===a?l(c):c):this.updateMatch(a,l)}}),i}catch(a){if(ge(a))return a.options.reloadDocument?void 0:await this.preloadRoute({...a.options,_fromLocation:n});ce(a)||console.error(a);return}},this.matchRoute=(s,n)=>{const i={...s,to:s.to?this.resolvePathWithBase(s.from||"",s.to):void 0,params:s.params||{},leaveParams:!0},r=this.buildLocation(i);if(n?.pending&&this.state.status!=="pending")return!1;const a=(n?.pending===void 0?!this.state.isLoading:n.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,l=Up(r.pathname,n?.caseSensitive??!1,n?.fuzzy??!1,a.pathname,this.processedTree);return!l||s.params&&!Ns(l.rawParams,s.params,{partial:!0})?!1:n?.includeSearch??!0?Ns(a.search,r.search,{partial:!0})?l.rawParams:!1:l.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(s=>s.status==="notFound"||s.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??um,parseSearch:t.parseSearch??cm}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:t,routesByPath:s,processedTree:n}){this.routesById=t,this.routesByPath=s,this.processedTree=n;const i=this.options.notFoundRoute;i&&(i.init({originalIndex:99999999999}),this.routesById[i.id]=i)}get looseRoutesById(){return this.routesById}matchRoutesInternal(t,s){const n=this.getMatchedRoutes(t.pathname),{foundRoute:i,routeParams:r,parsedParams:o}=n;let{matchedRoutes:a}=n,l=!1;(i?i.path!=="/"&&r["**"]:qe(t.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:l=!0);const c=l?Pm(this.options.notFoundMode,a):void 0,u=[],d=h=>h?.id?h.context??this.options.context??void 0:this.options.context??void 0;return a.forEach((h,f)=>{const p=u[f-1],[m,g,b]=(()=>{const V=p?.search??t.search,W=p?._strictSearch??void 0;try{const I=Ji(h.options.validateSearch,{...V})??void 0;return[{...V,...I},{...W,...I},void 0]}catch(I){let q=I;if(I instanceof mr||(q=new mr(I.message,{cause:I})),s?.throwOnError)throw q;return[V,{},q]}})(),x=h.options.loaderDeps?.({search:m})??"",w=x?JSON.stringify(x):"",{interpolatedPath:v,usedParams:S}=no({path:h.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),P=h.id+v+w,R=this.getMatch(P),_=this.state.matches.find(V=>V.routeId===h.id),C=R?._strictParams??S;let N;if(!R)try{Dl(h,S,o,C)}catch(V){if(ce(V)||ge(V)?N=V:N=new _m(V.message,{cause:V}),s?.throwOnError)throw N}Object.assign(r,C);const j=_?"stay":"enter";let A;if(R)A={...R,cause:j,params:_?Zt(_.params,r):r,_strictParams:C,search:Zt(_?_.search:R.search,m),_strictSearch:g};else{const V=h.options.loader||h.options.beforeLoad||h.lazyFn||Ld(h)?"pending":"success";A={id:P,ssr:h.options.ssr,index:f,routeId:h.id,params:_?Zt(_.params,r):r,_strictParams:C,pathname:v,updatedAt:Date.now(),search:_?Zt(_.search,m):m,_strictSearch:g,searchError:void 0,status:V,isFetching:!1,error:void 0,paramsError:N,__routeContext:void 0,_nonReactive:{loadPromise:an()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:j,loaderDeps:_?Zt(_.loaderDeps,x):x,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:h.options.staticData||{},fullPath:h.fullPath}}s?.preload||(A.globalNotFound=c===h.id),A.searchError=b;const F=d(p);A.context={...F,...A.__routeContext,...A.__beforeLoadContext},u.push(A)}),u.forEach((h,f)=>{const p=this.looseRoutesById[h.routeId];if(!this.getMatch(h.id)){const g=u[f-1],b=d(g);if(p.options.context){const x={deps:h.loaderDeps,params:h.params,context:b??{},location:t,navigate:w=>this.navigate({...w,_fromLocation:t}),buildLocation:this.buildLocation,cause:h.cause,abortController:h.abortController,preload:!!h.preload,matches:u};h.__routeContext=p.options.context(x)??void 0}h.context={...b,...h.__routeContext,...h.__beforeLoadContext}}}),u}matchRoutesLightweight(t){const{matchedRoutes:s,routeParams:n,parsedParams:i}=this.getMatchedRoutes(t.pathname),r=Xn(s),o={...t.search};for(const u of s)try{Object.assign(o,Ji(u.options.validateSearch,o))}catch{}const a=Xn(this.state.matches),l=a&&a.routeId===r.id&&t.pathname===this.state.location.pathname;let c;if(l)c=a.params;else{const u={...n};for(const d of s)try{Dl(d,n,i??{},u)}catch{}c=u}return{matchedRoutes:s,fullPath:r.fullPath,search:o,params:c}}}class mr extends Error{}class _m extends Error{}const Al=e=>e.endsWith("/")&&e.length>1?e.slice(0,-1):e;function Ll(e,t){return Al(e)===Al(t)}function wm(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Ji(e,t){if(e==null)return{};if("~standard"in e){const s=e["~standard"].validate(t);if(s instanceof Promise)throw new mr("Async validation not supported");if(s.issues)throw new mr(JSON.stringify(s.issues,void 0,2),{cause:s});return s.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function Sm({pathname:e,routesById:t,processedTree:s}){const n={},i=qe(e);let r,o;const a=Wp(i,s,!0);return a&&(r=a.route,Object.assign(n,a.rawParams),o=Object.assign({},a.parsedParams)),{matchedRoutes:a?.branch||[t[fe]],routeParams:n,foundRoute:r,parsedParams:o}}function km({search:e,dest:t,destRoutes:s,_includeValidateSearch:n}){return Rm(s)(e,t,n??!1)}function Rm(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const i of e){if("search"in i.options)i.options.search?.middlewares&&t.middlewares.push(...i.options.search.middlewares);else if(i.options.preSearchFilters||i.options.postSearchFilters){const r=({search:o,next:a})=>{let l=o;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(l=i.options.preSearchFilters.reduce((u,d)=>d(u),o));const c=a(l);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((u,d)=>d(u),c):c};t.middlewares.push(r)}if(i.options.validateSearch){const r=({search:o,next:a})=>{const l=a(o);if(!t._includeValidateSearch)return l;try{return{...l,...Ji(i.options.validateSearch,l)??void 0}}catch{return l}};t.middlewares.push(r)}}const s=({search:i})=>{const r=t.dest;return r.search?r.search===!0?i:is(r.search,i):{}};t.middlewares.push(s);const n=(i,r,o)=>{if(i>=o.length)return r;const a=o[i];return a({search:r,next:c=>n(i+1,c,o)})};return function(r,o,a){return t.dest=o,t._includeValidateSearch=a,n(0,r,t.middlewares)}}function Pm(e,t){if(e!=="root")for(let s=t.length-1;s>=0;s--){const n=t[s];if(n.children)return n.id}return fe}function Dl(e,t,s,n){const i=e.options.params?.parse??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(const r in t)r in s&&(n[r]=s[r]);else{const r=i(n);Object.assign(n,r)}}const Em="Error preloading route! ☝️";class Fd{constructor(t){if(this.init=s=>{this.originalIndex=s.originalIndex;const n=this.options,i=!n?.path&&!n?.id;this.parentRoute=this.options.getParentRoute?.(),i?this._path=fe:this.parentRoute||Qe(!1,"Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a Route instance.");let r=i?fe:n?.path;r&&r!=="/"&&(r=Rd(r));const o=n?.id||r;let a=i?fe:Xi([this.parentRoute.id===fe?"":this.parentRoute.id,o]);r===fe&&(r="/"),a!==fe&&(a=Xi(["/",a]));const l=a===fe?"/":Xi([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=l,this._to=qe(l)},this.addChildren=s=>this._addFileChildren(s),this._addFileChildren=s=>(Array.isArray(s)&&(this.children=s),typeof s=="object"&&s!==null&&(this.children=Object.values(s)),this),this._addFileTypes=()=>this,this.updateLoader=s=>(Object.assign(this.options,s),this),this.update=s=>(Object.assign(this.options,s),this),this.lazy=s=>(this.lazyFn=s,this),this.redirect=s=>Ed({from:this.fullPath,...s}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class Cm extends Fd{constructor(t){super(t)}}const Pi=typeof window<"u"?Q.useLayoutEffect:Q.useEffect;function ro(e){const t=Q.useRef({value:e,prev:null}),s=t.current.value;return e!==s&&(t.current={value:e,prev:s}),t.current.prev}function Om(e,t,s={},n={}){Q.useEffect(()=>{if(!e.current||n.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([r])=>{t(r)},s);return i.observe(e.current),()=>{i.disconnect()}},[t,s,n.disabled,e])}function Tm(e){const t=Q.useRef(null);return Q.useImperativeHandle(e,()=>t.current,[]),t}function Ra(e){const t=e.errorComponent??Pa;return y.jsx(Mm,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:s,reset:n})=>s?Q.createElement(t,{error:s,reset:n}):e.children})}class Mm extends Q.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,s){s.error&&s.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,s){this.props.onCatch&&this.props.onCatch(t,s)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Pa({error:e}){const[t,s]=Q.useState(process.env.NODE_ENV!=="production");return y.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[y.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[y.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),y.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>s(n=>!n),children:t?"Hide Error":"Show Error"})]}),y.jsx("div",{style:{height:".25rem"}}),t?y.jsx("div",{children:y.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?y.jsx("code",{children:e.message}):null})}):null]})}function Am({children:e,fallback:t=null}){return Id()?y.jsx(L.Fragment,{children:e}):y.jsx(L.Fragment,{children:t})}function Id(){return L.useSyncExternalStore(Lm,()=>!0,()=>!1)}function Lm(){return()=>{}}var Dm=process.env.NODE_ENV==="production";function cn(e,t){if(!Dm){if(e)return;var s="Warning: "+t;typeof console<"u"&&console.warn(s);try{throw Error(s)}catch{}}}var Ei={exports:{}},oo={},Ci={exports:{}},ao={};var Nl;function Nm(){if(Nl)return ao;Nl=1;var e=L;function t(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var s=typeof Object.is=="function"?Object.is:t,n=e.useState,i=e.useEffect,r=e.useLayoutEffect,o=e.useDebugValue;function a(d,h){var f=h(),p=n({inst:{value:f,getSnapshot:h}}),m=p[0].inst,g=p[1];return r(function(){m.value=f,m.getSnapshot=h,l(m)&&g({inst:m})},[d,f,h]),i(function(){return l(m)&&g({inst:m}),d(function(){l(m)&&g({inst:m})})},[d]),o(f),f}function l(d){var h=d.getSnapshot;d=d.value;try{var f=h();return!s(d,f)}catch{return!0}}function c(d,h){return h()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return ao.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,ao}var lo={};var Fl;function Fm(){return Fl||(Fl=1,process.env.NODE_ENV!=="production"&&(function(){function e(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}function t(f,p){u||i.startTransition===void 0||(u=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var m=p();if(!d){var g=p();r(m,g)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}g=o({inst:{value:m,getSnapshot:p}});var b=g[0].inst,x=g[1];return l(function(){b.value=m,b.getSnapshot=p,s(b)&&x({inst:b})},[f,m,p]),a(function(){return s(b)&&x({inst:b}),f(function(){s(b)&&x({inst:b})})},[f]),c(m),m}function s(f){var p=f.getSnapshot;f=f.value;try{var m=p();return!r(f,m)}catch{return!0}}function n(f,p){return p()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var i=L,r=typeof Object.is=="function"?Object.is:e,o=i.useState,a=i.useEffect,l=i.useLayoutEffect,c=i.useDebugValue,u=!1,d=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?n:t;lo.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),lo}var Il;function jd(){return Il||(Il=1,process.env.NODE_ENV==="production"?Ci.exports=Nm():Ci.exports=Fm()),Ci.exports}var jl;function Im(){if(jl)return oo;jl=1;var e=L,t=jd();function s(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var n=typeof Object.is=="function"?Object.is:s,i=t.useSyncExternalStore,r=e.useRef,o=e.useEffect,a=e.useMemo,l=e.useDebugValue;return oo.useSyncExternalStoreWithSelector=function(c,u,d,h,f){var p=r(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=a(function(){function b(P){if(!x){if(x=!0,w=P,P=h(P),f!==void 0&&m.hasValue){var R=m.value;if(f(R,P))return v=R}return v=P}if(R=v,n(w,P))return R;var _=h(P);return f!==void 0&&f(R,_)?(w=P,R):(w=P,v=_)}var x=!1,w,v,S=d===void 0?null:d;return[function(){return b(u())},S===null?void 0:function(){return b(S())}]},[u,d,h,f]);var g=i(c,p[0],p[1]);return o(function(){m.hasValue=!0,m.value=g},[g]),l(g),g},oo}var co={};var Bl;function jm(){return Bl||(Bl=1,process.env.NODE_ENV!=="production"&&(function(){function e(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=L,s=jd(),n=typeof Object.is=="function"?Object.is:e,i=s.useSyncExternalStore,r=t.useRef,o=t.useEffect,a=t.useMemo,l=t.useDebugValue;co.useSyncExternalStoreWithSelector=function(c,u,d,h,f){var p=r(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=a(function(){function b(P){if(!x){if(x=!0,w=P,P=h(P),f!==void 0&&m.hasValue){var R=m.value;if(f(R,P))return v=R}return v=P}if(R=v,n(w,P))return R;var _=h(P);return f!==void 0&&f(R,_)?(w=P,R):(w=P,v=_)}var x=!1,w,v,S=d===void 0?null:d;return[function(){return b(u())},S===null?void 0:function(){return b(S())}]},[u,d,h,f]);var g=i(c,p[0],p[1]);return o(function(){m.hasValue=!0,m.value=g},[g]),l(g),g},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),co}var Vl;function Bm(){return Vl||(Vl=1,process.env.NODE_ENV==="production"?Ei.exports=Im():Ei.exports=jm()),Ei.exports}var Vm=Bm();function zm(e,t=n=>n,s={}){const n=s.equal??Hm;return Vm.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,n)}function Hm(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[n,i]of e)if(!t.has(n)||!Object.is(i,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const s=zl(e);if(s.length!==zl(t).length)return!1;for(let n=0;n<s.length;n++)if(!Object.prototype.hasOwnProperty.call(t,s[n])||!Object.is(e[s[n]],t[s[n]]))return!1;return!0}function zl(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const uo=Q.createContext(null);function Bd(){return typeof document>"u"?uo:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=uo,uo)}function be(e){const t=Q.useContext(Bd());return cn(!((e?.warn??!0)&&!t),"useRouter must be used inside a <RouterProvider> component!"),t}function ue(e){const t=be({warn:e?.router===void 0}),s=e?.router||t,n=L.useRef(void 0);return zm(s.__store,i=>{if(e?.select){if(e.structuralSharing??s.options.defaultStructuralSharing){const r=Zt(n.current,e.select(i));return n.current=r,r}return e.select(i)}return i})}const Lr=Q.createContext(void 0),Um=Q.createContext(void 0);function Ie(e){const t=Q.useContext(e.from?Um:Lr);return ue({select:n=>{const i=n.matches.find(r=>e.from?e.from===r.routeId:r.id===t);if(Qe(!((e.shouldThrow??!0)&&!i),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),i!==void 0)return e.select?e.select(i):i},structuralSharing:e.structuralSharing})}function Ea(e){return Ie({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Ca(e){const{select:t,...s}=e;return Ie({...s,select:n=>t?t(n.loaderDeps):n.loaderDeps})}function ai(e){return Ie({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const s=e.strict===!1?t.params:t._strictParams;return e.select?e.select(s):s}})}function Oa(e){return Ie({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function qs(e){const t=be();return Q.useCallback(s=>t.navigate({...s,from:s.from??e?.from}),[e?.from,t])}function Wm(e,t){const s=be(),n=Tm(t),{activeProps:i,inactiveProps:r,activeOptions:o,to:a,preload:l,preloadDelay:c,hashScrollIntoView:u,replace:d,startTransition:h,resetScroll:f,viewTransition:p,children:m,target:g,disabled:b,style:x,className:w,onClick:v,onFocus:S,onMouseEnter:P,onMouseLeave:R,onTouchStart:_,ignoreBlocker:C,params:N,search:j,hash:A,state:F,mask:V,reloadDocument:W,unsafeRelative:I,from:q,_fromLocation:z,...rt}=e,dt=Id(),M=ue({select:D=>D.location.search,structuralSharing:!0}),Y=e.from,B=Q.useMemo(()=>({...e,from:Y}),[s,M,Y,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),U=Q.useMemo(()=>s.buildLocation({...B}),[s,B]),et=U.maskedLocation?U.maskedLocation.publicHref:U.publicHref,ft=U.maskedLocation?U.maskedLocation.external:U.external,Z=Q.useMemo(()=>Xm(et,ft,s.history,b),[b,ft,et,s.history]),it=Q.useMemo(()=>{if(Z?.external){if(dr(Z.href)){process.env.NODE_ENV!=="production"&&console.warn(`Blocked Link with dangerous protocol: ${Z.href}`);return}return Z.href}if(!Qm(a)&&!(typeof a!="string"||a.indexOf(":")===-1))try{if(new URL(a),dr(a)){process.env.NODE_ENV!=="production"&&console.warn(`Blocked Link with dangerous protocol: ${a}`);return}return a}catch{}},[a,Z]),kt=ue({select:D=>{if(it)return!1;if(o?.exact){if(!Xp(D.location.pathname,U.pathname,s.basepath))return!1}else{const K=fr(D.location.pathname,s.basepath),st=fr(U.pathname,s.basepath);if(!(K.startsWith(st)&&(K.length===st.length||K[st.length]==="/")))return!1}return(o?.includeSearch??!0)&&!Ns(D.location.search,U.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?dt&&D.location.hash===U.hash:!0}}),Ot=kt?is(i,{})??$m:ho,Bt=kt?ho:is(r,{})??ho,Ht=[w,Ot.className,Bt.className].filter(Boolean).join(" "),xs=(x||Ot.style||Bt.style)&&{...x,...Ot.style,...Bt.style},[vs,_s]=Q.useState(!1),Ze=Q.useRef(!1),Qt=e.reloadDocument||it?!1:l??s.options.defaultPreload,ts=c??s.options.defaultPreloadDelay??0,Ft=Q.useCallback(()=>{s.preloadRoute({...B}).catch(D=>{console.warn(D),console.warn(Em)})},[s,B]),Gs=Q.useCallback(D=>{D?.isIntersecting&&Ft()},[Ft]);Om(n,Gs,Gm,{disabled:!!b||Qt!=="viewport"}),Q.useEffect(()=>{Ze.current||!b&&Qt==="render"&&(Ft(),Ze.current=!0)},[b,Ft,Qt]);const k=D=>{const K=D.currentTarget.getAttribute("target"),st=g!==void 0?g:K;if(!b&&!Jm(D)&&!D.defaultPrevented&&(!st||st==="_self")&&D.button===0){D.preventDefault(),xd.flushSync(()=>{_s(!0)});const ct=s.subscribe("onResolved",()=>{ct(),_s(!1)});s.navigate({...B,replace:d,resetScroll:f,hashScrollIntoView:u,startTransition:h,viewTransition:p,ignoreBlocker:C})}};if(it)return{...rt,ref:n,href:it,...m&&{children:m},...g&&{target:g},...b&&{disabled:b},...x&&{style:x},...w&&{className:w},...v&&{onClick:v},...S&&{onFocus:S},...P&&{onMouseEnter:P},...R&&{onMouseLeave:R},..._&&{onTouchStart:_}};const E=D=>{b||Qt&&Ft()},T=E,$=D=>{if(!(b||!Qt))if(!ts)Ft();else{const K=D.target;if(Rn.has(K))return;const st=setTimeout(()=>{Rn.delete(K),Ft()},ts);Rn.set(K,st)}},H=D=>{if(b||!Qt||!ts)return;const K=D.target,st=Rn.get(K);st&&(clearTimeout(st),Rn.delete(K))};return{...rt,...Ot,...Bt,href:Z?.href,ref:n,onClick:Pn([v,k]),onFocus:Pn([S,E]),onMouseEnter:Pn([P,$]),onMouseLeave:Pn([R,H]),onTouchStart:Pn([_,T]),disabled:!!b,target:g,...xs&&{style:xs},...Ht&&{className:Ht},...b&&qm,...kt&&Km,...dt&&vs&&Ym}}const ho={},$m={className:"active"},qm={role:"link","aria-disabled":!0},Km={"data-status":"active","aria-current":"page"},Ym={"data-transitioning":"transitioning"},Rn=new WeakMap,Gm={rootMargin:"100px"},Pn=e=>t=>{for(const s of e)if(s){if(t.defaultPrevented)return;s(t)}};function Xm(e,t,s,n){if(!n)return t?{href:e,external:!0}:{href:s.createHref(e)||"/",external:!1}}function Qm(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const Ta=Q.forwardRef((e,t)=>{const{_asChild:s,...n}=e,{type:i,...r}=Wm(n,t),o=typeof n.children=="function"?n.children({isActive:r["data-status"]==="active"}):n.children;if(!s){const{disabled:a,...l}=r;return Q.createElement("a",l,o)}return Q.createElement(s,r,o)});function Jm(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}class Zm extends Fd{constructor(t){super(t),this.useMatch=s=>Ie({select:s?.select,from:this.id,structuralSharing:s?.structuralSharing}),this.useRouteContext=s=>Ie({...s,from:this.id,select:n=>s?.select?s.select(n.context):n.context}),this.useSearch=s=>Oa({select:s?.select,structuralSharing:s?.structuralSharing,from:this.id}),this.useParams=s=>ai({select:s?.select,structuralSharing:s?.structuralSharing,from:this.id}),this.useLoaderDeps=s=>Ca({...s,from:this.id}),this.useLoaderData=s=>Ea({...s,from:this.id}),this.useNavigate=()=>qs({from:this.fullPath}),this.Link=L.forwardRef((s,n)=>y.jsx(Ta,{ref:n,from:this.fullPath,...s})),this.$$typeof=Symbol.for("react.memo")}}function He(e){return new Zm(e)}class tg extends Cm{constructor(t){super(t),this.useMatch=s=>Ie({select:s?.select,from:this.id,structuralSharing:s?.structuralSharing}),this.useRouteContext=s=>Ie({...s,from:this.id,select:n=>s?.select?s.select(n.context):n.context}),this.useSearch=s=>Oa({select:s?.select,structuralSharing:s?.structuralSharing,from:this.id}),this.useParams=s=>ai({select:s?.select,structuralSharing:s?.structuralSharing,from:this.id}),this.useLoaderDeps=s=>Ca({...s,from:this.id}),this.useLoaderData=s=>Ea({...s,from:this.id}),this.useNavigate=()=>qs({from:this.fullPath}),this.Link=L.forwardRef((s,n)=>y.jsx(Ta,{ref:n,from:this.fullPath,...s})),this.$$typeof=Symbol.for("react.memo")}}function eg(e){return new tg(e)}function Hl(e){return typeof e=="object"?new Ul(e,{silent:!0}).createRoute(e):new Ul(e,{silent:!0}).createRoute}class Ul{constructor(t,s){this.path=t,this.createRoute=n=>{cn(this.silent,"FileRoute is deprecated and will be removed in the next major version. Use the createFileRoute(path)(options) function instead.");const i=He(n);return i.isRoot=!1,i},this.silent=s?.silent}}class Wl{constructor(t){this.useMatch=s=>Ie({select:s?.select,from:this.options.id,structuralSharing:s?.structuralSharing}),this.useRouteContext=s=>Ie({from:this.options.id,select:n=>s?.select?s.select(n.context):n.context}),this.useSearch=s=>Oa({select:s?.select,structuralSharing:s?.structuralSharing,from:this.options.id}),this.useParams=s=>ai({select:s?.select,structuralSharing:s?.structuralSharing,from:this.options.id}),this.useLoaderDeps=s=>Ca({...s,from:this.options.id}),this.useLoaderData=s=>Ea({...s,from:this.options.id}),this.useNavigate=()=>{const s=be();return qs({from:s.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function $l(e){return typeof e=="object"?new Wl(e):t=>new Wl({id:e,...t})}function sg(){const e=be(),t=Q.useRef({router:e,mounted:!1}),[s,n]=Q.useState(!1),{hasPendingMatches:i,isLoading:r}=ue({select:d=>({isLoading:d.isLoading,hasPendingMatches:d.matches.some(h=>h.status==="pending")}),structuralSharing:!0}),o=ro(r),a=r||s||i,l=ro(a),c=r||i,u=ro(c);return e.startTransition=d=>{n(!0),Q.startTransition(()=>{d(),n(!1)})},Q.useEffect(()=>{const d=e.history.subscribe(e.load),h=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return qe(e.latestLocation.publicHref)!==qe(h.publicHref)&&e.commitLocation({...h,replace:!0}),()=>{d()}},[e,e.history]),Pi(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(h){console.error(h)}})()},[e]),Pi(()=>{o&&!r&&e.emit({type:"onLoad",...Fs(e.state)})},[o,e,r]),Pi(()=>{u&&!c&&e.emit({type:"onBeforeRouteMount",...Fs(e.state)})},[c,u,e]),Pi(()=>{if(l&&!a){const d=Fs(e.state);e.emit({type:"onResolved",...d}),e.__store.setState(h=>({...h,status:"idle",resolvedLocation:h.location})),d.hrefChanged&&om(e)}},[a,l,e]),null}function ng(e){const t=ue({select:s=>`not-found-${s.location.pathname}-${s.status}`});return y.jsx(Ra,{getResetKey:()=>t,onCatch:(s,n)=>{if(ce(s))e.onCatch?.(s,n);else throw s},errorComponent:({error:s})=>{if(ce(s))return e.fallback?.(s);throw s},children:e.children})}function ig(){return y.jsx("p",{children:"Not Found"})}function en(e){return y.jsx(y.Fragment,{children:e.children})}function Vd(e,t,s){return t.options.notFoundComponent?y.jsx(t.options.notFoundComponent,{...s}):e.options.defaultNotFoundComponent?y.jsx(e.options.defaultNotFoundComponent,{...s}):(process.env.NODE_ENV==="development"&&cn(t.options.notFoundComponent,`A notFoundError was encountered on the route with ID "${t.id}", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (<p>Not Found</p>)`),y.jsx(ig,{}))}function rg(){return be().isScrollRestoring,null}const zd=Q.memo(function({matchId:t}){const s=be(),n=ue({select:m=>{const g=m.matches.findIndex(x=>x.id===t),b=m.matches[g];return Qe(b,`Could not find match for matchId "${t}". Please file an issue!`),{routeId:b.routeId,ssr:b.ssr,_displayPending:b._displayPending,resetKey:m.loadedAt,parentRouteId:m.matches[g-1]?.routeId}},structuralSharing:!0}),i=s.routesById[n.routeId],r=i.options.pendingComponent??s.options.defaultPendingComponent,o=r?y.jsx(r,{}):null,a=i.options.errorComponent??s.options.defaultErrorComponent,l=i.options.onCatch??s.options.defaultOnCatch,c=i.isRoot?i.options.notFoundComponent??s.options.notFoundRoute?.options.component:i.options.notFoundComponent,u=n.ssr===!1||n.ssr==="data-only",d=(!i.isRoot||i.options.wrapInSuspense||u)&&(i.options.wrapInSuspense??r??(i.options.errorComponent?.preload||u))?Q.Suspense:en,h=a?Ra:en,f=c?ng:en,p=i.isRoot?i.options.shellComponent??en:en;return y.jsxs(p,{children:[y.jsx(Lr.Provider,{value:t,children:y.jsx(d,{fallback:o,children:y.jsx(h,{getResetKey:()=>n.resetKey,errorComponent:a||Pa,onCatch:(m,g)=>{if(ce(m))throw m;cn(!1,`Error in route match: ${t}`),l?.(m,g)},children:y.jsx(f,{fallback:m=>{if(!c||m.routeId&&m.routeId!==n.routeId||!m.routeId&&!i.isRoot)throw m;return Q.createElement(c,m)},children:u||n._displayPending?y.jsx(Am,{fallback:o,children:y.jsx(ql,{matchId:t})}):y.jsx(ql,{matchId:t})})})})}),n.parentRouteId===fe&&s.options.scrollRestoration?y.jsxs(y.Fragment,{children:[y.jsx(og,{}),y.jsx(rg,{})]}):null]})});function og(){const e=be(),t=Q.useRef(void 0);return y.jsx("script",{suppressHydrationWarning:!0,ref:s=>{s&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Fs(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const ql=Q.memo(function({matchId:t}){const s=be(),{match:n,key:i,routeId:r}=ue({select:l=>{const c=l.matches.find(p=>p.id===t),u=c.routeId,h=(s.routesById[u].options.remountDeps??s.options.defaultRemountDeps)?.({routeId:u,loaderDeps:c.loaderDeps,params:c._strictParams,search:c._strictSearch});return{key:h?JSON.stringify(h):void 0,routeId:u,match:{id:c.id,status:c.status,error:c.error,invalid:c.invalid,_forcePending:c._forcePending,_displayPending:c._displayPending}}},structuralSharing:!0}),o=s.routesById[r],a=Q.useMemo(()=>{const l=o.options.component??s.options.defaultComponent;return l?y.jsx(l,{},i):y.jsx(Ma,{})},[i,o.options.component,s.options.defaultComponent]);if(n._displayPending)throw s.getMatch(n.id)?._nonReactive.displayPendingPromise;if(n._forcePending)throw s.getMatch(n.id)?._nonReactive.minPendingPromise;if(n.status==="pending"){const l=o.options.pendingMinMs??s.options.defaultPendingMinMs;if(l){const c=s.getMatch(n.id);if(c&&!c._nonReactive.minPendingPromise){const u=an();c._nonReactive.minPendingPromise=u,setTimeout(()=>{u.resolve(),c._nonReactive.minPendingPromise=void 0},l)}}throw s.getMatch(n.id)?._nonReactive.loadPromise}if(n.status==="notFound")return Qe(ce(n.error),"Expected a notFound error"),Vd(s,o,n.error);if(n.status==="redirected")throw Qe(ge(n.error),"Expected a redirect error"),s.getMatch(n.id)?._nonReactive.loadPromise;if(n.status==="error")throw n.error;return a}),Ma=Q.memo(function(){const t=be(),s=Q.useContext(Lr),n=ue({select:c=>c.matches.find(u=>u.id===s)?.routeId}),i=t.routesById[n],r=ue({select:c=>{const d=c.matches.find(h=>h.id===s);return Qe(d,`Could not find parent match for matchId "${s}"`),d.globalNotFound}}),o=ue({select:c=>{const u=c.matches,d=u.findIndex(h=>h.id===s);return u[d+1]?.id}}),a=t.options.defaultPendingComponent?y.jsx(t.options.defaultPendingComponent,{}):null;if(r)return Vd(t,i,void 0);if(!o)return null;const l=y.jsx(zd,{matchId:o});return n===fe?y.jsx(Q.Suspense,{fallback:a,children:l}):l});function ag(){const e=be(),s=e.routesById[fe].options.pendingComponent??e.options.defaultPendingComponent,n=s?y.jsx(s,{}):null,i=typeof document<"u"&&e.ssr?en:Q.Suspense,r=y.jsxs(i,{fallback:n,children:[y.jsx(sg,{}),y.jsx(lg,{})]});return e.options.InnerWrap?y.jsx(e.options.InnerWrap,{children:r}):r}function lg(){const e=be(),t=ue({select:i=>i.matches[0]?.id}),s=ue({select:i=>i.loadedAt}),n=t?y.jsx(zd,{matchId:t}):null;return y.jsx(Lr.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?n:y.jsx(Ra,{getResetKey:()=>s,errorComponent:Pa,onCatch:i=>{cn(!1,"The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!"),cn(!1,i.message||i.toString())},children:n})})}const Hd=e=>new cg(e);class cg extends vm{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=Hl,globalThis.createLazyFileRoute=$l):typeof window<"u"&&(window.createFileRoute=Hl,window.createLazyFileRoute=$l);function ug({router:e,children:t,...s}){Object.keys(s).length>0&&e.update({...e.options,...s,context:{...e.options.context,...s.context}});const n=Bd(),i=y.jsx(n.Provider,{value:e,children:t});return e.options.Wrap?y.jsx(e.options.Wrap,{children:i}):i}function dg({router:e,...t}){return y.jsx(ug,{router:e,...t,children:y.jsx(ag,{})})}function hg(e){return ue({select:t=>t.location})}var li=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},fg={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},pg=class{#t=fg;#e=!1;setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&this.#e&&e!==this.#t&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:this.#t,provider:e}),this.#t=e,process.env.NODE_ENV!=="production"&&(this.#e=!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&(this.#e=!0),this.#t.setTimeout(e,t)}clearTimeout(e){this.#t.clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&(this.#e=!0),this.#t.setInterval(e,t)}clearInterval(e){this.#t.clearInterval(e)}},As=new pg;function mg(e){setTimeout(e,0)}var Hs=typeof window>"u"||"Deno"in globalThis;function ee(){}function gg(e,t){return typeof e=="function"?e(t):e}function Bo(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ud(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ds(e,t){return typeof e=="function"?e(t):e}function pe(e,t){return typeof e=="function"?e(t):e}function Kl(e,t){const{type:s="all",exact:n,fetchStatus:i,predicate:r,queryKey:o,stale:a}=e;if(o){if(n){if(t.queryHash!==Aa(o,t.options))return!1}else if(!Zn(t.queryKey,o))return!1}if(s!=="all"){const l=t.isActive();if(s==="active"&&!l||s==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||i&&i!==t.state.fetchStatus||r&&!r(t))}function Yl(e,t){const{exact:s,status:n,predicate:i,mutationKey:r}=e;if(r){if(!t.options.mutationKey)return!1;if(s){if(Jn(t.options.mutationKey)!==Jn(r))return!1}else if(!Zn(t.options.mutationKey,r))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function Aa(e,t){return(t?.queryKeyHashFn||Jn)(e)}function Jn(e){return JSON.stringify(e,(t,s)=>Ho(s)?Object.keys(s).sort().reduce((n,i)=>(n[i]=s[i],n),{}):s)}function Zn(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(s=>Zn(e[s],t[s])):!1}var bg=Object.prototype.hasOwnProperty;function Vo(e,t,s=0){if(e===t)return e;if(s>500)return t;const n=Gl(e)&&Gl(t);if(!n&&!(Ho(e)&&Ho(t)))return t;const r=(n?e:Object.keys(e)).length,o=n?t:Object.keys(t),a=o.length,l=n?new Array(a):{};let c=0;for(let u=0;u<a;u++){const d=n?u:o[u],h=e[d],f=t[d];if(h===f){l[d]=h,(n?u<r:bg.call(e,d))&&c++;continue}if(h===null||f===null||typeof h!="object"||typeof f!="object"){l[d]=f;continue}const p=Vo(h,f,s+1);l[d]=p,p===h&&c++}return r===a&&c===r?e:l}function zo(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e)if(e[s]!==t[s])return!1;return!0}function Gl(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ho(e){if(!Xl(e))return!1;const t=e.constructor;if(t===void 0)return!0;const s=t.prototype;return!(!Xl(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Xl(e){return Object.prototype.toString.call(e)==="[object Object]"}function yg(e){return new Promise(t=>{As.setTimeout(t,e)})}function Uo(e,t,s){if(typeof s.structuralSharing=="function")return s.structuralSharing(e,t);if(s.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return Vo(e,t)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${s.queryHash}]: ${n}`),n}return Vo(e,t)}return t}function xg(e,t,s=0){const n=[...e,t];return s&&n.length>s?n.slice(1):n}function vg(e,t,s=0){const n=[t,...e];return s&&n.length>s?n.slice(0,-1):n}var gr=Symbol();function Wd(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===gr&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===gr?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function $d(e,t){return typeof e=="function"?e(...t):!!e}function _g(e,t,s){let n=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),n||(n=!0,i.aborted?s():i.addEventListener("abort",s,{once:!0})),i)}),e}var wg=class extends li{#t;#e;#s;constructor(){super(),this.#s=e=>{if(!Hs&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#e||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#s=e,this.#e?.(),this.#e=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#t!==e&&(this.#t=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},La=new wg;function Wo(){let e,t;const s=new Promise((i,r)=>{e=i,t=r});s.status="pending",s.catch(()=>{});function n(i){Object.assign(s,i),delete s.resolve,delete s.reject}return s.resolve=i=>{n({status:"fulfilled",value:i}),e(i)},s.reject=i=>{n({status:"rejected",reason:i}),t(i)},s}var Sg=mg;function kg(){let e=[],t=0,s=a=>{a()},n=a=>{a()},i=Sg;const r=a=>{t?e.push(a):i(()=>{s(a)})},o=()=>{const a=e;e=[],a.length&&i(()=>{n(()=>{a.forEach(l=>{s(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||o()}return l},batchCalls:a=>(...l)=>{r(()=>{a(...l)})},schedule:r,setNotifyFunction:a=>{s=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{i=a}}}var zt=kg(),Rg=class extends li{#t=!0;#e;#s;constructor(){super(),this.#s=e=>{if(!Hs&&window.addEventListener){const t=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#e||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#s=e,this.#e?.(),this.#e=e(this.setOnline.bind(this))}setOnline(e){this.#t!==e&&(this.#t=e,this.listeners.forEach(s=>{s(e)}))}isOnline(){return this.#t}},br=new Rg;function Pg(e){return Math.min(1e3*2**e,3e4)}function qd(e){return(e??"online")==="online"?br.isOnline():!0}var $o=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Kd(e){let t=!1,s=0,n;const i=Wo(),r=()=>i.status!=="pending",o=m=>{if(!r()){const g=new $o(m);h(g),e.onCancel?.(g)}},a=()=>{t=!0},l=()=>{t=!1},c=()=>La.isFocused()&&(e.networkMode==="always"||br.isOnline())&&e.canRun(),u=()=>qd(e.networkMode)&&e.canRun(),d=m=>{r()||(n?.(),i.resolve(m))},h=m=>{r()||(n?.(),i.reject(m))},f=()=>new Promise(m=>{n=g=>{(r()||c())&&m(g)},e.onPause?.()}).then(()=>{n=void 0,r()||e.onContinue?.()}),p=()=>{if(r())return;let m;const g=s===0?e.initialPromise:void 0;try{m=g??e.fn()}catch(b){m=Promise.reject(b)}Promise.resolve(m).then(d).catch(b=>{if(r())return;const x=e.retry??(Hs?0:3),w=e.retryDelay??Pg,v=typeof w=="function"?w(s,b):w,S=x===!0||typeof x=="number"&&s<x||typeof x=="function"&&x(s,b);if(t||!S){h(b);return}s++,e.onFail?.(s,b),yg(v).then(()=>c()?void 0:f()).then(()=>{t?h(b):p()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(n?.(),i),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?p():f().then(p),i)}}var Yd=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Bo(this.gcTime)&&(this.#t=As.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Hs?1/0:300*1e3))}clearGcTimeout(){this.#t&&(As.clearTimeout(this.#t),this.#t=void 0)}},Eg=class extends Yd{#t;#e;#s;#i;#n;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#s=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Jl(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#n?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=Jl(this.options);t.data!==void 0&&(this.setState(Ql(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#s.remove(this)}setData(e,t){const s=Uo(this.state.data,e,this.options);return this.#r({data:s,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),s}setState(e,t){this.#r({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#n?.promise;return this.#n?.cancel(e),t?t.then(ee).catch(ee):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>pe(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===gr||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>ds(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Ud(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#n&&(this.#o?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#s.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#r({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#n?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(e&&this.setOptions(e),!this.options.queryFn){const a=this.observers.find(l=>l.options.queryFn);a&&this.setOptions(a.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const s=new AbortController,n=a=>{Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(this.#o=!0,s.signal)})},i=()=>{const a=Wd(this.options,t),c=(()=>{const u={client:this.#i,queryKey:this.queryKey,meta:this.meta};return n(u),u})();return this.#o=!1,this.options.persister?this.options.persister(a,c,this):a(c)},o=(()=>{const a={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return n(a),a})();this.options.behavior?.onFetch(o,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#r({type:"fetch",meta:o.fetchOptions?.meta}),this.#n=Kd({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:a=>{a instanceof $o&&a.revert&&this.setState({...this.#e,fetchStatus:"idle"}),s.abort()},onFail:(a,l)=>{this.#r({type:"failed",failureCount:a,error:l})},onPause:()=>{this.#r({type:"pause"})},onContinue:()=>{this.#r({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const a=await this.#n.start();if(a===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(a),this.#s.config.onSuccess?.(a,this),this.#s.config.onSettled?.(a,this.state.error,this),a}catch(a){if(a instanceof $o){if(a.silent)return this.#n.promise;if(a.revert){if(this.state.data===void 0)throw a;return this.state.data}}throw this.#r({type:"error",error:a}),this.#s.config.onError?.(a,this),this.#s.config.onSettled?.(this.state.data,a,this),a}finally{this.scheduleGc()}}#r(e){const t=s=>{switch(e.type){case"failed":return{...s,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...Gd(s.data,this.options),fetchMeta:e.meta??null};case"success":const n={...s,...Ql(e.data,e.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#e=e.manual?n:void 0,n;case"error":const i=e.error;return{...s,error:i,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...e.state}}};this.state=t(this.state),zt.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#s.notify({query:this,type:"updated",action:e})})}};function Gd(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:qd(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Ql(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Jl(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,s=t!==void 0,n=s?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var Cg=class extends li{constructor(e,t){super(),this.options=t,this.#t=e,this.#r=null,this.#o=Wo(),this.bindMethods(),this.setOptions(t)}#t;#e=void 0;#s=void 0;#i=void 0;#n;#a;#o;#r;#m;#h;#f;#c;#u;#l;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),Zl(this.#e,this.options)?this.#d():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return qo(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return qo(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#v(),this.#_(),this.#e.removeObserver(this)}setOptions(e){const t=this.options,s=this.#e;if(this.options=this.#t.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof pe(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#e.setOptions(this.options),t._defaulted&&!zo(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const n=this.hasListeners();n&&tc(this.#e,s,this.options,t)&&this.#d(),this.updateResult(),n&&(this.#e!==s||pe(this.options.enabled,this.#e)!==pe(t.enabled,this.#e)||ds(this.options.staleTime,this.#e)!==ds(t.staleTime,this.#e))&&this.#g();const i=this.#b();n&&(this.#e!==s||pe(this.options.enabled,this.#e)!==pe(t.enabled,this.#e)||i!==this.#l)&&this.#y(i)}getOptimisticResult(e){const t=this.#t.getQueryCache().build(this.#t,e),s=this.createResult(t,e);return Tg(this,s)&&(this.#i=s,this.#a=this.options,this.#n=this.#e.state),s}getCurrentResult(){return this.#i}trackResult(e,t){return new Proxy(e,{get:(s,n)=>(this.trackProp(n),t?.(n),n==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#t.defaultQueryOptions(e),s=this.#t.getQueryCache().build(this.#t,t);return s.fetch().then(()=>this.createResult(s,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#d(e){this.#w();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(ee)),t}#g(){this.#v();const e=ds(this.options.staleTime,this.#e);if(Hs||this.#i.isStale||!Bo(e))return;const s=Ud(this.#i.dataUpdatedAt,e)+1;this.#c=As.setTimeout(()=>{this.#i.isStale||this.updateResult()},s)}#b(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#y(e){this.#_(),this.#l=e,!(Hs||pe(this.options.enabled,this.#e)===!1||!Bo(this.#l)||this.#l===0)&&(this.#u=As.setInterval(()=>{(this.options.refetchIntervalInBackground||La.isFocused())&&this.#d()},this.#l))}#x(){this.#g(),this.#y(this.#b())}#v(){this.#c&&(As.clearTimeout(this.#c),this.#c=void 0)}#_(){this.#u&&(As.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const s=this.#e,n=this.options,i=this.#i,r=this.#n,o=this.#a,l=e!==s?e.state:this.#s,{state:c}=e;let u={...c},d=!1,h;if(t._optimisticResults){const _=this.hasListeners(),C=!_&&Zl(e,t),N=_&&tc(e,s,t,n);(C||N)&&(u={...u,...Gd(c.data,e.options)}),t._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:f,errorUpdatedAt:p,status:m}=u;h=u.data;let g=!1;if(t.placeholderData!==void 0&&h===void 0&&m==="pending"){let _;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(_=i.data,g=!0):_=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,_!==void 0&&(m="success",h=Uo(i?.data,_,t),d=!0)}if(t.select&&h!==void 0&&!g)if(i&&h===r?.data&&t.select===this.#m)h=this.#h;else try{this.#m=t.select,h=t.select(h),h=Uo(i?.data,h,t),this.#h=h,this.#r=null}catch(_){this.#r=_}this.#r&&(f=this.#r,h=this.#h,p=Date.now(),m="error");const b=u.fetchStatus==="fetching",x=m==="pending",w=m==="error",v=x&&b,S=h!==void 0,R={status:m,fetchStatus:u.fetchStatus,isPending:x,isSuccess:m==="success",isError:w,isInitialLoading:v,isLoading:v,data:h,dataUpdatedAt:u.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>l.dataUpdateCount||u.errorUpdateCount>l.errorUpdateCount,isFetching:b,isRefetching:b&&!x,isLoadingError:w&&!S,isPaused:u.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:w&&S,isStale:Da(e,t),refetch:this.refetch,promise:this.#o,isEnabled:pe(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const _=R.data!==void 0,C=R.status==="error"&&!_,N=F=>{C?F.reject(R.error):_&&F.resolve(R.data)},j=()=>{const F=this.#o=R.promise=Wo();N(F)},A=this.#o;switch(A.status){case"pending":e.queryHash===s.queryHash&&N(A);break;case"fulfilled":(C||R.data!==A.value)&&j();break;case"rejected":(!C||R.error!==A.reason)&&j();break}}return R}updateResult(){const e=this.#i,t=this.createResult(this.#e,this.options);if(this.#n=this.#e.state,this.#a=this.options,this.#n.data!==void 0&&(this.#f=this.#e),zo(t,e))return;this.#i=t;const s=()=>{if(!e)return!0;const{notifyOnChangeProps:n}=this.options,i=typeof n=="function"?n():n;if(i==="all"||!i&&!this.#p.size)return!0;const r=new Set(i??this.#p);return this.options.throwOnError&&r.add("error"),Object.keys(this.#i).some(o=>{const a=o;return this.#i[a]!==e[a]&&r.has(a)})};this.#S({listeners:s()})}#w(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#s=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}#S(e){zt.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function Og(e,t){return pe(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Zl(e,t){return Og(e,t)||e.state.data!==void 0&&qo(e,t,t.refetchOnMount)}function qo(e,t,s){if(pe(t.enabled,e)!==!1&&ds(t.staleTime,e)!=="static"){const n=typeof s=="function"?s(e):s;return n==="always"||n!==!1&&Da(e,t)}return!1}function tc(e,t,s,n){return(e!==t||pe(n.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&Da(e,s)}function Da(e,t){return pe(t.enabled,e)!==!1&&e.isStaleByTime(ds(t.staleTime,e))}function Tg(e,t){return!zo(e.getCurrentResult(),t)}function ec(e){return{onFetch:(t,s)=>{const n=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,r=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let u=!1;const d=p=>{_g(p,()=>t.signal,()=>u=!0)},h=Wd(t.options,t.fetchOptions),f=async(p,m,g)=>{if(u)return Promise.reject();if(m==null&&p.pages.length)return Promise.resolve(p);const x=(()=>{const P={client:t.client,queryKey:t.queryKey,pageParam:m,direction:g?"backward":"forward",meta:t.options.meta};return d(P),P})(),w=await h(x),{maxPages:v}=t.options,S=g?vg:xg;return{pages:S(p.pages,w,v),pageParams:S(p.pageParams,m,v)}};if(i&&r.length){const p=i==="backward",m=p?Mg:sc,g={pages:r,pageParams:o},b=m(n,g);a=await f(g,b,p)}else{const p=e??r.length;do{const m=l===0?o[0]??n.initialPageParam:sc(n,a);if(l>0&&m==null)break;a=await f(a,m),l++}while(l<p)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s):t.fetchFn=c}}}function sc(e,{pages:t,pageParams:s}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,s[n],s):void 0}function Mg(e,{pages:t,pageParams:s}){return t.length>0?e.getPreviousPageParam?.(t[0],t,s[0],s):void 0}var Ag=class extends Yd{#t;#e;#s;#i;constructor(e){super(),this.#t=e.client,this.mutationId=e.mutationId,this.#s=e.mutationCache,this.#e=[],this.state=e.state||Lg(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#s.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#n({type:"continue"})},s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=Kd({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(new Error("No mutationFn found")),onFail:(r,o)=>{this.#n({type:"failed",failureCount:r,error:o})},onPause:()=>{this.#n({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});const n=this.state.status==="pending",i=!this.#i.canStart();try{if(n)t();else{this.#n({type:"pending",variables:e,isPaused:i}),this.#s.config.onMutate&&await this.#s.config.onMutate(e,this,s);const o=await this.options.onMutate?.(e,s);o!==this.state.context&&this.#n({type:"pending",context:o,variables:e,isPaused:i})}const r=await this.#i.start();return await this.#s.config.onSuccess?.(r,e,this.state.context,this,s),await this.options.onSuccess?.(r,e,this.state.context,s),await this.#s.config.onSettled?.(r,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(r,null,e,this.state.context,s),this.#n({type:"success",data:r}),r}catch(r){try{await this.#s.config.onError?.(r,e,this.state.context,this,s)}catch(o){Promise.reject(o)}try{await this.options.onError?.(r,e,this.state.context,s)}catch(o){Promise.reject(o)}try{await this.#s.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this,s)}catch(o){Promise.reject(o)}try{await this.options.onSettled?.(void 0,r,e,this.state.context,s)}catch(o){Promise.reject(o)}throw this.#n({type:"error",error:r}),r}finally{this.#s.runNext(this)}}#n(e){const t=s=>{switch(e.type){case"failed":return{...s,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...s,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:e.error,failureCount:s.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),zt.batch(()=>{this.#e.forEach(s=>{s.onMutationUpdate(e)}),this.#s.notify({mutation:this,type:"updated",action:e})})}};function Lg(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Dg=class extends li{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#e=new Map,this.#s=0}#t;#e;#s;build(e,t,s){const n=new Ag({client:e,mutationCache:this,mutationId:++this.#s,options:e.defaultMutationOptions(t),state:s});return this.add(n),n}add(e){this.#t.add(e);const t=Oi(e);if(typeof t=="string"){const s=this.#e.get(t);s?s.push(e):this.#e.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){const t=Oi(e);if(typeof t=="string"){const s=this.#e.get(t);if(s)if(s.length>1){const n=s.indexOf(e);n!==-1&&s.splice(n,1)}else s[0]===e&&this.#e.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Oi(e);if(typeof t=="string"){const n=this.#e.get(t)?.find(i=>i.state.status==="pending");return!n||n===e}else return!0}runNext(e){const t=Oi(e);return typeof t=="string"?this.#e.get(t)?.find(n=>n!==e&&n.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){zt.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(e){const t={exact:!0,...e};return this.getAll().find(s=>Yl(t,s))}findAll(e={}){return this.getAll().filter(t=>Yl(e,t))}notify(e){zt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return zt.batch(()=>Promise.all(e.map(t=>t.continue().catch(ee))))}};function Oi(e){return e.options.scope?.id}var Ng=class extends li{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,s){const n=t.queryKey,i=t.queryHash??Aa(n,t);let r=this.get(i);return r||(r=new Eg({client:e,queryKey:n,queryHash:i,options:e.defaultQueryOptions(t),state:s,defaultOptions:e.getQueryDefaults(n)}),this.add(r)),r}add(e){this.#t.has(e.queryHash)||(this.#t.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#t.get(e.queryHash);t&&(e.destroy(),t===e&&this.#t.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){zt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#t.get(e)}getAll(){return[...this.#t.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(s=>Kl(t,s))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(s=>Kl(e,s)):t}notify(e){zt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){zt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){zt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Fg=class{#t;#e;#s;#i;#n;#a;#o;#r;constructor(e={}){this.#t=e.queryCache||new Ng,this.#e=e.mutationCache||new Dg,this.#s=e.defaultOptions||{},this.#i=new Map,this.#n=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=La.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#r=br.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#r?.(),this.#r=void 0)}isFetching(e){return this.#t.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#e.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),s=this.#t.build(this,t),n=s.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(ds(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:t,state:s})=>{const n=s.data;return[t,n]})}setQueryData(e,t,s){const n=this.defaultQueryOptions({queryKey:e}),r=this.#t.get(n.queryHash)?.state.data,o=gg(t,r);if(o!==void 0)return this.#t.build(this,n).setData(o,{...s,manual:!0})}setQueriesData(e,t,s){return zt.batch(()=>this.#t.findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,s)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state}removeQueries(e){const t=this.#t;zt.batch(()=>{t.findAll(e).forEach(s=>{t.remove(s)})})}resetQueries(e,t){const s=this.#t;return zt.batch(()=>(s.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const s={revert:!0,...t},n=zt.batch(()=>this.#t.findAll(e).map(i=>i.cancel(s)));return Promise.all(n).then(ee).catch(ee)}invalidateQueries(e,t={}){return zt.batch(()=>(this.#t.findAll(e).forEach(s=>{s.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const s={...t,cancelRefetch:t.cancelRefetch??!0},n=zt.batch(()=>this.#t.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let r=i.fetch(void 0,s);return s.throwOnError||(r=r.catch(ee)),i.state.fetchStatus==="paused"?Promise.resolve():r}));return Promise.all(n).then(ee)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=this.#t.build(this,t);return s.isStaleByTime(ds(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ee).catch(ee)}fetchInfiniteQuery(e){return e.behavior=ec(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ee).catch(ee)}ensureInfiniteQueryData(e){return e.behavior=ec(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return br.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#s}setDefaultOptions(e){this.#s=e}setQueryDefaults(e,t){this.#i.set(Jn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],s={};return t.forEach(n=>{Zn(e,n.queryKey)&&Object.assign(s,n.defaultOptions)}),s}setMutationDefaults(e,t){this.#n.set(Jn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#n.values()],s={};return t.forEach(n=>{Zn(e,n.mutationKey)&&Object.assign(s,n.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#s.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Aa(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===gr&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#s.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}},Xd=Q.createContext(void 0),Ig=e=>{const t=Q.useContext(Xd);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},jg=({client:e,children:t})=>(Q.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),y.jsx(Xd.Provider,{value:e,children:t})),Qd=Q.createContext(!1),Bg=()=>Q.useContext(Qd);Qd.Provider;function Vg(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var zg=Q.createContext(Vg()),Hg=()=>Q.useContext(zg),Ug=(e,t,s)=>{const n=s?.state.error&&typeof e.throwOnError=="function"?$d(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},Wg=e=>{Q.useEffect(()=>{e.clearReset()},[e])},$g=({result:e,errorResetBoundary:t,throwOnError:s,query:n,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(i&&e.data===void 0||$d(s,[e.error,n])),qg=e=>{if(e.suspense){const s=i=>i==="static"?i:Math.max(i??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...i)=>s(n(...i)):s(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Kg=(e,t)=>e.isLoading&&e.isFetching&&!t,Yg=(e,t)=>e?.suspense&&t.isPending,nc=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function Gg(e,t,s){if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const n=Bg(),i=Hg(),r=Ig(),o=r.defaultQueryOptions(e);r.getDefaultOptions().queries?._experimental_beforeQuery?.(o);const a=r.getQueryCache().get(o.queryHash);process.env.NODE_ENV!=="production"&&(o.queryFn||console.error(`[${o.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),o._optimisticResults=n?"isRestoring":"optimistic",qg(o),Ug(o,i,a),Wg(i);const l=!r.getQueryCache().get(o.queryHash),[c]=Q.useState(()=>new t(r,o)),u=c.getOptimisticResult(o),d=!n&&e.subscribed!==!1;if(Q.useSyncExternalStore(Q.useCallback(h=>{const f=d?c.subscribe(zt.batchCalls(h)):ee;return c.updateResult(),f},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),Q.useEffect(()=>{c.setOptions(o)},[o,c]),Yg(o,u))throw nc(o,c,i);if($g({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:a,suspense:o.suspense}))throw u.error;return r.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!Hs&&Kg(u,n)&&(l?nc(o,c,i):a?.promise)?.catch(ee).finally(()=>{c.updateResult()}),o.notifyOnChangeProps?u:c.trackResult(u)}function ps(e,t){return Gg(e,Cg)}function Xg(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",t.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}const Qg=e=>{switch(e){case"success":return tb;case"info":return sb;case"warning":return eb;case"error":return nb;default:return null}},Jg=Array(12).fill(0),Zg=({visible:e,className:t})=>L.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},L.createElement("div",{className:"sonner-spinner"},Jg.map((s,n)=>L.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),tb=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},L.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),eb=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},L.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),sb=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},L.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),nb=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},L.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),ib=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},L.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),L.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),rb=()=>{const[e,t]=L.useState(document.hidden);return L.useEffect(()=>{const s=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",s),()=>window.removeEventListener("visibilitychange",s)},[]),e};let Ko=1;class ob{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const s=this.subscribers.indexOf(t);this.subscribers.splice(s,1)}),this.publish=t=>{this.subscribers.forEach(s=>s(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var s;const{message:n,...i}=t,r=typeof t?.id=="number"||((s=t.id)==null?void 0:s.length)>0?t.id:Ko++,o=this.toasts.find(l=>l.id===r),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),o?this.toasts=this.toasts.map(l=>l.id===r?(this.publish({...l,...t,id:r,title:n}),{...l,...t,id:r,dismissible:a,title:n}):l):this.addToast({title:n,...i,dismissible:a,id:r}),r},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(s=>s({id:t,dismiss:!0})))):this.toasts.forEach(s=>{this.subscribers.forEach(n=>n({id:s.id,dismiss:!0}))}),t),this.message=(t,s)=>this.create({...s,message:t}),this.error=(t,s)=>this.create({...s,message:t,type:"error"}),this.success=(t,s)=>this.create({...s,type:"success",message:t}),this.info=(t,s)=>this.create({...s,type:"info",message:t}),this.warning=(t,s)=>this.create({...s,type:"warning",message:t}),this.loading=(t,s)=>this.create({...s,type:"loading",message:t}),this.promise=(t,s)=>{if(!s)return;let n;s.loading!==void 0&&(n=this.create({...s,promise:t,type:"loading",message:s.loading,description:typeof s.description!="function"?s.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let r=n!==void 0,o;const a=i.then(async c=>{if(o=["resolve",c],L.isValidElement(c))r=!1,this.create({id:n,type:"default",message:c});else if(lb(c)&&!c.ok){r=!1;const d=typeof s.error=="function"?await s.error(`HTTP error! status: ${c.status}`):s.error,h=typeof s.description=="function"?await s.description(`HTTP error! status: ${c.status}`):s.description,p=typeof d=="object"&&!L.isValidElement(d)?d:{message:d};this.create({id:n,type:"error",description:h,...p})}else if(c instanceof Error){r=!1;const d=typeof s.error=="function"?await s.error(c):s.error,h=typeof s.description=="function"?await s.description(c):s.description,p=typeof d=="object"&&!L.isValidElement(d)?d:{message:d};this.create({id:n,type:"error",description:h,...p})}else if(s.success!==void 0){r=!1;const d=typeof s.success=="function"?await s.success(c):s.success,h=typeof s.description=="function"?await s.description(c):s.description,p=typeof d=="object"&&!L.isValidElement(d)?d:{message:d};this.create({id:n,type:"success",description:h,...p})}}).catch(async c=>{if(o=["reject",c],s.error!==void 0){r=!1;const u=typeof s.error=="function"?await s.error(c):s.error,d=typeof s.description=="function"?await s.description(c):s.description,f=typeof u=="object"&&!L.isValidElement(u)?u:{message:u};this.create({id:n,type:"error",description:d,...f})}}).finally(()=>{r&&(this.dismiss(n),n=void 0),s.finally==null||s.finally.call(s)}),l=()=>new Promise((c,u)=>a.then(()=>o[0]==="reject"?u(o[1]):c(o[1])).catch(u));return typeof n!="string"&&typeof n!="number"?{unwrap:l}:Object.assign(n,{unwrap:l})},this.custom=(t,s)=>{const n=s?.id||Ko++;return this.create({jsx:t(n),id:n,...s}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const te=new ob,ab=(e,t)=>{const s=t?.id||Ko++;return te.addToast({title:e,...t,id:s}),s},lb=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",cb=ab,ub=()=>te.toasts,db=()=>te.getActiveToasts(),yt=Object.assign(cb,{success:te.success,info:te.info,warning:te.warning,error:te.error,custom:te.custom,message:te.message,promise:te.promise,dismiss:te.dismiss,loading:te.loading},{getHistory:ub,getToasts:db});Xg("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Ti(e){return e.label!==void 0}const hb=3,fb="24px",pb="16px",ic=4e3,mb=356,gb=14,bb=45,yb=200;function Ee(...e){return e.filter(Boolean).join(" ")}function xb(e){const[t,s]=e.split("-"),n=[];return t&&n.push(t),s&&n.push(s),n}const vb=e=>{var t,s,n,i,r,o,a,l,c;const{invert:u,toast:d,unstyled:h,interacting:f,setHeights:p,visibleToasts:m,heights:g,index:b,toasts:x,expanded:w,removeToast:v,defaultRichColors:S,closeButton:P,style:R,cancelButtonStyle:_,actionButtonStyle:C,className:N="",descriptionClassName:j="",duration:A,position:F,gap:V,expandByDefault:W,classNames:I,icons:q,closeButtonAriaLabel:z="Close toast"}=e,[rt,dt]=L.useState(null),[M,Y]=L.useState(null),[B,U]=L.useState(!1),[et,ft]=L.useState(!1),[Z,it]=L.useState(!1),[kt,Ot]=L.useState(!1),[Bt,Ht]=L.useState(!1),[xs,vs]=L.useState(0),[_s,Ze]=L.useState(0),Qt=L.useRef(d.duration||A||ic),ts=L.useRef(null),Ft=L.useRef(null),Gs=b===0,k=b+1<=m,E=d.type,T=d.dismissible!==!1,$=d.className||"",H=d.descriptionClassName||"",D=L.useMemo(()=>g.findIndex(ot=>ot.toastId===d.id)||0,[g,d.id]),K=L.useMemo(()=>{var ot;return(ot=d.closeButton)!=null?ot:P},[d.closeButton,P]),st=L.useMemo(()=>d.duration||A||ic,[d.duration,A]),ct=L.useRef(0),Rt=L.useRef(0),Pe=L.useRef(0),Gt=L.useRef(null),[Xr,yn]=F.split("-"),Xs=L.useMemo(()=>g.reduce((ot,It,Ut)=>Ut>=D?ot:ot+It.height,0),[g,D]),xi=rb(),vi=d.invert||u,xn=E==="loading";Rt.current=L.useMemo(()=>D*V+Xs,[D,Xs]),L.useEffect(()=>{Qt.current=st},[st]),L.useEffect(()=>{U(!0)},[]),L.useEffect(()=>{const ot=Ft.current;if(ot){const It=ot.getBoundingClientRect().height;return Ze(It),p(Ut=>[{toastId:d.id,height:It,position:d.position},...Ut]),()=>p(Ut=>Ut.filter(oe=>oe.toastId!==d.id))}},[p,d.id]),L.useLayoutEffect(()=>{if(!B)return;const ot=Ft.current,It=ot.style.height;ot.style.height="auto";const Ut=ot.getBoundingClientRect().height;ot.style.height=It,Ze(Ut),p(oe=>oe.find(Vt=>Vt.toastId===d.id)?oe.map(Vt=>Vt.toastId===d.id?{...Vt,height:Ut}:Vt):[{toastId:d.id,height:Ut,position:d.position},...oe])},[B,d.title,d.description,p,d.id,d.jsx,d.action,d.cancel]);const ye=L.useCallback(()=>{ft(!0),vs(Rt.current),p(ot=>ot.filter(It=>It.toastId!==d.id)),setTimeout(()=>{v(d)},yb)},[d,v,p,Rt]);L.useEffect(()=>{if(d.promise&&E==="loading"||d.duration===1/0||d.type==="loading")return;let ot;return w||f||xi?(()=>{if(Pe.current<ct.current){const oe=new Date().getTime()-ct.current;Qt.current=Qt.current-oe}Pe.current=new Date().getTime()})():Qt.current!==1/0&&(ct.current=new Date().getTime(),ot=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),ye()},Qt.current)),()=>clearTimeout(ot)},[w,f,d,E,xi,ye]),L.useEffect(()=>{d.delete&&(ye(),d.onDismiss==null||d.onDismiss.call(d,d))},[ye,d.delete]);function xp(){var ot;if(q?.loading){var It;return L.createElement("div",{className:Ee(I?.loader,d==null||(It=d.classNames)==null?void 0:It.loader,"sonner-loader"),"data-visible":E==="loading"},q.loading)}return L.createElement(Zg,{className:Ee(I?.loader,d==null||(ot=d.classNames)==null?void 0:ot.loader),visible:E==="loading"})}const vp=d.icon||q?.[E]||Qg(E);var pl,ml;return L.createElement("li",{tabIndex:0,ref:Ft,className:Ee(N,$,I?.toast,d==null||(t=d.classNames)==null?void 0:t.toast,I?.default,I?.[E],d==null||(s=d.classNames)==null?void 0:s[E]),"data-sonner-toast":"","data-rich-colors":(pl=d.richColors)!=null?pl:S,"data-styled":!(d.jsx||d.unstyled||h),"data-mounted":B,"data-promise":!!d.promise,"data-swiped":Bt,"data-removed":et,"data-visible":k,"data-y-position":Xr,"data-x-position":yn,"data-index":b,"data-front":Gs,"data-swiping":Z,"data-dismissible":T,"data-type":E,"data-invert":vi,"data-swipe-out":kt,"data-swipe-direction":M,"data-expanded":!!(w||W&&B),"data-testid":d.testId,style:{"--index":b,"--toasts-before":b,"--z-index":x.length-b,"--offset":`${et?xs:Rt.current}px`,"--initial-height":W?"auto":`${_s}px`,...R,...d.style},onDragEnd:()=>{it(!1),dt(null),Gt.current=null},onPointerDown:ot=>{ot.button!==2&&(xn||!T||(ts.current=new Date,vs(Rt.current),ot.target.setPointerCapture(ot.pointerId),ot.target.tagName!=="BUTTON"&&(it(!0),Gt.current={x:ot.clientX,y:ot.clientY})))},onPointerUp:()=>{var ot,It,Ut;if(kt||!T)return;Gt.current=null;const oe=Number(((ot=Ft.current)==null?void 0:ot.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),_i=Number(((It=Ft.current)==null?void 0:It.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Vt=new Date().getTime()-((Ut=ts.current)==null?void 0:Ut.getTime()),de=rt==="x"?oe:_i,wi=Math.abs(de)/Vt;if(Math.abs(de)>=bb||wi>.11){vs(Rt.current),d.onDismiss==null||d.onDismiss.call(d,d),Y(rt==="x"?oe>0?"right":"left":_i>0?"down":"up"),ye(),Ot(!0);return}else{var xe,ve;(xe=Ft.current)==null||xe.style.setProperty("--swipe-amount-x","0px"),(ve=Ft.current)==null||ve.style.setProperty("--swipe-amount-y","0px")}Ht(!1),it(!1),dt(null)},onPointerMove:ot=>{var It,Ut,oe;if(!Gt.current||!T||((It=window.getSelection())==null?void 0:It.toString().length)>0)return;const Vt=ot.clientY-Gt.current.y,de=ot.clientX-Gt.current.x;var wi;const xe=(wi=e.swipeDirections)!=null?wi:xb(F);!rt&&(Math.abs(de)>1||Math.abs(Vt)>1)&&dt(Math.abs(de)>Math.abs(Vt)?"x":"y");let ve={x:0,y:0};const gl=ws=>1/(1.5+Math.abs(ws)/20);if(rt==="y"){if(xe.includes("top")||xe.includes("bottom"))if(xe.includes("top")&&Vt<0||xe.includes("bottom")&&Vt>0)ve.y=Vt;else{const ws=Vt*gl(Vt);ve.y=Math.abs(ws)<Math.abs(Vt)?ws:Vt}}else if(rt==="x"&&(xe.includes("left")||xe.includes("right")))if(xe.includes("left")&&de<0||xe.includes("right")&&de>0)ve.x=de;else{const ws=de*gl(de);ve.x=Math.abs(ws)<Math.abs(de)?ws:de}(Math.abs(ve.x)>0||Math.abs(ve.y)>0)&&Ht(!0),(Ut=Ft.current)==null||Ut.style.setProperty("--swipe-amount-x",`${ve.x}px`),(oe=Ft.current)==null||oe.style.setProperty("--swipe-amount-y",`${ve.y}px`)}},K&&!d.jsx&&E!=="loading"?L.createElement("button",{"aria-label":z,"data-disabled":xn,"data-close-button":!0,onClick:xn||!T?()=>{}:()=>{ye(),d.onDismiss==null||d.onDismiss.call(d,d)},className:Ee(I?.closeButton,d==null||(n=d.classNames)==null?void 0:n.closeButton)},(ml=q?.close)!=null?ml:ib):null,(E||d.icon||d.promise)&&d.icon!==null&&(q?.[E]!==null||d.icon)?L.createElement("div",{"data-icon":"",className:Ee(I?.icon,d==null||(i=d.classNames)==null?void 0:i.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||xp():null,d.type!=="loading"?vp:null):null,L.createElement("div",{"data-content":"",className:Ee(I?.content,d==null||(r=d.classNames)==null?void 0:r.content)},L.createElement("div",{"data-title":"",className:Ee(I?.title,d==null||(o=d.classNames)==null?void 0:o.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?L.createElement("div",{"data-description":"",className:Ee(j,H,I?.description,d==null||(a=d.classNames)==null?void 0:a.description)},typeof d.description=="function"?d.description():d.description):null),L.isValidElement(d.cancel)?d.cancel:d.cancel&&Ti(d.cancel)?L.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||_,onClick:ot=>{Ti(d.cancel)&&T&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,ot),ye())},className:Ee(I?.cancelButton,d==null||(l=d.classNames)==null?void 0:l.cancelButton)},d.cancel.label):null,L.isValidElement(d.action)?d.action:d.action&&Ti(d.action)?L.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||C,onClick:ot=>{Ti(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,ot),!ot.defaultPrevented&&ye())},className:Ee(I?.actionButton,d==null||(c=d.classNames)==null?void 0:c.actionButton)},d.action.label):null)};function rc(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function _b(e,t){const s={};return[e,t].forEach((n,i)=>{const r=i===1,o=r?"--mobile-offset":"--offset",a=r?pb:fb;function l(c){["top","right","bottom","left"].forEach(u=>{s[`${o}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof n=="number"||typeof n=="string"?l(n):typeof n=="object"?["top","right","bottom","left"].forEach(c=>{n[c]===void 0?s[`${o}-${c}`]=a:s[`${o}-${c}`]=typeof n[c]=="number"?`${n[c]}px`:n[c]}):l(a)}),s}const wb=L.forwardRef(function(t,s){const{id:n,invert:i,position:r="bottom-right",hotkey:o=["altKey","KeyT"],expand:a,closeButton:l,className:c,offset:u,mobileOffset:d,theme:h="light",richColors:f,duration:p,style:m,visibleToasts:g=hb,toastOptions:b,dir:x=rc(),gap:w=gb,icons:v,containerAriaLabel:S="Notifications"}=t,[P,R]=L.useState([]),_=L.useMemo(()=>n?P.filter(B=>B.toasterId===n):P.filter(B=>!B.toasterId),[P,n]),C=L.useMemo(()=>Array.from(new Set([r].concat(_.filter(B=>B.position).map(B=>B.position)))),[_,r]),[N,j]=L.useState([]),[A,F]=L.useState(!1),[V,W]=L.useState(!1),[I,q]=L.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),z=L.useRef(null),rt=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),dt=L.useRef(null),M=L.useRef(!1),Y=L.useCallback(B=>{R(U=>{var et;return(et=U.find(ft=>ft.id===B.id))!=null&&et.delete||te.dismiss(B.id),U.filter(({id:ft})=>ft!==B.id)})},[]);return L.useEffect(()=>te.subscribe(B=>{if(B.dismiss){requestAnimationFrame(()=>{R(U=>U.map(et=>et.id===B.id?{...et,delete:!0}:et))});return}setTimeout(()=>{xd.flushSync(()=>{R(U=>{const et=U.findIndex(ft=>ft.id===B.id);return et!==-1?[...U.slice(0,et),{...U[et],...B},...U.slice(et+1)]:[B,...U]})})})}),[P]),L.useEffect(()=>{if(h!=="system"){q(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?q("dark"):q("light")),typeof window>"u")return;const B=window.matchMedia("(prefers-color-scheme: dark)");try{B.addEventListener("change",({matches:U})=>{q(U?"dark":"light")})}catch{B.addListener(({matches:et})=>{try{q(et?"dark":"light")}catch(ft){console.error(ft)}})}},[h]),L.useEffect(()=>{P.length<=1&&F(!1)},[P]),L.useEffect(()=>{const B=U=>{var et;if(o.every(it=>U[it]||U.code===it)){var Z;F(!0),(Z=z.current)==null||Z.focus()}U.code==="Escape"&&(document.activeElement===z.current||(et=z.current)!=null&&et.contains(document.activeElement))&&F(!1)};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[o]),L.useEffect(()=>{if(z.current)return()=>{dt.current&&(dt.current.focus({preventScroll:!0}),dt.current=null,M.current=!1)}},[z.current]),L.createElement("section",{ref:s,"aria-label":`${S} ${rt}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},C.map((B,U)=>{var et;const[ft,Z]=B.split("-");return _.length?L.createElement("ol",{key:B,dir:x==="auto"?rc():x,tabIndex:-1,ref:z,className:c,"data-sonner-toaster":!0,"data-sonner-theme":I,"data-y-position":ft,"data-x-position":Z,style:{"--front-toast-height":`${((et=N[0])==null?void 0:et.height)||0}px`,"--width":`${mb}px`,"--gap":`${w}px`,...m,..._b(u,d)},onBlur:it=>{M.current&&!it.currentTarget.contains(it.relatedTarget)&&(M.current=!1,dt.current&&(dt.current.focus({preventScroll:!0}),dt.current=null))},onFocus:it=>{it.target instanceof HTMLElement&&it.target.dataset.dismissible==="false"||M.current||(M.current=!0,dt.current=it.relatedTarget)},onMouseEnter:()=>F(!0),onMouseMove:()=>F(!0),onMouseLeave:()=>{V||F(!1)},onDragEnd:()=>F(!1),onPointerDown:it=>{it.target instanceof HTMLElement&&it.target.dataset.dismissible==="false"||W(!0)},onPointerUp:()=>W(!1)},_.filter(it=>!it.position&&U===0||it.position===B).map((it,kt)=>{var Ot,Bt;return L.createElement(vb,{key:it.id,icons:v,index:kt,toast:it,defaultRichColors:f,duration:(Ot=b?.duration)!=null?Ot:p,className:b?.className,descriptionClassName:b?.descriptionClassName,invert:i,visibleToasts:g,closeButton:(Bt=b?.closeButton)!=null?Bt:l,interacting:V,position:B,style:b?.style,unstyled:b?.unstyled,classNames:b?.classNames,cancelButtonStyle:b?.cancelButtonStyle,actionButtonStyle:b?.actionButtonStyle,closeButtonAriaLabel:b?.closeButtonAriaLabel,removeToast:Y,toasts:_.filter(Ht=>Ht.position==it.position),heights:N.filter(Ht=>Ht.position==it.position),setHeights:j,expandByDefault:a,gap:w,expanded:A,swipeDirections:t.swipeDirections})})):null}))}),oc=e=>{let t;const s=new Set,n=(c,u)=>{const d=typeof c=="function"?c(t):c;if(!Object.is(d,t)){const h=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({},t,d),s.forEach(f=>f(t,h))}},i=()=>t,a={setState:n,getState:i,getInitialState:()=>l,subscribe:c=>(s.add(c),()=>s.delete(c))},l=t=e(n,i,a);return a},Sb=(e=>e?oc(e):oc),kb=e=>e;function Rb(e,t=kb){const s=L.useSyncExternalStore(e.subscribe,L.useCallback(()=>t(e.getState()),[e,t]),L.useCallback(()=>t(e.getInitialState()),[e,t]));return L.useDebugValue(s),s}const ac=e=>{const t=Sb(e),s=n=>Rb(t,n);return Object.assign(s,t),s},Jd=(e=>e?ac(e):ac);function Pb(e,t){let s;try{s=e()}catch{return}return{getItem:i=>{var r;const o=l=>l===null?null:JSON.parse(l,void 0),a=(r=s.getItem(i))!=null?r:null;return a instanceof Promise?a.then(o):o(a)},setItem:(i,r)=>s.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>s.removeItem(i)}}const Yo=e=>t=>{try{const s=e(t);return s instanceof Promise?s:{then(n){return Yo(n)(s)},catch(n){return this}}}catch(s){return{then(n){return this},catch(n){return Yo(n)(s)}}}},Eb=(e,t)=>(s,n,i)=>{let r={storage:Pb(()=>localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...t},o=!1,a=0;const l=new Set,c=new Set;let u=r.storage;if(!u)return e((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),s(...g)},n,i);const d=()=>{const g=r.partialize({...n()});return u.setItem(r.name,{state:g,version:r.version})},h=i.setState;i.setState=(g,b)=>(h(g,b),d());const f=e((...g)=>(s(...g),d()),n,i);i.getInitialState=()=>f;let p;const m=()=>{var g,b;if(!u)return;const x=++a;o=!1,l.forEach(v=>{var S;return v((S=n())!=null?S:f)});const w=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=n())!=null?g:f))||void 0;return Yo(u.getItem.bind(u))(r.name).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==r.version){if(r.migrate){const S=r.migrate(v.state,v.version);return S instanceof Promise?S.then(P=>[!0,P]):[!0,S]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,v.state];return[!1,void 0]}).then(v=>{var S;if(x!==a)return;const[P,R]=v;if(p=r.merge(R,(S=n())!=null?S:f),s(p,!0),P)return d()}).then(()=>{x===a&&(w?.(p,void 0),p=n(),o=!0,c.forEach(v=>v(p)))}).catch(v=>{x===a&&w?.(void 0,v)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(u=g.storage)},clearStorage:()=>{u?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>m(),hasHydrated:()=>o,onHydrate:g=>(l.add(g),()=>{l.delete(g)}),onFinishHydration:g=>(c.add(g),()=>{c.delete(g)})},r.skipHydration||m(),p||f},Cb=Eb;function Zd(e,t){return function(){return e.apply(t,arguments)}}const{toString:Ob}=Object.prototype,{getPrototypeOf:Na}=Object,{iterator:Dr,toStringTag:th}=Symbol,Nr=(e=>t=>{const s=Ob.call(t);return e[s]||(e[s]=s.slice(8,-1).toLowerCase())})(Object.create(null)),Re=e=>(e=e.toLowerCase(),t=>Nr(t)===e),Fr=e=>t=>typeof t===e,{isArray:pn}=Array,un=Fr("undefined");function ci(e){return e!==null&&!un(e)&&e.constructor!==null&&!un(e.constructor)&&ie(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const eh=Re("ArrayBuffer");function Tb(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&eh(e.buffer),t}const Mb=Fr("string"),ie=Fr("function"),sh=Fr("number"),ui=e=>e!==null&&typeof e=="object",Ab=e=>e===!0||e===!1,Zi=e=>{if(Nr(e)!=="object")return!1;const t=Na(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(th in e)&&!(Dr in e)},Lb=e=>{if(!ui(e)||ci(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Db=Re("Date"),Nb=Re("File"),Fb=Re("Blob"),Ib=Re("FileList"),jb=e=>ui(e)&&ie(e.pipe),Bb=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||ie(e.append)&&((t=Nr(e))==="formdata"||t==="object"&&ie(e.toString)&&e.toString()==="[object FormData]"))},Vb=Re("URLSearchParams"),[zb,Hb,Ub,Wb]=["ReadableStream","Request","Response","Headers"].map(Re),$b=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function di(e,t,{allOwnKeys:s=!1}={}){if(e===null||typeof e>"u")return;let n,i;if(typeof e!="object"&&(e=[e]),pn(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{if(ci(e))return;const r=s?Object.getOwnPropertyNames(e):Object.keys(e),o=r.length;let a;for(n=0;n<o;n++)a=r[n],t.call(null,e[a],a,e)}}function nh(e,t){if(ci(e))return null;t=t.toLowerCase();const s=Object.keys(e);let n=s.length,i;for(;n-- >0;)if(i=s[n],t===i.toLowerCase())return i;return null}const Ls=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ih=e=>!un(e)&&e!==Ls;function Go(){const{caseless:e,skipUndefined:t}=ih(this)&&this||{},s={},n=(i,r)=>{const o=e&&nh(s,r)||r;Zi(s[o])&&Zi(i)?s[o]=Go(s[o],i):Zi(i)?s[o]=Go({},i):pn(i)?s[o]=i.slice():(!t||!un(i))&&(s[o]=i)};for(let i=0,r=arguments.length;i<r;i++)arguments[i]&&di(arguments[i],n);return s}const qb=(e,t,s,{allOwnKeys:n}={})=>(di(t,(i,r)=>{s&&ie(i)?Object.defineProperty(e,r,{value:Zd(i,s),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{value:i,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),e),Kb=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Yb=(e,t,s,n)=>{e.prototype=Object.create(t.prototype,n),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),s&&Object.assign(e.prototype,s)},Gb=(e,t,s,n)=>{let i,r,o;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),r=i.length;r-- >0;)o=i[r],(!n||n(o,e,t))&&!a[o]&&(t[o]=e[o],a[o]=!0);e=s!==!1&&Na(e)}while(e&&(!s||s(e,t))&&e!==Object.prototype);return t},Xb=(e,t,s)=>{e=String(e),(s===void 0||s>e.length)&&(s=e.length),s-=t.length;const n=e.indexOf(t,s);return n!==-1&&n===s},Qb=e=>{if(!e)return null;if(pn(e))return e;let t=e.length;if(!sh(t))return null;const s=new Array(t);for(;t-- >0;)s[t]=e[t];return s},Jb=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Na(Uint8Array)),Zb=(e,t)=>{const n=(e&&e[Dr]).call(e);let i;for(;(i=n.next())&&!i.done;){const r=i.value;t.call(e,r[0],r[1])}},ty=(e,t)=>{let s;const n=[];for(;(s=e.exec(t))!==null;)n.push(s);return n},ey=Re("HTMLFormElement"),sy=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(s,n,i){return n.toUpperCase()+i}),lc=(({hasOwnProperty:e})=>(t,s)=>e.call(t,s))(Object.prototype),ny=Re("RegExp"),rh=(e,t)=>{const s=Object.getOwnPropertyDescriptors(e),n={};di(s,(i,r)=>{let o;(o=t(i,r,e))!==!1&&(n[r]=o||i)}),Object.defineProperties(e,n)},iy=e=>{rh(e,(t,s)=>{if(ie(e)&&["arguments","caller","callee"].indexOf(s)!==-1)return!1;const n=e[s];if(ie(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+s+"'")})}})},ry=(e,t)=>{const s={},n=i=>{i.forEach(r=>{s[r]=!0})};return pn(e)?n(e):n(String(e).split(t)),s},oy=()=>{},ay=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function ly(e){return!!(e&&ie(e.append)&&e[th]==="FormData"&&e[Dr])}const cy=e=>{const t=new Array(10),s=(n,i)=>{if(ui(n)){if(t.indexOf(n)>=0)return;if(ci(n))return n;if(!("toJSON"in n)){t[i]=n;const r=pn(n)?[]:{};return di(n,(o,a)=>{const l=s(o,i+1);!un(l)&&(r[a]=l)}),t[i]=void 0,r}}return n};return s(e,0)},uy=Re("AsyncFunction"),dy=e=>e&&(ui(e)||ie(e))&&ie(e.then)&&ie(e.catch),oh=((e,t)=>e?setImmediate:t?((s,n)=>(Ls.addEventListener("message",({source:i,data:r})=>{i===Ls&&r===s&&n.length&&n.shift()()},!1),i=>{n.push(i),Ls.postMessage(s,"*")}))(`axios@${Math.random()}`,[]):s=>setTimeout(s))(typeof setImmediate=="function",ie(Ls.postMessage)),hy=typeof queueMicrotask<"u"?queueMicrotask.bind(Ls):typeof process<"u"&&process.nextTick||oh,fy=e=>e!=null&&ie(e[Dr]),O={isArray:pn,isArrayBuffer:eh,isBuffer:ci,isFormData:Bb,isArrayBufferView:Tb,isString:Mb,isNumber:sh,isBoolean:Ab,isObject:ui,isPlainObject:Zi,isEmptyObject:Lb,isReadableStream:zb,isRequest:Hb,isResponse:Ub,isHeaders:Wb,isUndefined:un,isDate:Db,isFile:Nb,isBlob:Fb,isRegExp:ny,isFunction:ie,isStream:jb,isURLSearchParams:Vb,isTypedArray:Jb,isFileList:Ib,forEach:di,merge:Go,extend:qb,trim:$b,stripBOM:Kb,inherits:Yb,toFlatObject:Gb,kindOf:Nr,kindOfTest:Re,endsWith:Xb,toArray:Qb,forEachEntry:Zb,matchAll:ty,isHTMLForm:ey,hasOwnProperty:lc,hasOwnProp:lc,reduceDescriptors:rh,freezeMethods:iy,toObjectSet:ry,toCamelCase:sy,noop:oy,toFiniteNumber:ay,findKey:nh,global:Ls,isContextDefined:ih,isSpecCompliantForm:ly,toJSONObject:cy,isAsyncFn:uy,isThenable:dy,setImmediate:oh,asap:hy,isIterable:fy};let tt=class ah extends Error{static from(t,s,n,i,r,o){const a=new ah(t.message,s||t.code,n,i,r);return a.cause=t,a.name=t.name,o&&Object.assign(a,o),a}constructor(t,s,n,i,r){super(t),this.name="AxiosError",this.isAxiosError=!0,s&&(this.code=s),n&&(this.config=n),i&&(this.request=i),r&&(this.response=r,this.status=r.status)}toJSON(){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:O.toJSONObject(this.config),code:this.code,status:this.status}}};tt.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";tt.ERR_BAD_OPTION="ERR_BAD_OPTION";tt.ECONNABORTED="ECONNABORTED";tt.ETIMEDOUT="ETIMEDOUT";tt.ERR_NETWORK="ERR_NETWORK";tt.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";tt.ERR_DEPRECATED="ERR_DEPRECATED";tt.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";tt.ERR_BAD_REQUEST="ERR_BAD_REQUEST";tt.ERR_CANCELED="ERR_CANCELED";tt.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";tt.ERR_INVALID_URL="ERR_INVALID_URL";const py=null;function Xo(e){return O.isPlainObject(e)||O.isArray(e)}function lh(e){return O.endsWith(e,"[]")?e.slice(0,-2):e}function cc(e,t,s){return e?e.concat(t).map(function(i,r){return i=lh(i),!s&&r?"["+i+"]":i}).join(s?".":""):t}function my(e){return O.isArray(e)&&!e.some(Xo)}const gy=O.toFlatObject(O,{},null,function(t){return/^is[A-Z]/.test(t)});function Ir(e,t,s){if(!O.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,s=O.toFlatObject(s,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,g){return!O.isUndefined(g[m])});const n=s.metaTokens,i=s.visitor||u,r=s.dots,o=s.indexes,l=(s.Blob||typeof Blob<"u"&&Blob)&&O.isSpecCompliantForm(t);if(!O.isFunction(i))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(O.isDate(p))return p.toISOString();if(O.isBoolean(p))return p.toString();if(!l&&O.isBlob(p))throw new tt("Blob is not supported. Use a Buffer instead.");return O.isArrayBuffer(p)||O.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,m,g){let b=p;if(p&&!g&&typeof p=="object"){if(O.endsWith(m,"{}"))m=n?m:m.slice(0,-2),p=JSON.stringify(p);else if(O.isArray(p)&&my(p)||(O.isFileList(p)||O.endsWith(m,"[]"))&&(b=O.toArray(p)))return m=lh(m),b.forEach(function(w,v){!(O.isUndefined(w)||w===null)&&t.append(o===!0?cc([m],v,r):o===null?m:m+"[]",c(w))}),!1}return Xo(p)?!0:(t.append(cc(g,m,r),c(p)),!1)}const d=[],h=Object.assign(gy,{defaultVisitor:u,convertValue:c,isVisitable:Xo});function f(p,m){if(!O.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(p),O.forEach(p,function(b,x){(!(O.isUndefined(b)||b===null)&&i.call(t,b,O.isString(x)?x.trim():x,m,h))===!0&&f(b,m?m.concat(x):[x])}),d.pop()}}if(!O.isObject(e))throw new TypeError("data must be an object");return f(e),t}function uc(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function Fa(e,t){this._pairs=[],e&&Ir(e,this,t)}const ch=Fa.prototype;ch.append=function(t,s){this._pairs.push([t,s])};ch.toString=function(t){const s=t?function(n){return t.call(this,n,uc)}:uc;return this._pairs.map(function(i){return s(i[0])+"="+s(i[1])},"").join("&")};function by(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function uh(e,t,s){if(!t)return e;const n=s&&s.encode||by,i=O.isFunction(s)?{serialize:s}:s,r=i&&i.serialize;let o;if(r?o=r(t,i):o=O.isURLSearchParams(t)?t.toString():new Fa(t,i).toString(n),o){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class dc{constructor(){this.handlers=[]}use(t,s,n){return this.handlers.push({fulfilled:t,rejected:s,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){O.forEach(this.handlers,function(n){n!==null&&t(n)})}}const dh={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},yy=typeof URLSearchParams<"u"?URLSearchParams:Fa,xy=typeof FormData<"u"?FormData:null,vy=typeof Blob<"u"?Blob:null,_y={isBrowser:!0,classes:{URLSearchParams:yy,FormData:xy,Blob:vy},protocols:["http","https","file","blob","url","data"]},Ia=typeof window<"u"&&typeof document<"u",Qo=typeof navigator=="object"&&navigator||void 0,wy=Ia&&(!Qo||["ReactNative","NativeScript","NS"].indexOf(Qo.product)<0),Sy=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",ky=Ia&&window.location.href||"http://localhost",Ry=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ia,hasStandardBrowserEnv:wy,hasStandardBrowserWebWorkerEnv:Sy,navigator:Qo,origin:ky},Symbol.toStringTag,{value:"Module"})),qt={...Ry,..._y};function Py(e,t){return Ir(e,new qt.classes.URLSearchParams,{visitor:function(s,n,i,r){return qt.isNode&&O.isBuffer(s)?(this.append(n,s.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}function Ey(e){return O.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Cy(e){const t={},s=Object.keys(e);let n;const i=s.length;let r;for(n=0;n<i;n++)r=s[n],t[r]=e[r];return t}function hh(e){function t(s,n,i,r){let o=s[r++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),l=r>=s.length;return o=!o&&O.isArray(i)?i.length:o,l?(O.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!a):((!i[o]||!O.isObject(i[o]))&&(i[o]=[]),t(s,n,i[o],r)&&O.isArray(i[o])&&(i[o]=Cy(i[o])),!a)}if(O.isFormData(e)&&O.isFunction(e.entries)){const s={};return O.forEachEntry(e,(n,i)=>{t(Ey(n),i,s,0)}),s}return null}function Oy(e,t,s){if(O.isString(e))try{return(t||JSON.parse)(e),O.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(s||JSON.stringify)(e)}const hi={transitional:dh,adapter:["xhr","http","fetch"],transformRequest:[function(t,s){const n=s.getContentType()||"",i=n.indexOf("application/json")>-1,r=O.isObject(t);if(r&&O.isHTMLForm(t)&&(t=new FormData(t)),O.isFormData(t))return i?JSON.stringify(hh(t)):t;if(O.isArrayBuffer(t)||O.isBuffer(t)||O.isStream(t)||O.isFile(t)||O.isBlob(t)||O.isReadableStream(t))return t;if(O.isArrayBufferView(t))return t.buffer;if(O.isURLSearchParams(t))return s.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(r){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Py(t,this.formSerializer).toString();if((a=O.isFileList(t))||n.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Ir(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return r||i?(s.setContentType("application/json",!1),Oy(t)):t}],transformResponse:[function(t){const s=this.transitional||hi.transitional,n=s&&s.forcedJSONParsing,i=this.responseType==="json";if(O.isResponse(t)||O.isReadableStream(t))return t;if(t&&O.isString(t)&&(n&&!this.responseType||i)){const o=!(s&&s.silentJSONParsing)&&i;try{return JSON.parse(t,this.parseReviver)}catch(a){if(o)throw a.name==="SyntaxError"?tt.from(a,tt.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:qt.classes.FormData,Blob:qt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};O.forEach(["delete","get","head","post","put","patch"],e=>{hi.headers[e]={}});const Ty=O.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"]),My=e=>{const t={};let s,n,i;return e&&e.split(`
7
+ `).forEach(function(o){i=o.indexOf(":"),s=o.substring(0,i).trim().toLowerCase(),n=o.substring(i+1).trim(),!(!s||t[s]&&Ty[s])&&(s==="set-cookie"?t[s]?t[s].push(n):t[s]=[n]:t[s]=t[s]?t[s]+", "+n:n)}),t},hc=Symbol("internals");function En(e){return e&&String(e).trim().toLowerCase()}function tr(e){return e===!1||e==null?e:O.isArray(e)?e.map(tr):String(e)}function Ay(e){const t=Object.create(null),s=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=s.exec(e);)t[n[1]]=n[2];return t}const Ly=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function fo(e,t,s,n,i){if(O.isFunction(n))return n.call(this,t,s);if(i&&(t=s),!!O.isString(t)){if(O.isString(n))return t.indexOf(n)!==-1;if(O.isRegExp(n))return n.test(t)}}function Dy(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,s,n)=>s.toUpperCase()+n)}function Ny(e,t){const s=O.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+s,{value:function(i,r,o){return this[n].call(this,t,i,r,o)},configurable:!0})})}let re=class{constructor(t){t&&this.set(t)}set(t,s,n){const i=this;function r(a,l,c){const u=En(l);if(!u)throw new Error("header name must be a non-empty string");const d=O.findKey(i,u);(!d||i[d]===void 0||c===!0||c===void 0&&i[d]!==!1)&&(i[d||l]=tr(a))}const o=(a,l)=>O.forEach(a,(c,u)=>r(c,u,l));if(O.isPlainObject(t)||t instanceof this.constructor)o(t,s);else if(O.isString(t)&&(t=t.trim())&&!Ly(t))o(My(t),s);else if(O.isObject(t)&&O.isIterable(t)){let a={},l,c;for(const u of t){if(!O.isArray(u))throw TypeError("Object iterator must return a key-value pair");a[c=u[0]]=(l=a[c])?O.isArray(l)?[...l,u[1]]:[l,u[1]]:u[1]}o(a,s)}else t!=null&&r(s,t,n);return this}get(t,s){if(t=En(t),t){const n=O.findKey(this,t);if(n){const i=this[n];if(!s)return i;if(s===!0)return Ay(i);if(O.isFunction(s))return s.call(this,i,n);if(O.isRegExp(s))return s.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,s){if(t=En(t),t){const n=O.findKey(this,t);return!!(n&&this[n]!==void 0&&(!s||fo(this,this[n],n,s)))}return!1}delete(t,s){const n=this;let i=!1;function r(o){if(o=En(o),o){const a=O.findKey(n,o);a&&(!s||fo(n,n[a],a,s))&&(delete n[a],i=!0)}}return O.isArray(t)?t.forEach(r):r(t),i}clear(t){const s=Object.keys(this);let n=s.length,i=!1;for(;n--;){const r=s[n];(!t||fo(this,this[r],r,t,!0))&&(delete this[r],i=!0)}return i}normalize(t){const s=this,n={};return O.forEach(this,(i,r)=>{const o=O.findKey(n,r);if(o){s[o]=tr(i),delete s[r];return}const a=t?Dy(r):String(r).trim();a!==r&&delete s[r],s[a]=tr(i),n[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const s=Object.create(null);return O.forEach(this,(n,i)=>{n!=null&&n!==!1&&(s[i]=t&&O.isArray(n)?n.join(", "):n)}),s}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,s])=>t+": "+s).join(`
8
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...s){const n=new this(t);return s.forEach(i=>n.set(i)),n}static accessor(t){const n=(this[hc]=this[hc]={accessors:{}}).accessors,i=this.prototype;function r(o){const a=En(o);n[a]||(Ny(i,o),n[a]=!0)}return O.isArray(t)?t.forEach(r):r(t),this}};re.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);O.reduceDescriptors(re.prototype,({value:e},t)=>{let s=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[s]=n}}});O.freezeMethods(re);function po(e,t){const s=this||hi,n=t||s,i=re.from(n.headers);let r=n.data;return O.forEach(e,function(a){r=a.call(s,r,i.normalize(),t?t.status:void 0)}),i.normalize(),r}function fh(e){return!!(e&&e.__CANCEL__)}let fi=class extends tt{constructor(t,s,n){super(t??"canceled",tt.ERR_CANCELED,s,n),this.name="CanceledError",this.__CANCEL__=!0}};function ph(e,t,s){const n=s.config.validateStatus;!s.status||!n||n(s.status)?e(s):t(new tt("Request failed with status code "+s.status,[tt.ERR_BAD_REQUEST,tt.ERR_BAD_RESPONSE][Math.floor(s.status/100)-4],s.config,s.request,s))}function Fy(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Iy(e,t){e=e||10;const s=new Array(e),n=new Array(e);let i=0,r=0,o;return t=t!==void 0?t:1e3,function(l){const c=Date.now(),u=n[r];o||(o=c),s[i]=l,n[i]=c;let d=r,h=0;for(;d!==i;)h+=s[d++],d=d%e;if(i=(i+1)%e,i===r&&(r=(r+1)%e),c-o<t)return;const f=u&&c-u;return f?Math.round(h*1e3/f):void 0}}function jy(e,t){let s=0,n=1e3/t,i,r;const o=(c,u=Date.now())=>{s=u,i=null,r&&(clearTimeout(r),r=null),e(...c)};return[(...c)=>{const u=Date.now(),d=u-s;d>=n?o(c,u):(i=c,r||(r=setTimeout(()=>{r=null,o(i)},n-d)))},()=>i&&o(i)]}const yr=(e,t,s=3)=>{let n=0;const i=Iy(50,250);return jy(r=>{const o=r.loaded,a=r.lengthComputable?r.total:void 0,l=o-n,c=i(l),u=o<=a;n=o;const d={loaded:o,total:a,progress:a?o/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&u?(a-o)/c:void 0,event:r,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},s)},fc=(e,t)=>{const s=e!=null;return[n=>t[0]({lengthComputable:s,total:e,loaded:n}),t[1]]},pc=e=>(...t)=>O.asap(()=>e(...t)),By=qt.hasStandardBrowserEnv?((e,t)=>s=>(s=new URL(s,qt.origin),e.protocol===s.protocol&&e.host===s.host&&(t||e.port===s.port)))(new URL(qt.origin),qt.navigator&&/(msie|trident)/i.test(qt.navigator.userAgent)):()=>!0,Vy=qt.hasStandardBrowserEnv?{write(e,t,s,n,i,r,o){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];O.isNumber(s)&&a.push(`expires=${new Date(s).toUTCString()}`),O.isString(n)&&a.push(`path=${n}`),O.isString(i)&&a.push(`domain=${i}`),r===!0&&a.push("secure"),O.isString(o)&&a.push(`SameSite=${o}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function zy(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Hy(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function mh(e,t,s){let n=!zy(t);return e&&(n||s==!1)?Hy(e,t):t}const mc=e=>e instanceof re?{...e}:e;function Us(e,t){t=t||{};const s={};function n(c,u,d,h){return O.isPlainObject(c)&&O.isPlainObject(u)?O.merge.call({caseless:h},c,u):O.isPlainObject(u)?O.merge({},u):O.isArray(u)?u.slice():u}function i(c,u,d,h){if(O.isUndefined(u)){if(!O.isUndefined(c))return n(void 0,c,d,h)}else return n(c,u,d,h)}function r(c,u){if(!O.isUndefined(u))return n(void 0,u)}function o(c,u){if(O.isUndefined(u)){if(!O.isUndefined(c))return n(void 0,c)}else return n(void 0,u)}function a(c,u,d){if(d in t)return n(c,u);if(d in e)return n(void 0,c)}const l={url:r,method:r,data:r,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken: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:a,headers:(c,u,d)=>i(mc(c),mc(u),d,!0)};return O.forEach(Object.keys({...e,...t}),function(u){const d=l[u]||i,h=d(e[u],t[u],u);O.isUndefined(h)&&d!==a||(s[u]=h)}),s}const gh=e=>{const t=Us({},e);let{data:s,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:r,headers:o,auth:a}=t;if(t.headers=o=re.from(o),t.url=uh(mh(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),O.isFormData(s)){if(qt.hasStandardBrowserEnv||qt.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(O.isFunction(s.getHeaders)){const l=s.getHeaders(),c=["content-type","content-length"];Object.entries(l).forEach(([u,d])=>{c.includes(u.toLowerCase())&&o.set(u,d)})}}if(qt.hasStandardBrowserEnv&&(n&&O.isFunction(n)&&(n=n(t)),n||n!==!1&&By(t.url))){const l=i&&r&&Vy.read(r);l&&o.set(i,l)}return t},Uy=typeof XMLHttpRequest<"u",Wy=Uy&&function(e){return new Promise(function(s,n){const i=gh(e);let r=i.data;const o=re.from(i.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=i,u,d,h,f,p;function m(){f&&f(),p&&p(),i.cancelToken&&i.cancelToken.unsubscribe(u),i.signal&&i.signal.removeEventListener("abort",u)}let g=new XMLHttpRequest;g.open(i.method.toUpperCase(),i.url,!0),g.timeout=i.timeout;function b(){if(!g)return;const w=re.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders()),S={data:!a||a==="text"||a==="json"?g.responseText:g.response,status:g.status,statusText:g.statusText,headers:w,config:e,request:g};ph(function(R){s(R),m()},function(R){n(R),m()},S),g=null}"onloadend"in g?g.onloadend=b:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.indexOf("file:")===0)||setTimeout(b)},g.onabort=function(){g&&(n(new tt("Request aborted",tt.ECONNABORTED,e,g)),g=null)},g.onerror=function(v){const S=v&&v.message?v.message:"Network Error",P=new tt(S,tt.ERR_NETWORK,e,g);P.event=v||null,n(P),g=null},g.ontimeout=function(){let v=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const S=i.transitional||dh;i.timeoutErrorMessage&&(v=i.timeoutErrorMessage),n(new tt(v,S.clarifyTimeoutError?tt.ETIMEDOUT:tt.ECONNABORTED,e,g)),g=null},r===void 0&&o.setContentType(null),"setRequestHeader"in g&&O.forEach(o.toJSON(),function(v,S){g.setRequestHeader(S,v)}),O.isUndefined(i.withCredentials)||(g.withCredentials=!!i.withCredentials),a&&a!=="json"&&(g.responseType=i.responseType),c&&([h,p]=yr(c,!0),g.addEventListener("progress",h)),l&&g.upload&&([d,f]=yr(l),g.upload.addEventListener("progress",d),g.upload.addEventListener("loadend",f)),(i.cancelToken||i.signal)&&(u=w=>{g&&(n(!w||w.type?new fi(null,e,g):w),g.abort(),g=null)},i.cancelToken&&i.cancelToken.subscribe(u),i.signal&&(i.signal.aborted?u():i.signal.addEventListener("abort",u)));const x=Fy(i.url);if(x&&qt.protocols.indexOf(x)===-1){n(new tt("Unsupported protocol "+x+":",tt.ERR_BAD_REQUEST,e));return}g.send(r||null)})},$y=(e,t)=>{const{length:s}=e=e?e.filter(Boolean):[];if(t||s){let n=new AbortController,i;const r=function(c){if(!i){i=!0,a();const u=c instanceof Error?c:this.reason;n.abort(u instanceof tt?u:new fi(u instanceof Error?u.message:u))}};let o=t&&setTimeout(()=>{o=null,r(new tt(`timeout of ${t}ms exceeded`,tt.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(r):c.removeEventListener("abort",r)}),e=null)};e.forEach(c=>c.addEventListener("abort",r));const{signal:l}=n;return l.unsubscribe=()=>O.asap(a),l}},qy=function*(e,t){let s=e.byteLength;if(s<t){yield e;return}let n=0,i;for(;n<s;)i=n+t,yield e.slice(n,i),n=i},Ky=async function*(e,t){for await(const s of Yy(e))yield*qy(s,t)},Yy=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:s,value:n}=await t.read();if(s)break;yield n}}finally{await t.cancel()}},gc=(e,t,s,n)=>{const i=Ky(e,t);let r=0,o,a=l=>{o||(o=!0,n&&n(l))};return new ReadableStream({async pull(l){try{const{done:c,value:u}=await i.next();if(c){a(),l.close();return}let d=u.byteLength;if(s){let h=r+=d;s(h)}l.enqueue(new Uint8Array(u))}catch(c){throw a(c),c}},cancel(l){return a(l),i.return()}},{highWaterMark:2})},bc=64*1024,{isFunction:Mi}=O,Gy=(({Request:e,Response:t})=>({Request:e,Response:t}))(O.global),{ReadableStream:yc,TextEncoder:xc}=O.global,vc=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Xy=e=>{e=O.merge.call({skipUndefined:!0},Gy,e);const{fetch:t,Request:s,Response:n}=e,i=t?Mi(t):typeof fetch=="function",r=Mi(s),o=Mi(n);if(!i)return!1;const a=i&&Mi(yc),l=i&&(typeof xc=="function"?(p=>m=>p.encode(m))(new xc):async p=>new Uint8Array(await new s(p).arrayBuffer())),c=r&&a&&vc(()=>{let p=!1;const m=new s(qt.origin,{body:new yc,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!m}),u=o&&a&&vc(()=>O.isReadableStream(new n("").body)),d={stream:u&&(p=>p.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!d[p]&&(d[p]=(m,g)=>{let b=m&&m[p];if(b)return b.call(m);throw new tt(`Response type '${p}' is not supported`,tt.ERR_NOT_SUPPORT,g)})});const h=async p=>{if(p==null)return 0;if(O.isBlob(p))return p.size;if(O.isSpecCompliantForm(p))return(await new s(qt.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(O.isArrayBufferView(p)||O.isArrayBuffer(p))return p.byteLength;if(O.isURLSearchParams(p)&&(p=p+""),O.isString(p))return(await l(p)).byteLength},f=async(p,m)=>{const g=O.toFiniteNumber(p.getContentLength());return g??h(m)};return async p=>{let{url:m,method:g,data:b,signal:x,cancelToken:w,timeout:v,onDownloadProgress:S,onUploadProgress:P,responseType:R,headers:_,withCredentials:C="same-origin",fetchOptions:N}=gh(p),j=t||fetch;R=R?(R+"").toLowerCase():"text";let A=$y([x,w&&w.toAbortSignal()],v),F=null;const V=A&&A.unsubscribe&&(()=>{A.unsubscribe()});let W;try{if(P&&c&&g!=="get"&&g!=="head"&&(W=await f(_,b))!==0){let M=new s(m,{method:"POST",body:b,duplex:"half"}),Y;if(O.isFormData(b)&&(Y=M.headers.get("content-type"))&&_.setContentType(Y),M.body){const[B,U]=fc(W,yr(pc(P)));b=gc(M.body,bc,B,U)}}O.isString(C)||(C=C?"include":"omit");const I=r&&"credentials"in s.prototype,q={...N,signal:A,method:g.toUpperCase(),headers:_.normalize().toJSON(),body:b,duplex:"half",credentials:I?C:void 0};F=r&&new s(m,q);let z=await(r?j(F,N):j(m,q));const rt=u&&(R==="stream"||R==="response");if(u&&(S||rt&&V)){const M={};["status","statusText","headers"].forEach(et=>{M[et]=z[et]});const Y=O.toFiniteNumber(z.headers.get("content-length")),[B,U]=S&&fc(Y,yr(pc(S),!0))||[];z=new n(gc(z.body,bc,B,()=>{U&&U(),V&&V()}),M)}R=R||"text";let dt=await d[O.findKey(d,R)||"text"](z,p);return!rt&&V&&V(),await new Promise((M,Y)=>{ph(M,Y,{data:dt,headers:re.from(z.headers),status:z.status,statusText:z.statusText,config:p,request:F})})}catch(I){throw V&&V(),I&&I.name==="TypeError"&&/Load failed|fetch/i.test(I.message)?Object.assign(new tt("Network Error",tt.ERR_NETWORK,p,F),{cause:I.cause||I}):tt.from(I,I&&I.code,p,F)}}},Qy=new Map,bh=e=>{let t=e&&e.env||{};const{fetch:s,Request:n,Response:i}=t,r=[n,i,s];let o=r.length,a=o,l,c,u=Qy;for(;a--;)l=r[a],c=u.get(l),c===void 0&&u.set(l,c=a?new Map:Xy(t)),u=c;return c};bh();const ja={http:py,xhr:Wy,fetch:{get:bh}};O.forEach(ja,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const _c=e=>`- ${e}`,Jy=e=>O.isFunction(e)||e===null||e===!1;function Zy(e,t){e=O.isArray(e)?e:[e];const{length:s}=e;let n,i;const r={};for(let o=0;o<s;o++){n=e[o];let a;if(i=n,!Jy(n)&&(i=ja[(a=String(n)).toLowerCase()],i===void 0))throw new tt(`Unknown adapter '${a}'`);if(i&&(O.isFunction(i)||(i=i.get(t))))break;r[a||"#"+o]=i}if(!i){const o=Object.entries(r).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=s?o.length>1?`since :
9
+ `+o.map(_c).join(`
10
+ `):" "+_c(o[0]):"as no adapter specified";throw new tt("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return i}const yh={getAdapter:Zy,adapters:ja};function mo(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new fi(null,e)}function wc(e){return mo(e),e.headers=re.from(e.headers),e.data=po.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),yh.getAdapter(e.adapter||hi.adapter,e)(e).then(function(n){return mo(e),n.data=po.call(e,e.transformResponse,n),n.headers=re.from(n.headers),n},function(n){return fh(n)||(mo(e),n&&n.response&&(n.response.data=po.call(e,e.transformResponse,n.response),n.response.headers=re.from(n.response.headers))),Promise.reject(n)})}const xh="1.13.4",jr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{jr[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Sc={};jr.transitional=function(t,s,n){function i(r,o){return"[Axios v"+xh+"] Transitional option '"+r+"'"+o+(n?". "+n:"")}return(r,o,a)=>{if(t===!1)throw new tt(i(o," has been removed"+(s?" in "+s:"")),tt.ERR_DEPRECATED);return s&&!Sc[o]&&(Sc[o]=!0,console.warn(i(o," has been deprecated since v"+s+" and will be removed in the near future"))),t?t(r,o,a):!0}};jr.spelling=function(t){return(s,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function tx(e,t,s){if(typeof e!="object")throw new tt("options must be an object",tt.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const r=n[i],o=t[r];if(o){const a=e[r],l=a===void 0||o(a,r,e);if(l!==!0)throw new tt("option "+r+" must be "+l,tt.ERR_BAD_OPTION_VALUE);continue}if(s!==!0)throw new tt("Unknown option "+r,tt.ERR_BAD_OPTION)}}const er={assertOptions:tx,validators:jr},Ce=er.validators;let Is=class{constructor(t){this.defaults=t||{},this.interceptors={request:new dc,response:new dc}}async request(t,s){try{return await this._request(t,s)}catch(n){if(n instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const r=i.stack?i.stack.replace(/^.+\n/,""):"";try{n.stack?r&&!String(n.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(n.stack+=`
11
+ `+r):n.stack=r}catch{}}throw n}}_request(t,s){typeof t=="string"?(s=s||{},s.url=t):s=t||{},s=Us(this.defaults,s);const{transitional:n,paramsSerializer:i,headers:r}=s;n!==void 0&&er.assertOptions(n,{silentJSONParsing:Ce.transitional(Ce.boolean),forcedJSONParsing:Ce.transitional(Ce.boolean),clarifyTimeoutError:Ce.transitional(Ce.boolean)},!1),i!=null&&(O.isFunction(i)?s.paramsSerializer={serialize:i}:er.assertOptions(i,{encode:Ce.function,serialize:Ce.function},!0)),s.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?s.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:s.allowAbsoluteUrls=!0),er.assertOptions(s,{baseUrl:Ce.spelling("baseURL"),withXsrfToken:Ce.spelling("withXSRFToken")},!0),s.method=(s.method||this.defaults.method||"get").toLowerCase();let o=r&&O.merge(r.common,r[s.method]);r&&O.forEach(["delete","get","head","post","put","patch","common"],p=>{delete r[p]}),s.headers=re.concat(o,r);const a=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(s)===!1||(l=l&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let u,d=0,h;if(!l){const p=[wc.bind(this),void 0];for(p.unshift(...a),p.push(...c),h=p.length,u=Promise.resolve(s);d<h;)u=u.then(p[d++],p[d++]);return u}h=a.length;let f=s;for(;d<h;){const p=a[d++],m=a[d++];try{f=p(f)}catch(g){m.call(this,g);break}}try{u=wc.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,h=c.length;d<h;)u=u.then(c[d++],c[d++]);return u}getUri(t){t=Us(this.defaults,t);const s=mh(t.baseURL,t.url,t.allowAbsoluteUrls);return uh(s,t.params,t.paramsSerializer)}};O.forEach(["delete","get","head","options"],function(t){Is.prototype[t]=function(s,n){return this.request(Us(n||{},{method:t,url:s,data:(n||{}).data}))}});O.forEach(["post","put","patch"],function(t){function s(n){return function(r,o,a){return this.request(Us(a||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:r,data:o}))}}Is.prototype[t]=s(),Is.prototype[t+"Form"]=s(!0)});let ex=class vh{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let s;this.promise=new Promise(function(r){s=r});const n=this;this.promise.then(i=>{if(!n._listeners)return;let r=n._listeners.length;for(;r-- >0;)n._listeners[r](i);n._listeners=null}),this.promise.then=i=>{let r;const o=new Promise(a=>{n.subscribe(a),r=a}).then(i);return o.cancel=function(){n.unsubscribe(r)},o},t(function(r,o,a){n.reason||(n.reason=new fi(r,o,a),s(n.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 s=this._listeners.indexOf(t);s!==-1&&this._listeners.splice(s,1)}toAbortSignal(){const t=new AbortController,s=n=>{t.abort(n)};return this.subscribe(s),t.signal.unsubscribe=()=>this.unsubscribe(s),t.signal}static source(){let t;return{token:new vh(function(i){t=i}),cancel:t}}};function sx(e){return function(s){return e.apply(null,s)}}function nx(e){return O.isObject(e)&&e.isAxiosError===!0}const Jo={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Jo).forEach(([e,t])=>{Jo[t]=e});function _h(e){const t=new Is(e),s=Zd(Is.prototype.request,t);return O.extend(s,Is.prototype,t,{allOwnKeys:!0}),O.extend(s,t,null,{allOwnKeys:!0}),s.create=function(i){return _h(Us(e,i))},s}const Ct=_h(hi);Ct.Axios=Is;Ct.CanceledError=fi;Ct.CancelToken=ex;Ct.isCancel=fh;Ct.VERSION=xh;Ct.toFormData=Ir;Ct.AxiosError=tt;Ct.Cancel=Ct.CanceledError;Ct.all=function(t){return Promise.all(t)};Ct.spread=sx;Ct.isAxiosError=nx;Ct.mergeConfig=Us;Ct.AxiosHeaders=re;Ct.formToJSON=e=>hh(O.isHTMLForm(e)?new FormData(e):e);Ct.getAdapter=yh.getAdapter;Ct.HttpStatusCode=Jo;Ct.default=Ct;const{Axios:cP,AxiosError:uP,CanceledError:dP,isCancel:hP,CancelToken:fP,VERSION:pP,all:mP,Cancel:gP,isAxiosError:bP,spread:yP,toFormData:xP,AxiosHeaders:vP,HttpStatusCode:_P,formToJSON:wP,getAdapter:SP,mergeConfig:kP}=Ct,Zo={apiBase:"http://localhost:3000/api",wsPath:"/ws"},bt=Ct.create({baseURL:Zo.apiBase});function ta(e){e?bt.defaults.headers.common.Authorization=`Bearer ${e}`:delete bt.defaults.headers.common.Authorization}const Br=Jd()(Cb(e=>({token:null,email:null,setAuth:(t,s)=>{ta(t),e({token:t,email:s})},logout:()=>{ta(null),e({token:null,email:null})}}),{name:"kuma_clone_auth"})),kc=Br.getState();kc.token&&ta(kc.token);const wh="pulsewatch.theme";function ea(e){const t=document.documentElement;e==="dark"?t.classList.add("dark"):t.classList.remove("dark"),t.style.colorScheme=e,localStorage.setItem(wh,e)}const Sh=Jd((e,t)=>({mode:"light",setMode:s=>{ea(s),e({mode:s})},toggle:()=>{const s=t().mode==="dark"?"light":"dark";ea(s),e({mode:s})}}));function ix(){const t=localStorage.getItem(wh)==="dark"?"dark":"light";ea(t),Sh.setState({mode:t})}var pi=e=>e.type==="checkbox",Ds=e=>e instanceof Date,se=e=>e==null;const kh=e=>typeof e=="object";var At=e=>!se(e)&&!Array.isArray(e)&&kh(e)&&!Ds(e),rx=e=>At(e)&&e.target?pi(e.target)?e.target.checked:e.target.value:e,ox=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,ax=(e,t)=>e.has(ox(t)),lx=e=>{const t=e.constructor&&e.constructor.prototype;return At(t)&&t.hasOwnProperty("isPrototypeOf")},Ba=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Dt(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(Ba&&(e instanceof Blob||t))return e;const s=Array.isArray(e);if(!s&&!(At(e)&&lx(e)))return e;const n=s?[]:Object.create(Object.getPrototypeOf(e));for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=Dt(e[i]));return n}var Vr=e=>/^\w*$/.test(e),St=e=>e===void 0,Va=e=>Array.isArray(e)?e.filter(Boolean):[],za=e=>Va(e.replace(/["|']|\]/g,"").split(/\.|\[/)),J=(e,t,s)=>{if(!t||!At(e))return s;const n=(Vr(t)?[t]:za(t)).reduce((i,r)=>se(i)?i:i[r],e);return St(n)||n===e?St(e[t])?s:e[t]:n},Me=e=>typeof e=="boolean",we=e=>typeof e=="function",vt=(e,t,s)=>{let n=-1;const i=Vr(t)?[t]:za(t),r=i.length,o=r-1;for(;++n<r;){const a=i[n];let l=s;if(n!==o){const c=e[a];l=At(c)||Array.isArray(c)?c:isNaN(+i[n+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=l,e=e[a]}};const Rc={BLUR:"blur",FOCUS_OUT:"focusout"},Se={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Be={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},cx=L.createContext(null);cx.displayName="HookFormControlContext";var ux=(e,t,s,n=!0)=>{const i={defaultValues:t._defaultValues};for(const r in e)Object.defineProperty(i,r,{get:()=>{const o=r;return t._proxyFormState[o]!==Se.all&&(t._proxyFormState[o]=!n||Se.all),e[o]}});return i};const dx=typeof window<"u"?L.useLayoutEffect:L.useEffect;var le=e=>typeof e=="string",hx=(e,t,s,n,i)=>le(e)?(n&&t.watch.add(e),J(s,e,i)):Array.isArray(e)?e.map(r=>(n&&t.watch.add(r),J(s,r))):(n&&(t.watchAll=!0),s),sa=e=>se(e)||!kh(e);function ns(e,t,s=new WeakSet){if(sa(e)||sa(t))return Object.is(e,t);if(Ds(e)&&Ds(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;if(s.has(e)||s.has(t))return!0;s.add(e),s.add(t);for(const r of n){const o=e[r];if(!i.includes(r))return!1;if(r!=="ref"){const a=t[r];if(Ds(o)&&Ds(a)||At(o)&&At(a)||Array.isArray(o)&&Array.isArray(a)?!ns(o,a,s):!Object.is(o,a))return!1}}return!0}const fx=L.createContext(null);fx.displayName="HookFormContext";var px=(e,t,s,n,i)=>t?{...s[e],types:{...s[e]&&s[e].types?s[e].types:{},[n]:i||!0}}:{},Wn=e=>Array.isArray(e)?e:[e],Pc=()=>{let e=[];return{get observers(){return e},next:i=>{for(const r of e)r.next&&r.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(r=>r!==i)}}),unsubscribe:()=>{e=[]}}};function Rh(e,t){const s={};for(const n in e)if(e.hasOwnProperty(n)){const i=e[n],r=t[n];if(i&&At(i)&&r){const o=Rh(i,r);At(o)&&(s[n]=o)}else e[n]&&(s[n]=r)}return s}var Xt=e=>At(e)&&!Object.keys(e).length,Ha=e=>e.type==="file",xr=e=>{if(!Ba)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Ph=e=>e.type==="select-multiple",Ua=e=>e.type==="radio",mx=e=>Ua(e)||pi(e),go=e=>xr(e)&&e.isConnected;function gx(e,t){const s=t.slice(0,-1).length;let n=0;for(;n<s;)e=St(e)?n++:e[t[n++]];return e}function bx(e){for(const t in e)if(e.hasOwnProperty(t)&&!St(e[t]))return!1;return!0}function Tt(e,t){const s=Array.isArray(t)?t:Vr(t)?[t]:za(t),n=s.length===1?e:gx(e,s),i=s.length-1,r=s[i];return n&&delete n[r],i!==0&&(At(n)&&Xt(n)||Array.isArray(n)&&bx(n))&&Tt(e,s.slice(0,-1)),e}var yx=e=>{for(const t in e)if(we(e[t]))return!0;return!1};function Eh(e){return Array.isArray(e)||At(e)&&!yx(e)}function na(e,t={}){for(const s in e){const n=e[s];Eh(n)?(t[s]=Array.isArray(n)?[]:{},na(n,t[s])):St(n)||(t[s]=!0)}return t}function sn(e,t,s){s||(s=na(t));for(const n in e){const i=e[n];if(Eh(i))St(t)||sa(s[n])?s[n]=na(i,Array.isArray(i)?[]:{}):sn(i,se(t)?{}:t[n],s[n]);else{const r=t[n];s[n]=!ns(i,r)}}return s}const Ec={value:!1,isValid:!1},Cc={value:!0,isValid:!0};var Ch=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(s=>s&&s.checked&&!s.disabled).map(s=>s.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!St(e[0].attributes.value)?St(e[0].value)||e[0].value===""?Cc:{value:e[0].value,isValid:!0}:Cc:Ec}return Ec},Oh=(e,{valueAsNumber:t,valueAsDate:s,setValueAs:n})=>St(e)?e:t?e===""?NaN:e&&+e:s&&le(e)?new Date(e):n?n(e):e;const Oc={isValid:!1,value:null};var Th=e=>Array.isArray(e)?e.reduce((t,s)=>s&&s.checked&&!s.disabled?{isValid:!0,value:s.value}:t,Oc):Oc;function Tc(e){const t=e.ref;return Ha(t)?t.files:Ua(t)?Th(e.refs).value:Ph(t)?[...t.selectedOptions].map(({value:s})=>s):pi(t)?Ch(e.refs).value:Oh(St(t.value)?e.ref.value:t.value,e)}var xx=(e,t,s,n)=>{const i={};for(const r of e){const o=J(t,r);o&&vt(i,r,o._f)}return{criteriaMode:s,names:[...e],fields:i,shouldUseNativeValidation:n}},vr=e=>e instanceof RegExp,Cn=e=>St(e)?e:vr(e)?e.source:At(e)?vr(e.value)?e.value.source:e.value:e,Mc=e=>({isOnSubmit:!e||e===Se.onSubmit,isOnBlur:e===Se.onBlur,isOnChange:e===Se.onChange,isOnAll:e===Se.all,isOnTouch:e===Se.onTouched});const Ac="AsyncFunction";var vx=e=>!!e&&!!e.validate&&!!(we(e.validate)&&e.validate.constructor.name===Ac||At(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Ac)),_x=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Lc=(e,t,s)=>!s&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const $n=(e,t,s,n)=>{for(const i of s||Object.keys(e)){const r=J(e,i);if(r){const{_f:o,...a}=r;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],i)&&!n)return!0;if(o.ref&&t(o.ref,o.name)&&!n)return!0;if($n(a,t))break}else if(At(a)&&$n(a,t))break}}};function Dc(e,t,s){const n=J(e,s);if(n||Vr(s))return{error:n,name:s};const i=s.split(".");for(;i.length;){const r=i.join("."),o=J(t,r),a=J(e,r);if(o&&!Array.isArray(o)&&s!==r)return{name:s};if(a&&a.type)return{name:r,error:a};if(a&&a.root&&a.root.type)return{name:`${r}.root`,error:a.root};i.pop()}return{name:s}}var wx=(e,t,s,n)=>{s(e);const{name:i,...r}=e;return Xt(r)||Object.keys(r).length>=Object.keys(t).length||Object.keys(r).find(o=>t[o]===(!n||Se.all))},Sx=(e,t,s)=>!e||!t||e===t||Wn(e).some(n=>n&&(s?n===t:n.startsWith(t)||t.startsWith(n))),kx=(e,t,s,n,i)=>i.isOnAll?!1:!s&&i.isOnTouch?!(t||e):(s?n.isOnBlur:i.isOnBlur)?!e:(s?n.isOnChange:i.isOnChange)?e:!0,Rx=(e,t)=>!Va(J(e,t)).length&&Tt(e,t),Px=(e,t,s)=>{const n=Wn(J(e,s));return vt(n,"root",t[s]),vt(e,s,n),e};function Nc(e,t,s="validate"){if(le(e)||Array.isArray(e)&&e.every(le)||Me(e)&&!e)return{type:s,message:le(e)?e:"",ref:t}}var Qs=e=>At(e)&&!vr(e)?e:{value:e,message:""},Fc=async(e,t,s,n,i,r)=>{const{ref:o,refs:a,required:l,maxLength:c,minLength:u,min:d,max:h,pattern:f,validate:p,name:m,valueAsNumber:g,mount:b}=e._f,x=J(s,m);if(!b||t.has(m))return{};const w=a?a[0]:o,v=A=>{i&&w.reportValidity&&(w.setCustomValidity(Me(A)?"":A||""),w.reportValidity())},S={},P=Ua(o),R=pi(o),_=P||R,C=(g||Ha(o))&&St(o.value)&&St(x)||xr(o)&&o.value===""||x===""||Array.isArray(x)&&!x.length,N=px.bind(null,m,n,S),j=(A,F,V,W=Be.maxLength,I=Be.minLength)=>{const q=A?F:V;S[m]={type:A?W:I,message:q,ref:o,...N(A?W:I,q)}};if(r?!Array.isArray(x)||!x.length:l&&(!_&&(C||se(x))||Me(x)&&!x||R&&!Ch(a).isValid||P&&!Th(a).isValid)){const{value:A,message:F}=le(l)?{value:!!l,message:l}:Qs(l);if(A&&(S[m]={type:Be.required,message:F,ref:w,...N(Be.required,F)},!n))return v(F),S}if(!C&&(!se(d)||!se(h))){let A,F;const V=Qs(h),W=Qs(d);if(!se(x)&&!isNaN(x)){const I=o.valueAsNumber||x&&+x;se(V.value)||(A=I>V.value),se(W.value)||(F=I<W.value)}else{const I=o.valueAsDate||new Date(x),q=dt=>new Date(new Date().toDateString()+" "+dt),z=o.type=="time",rt=o.type=="week";le(V.value)&&x&&(A=z?q(x)>q(V.value):rt?x>V.value:I>new Date(V.value)),le(W.value)&&x&&(F=z?q(x)<q(W.value):rt?x<W.value:I<new Date(W.value))}if((A||F)&&(j(!!A,V.message,W.message,Be.max,Be.min),!n))return v(S[m].message),S}if((c||u)&&!C&&(le(x)||r&&Array.isArray(x))){const A=Qs(c),F=Qs(u),V=!se(A.value)&&x.length>+A.value,W=!se(F.value)&&x.length<+F.value;if((V||W)&&(j(V,A.message,F.message),!n))return v(S[m].message),S}if(f&&!C&&le(x)){const{value:A,message:F}=Qs(f);if(vr(A)&&!x.match(A)&&(S[m]={type:Be.pattern,message:F,ref:o,...N(Be.pattern,F)},!n))return v(F),S}if(p){if(we(p)){const A=await p(x,s),F=Nc(A,w);if(F&&(S[m]={...F,...N(Be.validate,F.message)},!n))return v(F.message),S}else if(At(p)){let A={};for(const F in p){if(!Xt(A)&&!n)break;const V=Nc(await p[F](x,s),w,F);V&&(A={...V,...N(F,V.message)},v(V.message),n&&(S[m]=A))}if(!Xt(A)&&(S[m]={ref:w,...A},!n))return S}}return v(!0),S};const Ex={mode:Se.onSubmit,reValidateMode:Se.onChange,shouldFocusError:!0};function Cx(e={}){let t={...Ex,...e},s={submitCount:0,isDirty:!1,isReady:!1,isLoading:we(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},i=At(t.defaultValues)||At(t.values)?Dt(t.defaultValues||t.values)||{}:{},r=t.shouldUnregister?{}:Dt(i),o={action:!1,mount:!1,watch:!1,keepIsValid:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},l,c=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={...u};let h={...d};const f={array:Pc(),state:Pc()},p=t.criteriaMode===Se.all,m=k=>E=>{clearTimeout(c),c=setTimeout(k,E)},g=async k=>{if(!o.keepIsValid&&!t.disabled&&(d.isValid||h.isValid||k)){let E;t.resolver?(E=Xt((await _()).errors),b()):E=await N(n,!0),E!==s.isValid&&f.state.next({isValid:E})}},b=(k,E)=>{!t.disabled&&(d.isValidating||d.validatingFields||h.isValidating||h.validatingFields)&&((k||Array.from(a.mount)).forEach(T=>{T&&(E?vt(s.validatingFields,T,E):Tt(s.validatingFields,T))}),f.state.next({validatingFields:s.validatingFields,isValidating:!Xt(s.validatingFields)}))},x=(k,E=[],T,$,H=!0,D=!0)=>{if($&&T&&!t.disabled){if(o.action=!0,D&&Array.isArray(J(n,k))){const K=T(J(n,k),$.argA,$.argB);H&&vt(n,k,K)}if(D&&Array.isArray(J(s.errors,k))){const K=T(J(s.errors,k),$.argA,$.argB);H&&vt(s.errors,k,K),Rx(s.errors,k)}if((d.touchedFields||h.touchedFields)&&D&&Array.isArray(J(s.touchedFields,k))){const K=T(J(s.touchedFields,k),$.argA,$.argB);H&&vt(s.touchedFields,k,K)}(d.dirtyFields||h.dirtyFields)&&(s.dirtyFields=sn(i,r)),f.state.next({name:k,isDirty:A(k,E),dirtyFields:s.dirtyFields,errors:s.errors,isValid:s.isValid})}else vt(r,k,E)},w=(k,E)=>{vt(s.errors,k,E),f.state.next({errors:s.errors})},v=k=>{s.errors=k,f.state.next({errors:s.errors,isValid:!1})},S=(k,E,T,$)=>{const H=J(n,k);if(H){const D=J(r,k,St(T)?J(i,k):T);St(D)||$&&$.defaultChecked||E?vt(r,k,E?D:Tc(H._f)):W(k,D),o.mount&&!o.action&&g()}},P=(k,E,T,$,H)=>{let D=!1,K=!1;const st={name:k};if(!t.disabled){if(!T||$){(d.isDirty||h.isDirty)&&(K=s.isDirty,s.isDirty=st.isDirty=A(),D=K!==st.isDirty);const ct=ns(J(i,k),E);K=!!J(s.dirtyFields,k),ct?Tt(s.dirtyFields,k):vt(s.dirtyFields,k,!0),st.dirtyFields=s.dirtyFields,D=D||(d.dirtyFields||h.dirtyFields)&&K!==!ct}if(T){const ct=J(s.touchedFields,k);ct||(vt(s.touchedFields,k,T),st.touchedFields=s.touchedFields,D=D||(d.touchedFields||h.touchedFields)&&ct!==T)}D&&H&&f.state.next(st)}return D?st:{}},R=(k,E,T,$)=>{const H=J(s.errors,k),D=(d.isValid||h.isValid)&&Me(E)&&s.isValid!==E;if(t.delayError&&T?(l=m(()=>w(k,T)),l(t.delayError)):(clearTimeout(c),l=null,T?vt(s.errors,k,T):Tt(s.errors,k)),(T?!ns(H,T):H)||!Xt($)||D){const K={...$,...D&&Me(E)?{isValid:E}:{},errors:s.errors,name:k};s={...s,...K},f.state.next(K)}},_=async k=>(b(k,!0),await t.resolver(r,t.context,xx(k||a.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),C=async k=>{const{errors:E}=await _(k);if(b(k),k)for(const T of k){const $=J(E,T);$?vt(s.errors,T,$):Tt(s.errors,T)}else s.errors=E;return E},N=async(k,E,T={valid:!0})=>{for(const $ in k){const H=k[$];if(H){const{_f:D,...K}=H;if(D){const st=a.array.has(D.name),ct=H._f&&vx(H._f);ct&&d.validatingFields&&b([D.name],!0);const Rt=await Fc(H,a.disabled,r,p,t.shouldUseNativeValidation&&!E,st);if(ct&&d.validatingFields&&b([D.name]),Rt[D.name]&&(T.valid=!1,E||e.shouldUseNativeValidation))break;!E&&(J(Rt,D.name)?st?Px(s.errors,Rt,D.name):vt(s.errors,D.name,Rt[D.name]):Tt(s.errors,D.name))}!Xt(K)&&await N(K,E,T)}}return T.valid},j=()=>{for(const k of a.unMount){const E=J(n,k);E&&(E._f.refs?E._f.refs.every(T=>!go(T)):!go(E._f.ref))&&it(k)}a.unMount=new Set},A=(k,E)=>!t.disabled&&(k&&E&&vt(r,k,E),!ns(M(),i)),F=(k,E,T)=>hx(k,a,{...o.mount?r:St(E)?i:le(k)?{[k]:E}:E},T,E),V=k=>Va(J(o.mount?r:i,k,t.shouldUnregister?J(i,k,[]):[])),W=(k,E,T={})=>{const $=J(n,k);let H=E;if($){const D=$._f;D&&(!D.disabled&&vt(r,k,Oh(E,D)),H=xr(D.ref)&&se(E)?"":E,Ph(D.ref)?[...D.ref.options].forEach(K=>K.selected=H.includes(K.value)):D.refs?pi(D.ref)?D.refs.forEach(K=>{(!K.defaultChecked||!K.disabled)&&(Array.isArray(H)?K.checked=!!H.find(st=>st===K.value):K.checked=H===K.value||!!H)}):D.refs.forEach(K=>K.checked=K.value===H):Ha(D.ref)?D.ref.value="":(D.ref.value=H,D.ref.type||f.state.next({name:k,values:Dt(r)})))}(T.shouldDirty||T.shouldTouch)&&P(k,H,T.shouldTouch,T.shouldDirty,!0),T.shouldValidate&&dt(k)},I=(k,E,T)=>{for(const $ in E){if(!E.hasOwnProperty($))return;const H=E[$],D=k+"."+$,K=J(n,D);(a.array.has(k)||At(H)||K&&!K._f)&&!Ds(H)?I(D,H,T):W(D,H,T)}},q=(k,E,T={})=>{const $=J(n,k),H=a.array.has(k),D=Dt(E);vt(r,k,D),H?(f.array.next({name:k,values:Dt(r)}),(d.isDirty||d.dirtyFields||h.isDirty||h.dirtyFields)&&T.shouldDirty&&f.state.next({name:k,dirtyFields:sn(i,r),isDirty:A(k,D)})):$&&!$._f&&!se(D)?I(k,D,T):W(k,D,T),Lc(k,a)?f.state.next({...s,name:k,values:Dt(r)}):f.state.next({name:o.mount?k:void 0,values:Dt(r)})},z=async k=>{o.mount=!0;const E=k.target;let T=E.name,$=!0;const H=J(n,T),D=ct=>{$=Number.isNaN(ct)||Ds(ct)&&isNaN(ct.getTime())||ns(ct,J(r,T,ct))},K=Mc(t.mode),st=Mc(t.reValidateMode);if(H){let ct,Rt;const Pe=E.type?Tc(H._f):rx(k),Gt=k.type===Rc.BLUR||k.type===Rc.FOCUS_OUT,Xr=!_x(H._f)&&!t.resolver&&!J(s.errors,T)&&!H._f.deps||kx(Gt,J(s.touchedFields,T),s.isSubmitted,st,K),yn=Lc(T,a,Gt);vt(r,T,Pe),Gt?(!E||!E.readOnly)&&(H._f.onBlur&&H._f.onBlur(k),l&&l(0)):H._f.onChange&&H._f.onChange(k);const Xs=P(T,Pe,Gt),xi=!Xt(Xs)||yn;if(!Gt&&f.state.next({name:T,type:k.type,values:Dt(r)}),Xr)return(d.isValid||h.isValid)&&(t.mode==="onBlur"?Gt&&g():Gt||g()),xi&&f.state.next({name:T,...yn?{}:Xs});if(!Gt&&yn&&f.state.next({...s}),t.resolver){const{errors:vi}=await _([T]);if(b([T]),D(Pe),$){const xn=Dc(s.errors,n,T),ye=Dc(vi,n,xn.name||T);ct=ye.error,T=ye.name,Rt=Xt(vi)}}else b([T],!0),ct=(await Fc(H,a.disabled,r,p,t.shouldUseNativeValidation))[T],b([T]),D(Pe),$&&(ct?Rt=!1:(d.isValid||h.isValid)&&(Rt=await N(n,!0)));$&&(H._f.deps&&(!Array.isArray(H._f.deps)||H._f.deps.length>0)&&dt(H._f.deps),R(T,Rt,ct,Xs))}},rt=(k,E)=>{if(J(s.errors,E)&&k.focus)return k.focus(),1},dt=async(k,E={})=>{let T,$;const H=Wn(k);if(t.resolver){const D=await C(St(k)?k:H);T=Xt(D),$=k?!H.some(K=>J(D,K)):T}else k?($=(await Promise.all(H.map(async D=>{const K=J(n,D);return await N(K&&K._f?{[D]:K}:K)}))).every(Boolean),!(!$&&!s.isValid)&&g()):$=T=await N(n);return f.state.next({...!le(k)||(d.isValid||h.isValid)&&T!==s.isValid?{}:{name:k},...t.resolver||!k?{isValid:T}:{},errors:s.errors}),E.shouldFocus&&!$&&$n(n,rt,k?H:a.mount),$},M=(k,E)=>{let T={...o.mount?r:i};return E&&(T=Rh(E.dirtyFields?s.dirtyFields:s.touchedFields,T)),St(k)?T:le(k)?J(T,k):k.map($=>J(T,$))},Y=(k,E)=>({invalid:!!J((E||s).errors,k),isDirty:!!J((E||s).dirtyFields,k),error:J((E||s).errors,k),isValidating:!!J(s.validatingFields,k),isTouched:!!J((E||s).touchedFields,k)}),B=k=>{k&&Wn(k).forEach(E=>Tt(s.errors,E)),f.state.next({errors:k?s.errors:{}})},U=(k,E,T)=>{const $=(J(n,k,{_f:{}})._f||{}).ref,H=J(s.errors,k)||{},{ref:D,message:K,type:st,...ct}=H;vt(s.errors,k,{...ct,...E,ref:$}),f.state.next({name:k,errors:s.errors,isValid:!1}),T&&T.shouldFocus&&$&&$.focus&&$.focus()},et=(k,E)=>we(k)?f.state.subscribe({next:T=>"values"in T&&k(F(void 0,E),T)}):F(k,E,!0),ft=k=>f.state.subscribe({next:E=>{Sx(k.name,E.name,k.exact)&&wx(E,k.formState||d,ts,k.reRenderRoot)&&k.callback({values:{...r},...s,...E,defaultValues:i})}}).unsubscribe,Z=k=>(o.mount=!0,h={...h,...k.formState},ft({...k,formState:{...u,...k.formState}})),it=(k,E={})=>{for(const T of k?Wn(k):a.mount)a.mount.delete(T),a.array.delete(T),E.keepValue||(Tt(n,T),Tt(r,T)),!E.keepError&&Tt(s.errors,T),!E.keepDirty&&Tt(s.dirtyFields,T),!E.keepTouched&&Tt(s.touchedFields,T),!E.keepIsValidating&&Tt(s.validatingFields,T),!t.shouldUnregister&&!E.keepDefaultValue&&Tt(i,T);f.state.next({values:Dt(r)}),f.state.next({...s,...E.keepDirty?{isDirty:A()}:{}}),!E.keepIsValid&&g()},kt=({disabled:k,name:E})=>{if(Me(k)&&o.mount||k||a.disabled.has(E)){const H=a.disabled.has(E)!==!!k;k?a.disabled.add(E):a.disabled.delete(E),H&&o.mount&&!o.action&&g()}},Ot=(k,E={})=>{let T=J(n,k);const $=Me(E.disabled)||Me(t.disabled);return vt(n,k,{...T||{},_f:{...T&&T._f?T._f:{ref:{name:k}},name:k,mount:!0,...E}}),a.mount.add(k),T?kt({disabled:Me(E.disabled)?E.disabled:t.disabled,name:k}):S(k,!0,E.value),{...$?{disabled:E.disabled||t.disabled}:{},...t.progressive?{required:!!E.required,min:Cn(E.min),max:Cn(E.max),minLength:Cn(E.minLength),maxLength:Cn(E.maxLength),pattern:Cn(E.pattern)}:{},name:k,onChange:z,onBlur:z,ref:H=>{if(H){Ot(k,E),T=J(n,k);const D=St(H.value)&&H.querySelectorAll&&H.querySelectorAll("input,select,textarea")[0]||H,K=mx(D),st=T._f.refs||[];if(K?st.find(ct=>ct===D):D===T._f.ref)return;vt(n,k,{_f:{...T._f,...K?{refs:[...st.filter(go),D,...Array.isArray(J(i,k))?[{}]:[]],ref:{type:D.type,name:k}}:{ref:D}}}),S(k,!1,void 0,D)}else T=J(n,k,{}),T._f&&(T._f.mount=!1),(t.shouldUnregister||E.shouldUnregister)&&!(ax(a.array,k)&&o.action)&&a.unMount.add(k)}}},Bt=()=>t.shouldFocusError&&$n(n,rt,a.mount),Ht=k=>{Me(k)&&(f.state.next({disabled:k}),$n(n,(E,T)=>{const $=J(n,T);$&&(E.disabled=$._f.disabled||k,Array.isArray($._f.refs)&&$._f.refs.forEach(H=>{H.disabled=$._f.disabled||k}))},0,!1))},xs=(k,E)=>async T=>{let $;T&&(T.preventDefault&&T.preventDefault(),T.persist&&T.persist());let H=Dt(r);if(f.state.next({isSubmitting:!0}),t.resolver){const{errors:D,values:K}=await _();b(),s.errors=D,H=Dt(K)}else await N(n);if(a.disabled.size)for(const D of a.disabled)Tt(H,D);if(Tt(s.errors,"root"),Xt(s.errors)){f.state.next({errors:{}});try{await k(H,T)}catch(D){$=D}}else E&&await E({...s.errors},T),Bt(),setTimeout(Bt);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Xt(s.errors)&&!$,submitCount:s.submitCount+1,errors:s.errors}),$)throw $},vs=(k,E={})=>{J(n,k)&&(St(E.defaultValue)?q(k,Dt(J(i,k))):(q(k,E.defaultValue),vt(i,k,Dt(E.defaultValue))),E.keepTouched||Tt(s.touchedFields,k),E.keepDirty||(Tt(s.dirtyFields,k),s.isDirty=E.defaultValue?A(k,Dt(J(i,k))):A()),E.keepError||(Tt(s.errors,k),d.isValid&&g()),f.state.next({...s}))},_s=(k,E={})=>{const T=k?Dt(k):i,$=Dt(T),H=Xt(k),D=H?i:$;if(E.keepDefaultValues||(i=T),!E.keepValues){if(E.keepDirtyValues){const K=new Set([...a.mount,...Object.keys(sn(i,r))]);for(const st of Array.from(K)){const ct=J(s.dirtyFields,st),Rt=J(r,st),Pe=J(D,st);ct&&!St(Rt)?vt(D,st,Rt):!ct&&!St(Pe)&&q(st,Pe)}}else{if(Ba&&St(k))for(const K of a.mount){const st=J(n,K);if(st&&st._f){const ct=Array.isArray(st._f.refs)?st._f.refs[0]:st._f.ref;if(xr(ct)){const Rt=ct.closest("form");if(Rt){Rt.reset();break}}}}if(E.keepFieldsRef)for(const K of a.mount)q(K,J(D,K));else n={}}r=t.shouldUnregister?E.keepDefaultValues?Dt(i):{}:Dt(D),f.array.next({values:{...D}}),f.state.next({values:{...D}})}a={mount:E.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!d.isValid||!!E.keepIsValid||!!E.keepDirtyValues||!t.shouldUnregister&&!Xt(D),o.watch=!!t.shouldUnregister,o.keepIsValid=!!E.keepIsValid,o.action=!1,E.keepErrors||(s.errors={}),f.state.next({submitCount:E.keepSubmitCount?s.submitCount:0,isDirty:H?!1:E.keepDirty?s.isDirty:!!(E.keepDefaultValues&&!ns(k,i)),isSubmitted:E.keepIsSubmitted?s.isSubmitted:!1,dirtyFields:H?{}:E.keepDirtyValues?E.keepDefaultValues&&r?sn(i,r):s.dirtyFields:E.keepDefaultValues&&k?sn(i,k):E.keepDirty?s.dirtyFields:{},touchedFields:E.keepTouched?s.touchedFields:{},errors:E.keepErrors?s.errors:{},isSubmitSuccessful:E.keepIsSubmitSuccessful?s.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},Ze=(k,E)=>_s(we(k)?k(r):k,{...t.resetOptions,...E}),Qt=(k,E={})=>{const T=J(n,k),$=T&&T._f;if($){const H=$.refs?$.refs[0]:$.ref;H.focus&&setTimeout(()=>{H.focus(),E.shouldSelect&&we(H.select)&&H.select()})}},ts=k=>{s={...s,...k}},Gs={control:{register:Ot,unregister:it,getFieldState:Y,handleSubmit:xs,setError:U,_subscribe:ft,_runSchema:_,_updateIsValidating:b,_focusError:Bt,_getWatch:F,_getDirty:A,_setValid:g,_setFieldArray:x,_setDisabledField:kt,_setErrors:v,_getFieldArray:V,_reset:_s,_resetDefaultValues:()=>we(t.defaultValues)&&t.defaultValues().then(k=>{Ze(k,t.resetOptions),f.state.next({isLoading:!1})}),_removeUnmounted:j,_disableForm:Ht,_subjects:f,_proxyFormState:d,get _fields(){return n},get _formValues(){return r},get _state(){return o},set _state(k){o=k},get _defaultValues(){return i},get _names(){return a},set _names(k){a=k},get _formState(){return s},get _options(){return t},set _options(k){t={...t,...k}}},subscribe:Z,trigger:dt,register:Ot,handleSubmit:xs,watch:et,setValue:q,getValues:M,reset:Ze,resetField:vs,clearErrors:B,unregister:it,setError:U,setFocus:Qt,getFieldState:Y};return{...Gs,formControl:Gs}}function Mh(e={}){const t=L.useRef(void 0),s=L.useRef(void 0),[n,i]=L.useState({isDirty:!1,isValidating:!1,isLoading:we(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:we(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!we(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:o,...a}=Cx(e);t.current={...a,formState:n}}const r=t.current.control;return r._options=e,dx(()=>{const o=r._subscribe({formState:r._proxyFormState,callback:()=>i({...r._formState}),reRenderRoot:!0});return i(a=>({...a,isReady:!0})),r._formState.isReady=!0,o},[r]),L.useEffect(()=>r._disableForm(e.disabled),[r,e.disabled]),L.useEffect(()=>{e.mode&&(r._options.mode=e.mode),e.reValidateMode&&(r._options.reValidateMode=e.reValidateMode)},[r,e.mode,e.reValidateMode]),L.useEffect(()=>{e.errors&&(r._setErrors(e.errors),r._focusError())},[r,e.errors]),L.useEffect(()=>{e.shouldUnregister&&r._subjects.state.next({values:r._getWatch()})},[r,e.shouldUnregister]),L.useEffect(()=>{if(r._proxyFormState.isDirty){const o=r._getDirty();o!==n.isDirty&&r._subjects.state.next({isDirty:o})}},[r,n.isDirty]),L.useEffect(()=>{var o;e.values&&!ns(e.values,s.current)?(r._reset(e.values,{keepFieldsRef:!0,...r._options.resetOptions}),!((o=r._options.resetOptions)===null||o===void 0)&&o.keepIsValid||r._setValid(),s.current=e.values,i(a=>({...a}))):r._resetDefaultValues()},[r,e.values]),L.useEffect(()=>{r._state.mount||(r._setValid(),r._state.mount=!0),r._state.watch&&(r._state.watch=!1,r._subjects.state.next({...r._formState})),r._removeUnmounted()}),t.current.formState=L.useMemo(()=>ux(n,r),[r,n]),t.current}function Ah(e){var t,s,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(s=Ah(e[t]))&&(n&&(n+=" "),n+=s)}else for(s in e)e[s]&&(n&&(n+=" "),n+=s);return n}function Ox(){for(var e,t,s=0,n="",i=arguments.length;s<i;s++)(e=arguments[s])&&(t=Ah(e))&&(n&&(n+=" "),n+=t);return n}const Tx=(e,t)=>{const s=new Array(e.length+t.length);for(let n=0;n<e.length;n++)s[n]=e[n];for(let n=0;n<t.length;n++)s[e.length+n]=t[n];return s},Mx=(e,t)=>({classGroupId:e,validator:t}),Lh=(e=new Map,t=null,s)=>({nextPart:e,validators:t,classGroupId:s}),_r="-",Ic=[],Ax="arbitrary..",Lx=e=>{const t=Nx(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return Dx(o);const a=o.split(_r),l=a[0]===""&&a.length>1?1:0;return Dh(a,l,t)},getConflictingClassGroupIds:(o,a)=>{if(a){const l=n[o],c=s[o];return l?c?Tx(c,l):l:c||Ic}return s[o]||Ic}}},Dh=(e,t,s)=>{if(e.length-t===0)return s.classGroupId;const i=e[t],r=s.nextPart.get(i);if(r){const c=Dh(e,t+1,r);if(c)return c}const o=s.validators;if(o===null)return;const a=t===0?e.join(_r):e.slice(t).join(_r),l=o.length;for(let c=0;c<l;c++){const u=o[c];if(u.validator(a))return u.classGroupId}},Dx=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),s=t.indexOf(":"),n=t.slice(0,s);return n?Ax+n:void 0})(),Nx=e=>{const{theme:t,classGroups:s}=e;return Fx(s,t)},Fx=(e,t)=>{const s=Lh();for(const n in e){const i=e[n];Wa(i,s,n,t)}return s},Wa=(e,t,s,n)=>{const i=e.length;for(let r=0;r<i;r++){const o=e[r];Ix(o,t,s,n)}},Ix=(e,t,s,n)=>{if(typeof e=="string"){jx(e,t,s);return}if(typeof e=="function"){Bx(e,t,s,n);return}Vx(e,t,s,n)},jx=(e,t,s)=>{const n=e===""?t:Nh(t,e);n.classGroupId=s},Bx=(e,t,s,n)=>{if(zx(e)){Wa(e(n),t,s,n);return}t.validators===null&&(t.validators=[]),t.validators.push(Mx(s,e))},Vx=(e,t,s,n)=>{const i=Object.entries(e),r=i.length;for(let o=0;o<r;o++){const[a,l]=i[o];Wa(l,Nh(t,a),s,n)}},Nh=(e,t)=>{let s=e;const n=t.split(_r),i=n.length;for(let r=0;r<i;r++){const o=n[r];let a=s.nextPart.get(o);a||(a=Lh(),s.nextPart.set(o,a)),s=a}return s},zx=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Hx=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,s=Object.create(null),n=Object.create(null);const i=(r,o)=>{s[r]=o,t++,t>e&&(t=0,n=s,s=Object.create(null))};return{get(r){let o=s[r];if(o!==void 0)return o;if((o=n[r])!==void 0)return i(r,o),o},set(r,o){r in s?s[r]=o:i(r,o)}}},ia="!",jc=":",Ux=[],Bc=(e,t,s,n,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:n,isExternal:i}),Wx=e=>{const{prefix:t,experimentalParseClassName:s}=e;let n=i=>{const r=[];let o=0,a=0,l=0,c;const u=i.length;for(let m=0;m<u;m++){const g=i[m];if(o===0&&a===0){if(g===jc){r.push(i.slice(l,m)),l=m+1;continue}if(g==="/"){c=m;continue}}g==="["?o++:g==="]"?o--:g==="("?a++:g===")"&&a--}const d=r.length===0?i:i.slice(l);let h=d,f=!1;d.endsWith(ia)?(h=d.slice(0,-1),f=!0):d.startsWith(ia)&&(h=d.slice(1),f=!0);const p=c&&c>l?c-l:void 0;return Bc(r,f,h,p)};if(t){const i=t+jc,r=n;n=o=>o.startsWith(i)?r(o.slice(i.length)):Bc(Ux,!1,o,void 0,!0)}if(s){const i=n;n=r=>s({className:r,parseClassName:i})}return n},$x=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((s,n)=>{t.set(s,1e6+n)}),s=>{const n=[];let i=[];for(let r=0;r<s.length;r++){const o=s[r],a=o[0]==="[",l=t.has(o);a||l?(i.length>0&&(i.sort(),n.push(...i),i=[]),n.push(o)):i.push(o)}return i.length>0&&(i.sort(),n.push(...i)),n}},qx=e=>({cache:Hx(e.cacheSize),parseClassName:Wx(e),sortModifiers:$x(e),...Lx(e)}),Kx=/\s+/,Yx=(e,t)=>{const{parseClassName:s,getClassGroupId:n,getConflictingClassGroupIds:i,sortModifiers:r}=t,o=[],a=e.trim().split(Kx);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{isExternal:d,modifiers:h,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=s(u);if(d){l=u+(l.length>0?" "+l:l);continue}let g=!!m,b=n(g?p.substring(0,m):p);if(!b){if(!g){l=u+(l.length>0?" "+l:l);continue}if(b=n(p),!b){l=u+(l.length>0?" "+l:l);continue}g=!1}const x=h.length===0?"":h.length===1?h[0]:r(h).join(":"),w=f?x+ia:x,v=w+b;if(o.indexOf(v)>-1)continue;o.push(v);const S=i(b,g);for(let P=0;P<S.length;++P){const R=S[P];o.push(w+R)}l=u+(l.length>0?" "+l:l)}return l},Gx=(...e)=>{let t=0,s,n,i="";for(;t<e.length;)(s=e[t++])&&(n=Fh(s))&&(i&&(i+=" "),i+=n);return i},Fh=e=>{if(typeof e=="string")return e;let t,s="";for(let n=0;n<e.length;n++)e[n]&&(t=Fh(e[n]))&&(s&&(s+=" "),s+=t);return s},Xx=(e,...t)=>{let s,n,i,r;const o=l=>{const c=t.reduce((u,d)=>d(u),e());return s=qx(c),n=s.cache.get,i=s.cache.set,r=a,a(l)},a=l=>{const c=n(l);if(c)return c;const u=Yx(l,s);return i(l,u),u};return r=o,(...l)=>r(Gx(...l))},Qx=[],Lt=e=>{const t=s=>s[e]||Qx;return t.isThemeGetter=!0,t},Ih=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,jh=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Jx=/^\d+\/\d+$/,Zx=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,t0=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,e0=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,s0=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,n0=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Js=e=>Jx.test(e),at=e=>!!e&&!Number.isNaN(Number(e)),es=e=>!!e&&Number.isInteger(Number(e)),bo=e=>e.endsWith("%")&&at(e.slice(0,-1)),Ve=e=>Zx.test(e),i0=()=>!0,r0=e=>t0.test(e)&&!e0.test(e),Bh=()=>!1,o0=e=>s0.test(e),a0=e=>n0.test(e),l0=e=>!G(e)&&!X(e),c0=e=>mn(e,Hh,Bh),G=e=>Ih.test(e),Ss=e=>mn(e,Uh,r0),yo=e=>mn(e,p0,at),Vc=e=>mn(e,Vh,Bh),u0=e=>mn(e,zh,a0),Ai=e=>mn(e,Wh,o0),X=e=>jh.test(e),On=e=>gn(e,Uh),d0=e=>gn(e,m0),zc=e=>gn(e,Vh),h0=e=>gn(e,Hh),f0=e=>gn(e,zh),Li=e=>gn(e,Wh,!0),mn=(e,t,s)=>{const n=Ih.exec(e);return n?n[1]?t(n[1]):s(n[2]):!1},gn=(e,t,s=!1)=>{const n=jh.exec(e);return n?n[1]?t(n[1]):s:!1},Vh=e=>e==="position"||e==="percentage",zh=e=>e==="image"||e==="url",Hh=e=>e==="length"||e==="size"||e==="bg-size",Uh=e=>e==="length",p0=e=>e==="number",m0=e=>e==="family-name",Wh=e=>e==="shadow",g0=()=>{const e=Lt("color"),t=Lt("font"),s=Lt("text"),n=Lt("font-weight"),i=Lt("tracking"),r=Lt("leading"),o=Lt("breakpoint"),a=Lt("container"),l=Lt("spacing"),c=Lt("radius"),u=Lt("shadow"),d=Lt("inset-shadow"),h=Lt("text-shadow"),f=Lt("drop-shadow"),p=Lt("blur"),m=Lt("perspective"),g=Lt("aspect"),b=Lt("ease"),x=Lt("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],v=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...v(),X,G],P=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],_=()=>[X,G,l],C=()=>[Js,"full","auto",..._()],N=()=>[es,"none","subgrid",X,G],j=()=>["auto",{span:["full",es,X,G]},es,X,G],A=()=>[es,"auto",X,G],F=()=>["auto","min","max","fr",X,G],V=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],I=()=>["auto",..._()],q=()=>[Js,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",..._()],z=()=>[e,X,G],rt=()=>[...v(),zc,Vc,{position:[X,G]}],dt=()=>["no-repeat",{repeat:["","x","y","space","round"]}],M=()=>["auto","cover","contain",h0,c0,{size:[X,G]}],Y=()=>[bo,On,Ss],B=()=>["","none","full",c,X,G],U=()=>["",at,On,Ss],et=()=>["solid","dashed","dotted","double"],ft=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Z=()=>[at,bo,zc,Vc],it=()=>["","none",p,X,G],kt=()=>["none",at,X,G],Ot=()=>["none",at,X,G],Bt=()=>[at,X,G],Ht=()=>[Js,"full",..._()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ve],breakpoint:[Ve],color:[i0],container:[Ve],"drop-shadow":[Ve],ease:["in","out","in-out"],font:[l0],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ve],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ve],shadow:[Ve],spacing:["px",at],text:[Ve],"text-shadow":[Ve],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Js,G,X,g]}],container:["container"],columns:[{columns:[at,G,X,a]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:S()}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:C()}],"inset-x":[{"inset-x":C()}],"inset-y":[{"inset-y":C()}],start:[{start:C()}],end:[{end:C()}],top:[{top:C()}],right:[{right:C()}],bottom:[{bottom:C()}],left:[{left:C()}],visibility:["visible","invisible","collapse"],z:[{z:[es,"auto",X,G]}],basis:[{basis:[Js,"full","auto",a,..._()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[at,Js,"auto","initial","none",G]}],grow:[{grow:["",at,X,G]}],shrink:[{shrink:["",at,X,G]}],order:[{order:[es,"first","last","none",X,G]}],"grid-cols":[{"grid-cols":N()}],"col-start-end":[{col:j()}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":N()}],"row-start-end":[{row:j()}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:_()}],"gap-x":[{"gap-x":_()}],"gap-y":[{"gap-y":_()}],"justify-content":[{justify:[...V(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...V()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":V()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],p:[{p:_()}],px:[{px:_()}],py:[{py:_()}],ps:[{ps:_()}],pe:[{pe:_()}],pt:[{pt:_()}],pr:[{pr:_()}],pb:[{pb:_()}],pl:[{pl:_()}],m:[{m:I()}],mx:[{mx:I()}],my:[{my:I()}],ms:[{ms:I()}],me:[{me:I()}],mt:[{mt:I()}],mr:[{mr:I()}],mb:[{mb:I()}],ml:[{ml:I()}],"space-x":[{"space-x":_()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":_()}],"space-y-reverse":["space-y-reverse"],size:[{size:q()}],w:[{w:[a,"screen",...q()]}],"min-w":[{"min-w":[a,"screen","none",...q()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[o]},...q()]}],h:[{h:["screen","lh",...q()]}],"min-h":[{"min-h":["screen","lh","none",...q()]}],"max-h":[{"max-h":["screen","lh",...q()]}],"font-size":[{text:["base",s,On,Ss]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,X,yo]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",bo,G]}],"font-family":[{font:[d0,G,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,X,G]}],"line-clamp":[{"line-clamp":[at,"none",X,yo]}],leading:[{leading:[r,..._()]}],"list-image":[{"list-image":["none",X,G]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",X,G]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...et(),"wavy"]}],"text-decoration-thickness":[{decoration:[at,"from-font","auto",X,Ss]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[at,"auto",X,G]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:_()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",X,G]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",X,G]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:rt()}],"bg-repeat":[{bg:dt()}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},es,X,G],radial:["",X,G],conic:[es,X,G]},f0,u0]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:Y()}],"gradient-via-pos":[{via:Y()}],"gradient-to-pos":[{to:Y()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:B()}],"rounded-s":[{"rounded-s":B()}],"rounded-e":[{"rounded-e":B()}],"rounded-t":[{"rounded-t":B()}],"rounded-r":[{"rounded-r":B()}],"rounded-b":[{"rounded-b":B()}],"rounded-l":[{"rounded-l":B()}],"rounded-ss":[{"rounded-ss":B()}],"rounded-se":[{"rounded-se":B()}],"rounded-ee":[{"rounded-ee":B()}],"rounded-es":[{"rounded-es":B()}],"rounded-tl":[{"rounded-tl":B()}],"rounded-tr":[{"rounded-tr":B()}],"rounded-br":[{"rounded-br":B()}],"rounded-bl":[{"rounded-bl":B()}],"border-w":[{border:U()}],"border-w-x":[{"border-x":U()}],"border-w-y":[{"border-y":U()}],"border-w-s":[{"border-s":U()}],"border-w-e":[{"border-e":U()}],"border-w-t":[{"border-t":U()}],"border-w-r":[{"border-r":U()}],"border-w-b":[{"border-b":U()}],"border-w-l":[{"border-l":U()}],"divide-x":[{"divide-x":U()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":U()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...et(),"hidden","none"]}],"divide-style":[{divide:[...et(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...et(),"none","hidden"]}],"outline-offset":[{"outline-offset":[at,X,G]}],"outline-w":[{outline:["",at,On,Ss]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",u,Li,Ai]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",d,Li,Ai]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[at,Ss]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":U()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",h,Li,Ai]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[at,X,G]}],"mix-blend":[{"mix-blend":[...ft(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ft()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[at]}],"mask-image-linear-from-pos":[{"mask-linear-from":Z()}],"mask-image-linear-to-pos":[{"mask-linear-to":Z()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":Z()}],"mask-image-t-to-pos":[{"mask-t-to":Z()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":Z()}],"mask-image-r-to-pos":[{"mask-r-to":Z()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":Z()}],"mask-image-b-to-pos":[{"mask-b-to":Z()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":Z()}],"mask-image-l-to-pos":[{"mask-l-to":Z()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":Z()}],"mask-image-x-to-pos":[{"mask-x-to":Z()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":Z()}],"mask-image-y-to-pos":[{"mask-y-to":Z()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[X,G]}],"mask-image-radial-from-pos":[{"mask-radial-from":Z()}],"mask-image-radial-to-pos":[{"mask-radial-to":Z()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":v()}],"mask-image-conic-pos":[{"mask-conic":[at]}],"mask-image-conic-from-pos":[{"mask-conic-from":Z()}],"mask-image-conic-to-pos":[{"mask-conic-to":Z()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:rt()}],"mask-repeat":[{mask:dt()}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",X,G]}],filter:[{filter:["","none",X,G]}],blur:[{blur:it()}],brightness:[{brightness:[at,X,G]}],contrast:[{contrast:[at,X,G]}],"drop-shadow":[{"drop-shadow":["","none",f,Li,Ai]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",at,X,G]}],"hue-rotate":[{"hue-rotate":[at,X,G]}],invert:[{invert:["",at,X,G]}],saturate:[{saturate:[at,X,G]}],sepia:[{sepia:["",at,X,G]}],"backdrop-filter":[{"backdrop-filter":["","none",X,G]}],"backdrop-blur":[{"backdrop-blur":it()}],"backdrop-brightness":[{"backdrop-brightness":[at,X,G]}],"backdrop-contrast":[{"backdrop-contrast":[at,X,G]}],"backdrop-grayscale":[{"backdrop-grayscale":["",at,X,G]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[at,X,G]}],"backdrop-invert":[{"backdrop-invert":["",at,X,G]}],"backdrop-opacity":[{"backdrop-opacity":[at,X,G]}],"backdrop-saturate":[{"backdrop-saturate":[at,X,G]}],"backdrop-sepia":[{"backdrop-sepia":["",at,X,G]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":_()}],"border-spacing-x":[{"border-spacing-x":_()}],"border-spacing-y":[{"border-spacing-y":_()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",X,G]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[at,"initial",X,G]}],ease:[{ease:["linear","initial",b,X,G]}],delay:[{delay:[at,X,G]}],animate:[{animate:["none",x,X,G]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,X,G]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:kt()}],"rotate-x":[{"rotate-x":kt()}],"rotate-y":[{"rotate-y":kt()}],"rotate-z":[{"rotate-z":kt()}],scale:[{scale:Ot()}],"scale-x":[{"scale-x":Ot()}],"scale-y":[{"scale-y":Ot()}],"scale-z":[{"scale-z":Ot()}],"scale-3d":["scale-3d"],skew:[{skew:Bt()}],"skew-x":[{"skew-x":Bt()}],"skew-y":[{"skew-y":Bt()}],transform:[{transform:[X,G,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ht()}],"translate-x":[{"translate-x":Ht()}],"translate-y":[{"translate-y":Ht()}],"translate-z":[{"translate-z":Ht()}],"translate-none":["translate-none"],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",X,G]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":_()}],"scroll-mx":[{"scroll-mx":_()}],"scroll-my":[{"scroll-my":_()}],"scroll-ms":[{"scroll-ms":_()}],"scroll-me":[{"scroll-me":_()}],"scroll-mt":[{"scroll-mt":_()}],"scroll-mr":[{"scroll-mr":_()}],"scroll-mb":[{"scroll-mb":_()}],"scroll-ml":[{"scroll-ml":_()}],"scroll-p":[{"scroll-p":_()}],"scroll-px":[{"scroll-px":_()}],"scroll-py":[{"scroll-py":_()}],"scroll-ps":[{"scroll-ps":_()}],"scroll-pe":[{"scroll-pe":_()}],"scroll-pt":[{"scroll-pt":_()}],"scroll-pr":[{"scroll-pr":_()}],"scroll-pb":[{"scroll-pb":_()}],"scroll-pl":[{"scroll-pl":_()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",X,G]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[at,On,Ss,yo]}],stroke:[{stroke:["none",...z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},b0=Xx(g0);function Ke(...e){return b0(Ox(e))}function Ae(e){return y.jsx("div",{...e,className:Ke("rounded-2xl border bg-white shadow-sm",e.className)})}function Le(e){return y.jsx("div",{...e,className:Ke("border-b px-4 py-3",e.className)})}function De(e){return y.jsx("div",{...e,className:Ke("px-4 py-3",e.className)})}function y0(){const e=qs(),t=Br(),{register:s,handleSubmit:n,formState:i}=Mh({defaultValues:{email:"admin@example.com",password:"ChangeMe123!"}}),r=n(async o=>{try{const a=await bt.post("/auth/login",o);t.setAuth(a.data.token,a.data.user.email),yt.success("Logged in"),e({to:"/"})}catch(a){yt.error(a?.response?.data?.detail??"Login failed")}});return y.jsx("div",{className:"mx-auto max-w-md",children:y.jsxs(Ae,{children:[y.jsxs(Le,{children:[y.jsx("div",{className:"text-lg font-semibold",children:"Login"}),y.jsx("div",{className:"text-sm text-neutral-600",children:"Use the admin credentials from your backend env."})]}),y.jsx(De,{children:y.jsxs("form",{onSubmit:r,className:"space-y-3",children:[y.jsxs("div",{children:[y.jsx("label",{className:"text-sm text-neutral-700",children:"Email"}),y.jsx("input",{className:"mt-1 w-full rounded-xl border px-3 py-2",...s("email",{required:!0})})]}),y.jsxs("div",{children:[y.jsx("label",{className:"text-sm text-neutral-700",children:"Password"}),y.jsx("input",{type:"password",className:"mt-1 w-full rounded-xl border px-3 py-2",...s("password",{required:!0})})]}),y.jsx("button",{disabled:i.isSubmitting,className:"w-full rounded-xl bg-neutral-900 px-3 py-2 text-white hover:bg-neutral-800 disabled:opacity-60",children:i.isSubmitting?"Signing in...":"Sign in"})]})})]})})}const x0=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),v0=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,s,n)=>n?n.toUpperCase():s.toLowerCase()),Hc=e=>{const t=v0(e);return t.charAt(0).toUpperCase()+t.slice(1)},$h=(...e)=>e.filter((t,s,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===s).join(" ").trim(),_0=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var w0={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const S0=L.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:n,className:i="",children:r,iconNode:o,...a},l)=>L.createElement("svg",{ref:l,...w0,width:t,height:t,stroke:e,strokeWidth:n?Number(s)*24/Number(t):s,className:$h("lucide",i),...!r&&!_0(a)&&{"aria-hidden":"true"},...a},[...o.map(([c,u])=>L.createElement(c,u)),...Array.isArray(r)?r:[r]]));const Ks=(e,t)=>{const s=L.forwardRef(({className:n,...i},r)=>L.createElement(S0,{ref:r,iconNode:t,className:$h(`lucide-${x0(Hc(e))}`,`lucide-${e}`,n),...i}));return s.displayName=Hc(e),s};const k0=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],qh=Ks("copy",k0);const R0=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],Kh=Ks("pause",R0);const P0=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Yh=Ks("pencil",P0);const E0=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Gh=Ks("play",E0);const C0=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],O0=Ks("plus",C0);const T0=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],M0=Ks("search",T0);const A0=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Xh=Ks("trash-2",A0);function L0(){const e=qs(),s=hg().pathname.match(/\/monitors\/([0-9a-f\-]+)/i)?.[1]??"",[n,i]=Q.useState(""),{data:r,refetch:o,isLoading:a}=ps({queryKey:["monitors-summary"],queryFn:async()=>(await bt.get("/monitors/summary?bars=60")).data.rows,refetchInterval:2e4}),l=(r??[]).filter(h=>h.monitor.name.toLowerCase().includes(n.toLowerCase()));async function c(h){try{await bt.post(`/monitors/${h.id}/pause`,{paused:!h.isPaused}),yt.success(h.isPaused?"Resumed":"Paused"),await o()}catch(f){yt.error(f?.response?.data?.detail??"Failed")}}async function u(h){try{const p=(await bt.post(`/monitors/${h.id}/clone`)).data.monitor.id;yt.success("Cloned (paused)"),await o(),e({to:"/monitors/$id",params:{id:p}})}catch(f){yt.error(f?.response?.data?.detail??"Clone failed")}}async function d(h){if(confirm(`Delete monitor "${h.name}"?`))try{await bt.delete(`/monitors/${h.id}`),yt.success("Deleted"),await o(),e({to:"/"})}catch(f){yt.error(f?.response?.data?.detail??"Delete failed")}}return y.jsxs("aside",{className:"flex h-full w-[360px] flex-col border-r border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-950",children:[y.jsxs("div",{className:"p-3",children:[y.jsxs("button",{className:"inline-flex w-full items-center justify-center gap-2 rounded-full bg-emerald-500 px-3 py-2 text-sm font-semibold text-white hover:bg-emerald-600",onClick:()=>e({to:"/monitors/new"}),children:[y.jsx(O0,{size:16})," Add New Monitor"]}),y.jsxs("div",{className:"mt-3 flex items-center gap-2 rounded-full border border-neutral-200 bg-neutral-50 px-3 py-2 dark:border-neutral-800 dark:bg-neutral-900",children:[y.jsx(M0,{size:16,className:"text-neutral-500"}),y.jsx("input",{value:n,onChange:h=>i(h.target.value),placeholder:"Search...",className:"w-full bg-transparent text-sm outline-none placeholder:text-neutral-400 dark:text-neutral-100"})]})]}),y.jsxs("div",{className:"flex-1 overflow-auto p-2",children:[a?y.jsx("div",{className:"p-3 text-sm text-neutral-500",children:"Loading..."}):null,l.map(h=>{const f=h.monitor,p=h.latest?.status??"unknown",m=p==="up"?"bg-emerald-500":p==="down"?"bg-red-500":"bg-neutral-400";return y.jsxs("div",{className:Ke("mb-2 rounded-2xl border p-3 shadow-sm transition",s===f.id?"border-emerald-400 bg-emerald-50 dark:border-emerald-700/60 dark:bg-emerald-900/10":"border-neutral-200 bg-white hover:bg-neutral-50 dark:border-neutral-800 dark:bg-neutral-950 dark:hover:bg-neutral-900/60"),children:[y.jsxs("div",{className:"flex items-center justify-between gap-2",children:[y.jsxs(Ta,{to:"/monitors/$id",params:{id:f.id},className:"min-w-0 flex-1",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("span",{className:Ke("h-2.5 w-2.5 rounded-full",m)}),y.jsx("div",{className:"truncate text-sm font-semibold",children:f.name}),f.isPaused?y.jsx("span",{className:"rounded-full bg-neutral-200 px-2 py-0.5 text-xs dark:bg-neutral-800",children:"Paused"}):null]}),y.jsxs("div",{className:"mt-1 text-xs text-neutral-500 dark:text-neutral-400",children:[f.type," • ",f.intervalSeconds,"s"]})]}),y.jsxs("div",{className:"flex items-center gap-1",children:[y.jsx("button",{className:"rounded-lg p-1 hover:bg-neutral-100 dark:hover:bg-neutral-800",onClick:()=>c(f),children:f.isPaused?y.jsx(Gh,{size:16}):y.jsx(Kh,{size:16})}),y.jsx("button",{className:"rounded-lg p-1 hover:bg-neutral-100 dark:hover:bg-neutral-800",onClick:()=>e({to:"/monitors/$id/edit",params:{id:f.id}}),children:y.jsx(Yh,{size:16})}),y.jsx("button",{className:"rounded-lg p-1 hover:bg-neutral-100 dark:hover:bg-neutral-800",onClick:()=>u(f),children:y.jsx(qh,{size:16})}),y.jsx("button",{className:"rounded-lg p-1 hover:bg-neutral-100 dark:hover:bg-neutral-800 text-red-600",onClick:()=>d(f),children:y.jsx(Xh,{size:16})})]})]}),y.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[y.jsxs("div",{className:Ke("rounded-full px-2 py-0.5 text-xs font-semibold text-white",m),children:[Math.round(h.uptimePct),"%"]}),y.jsx("div",{className:"flex items-center gap-1",children:h.bars.slice(-18).map((g,b)=>y.jsx("span",{className:Ke("h-3 w-1.5 rounded-full",g==="up"?"bg-emerald-500":g==="down"?"bg-red-500":"bg-neutral-300 dark:bg-neutral-700")},b))})]})]},f.id)})]})]})}function D0(){return y.jsxs("div",{className:"flex h-[calc(100vh-56px)]",children:[y.jsx(L0,{}),y.jsx("div",{className:"flex-1 overflow-auto bg-neutral-50 p-4 dark:bg-neutral-900/40",children:y.jsx(Ma,{})})]})}function N0(){return y.jsx("div",{className:"flex h-full items-center justify-center",children:y.jsxs("div",{className:"rounded-2xl border border-neutral-200 bg-white p-10 text-center shadow-sm dark:border-neutral-800 dark:bg-neutral-950",children:[y.jsx("div",{className:"text-xl font-semibold",children:"Select a monitor"}),y.jsx("div",{className:"mt-2 text-sm text-neutral-500 dark:text-neutral-400",children:"Choose a monitor from the left to view details."})]})})}function Uc(){const e=qs(),s=ai({strict:!1})?.id,{register:n,handleSubmit:i,watch:r,reset:o,formState:a}=Mh({defaultValues:{name:"",type:"http",intervalSeconds:20,timeoutMs:8e3,method:"GET"}});Q.useEffect(()=>{s&&(async()=>{const d=(await bt.get("/monitors")).data.monitors.find(h=>h.id===s);d&&o(d)})()},[s,o]);const l=r("type"),c=i(async u=>{try{s?(await bt.put(`/monitors/${s}`,u),yt.success("Monitor updated")):(await bt.post("/monitors",u),yt.success("Monitor created")),e({to:"/"})}catch(d){yt.error(d?.response?.data?.detail??"Save failed")}});return y.jsx("div",{className:"mx-auto max-w-2xl",children:y.jsxs(Ae,{children:[y.jsxs(Le,{children:[y.jsx("div",{className:"text-lg font-semibold",children:s?"Edit Monitor":"New Monitor"}),y.jsx("div",{className:"text-sm text-neutral-600",children:"Default interval is 20 seconds (configurable)."})]}),y.jsx(De,{children:y.jsxs("form",{onSubmit:c,className:"space-y-4",children:[y.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[y.jsxs("div",{children:[y.jsx("label",{className:"text-sm",children:"Name"}),y.jsx("input",{className:"mt-1 w-full rounded-xl border px-3 py-2",...n("name",{required:!0})})]}),y.jsxs("div",{children:[y.jsx("label",{className:"text-sm",children:"Type"}),y.jsx("select",{className:"mt-1 w-full rounded-xl border px-3 py-2",...n("type"),children:["http","tcp","keyword","json_query","websocket","ping","dns","push","steam","docker"].map(u=>y.jsx("option",{value:u,children:u},u))})]}),y.jsxs("div",{children:[y.jsx("label",{className:"text-sm",children:"Interval (seconds)"}),y.jsx("input",{type:"number",className:"mt-1 w-full rounded-xl border px-3 py-2",...n("intervalSeconds",{valueAsNumber:!0})})]}),y.jsxs("div",{children:[y.jsx("label",{className:"text-sm",children:"Timeout (ms)"}),y.jsx("input",{type:"number",className:"mt-1 w-full rounded-xl border px-3 py-2",...n("timeoutMs",{valueAsNumber:!0})})]})]}),(l==="http"||l==="keyword"||l==="json_query"||l==="websocket")&&y.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[y.jsxs("div",{className:"sm:col-span-2",children:[y.jsx("label",{className:"text-sm",children:"URL"}),y.jsx("input",{className:"mt-1 w-full rounded-xl border px-3 py-2",placeholder:"https://example.com",...n("url")})]}),l!=="websocket"&&y.jsxs("div",{children:[y.jsx("label",{className:"text-sm",children:"Method"}),y.jsx("select",{className:"mt-1 w-full rounded-xl border px-3 py-2",...n("method"),children:["GET","POST","PUT","DELETE"].map(u=>y.jsx("option",{value:u,children:u},u))})]})]}),(l==="tcp"||l==="ping"||l==="dns"||l==="steam")&&y.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[y.jsxs("div",{children:[y.jsx("label",{className:"text-sm",children:"Host"}),y.jsx("input",{className:"mt-1 w-full rounded-xl border px-3 py-2",...n("host")})]}),(l==="tcp"||l==="steam")&&y.jsxs("div",{children:[y.jsx("label",{className:"text-sm",children:"Port"}),y.jsx("input",{type:"number",className:"mt-1 w-full rounded-xl border px-3 py-2",...n("port",{valueAsNumber:!0})})]}),l==="dns"&&y.jsxs("div",{children:[y.jsx("label",{className:"text-sm",children:"DNS Record Type"}),y.jsx("select",{className:"mt-1 w-full rounded-xl border px-3 py-2",...n("dnsRecordType"),children:["A","AAAA","CNAME","TXT","MX","NS"].map(u=>y.jsx("option",{value:u,children:u},u))})]})]}),l==="keyword"&&y.jsxs("div",{children:[y.jsx("label",{className:"text-sm",children:"Keyword"}),y.jsx("input",{className:"mt-1 w-full rounded-xl border px-3 py-2",...n("keyword")})]}),l==="json_query"&&y.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[y.jsxs("div",{children:[y.jsx("label",{className:"text-sm",children:"JSON Query"}),y.jsx("input",{className:"mt-1 w-full rounded-xl border px-3 py-2",placeholder:"$.data.status",...n("jsonQuery")})]}),y.jsxs("div",{children:[y.jsx("label",{className:"text-sm",children:"Expected Value"}),y.jsx("input",{className:"mt-1 w-full rounded-xl border px-3 py-2",...n("expectedValue")})]})]}),l==="push"&&y.jsx("div",{className:"rounded-2xl border bg-neutral-50 p-3 text-sm text-neutral-700",children:"Push monitors generate a token on create. Use the Dashboard to copy the push URL after saving."}),y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsx("button",{type:"button",onClick:()=>e({to:"/"}),className:"rounded-xl border px-3 py-2 hover:bg-neutral-50",children:"Cancel"}),y.jsx("button",{disabled:a.isSubmitting,className:"rounded-xl bg-neutral-900 px-4 py-2 text-white hover:bg-neutral-800 disabled:opacity-60",children:a.isSubmitting?"Saving...":"Save"})]})]})})]})})}const je=Object.create(null);je.open="0";je.close="1";je.ping="2";je.pong="3";je.message="4";je.upgrade="5";je.noop="6";const sr=Object.create(null);Object.keys(je).forEach(e=>{sr[je[e]]=e});const ra={type:"error",data:"parser error"},Qh=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Jh=typeof ArrayBuffer=="function",Zh=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,$a=({type:e,data:t},s,n)=>Qh&&t instanceof Blob?s?n(t):Wc(t,n):Jh&&(t instanceof ArrayBuffer||Zh(t))?s?n(t):Wc(new Blob([t]),n):n(je[e]+(t||"")),Wc=(e,t)=>{const s=new FileReader;return s.onload=function(){const n=s.result.split(",")[1];t("b"+(n||""))},s.readAsDataURL(e)};function $c(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let xo;function F0(e,t){if(Qh&&e.data instanceof Blob)return e.data.arrayBuffer().then($c).then(t);if(Jh&&(e.data instanceof ArrayBuffer||Zh(e.data)))return t($c(e.data));$a(e,!1,s=>{xo||(xo=new TextEncoder),t(xo.encode(s))})}const qc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",In=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<qc.length;e++)In[qc.charCodeAt(e)]=e;const I0=e=>{let t=e.length*.75,s=e.length,n,i=0,r,o,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),u=new Uint8Array(c);for(n=0;n<s;n+=4)r=In[e.charCodeAt(n)],o=In[e.charCodeAt(n+1)],a=In[e.charCodeAt(n+2)],l=In[e.charCodeAt(n+3)],u[i++]=r<<2|o>>4,u[i++]=(o&15)<<4|a>>2,u[i++]=(a&3)<<6|l&63;return c},j0=typeof ArrayBuffer=="function",qa=(e,t)=>{if(typeof e!="string")return{type:"message",data:tf(e,t)};const s=e.charAt(0);return s==="b"?{type:"message",data:B0(e.substring(1),t)}:sr[s]?e.length>1?{type:sr[s],data:e.substring(1)}:{type:sr[s]}:ra},B0=(e,t)=>{if(j0){const s=I0(e);return tf(s,t)}else return{base64:!0,data:e}},tf=(e,t)=>t==="blob"?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,ef="",V0=(e,t)=>{const s=e.length,n=new Array(s);let i=0;e.forEach((r,o)=>{$a(r,!1,a=>{n[o]=a,++i===s&&t(n.join(ef))})})},z0=(e,t)=>{const s=e.split(ef),n=[];for(let i=0;i<s.length;i++){const r=qa(s[i],t);if(n.push(r),r.type==="error")break}return n};function H0(){return new TransformStream({transform(e,t){F0(e,s=>{const n=s.length;let i;if(n<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,n);else if(n<65536){i=new Uint8Array(3);const r=new DataView(i.buffer);r.setUint8(0,126),r.setUint16(1,n)}else{i=new Uint8Array(9);const r=new DataView(i.buffer);r.setUint8(0,127),r.setBigUint64(1,BigInt(n))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(s)})}})}let vo;function Di(e){return e.reduce((t,s)=>t+s.length,0)}function Ni(e,t){if(e[0].length===t)return e.shift();const s=new Uint8Array(t);let n=0;for(let i=0;i<t;i++)s[i]=e[0][n++],n===e[0].length&&(e.shift(),n=0);return e.length&&n<e[0].length&&(e[0]=e[0].slice(n)),s}function U0(e,t){vo||(vo=new TextDecoder);const s=[];let n=0,i=-1,r=!1;return new TransformStream({transform(o,a){for(s.push(o);;){if(n===0){if(Di(s)<1)break;const l=Ni(s,1);r=(l[0]&128)===128,i=l[0]&127,i<126?n=3:i===126?n=1:n=2}else if(n===1){if(Di(s)<2)break;const l=Ni(s,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),n=3}else if(n===2){if(Di(s)<8)break;const l=Ni(s,8),c=new DataView(l.buffer,l.byteOffset,l.length),u=c.getUint32(0);if(u>Math.pow(2,21)-1){a.enqueue(ra);break}i=u*Math.pow(2,32)+c.getUint32(4),n=3}else{if(Di(s)<i)break;const l=Ni(s,i);a.enqueue(qa(r?l:vo.decode(l),t)),n=0}if(i===0||i>e){a.enqueue(ra);break}}}})}const sf=4;function Mt(e){if(e)return W0(e)}function W0(e){for(var t in Mt.prototype)e[t]=Mt.prototype[t];return e}Mt.prototype.on=Mt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Mt.prototype.once=function(e,t){function s(){this.off(e,s),t.apply(this,arguments)}return s.fn=t,this.on(e,s),this};Mt.prototype.off=Mt.prototype.removeListener=Mt.prototype.removeAllListeners=Mt.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var s=this._callbacks["$"+e];if(!s)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var n,i=0;i<s.length;i++)if(n=s[i],n===t||n.fn===t){s.splice(i,1);break}return s.length===0&&delete this._callbacks["$"+e],this};Mt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),s=this._callbacks["$"+e],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(s){s=s.slice(0);for(var n=0,i=s.length;n<i;++n)s[n].apply(this,t)}return this};Mt.prototype.emitReserved=Mt.prototype.emit;Mt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Mt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const zr=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,s)=>s(t,0),me=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),$0="arraybuffer";function nf(e,...t){return t.reduce((s,n)=>(e.hasOwnProperty(n)&&(s[n]=e[n]),s),{})}const q0=me.setTimeout,K0=me.clearTimeout;function Hr(e,t){t.useNativeTimers?(e.setTimeoutFn=q0.bind(me),e.clearTimeoutFn=K0.bind(me)):(e.setTimeoutFn=me.setTimeout.bind(me),e.clearTimeoutFn=me.clearTimeout.bind(me))}const Y0=1.33;function G0(e){return typeof e=="string"?X0(e):Math.ceil((e.byteLength||e.size)*Y0)}function X0(e){let t=0,s=0;for(let n=0,i=e.length;n<i;n++)t=e.charCodeAt(n),t<128?s+=1:t<2048?s+=2:t<55296||t>=57344?s+=3:(n++,s+=4);return s}function rf(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Q0(e){let t="";for(let s in e)e.hasOwnProperty(s)&&(t.length&&(t+="&"),t+=encodeURIComponent(s)+"="+encodeURIComponent(e[s]));return t}function J0(e){let t={},s=e.split("&");for(let n=0,i=s.length;n<i;n++){let r=s[n].split("=");t[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return t}class Z0 extends Error{constructor(t,s,n){super(t),this.description=s,this.context=n,this.type="TransportError"}}class Ka extends Mt{constructor(t){super(),this.writable=!1,Hr(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,s,n){return super.emitReserved("error",new Z0(t,s,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const s=qa(t,this.socket.binaryType);this.onPacket(s)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,s={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(s)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const s=Q0(t);return s.length?"?"+s:""}}class tv extends Ka{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const s=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let n=0;this._polling&&(n++,this.once("pollComplete",function(){--n||s()})),this.writable||(n++,this.once("drain",function(){--n||s()}))}else s()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const s=n=>{if(this.readyState==="opening"&&n.type==="open"&&this.onOpen(),n.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(n)};z0(t,this.socket.binaryType).forEach(s),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,V0(t,s=>{this.doWrite(s,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",s=this.query||{};return this.opts.timestampRequests!==!1&&(s[this.opts.timestampParam]=rf()),!this.supportsBinary&&!s.sid&&(s.b64=1),this.createUri(t,s)}}let of=!1;try{of=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const ev=of;function sv(){}class nv extends tv{constructor(t){if(super(t),typeof location<"u"){const s=location.protocol==="https:";let n=location.port;n||(n=s?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||n!==t.port}}doWrite(t,s){const n=this.request({method:"POST",data:t});n.on("success",s),n.on("error",(i,r)=>{this.onError("xhr post error",i,r)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(s,n)=>{this.onError("xhr poll error",s,n)}),this.pollXhr=t}}class Ne extends Mt{constructor(t,s,n){super(),this.createRequest=t,Hr(this,n),this._opts=n,this._method=n.method||"GET",this._uri=s,this._data=n.data!==void 0?n.data:null,this._create()}_create(){var t;const s=nf(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");s.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(s);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&n.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var i;n.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(n.getResponseHeader("set-cookie"))),n.readyState===4&&(n.status===200||n.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof n.status=="number"?n.status:0)},0))},n.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=Ne.requestsCount++,Ne.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=sv,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Ne.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Ne.requestsCount=0;Ne.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Kc);else if(typeof addEventListener=="function"){const e="onpagehide"in me?"pagehide":"unload";addEventListener(e,Kc,!1)}}function Kc(){for(let e in Ne.requests)Ne.requests.hasOwnProperty(e)&&Ne.requests[e].abort()}const iv=(function(){const e=af({xdomain:!1});return e&&e.responseType!==null})();class rv extends nv{constructor(t){super(t);const s=t&&t.forceBase64;this.supportsBinary=iv&&!s}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Ne(af,this.uri(),t)}}function af(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||ev))return new XMLHttpRequest}catch{}if(!t)try{return new me[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const lf=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class ov extends Ka{get name(){return"websocket"}doOpen(){const t=this.uri(),s=this.opts.protocols,n=lf?{}:nf(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,s,n)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let s=0;s<t.length;s++){const n=t[s],i=s===t.length-1;$a(n,this.supportsBinary,r=>{try{this.doWrite(n,r)}catch{}i&&zr(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",s=this.query||{};return this.opts.timestampRequests&&(s[this.opts.timestampParam]=rf()),this.supportsBinary||(s.b64=1),this.createUri(t,s)}}const _o=me.WebSocket||me.MozWebSocket;class av extends ov{createSocket(t,s,n){return lf?new _o(t,s,n):s?new _o(t,s):new _o(t)}doWrite(t,s){this.ws.send(s)}}class lv extends Ka{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const s=U0(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=t.readable.pipeThrough(s).getReader(),i=H0();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const r=()=>{n.read().then(({done:a,value:l})=>{a||(this.onPacket(l),r())}).catch(a=>{})};r();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let s=0;s<t.length;s++){const n=t[s],i=s===t.length-1;this._writer.write(n).then(()=>{i&&zr(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const cv={websocket:av,webtransport:lv,polling:rv},uv=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,dv=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function oa(e){if(e.length>8e3)throw"URI too long";const t=e,s=e.indexOf("["),n=e.indexOf("]");s!=-1&&n!=-1&&(e=e.substring(0,s)+e.substring(s,n).replace(/:/g,";")+e.substring(n,e.length));let i=uv.exec(e||""),r={},o=14;for(;o--;)r[dv[o]]=i[o]||"";return s!=-1&&n!=-1&&(r.source=t,r.host=r.host.substring(1,r.host.length-1).replace(/;/g,":"),r.authority=r.authority.replace("[","").replace("]","").replace(/;/g,":"),r.ipv6uri=!0),r.pathNames=hv(r,r.path),r.queryKey=fv(r,r.query),r}function hv(e,t){const s=/\/{2,9}/g,n=t.replace(s,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&n.splice(0,1),t.slice(-1)=="/"&&n.splice(n.length-1,1),n}function fv(e,t){const s={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,i,r){i&&(s[i]=r)}),s}const aa=typeof addEventListener=="function"&&typeof removeEventListener=="function",nr=[];aa&&addEventListener("offline",()=>{nr.forEach(e=>e())},!1);class hs extends Mt{constructor(t,s){if(super(),this.binaryType=$0,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(s=t,t=null),t){const n=oa(t);s.hostname=n.host,s.secure=n.protocol==="https"||n.protocol==="wss",s.port=n.port,n.query&&(s.query=n.query)}else s.host&&(s.hostname=oa(s.host).host);Hr(this,s),this.secure=s.secure!=null?s.secure:typeof location<"u"&&location.protocol==="https:",s.hostname&&!s.port&&(s.port=this.secure?"443":"80"),this.hostname=s.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=s.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},s.transports.forEach(n=>{const i=n.prototype.name;this.transports.push(i),this._transportsByName[i]=n}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},s),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=J0(this.opts.query)),aa&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},nr.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const s=Object.assign({},this.opts.query);s.EIO=sf,s.transport=t,this.id&&(s.sid=this.id);const n=Object.assign({},this.opts,{query:s,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&hs.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const s=this.createTransport(t);s.open(),this.setTransport(s)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",s=>this._onClose("transport close",s))}onOpen(){this.readyState="open",hs.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const s=new Error("server error");s.code=t.data,this._onError(s);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let s=1;for(let n=0;n<this.writeBuffer.length;n++){const i=this.writeBuffer[n].data;if(i&&(s+=G0(i)),n>0&&s>this._maxPayload)return this.writeBuffer.slice(0,n);s+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,zr(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,s,n){return this._sendPacket("message",t,s,n),this}send(t,s,n){return this._sendPacket("message",t,s,n),this}_sendPacket(t,s,n,i){if(typeof s=="function"&&(i=s,s=void 0),typeof n=="function"&&(i=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;const r={type:t,data:s,options:n};this.emitReserved("packetCreate",r),this.writeBuffer.push(r),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},s=()=>{this.off("upgrade",s),this.off("upgradeError",s),t()},n=()=>{this.once("upgrade",s),this.once("upgradeError",s)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():t()}):this.upgrading?n():t()),this}_onError(t){if(hs.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,s){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),aa&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const n=nr.indexOf(this._offlineEventListener);n!==-1&&nr.splice(n,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,s),this.writeBuffer=[],this._prevBufferLen=0}}}hs.protocol=sf;class pv extends hs{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let s=this.createTransport(t),n=!1;hs.priorWebsocketSuccess=!1;const i=()=>{n||(s.send([{type:"ping",data:"probe"}]),s.once("packet",d=>{if(!n)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",s),!s)return;hs.priorWebsocketSuccess=s.name==="websocket",this.transport.pause(()=>{n||this.readyState!=="closed"&&(u(),this.setTransport(s),s.send([{type:"upgrade"}]),this.emitReserved("upgrade",s),s=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=s.name,this.emitReserved("upgradeError",h)}}))};function r(){n||(n=!0,u(),s.close(),s=null)}const o=d=>{const h=new Error("probe error: "+d);h.transport=s.name,r(),this.emitReserved("upgradeError",h)};function a(){o("transport closed")}function l(){o("socket closed")}function c(d){s&&d.name!==s.name&&r()}const u=()=>{s.removeListener("open",i),s.removeListener("error",o),s.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};s.once("open",i),s.once("error",o),s.once("close",a),this.once("close",l),this.once("upgrading",c),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{n||s.open()},200):s.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const s=[];for(let n=0;n<t.length;n++)~this.transports.indexOf(t[n])&&s.push(t[n]);return s}}let mv=class extends pv{constructor(t,s={}){const n=typeof t=="object"?t:s;(!n.transports||n.transports&&typeof n.transports[0]=="string")&&(n.transports=(n.transports||["polling","websocket","webtransport"]).map(i=>cv[i]).filter(i=>!!i)),super(t,n)}};function gv(e,t="",s){let n=e;s=s||typeof location<"u"&&location,e==null&&(e=s.protocol+"//"+s.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=s.protocol+e:e=s.host+e),/^(https?|wss?):\/\//.test(e)||(typeof s<"u"?e=s.protocol+"//"+e:e="https://"+e),n=oa(e)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const r=n.host.indexOf(":")!==-1?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+r+":"+n.port+t,n.href=n.protocol+"://"+r+(s&&s.port===n.port?"":":"+n.port),n}const bv=typeof ArrayBuffer=="function",yv=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,cf=Object.prototype.toString,xv=typeof Blob=="function"||typeof Blob<"u"&&cf.call(Blob)==="[object BlobConstructor]",vv=typeof File=="function"||typeof File<"u"&&cf.call(File)==="[object FileConstructor]";function Ya(e){return bv&&(e instanceof ArrayBuffer||yv(e))||xv&&e instanceof Blob||vv&&e instanceof File}function ir(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let s=0,n=e.length;s<n;s++)if(ir(e[s]))return!0;return!1}if(Ya(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return ir(e.toJSON(),!0);for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&ir(e[s]))return!0;return!1}function _v(e){const t=[],s=e.data,n=e;return n.data=la(s,t),n.attachments=t.length,{packet:n,buffers:t}}function la(e,t){if(!e)return e;if(Ya(e)){const s={_placeholder:!0,num:t.length};return t.push(e),s}else if(Array.isArray(e)){const s=new Array(e.length);for(let n=0;n<e.length;n++)s[n]=la(e[n],t);return s}else if(typeof e=="object"&&!(e instanceof Date)){const s={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(s[n]=la(e[n],t));return s}return e}function wv(e,t){return e.data=ca(e.data,t),delete e.attachments,e}function ca(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let s=0;s<e.length;s++)e[s]=ca(e[s],t);else if(typeof e=="object")for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(e[s]=ca(e[s],t));return e}const Sv=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var ht;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(ht||(ht={}));class kv{constructor(t){this.replacer=t}encode(t){return(t.type===ht.EVENT||t.type===ht.ACK)&&ir(t)?this.encodeAsBinary({type:t.type===ht.EVENT?ht.BINARY_EVENT:ht.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let s=""+t.type;return(t.type===ht.BINARY_EVENT||t.type===ht.BINARY_ACK)&&(s+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(s+=t.nsp+","),t.id!=null&&(s+=t.id),t.data!=null&&(s+=JSON.stringify(t.data,this.replacer)),s}encodeAsBinary(t){const s=_v(t),n=this.encodeAsString(s.packet),i=s.buffers;return i.unshift(n),i}}class Ga extends Mt{constructor(t){super(),this.reviver=t}add(t){let s;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");s=this.decodeString(t);const n=s.type===ht.BINARY_EVENT;n||s.type===ht.BINARY_ACK?(s.type=n?ht.EVENT:ht.ACK,this.reconstructor=new Rv(s),s.attachments===0&&super.emitReserved("decoded",s)):super.emitReserved("decoded",s)}else if(Ya(t)||t.base64)if(this.reconstructor)s=this.reconstructor.takeBinaryData(t),s&&(this.reconstructor=null,super.emitReserved("decoded",s));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let s=0;const n={type:Number(t.charAt(0))};if(ht[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===ht.BINARY_EVENT||n.type===ht.BINARY_ACK){const r=s+1;for(;t.charAt(++s)!=="-"&&s!=t.length;);const o=t.substring(r,s);if(o!=Number(o)||t.charAt(s)!=="-")throw new Error("Illegal attachments");n.attachments=Number(o)}if(t.charAt(s+1)==="/"){const r=s+1;for(;++s&&!(t.charAt(s)===","||s===t.length););n.nsp=t.substring(r,s)}else n.nsp="/";const i=t.charAt(s+1);if(i!==""&&Number(i)==i){const r=s+1;for(;++s;){const o=t.charAt(s);if(o==null||Number(o)!=o){--s;break}if(s===t.length)break}n.id=Number(t.substring(r,s+1))}if(t.charAt(++s)){const r=this.tryParse(t.substr(s));if(Ga.isPayloadValid(n.type,r))n.data=r;else throw new Error("invalid payload")}return n}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,s){switch(t){case ht.CONNECT:return Yc(s);case ht.DISCONNECT:return s===void 0;case ht.CONNECT_ERROR:return typeof s=="string"||Yc(s);case ht.EVENT:case ht.BINARY_EVENT:return Array.isArray(s)&&(typeof s[0]=="number"||typeof s[0]=="string"&&Sv.indexOf(s[0])===-1);case ht.ACK:case ht.BINARY_ACK:return Array.isArray(s)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Rv{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const s=wv(this.reconPack,this.buffers);return this.finishedReconstruction(),s}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function Yc(e){return Object.prototype.toString.call(e)==="[object Object]"}const Pv=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Ga,Encoder:kv,get PacketType(){return ht}},Symbol.toStringTag,{value:"Module"}));function _e(e,t,s){return e.on(t,s),function(){e.off(t,s)}}const Ev=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class uf extends Mt{constructor(t,s,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=s,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[_e(t,"open",this.onopen.bind(this)),_e(t,"packet",this.onpacket.bind(this)),_e(t,"error",this.onerror.bind(this)),_e(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...s){var n,i,r;if(Ev.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(s.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(s),this;const o={type:ht.EVENT,data:s};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof s[s.length-1]=="function"){const u=this.ids++,d=s.pop();this._registerAckCallback(u,d),o.id=u}const a=(i=(n=this.io.engine)===null||n===void 0?void 0:n.transport)===null||i===void 0?void 0:i.writable,l=this.connected&&!(!((r=this.io.engine)===null||r===void 0)&&r._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,s){var n;const i=(n=this.flags.timeout)!==null&&n!==void 0?n:this._opts.ackTimeout;if(i===void 0){this.acks[t]=s;return}const r=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);s.call(this,new Error("operation has timed out"))},i),o=(...a)=>{this.io.clearTimeoutFn(r),s.apply(this,a)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...s){return new Promise((n,i)=>{const r=(o,a)=>o?i(o):n(a);r.withError=!0,s.push(r),this.emit(t,...s)})}_addToQueue(t){let s;typeof t[t.length-1]=="function"&&(s=t.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...r)=>(this._queue[0],i!==null?n.tryCount>this._opts.retries&&(this._queue.shift(),s&&s(i)):(this._queue.shift(),s&&s(null,...r)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const s=this._queue[0];s.pending&&!t||(s.pending=!0,s.tryCount++,this.flags=s.flags,this.emit.apply(this,s.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:ht.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,s){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,s),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(n=>String(n.id)===t)){const n=this.acks[t];delete this.acks[t],n.withError&&n.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case ht.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case ht.EVENT:case ht.BINARY_EVENT:this.onevent(t);break;case ht.ACK:case ht.BINARY_ACK:this.onack(t);break;case ht.DISCONNECT:this.ondisconnect();break;case ht.CONNECT_ERROR:this.destroy();const n=new Error(t.data.message);n.data=t.data.data,this.emitReserved("connect_error",n);break}}onevent(t){const s=t.data||[];t.id!=null&&s.push(this.ack(t.id)),this.connected?this.emitEvent(s):this.receiveBuffer.push(Object.freeze(s))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const s=this._anyListeners.slice();for(const n of s)n.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const s=this;let n=!1;return function(...i){n||(n=!0,s.packet({type:ht.ACK,id:t,data:i}))}}onack(t){const s=this.acks[t.id];typeof s=="function"&&(delete this.acks[t.id],s.withError&&t.data.unshift(null),s.apply(this,t.data))}onconnect(t,s){this.id=t,this.recovered=s&&this._pid===s,this._pid=s,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:ht.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const s=this._anyListeners;for(let n=0;n<s.length;n++)if(t===s[n])return s.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const s=this._anyOutgoingListeners;for(let n=0;n<s.length;n++)if(t===s[n])return s.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const s=this._anyOutgoingListeners.slice();for(const n of s)n.apply(this,t.data)}}}function bn(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}bn.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),s=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-s:e+s}return Math.min(e,this.max)|0};bn.prototype.reset=function(){this.attempts=0};bn.prototype.setMin=function(e){this.ms=e};bn.prototype.setMax=function(e){this.max=e};bn.prototype.setJitter=function(e){this.jitter=e};class ua extends Mt{constructor(t,s){var n;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(s=t,t=void 0),s=s||{},s.path=s.path||"/socket.io",this.opts=s,Hr(this,s),this.reconnection(s.reconnection!==!1),this.reconnectionAttempts(s.reconnectionAttempts||1/0),this.reconnectionDelay(s.reconnectionDelay||1e3),this.reconnectionDelayMax(s.reconnectionDelayMax||5e3),this.randomizationFactor((n=s.randomizationFactor)!==null&&n!==void 0?n:.5),this.backoff=new bn({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(s.timeout==null?2e4:s.timeout),this._readyState="closed",this.uri=t;const i=s.parser||Pv;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=s.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var s;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(s=this.backoff)===null||s===void 0||s.setMin(t),this)}randomizationFactor(t){var s;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(s=this.backoff)===null||s===void 0||s.setJitter(t),this)}reconnectionDelayMax(t){var s;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(s=this.backoff)===null||s===void 0||s.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new mv(this.uri,this.opts);const s=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const i=_e(s,"open",function(){n.onopen(),t&&t()}),r=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=_e(s,"error",r);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{i(),r(new Error("timeout")),s.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(_e(t,"ping",this.onping.bind(this)),_e(t,"data",this.ondata.bind(this)),_e(t,"error",this.onerror.bind(this)),_e(t,"close",this.onclose.bind(this)),_e(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(s){this.onclose("parse error",s)}}ondecoded(t){zr(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,s){let n=this.nsps[t];return n?this._autoConnect&&!n.active&&n.connect():(n=new uf(this,t,s),this.nsps[t]=n),n}_destroy(t){const s=Object.keys(this.nsps);for(const n of s)if(this.nsps[n].active)return;this._close()}_packet(t){const s=this.encoder.encode(t);for(let n=0;n<s.length;n++)this.engine.write(s[n],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,s){var n;this.cleanup(),(n=this.engine)===null||n===void 0||n.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,s),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const s=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},s);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Tn={};function rr(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const s=gv(e,t.path||"/socket.io"),n=s.source,i=s.id,r=s.path,o=Tn[i]&&r in Tn[i].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return a?l=new ua(n,t):(Tn[i]||(Tn[i]=new ua(n,t)),l=Tn[i]),s.query&&!t.query&&(t.query=s.queryKey),l.socket(s.path,t)}Object.assign(rr,{Manager:ua,Socket:uf,io:rr,connect:rr});function mi(e){return e+.5|0}const os=(e,t,s)=>Math.max(Math.min(e,s),t);function jn(e){return os(mi(e*2.55),0,255)}function fs(e){return os(mi(e*255),0,255)}function $e(e){return os(mi(e/2.55)/100,0,1)}function Gc(e){return os(mi(e*100),0,100)}const he={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},da=[..."0123456789ABCDEF"],Cv=e=>da[e&15],Ov=e=>da[(e&240)>>4]+da[e&15],Fi=e=>(e&240)>>4===(e&15),Tv=e=>Fi(e.r)&&Fi(e.g)&&Fi(e.b)&&Fi(e.a);function Mv(e){var t=e.length,s;return e[0]==="#"&&(t===4||t===5?s={r:255&he[e[1]]*17,g:255&he[e[2]]*17,b:255&he[e[3]]*17,a:t===5?he[e[4]]*17:255}:(t===7||t===9)&&(s={r:he[e[1]]<<4|he[e[2]],g:he[e[3]]<<4|he[e[4]],b:he[e[5]]<<4|he[e[6]],a:t===9?he[e[7]]<<4|he[e[8]]:255})),s}const Av=(e,t)=>e<255?t(e):"";function Lv(e){var t=Tv(e)?Cv:Ov;return e?"#"+t(e.r)+t(e.g)+t(e.b)+Av(e.a,t):void 0}const Dv=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function df(e,t,s){const n=t*Math.min(s,1-s),i=(r,o=(r+e/30)%12)=>s-n*Math.max(Math.min(o-3,9-o,1),-1);return[i(0),i(8),i(4)]}function Nv(e,t,s){const n=(i,r=(i+e/60)%6)=>s-s*t*Math.max(Math.min(r,4-r,1),0);return[n(5),n(3),n(1)]}function Fv(e,t,s){const n=df(e,1,.5);let i;for(t+s>1&&(i=1/(t+s),t*=i,s*=i),i=0;i<3;i++)n[i]*=1-t-s,n[i]+=t;return n}function Iv(e,t,s,n,i){return e===i?(t-s)/n+(t<s?6:0):t===i?(s-e)/n+2:(e-t)/n+4}function Xa(e){const s=e.r/255,n=e.g/255,i=e.b/255,r=Math.max(s,n,i),o=Math.min(s,n,i),a=(r+o)/2;let l,c,u;return r!==o&&(u=r-o,c=a>.5?u/(2-r-o):u/(r+o),l=Iv(s,n,i,u,r),l=l*60+.5),[l|0,c||0,a]}function Qa(e,t,s,n){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,s,n)).map(fs)}function Ja(e,t,s){return Qa(df,e,t,s)}function jv(e,t,s){return Qa(Fv,e,t,s)}function Bv(e,t,s){return Qa(Nv,e,t,s)}function hf(e){return(e%360+360)%360}function Vv(e){const t=Dv.exec(e);let s=255,n;if(!t)return;t[5]!==n&&(s=t[6]?jn(+t[5]):fs(+t[5]));const i=hf(+t[2]),r=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?n=jv(i,r,o):t[1]==="hsv"?n=Bv(i,r,o):n=Ja(i,r,o),{r:n[0],g:n[1],b:n[2],a:s}}function zv(e,t){var s=Xa(e);s[0]=hf(s[0]+t),s=Ja(s),e.r=s[0],e.g=s[1],e.b=s[2]}function Hv(e){if(!e)return;const t=Xa(e),s=t[0],n=Gc(t[1]),i=Gc(t[2]);return e.a<255?`hsla(${s}, ${n}%, ${i}%, ${$e(e.a)})`:`hsl(${s}, ${n}%, ${i}%)`}const Xc={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"},Qc={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 Uv(){const e={},t=Object.keys(Qc),s=Object.keys(Xc);let n,i,r,o,a;for(n=0;n<t.length;n++){for(o=a=t[n],i=0;i<s.length;i++)r=s[i],a=a.replace(r,Xc[r]);r=parseInt(Qc[o],16),e[a]=[r>>16&255,r>>8&255,r&255]}return e}let Ii;function Wv(e){Ii||(Ii=Uv(),Ii.transparent=[0,0,0,0]);const t=Ii[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const $v=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function qv(e){const t=$v.exec(e);let s=255,n,i,r;if(t){if(t[7]!==n){const o=+t[7];s=t[8]?jn(o):os(o*255,0,255)}return n=+t[1],i=+t[3],r=+t[5],n=255&(t[2]?jn(n):os(n,0,255)),i=255&(t[4]?jn(i):os(i,0,255)),r=255&(t[6]?jn(r):os(r,0,255)),{r:n,g:i,b:r,a:s}}}function Kv(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${$e(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const wo=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Zs=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function Yv(e,t,s){const n=Zs($e(e.r)),i=Zs($e(e.g)),r=Zs($e(e.b));return{r:fs(wo(n+s*(Zs($e(t.r))-n))),g:fs(wo(i+s*(Zs($e(t.g))-i))),b:fs(wo(r+s*(Zs($e(t.b))-r))),a:e.a+s*(t.a-e.a)}}function ji(e,t,s){if(e){let n=Xa(e);n[t]=Math.max(0,Math.min(n[t]+n[t]*s,t===0?360:1)),n=Ja(n),e.r=n[0],e.g=n[1],e.b=n[2]}}function ff(e,t){return e&&Object.assign(t||{},e)}function Jc(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=fs(e[3]))):(t=ff(e,{r:0,g:0,b:0,a:1}),t.a=fs(t.a)),t}function Gv(e){return e.charAt(0)==="r"?qv(e):Vv(e)}class ti{constructor(t){if(t instanceof ti)return t;const s=typeof t;let n;s==="object"?n=Jc(t):s==="string"&&(n=Mv(t)||Wv(t)||Gv(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=ff(this._rgb);return t&&(t.a=$e(t.a)),t}set rgb(t){this._rgb=Jc(t)}rgbString(){return this._valid?Kv(this._rgb):void 0}hexString(){return this._valid?Lv(this._rgb):void 0}hslString(){return this._valid?Hv(this._rgb):void 0}mix(t,s){if(t){const n=this.rgb,i=t.rgb;let r;const o=s===r?.5:s,a=2*o-1,l=n.a-i.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;r=1-c,n.r=255&c*n.r+r*i.r+.5,n.g=255&c*n.g+r*i.g+.5,n.b=255&c*n.b+r*i.b+.5,n.a=o*n.a+(1-o)*i.a,this.rgb=n}return this}interpolate(t,s){return t&&(this._rgb=Yv(this._rgb,t._rgb,s)),this}clone(){return new ti(this.rgb)}alpha(t){return this._rgb.a=fs(t),this}clearer(t){const s=this._rgb;return s.a*=1-t,this}greyscale(){const t=this._rgb,s=mi(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=s,this}opaquer(t){const s=this._rgb;return s.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 ji(this._rgb,2,t),this}darken(t){return ji(this._rgb,2,-t),this}saturate(t){return ji(this._rgb,1,t),this}desaturate(t){return ji(this._rgb,1,-t),this}rotate(t){return zv(this._rgb,t),this}}function ze(){}const Xv=(()=>{let e=0;return()=>e++})();function lt(e){return e==null}function _t(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 ut(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function Pt(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function ae(e,t){return Pt(e)?e:t}function nt(e,t){return typeof e>"u"?t:e}const Qv=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,pf=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function gt(e,t,s){if(e&&typeof e.call=="function")return e.apply(s,t)}function mt(e,t,s,n){let i,r,o;if(_t(e))for(r=e.length,i=0;i<r;i++)t.call(s,e[i],i);else if(ut(e))for(o=Object.keys(e),r=o.length,i=0;i<r;i++)t.call(s,e[o[i]],o[i])}function wr(e,t){let s,n,i,r;if(!e||!t||e.length!==t.length)return!1;for(s=0,n=e.length;s<n;++s)if(i=e[s],r=t[s],i.datasetIndex!==r.datasetIndex||i.index!==r.index)return!1;return!0}function Sr(e){if(_t(e))return e.map(Sr);if(ut(e)){const t=Object.create(null),s=Object.keys(e),n=s.length;let i=0;for(;i<n;++i)t[s[i]]=Sr(e[s[i]]);return t}return e}function mf(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function Jv(e,t,s,n){if(!mf(e))return;const i=t[e],r=s[e];ut(i)&&ut(r)?ei(i,r,n):t[e]=Sr(r)}function ei(e,t,s){const n=_t(t)?t:[t],i=n.length;if(!ut(e))return e;s=s||{};const r=s.merger||Jv;let o;for(let a=0;a<i;++a){if(o=n[a],!ut(o))continue;const l=Object.keys(o);for(let c=0,u=l.length;c<u;++c)r(l[c],e,o,s)}return e}function qn(e,t){return ei(e,t,{merger:Zv})}function Zv(e,t,s){if(!mf(e))return;const n=t[e],i=s[e];ut(n)&&ut(i)?qn(n,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Sr(i))}const Zc={"":e=>e,x:e=>e.x,y:e=>e.y};function t_(e){const t=e.split("."),s=[];let n="";for(const i of t)n+=i,n.endsWith("\\")?n=n.slice(0,-1)+".":(s.push(n),n="");return s}function e_(e){const t=t_(e);return s=>{for(const n of t){if(n==="")break;s=s&&s[n]}return s}}function ms(e,t){return(Zc[t]||(Zc[t]=e_(t)))(e)}function Za(e){return e.charAt(0).toUpperCase()+e.slice(1)}const si=e=>typeof e<"u",gs=e=>typeof e=="function",tu=(e,t)=>{if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0};function s_(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const pt=Math.PI,xt=2*pt,n_=xt+pt,kr=Number.POSITIVE_INFINITY,i_=pt/180,Et=pt/2,ks=pt/4,eu=pt*2/3,as=Math.log10,Fe=Math.sign;function Kn(e,t,s){return Math.abs(e-t)<s}function su(e){const t=Math.round(e);e=Kn(e,t,e/1e3)?t:e;const s=Math.pow(10,Math.floor(as(e))),n=e/s;return(n<=1?1:n<=2?2:n<=5?5:10)*s}function r_(e){const t=[],s=Math.sqrt(e);let n;for(n=1;n<s;n++)e%n===0&&(t.push(n),t.push(e/n));return s===(s|0)&&t.push(s),t.sort((i,r)=>i-r).pop(),t}function o_(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function dn(e){return!o_(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function a_(e,t){const s=Math.round(e);return s-t<=e&&s+t>=e}function gf(e,t,s){let n,i,r;for(n=0,i=e.length;n<i;n++)r=e[n][s],isNaN(r)||(t.min=Math.min(t.min,r),t.max=Math.max(t.max,r))}function ke(e){return e*(pt/180)}function tl(e){return e*(180/pt)}function nu(e){if(!Pt(e))return;let t=1,s=0;for(;Math.round(e*t)/t!==e;)t*=10,s++;return s}function bf(e,t){const s=t.x-e.x,n=t.y-e.y,i=Math.sqrt(s*s+n*n);let r=Math.atan2(n,s);return r<-.5*pt&&(r+=xt),{angle:r,distance:i}}function ha(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function l_(e,t){return(e-t+n_)%xt-pt}function $t(e){return(e%xt+xt)%xt}function ni(e,t,s,n){const i=$t(e),r=$t(t),o=$t(s),a=$t(r-i),l=$t(o-i),c=$t(i-r),u=$t(i-o);return i===r||i===o||n&&r===o||a>l&&c<u}function jt(e,t,s){return Math.max(t,Math.min(s,e))}function c_(e){return jt(e,-32768,32767)}function Ye(e,t,s,n=1e-6){return e>=Math.min(t,s)-n&&e<=Math.max(t,s)+n}function el(e,t,s){s=s||(o=>e[o]<t);let n=e.length-1,i=0,r;for(;n-i>1;)r=i+n>>1,s(r)?i=r:n=r;return{lo:i,hi:n}}const Ge=(e,t,s,n)=>el(e,s,n?i=>{const r=e[i][t];return r<s||r===s&&e[i+1][t]===s}:i=>e[i][t]<s),u_=(e,t,s)=>el(e,s,n=>e[n][t]>=s);function d_(e,t,s){let n=0,i=e.length;for(;n<i&&e[n]<t;)n++;for(;i>n&&e[i-1]>s;)i--;return n>0||i<e.length?e.slice(n,i):e}const yf=["push","pop","shift","splice","unshift"];function h_(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),yf.forEach(s=>{const n="_onData"+Za(s),i=e[s];Object.defineProperty(e,s,{configurable:!0,enumerable:!1,value(...r){const o=i.apply(this,r);return e._chartjs.listeners.forEach(a=>{typeof a[n]=="function"&&a[n](...r)}),o}})})}function iu(e,t){const s=e._chartjs;if(!s)return;const n=s.listeners,i=n.indexOf(t);i!==-1&&n.splice(i,1),!(n.length>0)&&(yf.forEach(r=>{delete e[r]}),delete e._chartjs)}function xf(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const vf=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();function _f(e,t){let s=[],n=!1;return function(...i){s=i,n||(n=!0,vf.call(window,()=>{n=!1,e.apply(t,s)}))}}function f_(e,t){let s;return function(...n){return t?(clearTimeout(s),s=setTimeout(e,t,n)):e.apply(this,n),t}}const sl=e=>e==="start"?"left":e==="end"?"right":"center",Wt=(e,t,s)=>e==="start"?t:e==="end"?s:(t+s)/2,p_=(e,t,s,n)=>e===(n?"left":"right")?s:e==="center"?(t+s)/2:t;function wf(e,t,s){const n=t.length;let i=0,r=n;if(e._sorted){const{iScale:o,vScale:a,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=o.axis,{min:d,max:h,minDefined:f,maxDefined:p}=o.getUserBounds();if(f){if(i=Math.min(Ge(l,u,d).lo,s?n:Ge(t,u,o.getPixelForValue(d)).lo),c){const m=l.slice(0,i+1).reverse().findIndex(g=>!lt(g[a.axis]));i-=Math.max(0,m)}i=jt(i,0,n-1)}if(p){let m=Math.max(Ge(l,o.axis,h,!0).hi+1,s?0:Ge(t,u,o.getPixelForValue(h),!0).hi+1);if(c){const g=l.slice(m-1).findIndex(b=>!lt(b[a.axis]));m+=Math.max(0,g)}r=jt(m,i,n)-i}else r=n-i}return{start:i,count:r}}function Sf(e){const{xScale:t,yScale:s,_scaleRanges:n}=e,i={xmin:t.min,xmax:t.max,ymin:s.min,ymax:s.max};if(!n)return e._scaleRanges=i,!0;const r=n.xmin!==t.min||n.xmax!==t.max||n.ymin!==s.min||n.ymax!==s.max;return Object.assign(n,i),r}const Bi=e=>e===0||e===1,ru=(e,t,s)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*xt/s)),ou=(e,t,s)=>Math.pow(2,-10*e)*Math.sin((e-t)*xt/s)+1,Yn={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(pt*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=>Bi(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=>Bi(e)?e:ru(e,.075,.3),easeOutElastic:e=>Bi(e)?e:ou(e,.075,.3),easeInOutElastic(e){return Bi(e)?e:e<.5?.5*ru(e*2,.1125,.45):.5+.5*ou(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-Yn.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?Yn.easeInBounce(e*2)*.5:Yn.easeOutBounce(e*2-1)*.5+.5};function nl(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function au(e){return nl(e)?e:new ti(e)}function So(e){return nl(e)?e:new ti(e).saturate(.5).darken(.1).hexString()}const m_=["x","y","borderWidth","radius","tension"],g_=["color","borderColor","backgroundColor"];function b_(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:g_},numbers:{type:"number",properties:m_}}),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 y_(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const lu=new Map;function x_(e,t){t=t||{};const s=e+JSON.stringify(t);let n=lu.get(s);return n||(n=new Intl.NumberFormat(e,t),lu.set(s,n)),n}function gi(e,t,s){return x_(t,s).format(e)}const kf={values(e){return _t(e)?e:""+e},numeric(e,t,s){if(e===0)return"0";const n=this.chart.options.locale;let i,r=e;if(s.length>1){const c=Math.max(Math.abs(s[0].value),Math.abs(s[s.length-1].value));(c<1e-4||c>1e15)&&(i="scientific"),r=v_(e,s)}const o=as(Math.abs(r)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:i,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),gi(e,n,l)},logarithmic(e,t,s){if(e===0)return"0";const n=s[t].significand||e/Math.pow(10,Math.floor(as(e)));return[1,2,3,5,10,15].includes(n)||t>.8*s.length?kf.numeric.call(this,e,t,s):""}};function v_(e,t){let s=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(s)>=1&&e!==Math.floor(e)&&(s=e-Math.floor(e)),s}var Ur={formatters:kf};function __(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,s)=>s.lineWidth,tickColor:(t,s)=>s.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:Ur.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 Ws=Object.create(null),fa=Object.create(null);function Gn(e,t){if(!t)return e;const s=t.split(".");for(let n=0,i=s.length;n<i;++n){const r=s[n];e=e[r]||(e[r]=Object.create(null))}return e}function ko(e,t,s){return typeof t=="string"?ei(Gn(e,t),s):ei(Gn(e,""),t)}class w_{constructor(t,s){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=n=>n.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=(n,i)=>So(i.backgroundColor),this.hoverBorderColor=(n,i)=>So(i.borderColor),this.hoverColor=(n,i)=>So(i.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(s)}set(t,s){return ko(this,t,s)}get(t){return Gn(this,t)}describe(t,s){return ko(fa,t,s)}override(t,s){return ko(Ws,t,s)}route(t,s,n,i){const r=Gn(this,t),o=Gn(this,n),a="_"+s;Object.defineProperties(r,{[a]:{value:r[s],writable:!0},[s]:{enumerable:!0,get(){const l=this[a],c=o[i];return ut(l)?Object.assign({},c,l):nt(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(s=>s(this))}}var wt=new w_({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[b_,y_,__]);function S_(e){return!e||lt(e.size)||lt(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Rr(e,t,s,n,i){let r=t[i];return r||(r=t[i]=e.measureText(i).width,s.push(i)),r>n&&(n=r),n}function k_(e,t,s,n){n=n||{};let i=n.data=n.data||{},r=n.garbageCollect=n.garbageCollect||[];n.font!==t&&(i=n.data={},r=n.garbageCollect=[],n.font=t),e.save(),e.font=t;let o=0;const a=s.length;let l,c,u,d,h;for(l=0;l<a;l++)if(d=s[l],d!=null&&!_t(d))o=Rr(e,i,r,o,d);else if(_t(d))for(c=0,u=d.length;c<u;c++)h=d[c],h!=null&&!_t(h)&&(o=Rr(e,i,r,o,h));e.restore();const f=r.length/2;if(f>s.length){for(l=0;l<f;l++)delete i[r[l]];r.splice(0,f)}return o}function Rs(e,t,s){const n=e.currentDevicePixelRatio,i=s!==0?Math.max(s/2,.5):0;return Math.round((t-i)*n)/n+i}function cu(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function pa(e,t,s,n){Rf(e,t,s,n,null)}function Rf(e,t,s,n,i){let r,o,a,l,c,u,d,h;const f=t.pointStyle,p=t.rotation,m=t.radius;let g=(p||0)*i_;if(f&&typeof f=="object"&&(r=f.toString(),r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]")){e.save(),e.translate(s,n),e.rotate(g),e.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),e.restore();return}if(!(isNaN(m)||m<=0)){switch(e.beginPath(),f){default:i?e.ellipse(s,n,i/2,m,0,0,xt):e.arc(s,n,m,0,xt),e.closePath();break;case"triangle":u=i?i/2:m,e.moveTo(s+Math.sin(g)*u,n-Math.cos(g)*m),g+=eu,e.lineTo(s+Math.sin(g)*u,n-Math.cos(g)*m),g+=eu,e.lineTo(s+Math.sin(g)*u,n-Math.cos(g)*m),e.closePath();break;case"rectRounded":c=m*.516,l=m-c,o=Math.cos(g+ks)*l,d=Math.cos(g+ks)*(i?i/2-c:l),a=Math.sin(g+ks)*l,h=Math.sin(g+ks)*(i?i/2-c:l),e.arc(s-d,n-a,c,g-pt,g-Et),e.arc(s+h,n-o,c,g-Et,g),e.arc(s+d,n+a,c,g,g+Et),e.arc(s-h,n+o,c,g+Et,g+pt),e.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*m,u=i?i/2:l,e.rect(s-u,n-l,2*u,2*l);break}g+=ks;case"rectRot":d=Math.cos(g)*(i?i/2:m),o=Math.cos(g)*m,a=Math.sin(g)*m,h=Math.sin(g)*(i?i/2:m),e.moveTo(s-d,n-a),e.lineTo(s+h,n-o),e.lineTo(s+d,n+a),e.lineTo(s-h,n+o),e.closePath();break;case"crossRot":g+=ks;case"cross":d=Math.cos(g)*(i?i/2:m),o=Math.cos(g)*m,a=Math.sin(g)*m,h=Math.sin(g)*(i?i/2:m),e.moveTo(s-d,n-a),e.lineTo(s+d,n+a),e.moveTo(s+h,n-o),e.lineTo(s-h,n+o);break;case"star":d=Math.cos(g)*(i?i/2:m),o=Math.cos(g)*m,a=Math.sin(g)*m,h=Math.sin(g)*(i?i/2:m),e.moveTo(s-d,n-a),e.lineTo(s+d,n+a),e.moveTo(s+h,n-o),e.lineTo(s-h,n+o),g+=ks,d=Math.cos(g)*(i?i/2:m),o=Math.cos(g)*m,a=Math.sin(g)*m,h=Math.sin(g)*(i?i/2:m),e.moveTo(s-d,n-a),e.lineTo(s+d,n+a),e.moveTo(s+h,n-o),e.lineTo(s-h,n+o);break;case"line":o=i?i/2:Math.cos(g)*m,a=Math.sin(g)*m,e.moveTo(s-o,n-a),e.lineTo(s+o,n+a);break;case"dash":e.moveTo(s,n),e.lineTo(s+Math.cos(g)*(i?i/2:m),n+Math.sin(g)*m);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function Xe(e,t,s){return s=s||.5,!t||e&&e.x>t.left-s&&e.x<t.right+s&&e.y>t.top-s&&e.y<t.bottom+s}function Wr(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function $r(e){e.restore()}function R_(e,t,s,n,i){if(!t)return e.lineTo(s.x,s.y);if(i==="middle"){const r=(t.x+s.x)/2;e.lineTo(r,t.y),e.lineTo(r,s.y)}else i==="after"!=!!n?e.lineTo(t.x,s.y):e.lineTo(s.x,t.y);e.lineTo(s.x,s.y)}function P_(e,t,s,n){if(!t)return e.lineTo(s.x,s.y);e.bezierCurveTo(n?t.cp1x:t.cp2x,n?t.cp1y:t.cp2y,n?s.cp2x:s.cp1x,n?s.cp2y:s.cp1y,s.x,s.y)}function E_(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),lt(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function C_(e,t,s,n,i){if(i.strikethrough||i.underline){const r=e.measureText(n),o=t-r.actualBoundingBoxLeft,a=t+r.actualBoundingBoxRight,l=s-r.actualBoundingBoxAscent,c=s+r.actualBoundingBoxDescent,u=i.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(o,u),e.lineTo(a,u),e.stroke()}}function O_(e,t){const s=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=s}function $s(e,t,s,n,i,r={}){const o=_t(t)?t:[t],a=r.strokeWidth>0&&r.strokeColor!=="";let l,c;for(e.save(),e.font=i.string,E_(e,r),l=0;l<o.length;++l)c=o[l],r.backdrop&&O_(e,r.backdrop),a&&(r.strokeColor&&(e.strokeStyle=r.strokeColor),lt(r.strokeWidth)||(e.lineWidth=r.strokeWidth),e.strokeText(c,s,n,r.maxWidth)),e.fillText(c,s,n,r.maxWidth),C_(e,s,n,c,r),n+=Number(i.lineHeight);e.restore()}function ii(e,t){const{x:s,y:n,w:i,h:r,radius:o}=t;e.arc(s+o.topLeft,n+o.topLeft,o.topLeft,1.5*pt,pt,!0),e.lineTo(s,n+r-o.bottomLeft),e.arc(s+o.bottomLeft,n+r-o.bottomLeft,o.bottomLeft,pt,Et,!0),e.lineTo(s+i-o.bottomRight,n+r),e.arc(s+i-o.bottomRight,n+r-o.bottomRight,o.bottomRight,Et,0,!0),e.lineTo(s+i,n+o.topRight),e.arc(s+i-o.topRight,n+o.topRight,o.topRight,0,-Et,!0),e.lineTo(s+o.topLeft,n)}const T_=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,M_=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function A_(e,t){const s=(""+e).match(T_);if(!s||s[1]==="normal")return t*1.2;switch(e=+s[2],s[3]){case"px":return e;case"%":e/=100;break}return t*e}const L_=e=>+e||0;function il(e,t){const s={},n=ut(t),i=n?Object.keys(t):t,r=ut(e)?n?o=>nt(e[o],e[t[o]]):o=>e[o]:()=>e;for(const o of i)s[o]=L_(r(o));return s}function Pf(e){return il(e,{top:"y",right:"x",bottom:"y",left:"x"})}function js(e){return il(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Yt(e){const t=Pf(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Nt(e,t){e=e||{},t=t||wt.font;let s=nt(e.size,t.size);typeof s=="string"&&(s=parseInt(s,10));let n=nt(e.style,t.style);n&&!(""+n).match(M_)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const i={family:nt(e.family,t.family),lineHeight:A_(nt(e.lineHeight,t.lineHeight),s),size:s,style:n,weight:nt(e.weight,t.weight),string:""};return i.string=S_(i),i}function Bn(e,t,s,n){let i,r,o;for(i=0,r=e.length;i<r;++i)if(o=e[i],o!==void 0&&o!==void 0)return o}function D_(e,t,s){const{min:n,max:i}=e,r=pf(t,(i-n)/2),o=(a,l)=>s&&a===0?0:a+l;return{min:o(n,-Math.abs(r)),max:o(i,r)}}function bs(e,t){return Object.assign(Object.create(e),t)}function rl(e,t=[""],s,n,i=()=>e[0]){const r=s||e;typeof n>"u"&&(n=Tf("_fallback",e));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:r,_fallback:n,_getTarget:i,override:a=>rl([a,...e],t,r,n)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return Cf(a,l,()=>H_(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return du(a).includes(l)},ownKeys(a){return du(a)},set(a,l,c){const u=a._storage||(a._storage=i());return a[l]=u[l]=c,delete a._keys,!0}})}function hn(e,t,s,n){const i={_cacheable:!1,_proxy:e,_context:t,_subProxy:s,_stack:new Set,_descriptors:Ef(e,n),setContext:r=>hn(e,r,s,n),override:r=>hn(e.override(r),t,s,n)};return new Proxy(i,{deleteProperty(r,o){return delete r[o],delete e[o],!0},get(r,o,a){return Cf(r,o,()=>F_(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(e,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,o)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(r,o){return Reflect.has(e,o)},ownKeys(){return Reflect.ownKeys(e)},set(r,o,a){return e[o]=a,delete r[o],!0}})}function Ef(e,t={scriptable:!0,indexable:!0}){const{_scriptable:s=t.scriptable,_indexable:n=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:s,indexable:n,isScriptable:gs(s)?s:()=>s,isIndexable:gs(n)?n:()=>n}}const N_=(e,t)=>e?e+Za(t):t,ol=(e,t)=>ut(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Cf(e,t,s){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const n=s();return e[t]=n,n}function F_(e,t,s){const{_proxy:n,_context:i,_subProxy:r,_descriptors:o}=e;let a=n[t];return gs(a)&&o.isScriptable(t)&&(a=I_(t,a,e,s)),_t(a)&&a.length&&(a=j_(t,a,e,o.isIndexable)),ol(t,a)&&(a=hn(a,i,r&&r[t],o)),a}function I_(e,t,s,n){const{_proxy:i,_context:r,_subProxy:o,_stack:a}=s;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(r,o||n);return a.delete(e),ol(e,l)&&(l=al(i._scopes,i,e,l)),l}function j_(e,t,s,n){const{_proxy:i,_context:r,_subProxy:o,_descriptors:a}=s;if(typeof r.index<"u"&&n(e))return t[r.index%t.length];if(ut(t[0])){const l=t,c=i._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=al(c,i,e,u);t.push(hn(d,r,o&&o[e],a))}}return t}function Of(e,t,s){return gs(e)?e(t,s):e}const B_=(e,t)=>e===!0?t:typeof e=="string"?ms(t,e):void 0;function V_(e,t,s,n,i){for(const r of t){const o=B_(s,r);if(o){e.add(o);const a=Of(o._fallback,s,i);if(typeof a<"u"&&a!==s&&a!==n)return a}else if(o===!1&&typeof n<"u"&&s!==n)return null}return!1}function al(e,t,s,n){const i=t._rootScopes,r=Of(t._fallback,s,n),o=[...e,...i],a=new Set;a.add(n);let l=uu(a,o,s,r||s,n);return l===null||typeof r<"u"&&r!==s&&(l=uu(a,o,r,l,n),l===null)?!1:rl(Array.from(a),[""],i,r,()=>z_(t,s,n))}function uu(e,t,s,n,i){for(;s;)s=V_(e,t,s,n,i);return s}function z_(e,t,s){const n=e._getTarget();t in n||(n[t]={});const i=n[t];return _t(i)&&ut(s)?s:i||{}}function H_(e,t,s,n){let i;for(const r of t)if(i=Tf(N_(r,e),s),typeof i<"u")return ol(e,i)?al(s,n,e,i):i}function Tf(e,t){for(const s of t){if(!s)continue;const n=s[e];if(typeof n<"u")return n}}function du(e){let t=e._keys;return t||(t=e._keys=U_(e._scopes)),t}function U_(e){const t=new Set;for(const s of e)for(const n of Object.keys(s).filter(i=>!i.startsWith("_")))t.add(n);return Array.from(t)}function Mf(e,t,s,n){const{iScale:i}=e,{key:r="r"}=this._parsing,o=new Array(n);let a,l,c,u;for(a=0,l=n;a<l;++a)c=a+s,u=t[c],o[a]={r:i.parse(ms(u,r),c)};return o}const W_=Number.EPSILON||1e-14,fn=(e,t)=>t<e.length&&!e[t].skip&&e[t],Af=e=>e==="x"?"y":"x";function $_(e,t,s,n){const i=e.skip?t:e,r=t,o=s.skip?t:s,a=ha(r,i),l=ha(o,r);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=n*c,h=n*u;return{previous:{x:r.x-d*(o.x-i.x),y:r.y-d*(o.y-i.y)},next:{x:r.x+h*(o.x-i.x),y:r.y+h*(o.y-i.y)}}}function q_(e,t,s){const n=e.length;let i,r,o,a,l,c=fn(e,0);for(let u=0;u<n-1;++u)if(l=c,c=fn(e,u+1),!(!l||!c)){if(Kn(t[u],0,W_)){s[u]=s[u+1]=0;continue}i=s[u]/t[u],r=s[u+1]/t[u],a=Math.pow(i,2)+Math.pow(r,2),!(a<=9)&&(o=3/Math.sqrt(a),s[u]=i*o*t[u],s[u+1]=r*o*t[u])}}function K_(e,t,s="x"){const n=Af(s),i=e.length;let r,o,a,l=fn(e,0);for(let c=0;c<i;++c){if(o=a,a=l,l=fn(e,c+1),!a)continue;const u=a[s],d=a[n];o&&(r=(u-o[s])/3,a[`cp1${s}`]=u-r,a[`cp1${n}`]=d-r*t[c]),l&&(r=(l[s]-u)/3,a[`cp2${s}`]=u+r,a[`cp2${n}`]=d+r*t[c])}}function Y_(e,t="x"){const s=Af(t),n=e.length,i=Array(n).fill(0),r=Array(n);let o,a,l,c=fn(e,0);for(o=0;o<n;++o)if(a=l,l=c,c=fn(e,o+1),!!l){if(c){const u=c[t]-l[t];i[o]=u!==0?(c[s]-l[s])/u:0}r[o]=a?c?Fe(i[o-1])!==Fe(i[o])?0:(i[o-1]+i[o])/2:i[o-1]:i[o]}q_(e,i,r),K_(e,r,t)}function Vi(e,t,s){return Math.max(Math.min(e,s),t)}function G_(e,t){let s,n,i,r,o,a=Xe(e[0],t);for(s=0,n=e.length;s<n;++s)o=r,r=a,a=s<n-1&&Xe(e[s+1],t),r&&(i=e[s],o&&(i.cp1x=Vi(i.cp1x,t.left,t.right),i.cp1y=Vi(i.cp1y,t.top,t.bottom)),a&&(i.cp2x=Vi(i.cp2x,t.left,t.right),i.cp2y=Vi(i.cp2y,t.top,t.bottom)))}function X_(e,t,s,n,i){let r,o,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Y_(e,i);else{let c=n?e[e.length-1]:e[0];for(r=0,o=e.length;r<o;++r)a=e[r],l=$_(c,a,e[Math.min(r+1,o-(n?0:1))%o],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&G_(e,s)}function ll(){return typeof window<"u"&&typeof document<"u"}function cl(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Pr(e,t,s){let n;return typeof e=="string"?(n=parseInt(e,10),e.indexOf("%")!==-1&&(n=n/100*t.parentNode[s])):n=e,n}const qr=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function Q_(e,t){return qr(e).getPropertyValue(t)}const J_=["top","right","bottom","left"];function Bs(e,t,s){const n={};s=s?"-"+s:"";for(let i=0;i<4;i++){const r=J_[i];n[r]=parseFloat(e[t+"-"+r+s])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const Z_=(e,t,s)=>(e>0||t>0)&&(!s||!s.shadowRoot);function tw(e,t){const s=e.touches,n=s&&s.length?s[0]:e,{offsetX:i,offsetY:r}=n;let o=!1,a,l;if(Z_(i,r,e.target))a=i,l=r;else{const c=t.getBoundingClientRect();a=n.clientX-c.left,l=n.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function Cs(e,t){if("native"in e)return e;const{canvas:s,currentDevicePixelRatio:n}=t,i=qr(s),r=i.boxSizing==="border-box",o=Bs(i,"padding"),a=Bs(i,"border","width"),{x:l,y:c,box:u}=tw(e,s),d=o.left+(u&&a.left),h=o.top+(u&&a.top);let{width:f,height:p}=t;return r&&(f-=o.width+a.width,p-=o.height+a.height),{x:Math.round((l-d)/f*s.width/n),y:Math.round((c-h)/p*s.height/n)}}function ew(e,t,s){let n,i;if(t===void 0||s===void 0){const r=e&&cl(e);if(!r)t=e.clientWidth,s=e.clientHeight;else{const o=r.getBoundingClientRect(),a=qr(r),l=Bs(a,"border","width"),c=Bs(a,"padding");t=o.width-c.width-l.width,s=o.height-c.height-l.height,n=Pr(a.maxWidth,r,"clientWidth"),i=Pr(a.maxHeight,r,"clientHeight")}}return{width:t,height:s,maxWidth:n||kr,maxHeight:i||kr}}const ls=e=>Math.round(e*10)/10;function sw(e,t,s,n){const i=qr(e),r=Bs(i,"margin"),o=Pr(i.maxWidth,e,"clientWidth")||kr,a=Pr(i.maxHeight,e,"clientHeight")||kr,l=ew(e,t,s);let{width:c,height:u}=l;if(i.boxSizing==="content-box"){const h=Bs(i,"border","width"),f=Bs(i,"padding");c-=f.width+h.width,u-=f.height+h.height}return c=Math.max(0,c-r.width),u=Math.max(0,n?c/n:u-r.height),c=ls(Math.min(c,o,l.maxWidth)),u=ls(Math.min(u,a,l.maxHeight)),c&&!u&&(u=ls(c/2)),(t!==void 0||s!==void 0)&&n&&l.height&&u>l.height&&(u=l.height,c=ls(Math.floor(u*n))),{width:c,height:u}}function hu(e,t,s){const n=t||1,i=ls(e.height*n),r=ls(e.width*n);e.height=ls(e.height),e.width=ls(e.width);const o=e.canvas;return o.style&&(s||!o.style.height&&!o.style.width)&&(o.style.height=`${e.height}px`,o.style.width=`${e.width}px`),e.currentDevicePixelRatio!==n||o.height!==i||o.width!==r?(e.currentDevicePixelRatio=n,o.height=i,o.width=r,e.ctx.setTransform(n,0,0,n,0,0),!0):!1}const nw=(function(){let e=!1;try{const t={get passive(){return e=!0,!1}};ll()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();function fu(e,t){const s=Q_(e,t),n=s&&s.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Os(e,t,s,n){return{x:e.x+s*(t.x-e.x),y:e.y+s*(t.y-e.y)}}function iw(e,t,s,n){return{x:e.x+s*(t.x-e.x),y:n==="middle"?s<.5?e.y:t.y:n==="after"?s<1?e.y:t.y:s>0?t.y:e.y}}function rw(e,t,s,n){const i={x:e.cp2x,y:e.cp2y},r={x:t.cp1x,y:t.cp1y},o=Os(e,i,s),a=Os(i,r,s),l=Os(r,t,s),c=Os(o,a,s),u=Os(a,l,s);return Os(c,u,s)}const ow=function(e,t){return{x(s){return e+e+t-s},setWidth(s){t=s},textAlign(s){return s==="center"?s:s==="right"?"left":"right"},xPlus(s,n){return s-n},leftForLtr(s,n){return s-n}}},aw=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function on(e,t,s){return e?ow(t,s):aw()}function Lf(e,t){let s,n;(t==="ltr"||t==="rtl")&&(s=e.canvas.style,n=[s.getPropertyValue("direction"),s.getPropertyPriority("direction")],s.setProperty("direction",t,"important"),e.prevTextDirection=n)}function Df(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function Nf(e){return e==="angle"?{between:ni,compare:l_,normalize:$t}:{between:Ye,compare:(t,s)=>t-s,normalize:t=>t}}function pu({start:e,end:t,count:s,loop:n,style:i}){return{start:e%s,end:t%s,loop:n&&(t-e+1)%s===0,style:i}}function lw(e,t,s){const{property:n,start:i,end:r}=s,{between:o,normalize:a}=Nf(n),l=t.length;let{start:c,end:u,loop:d}=e,h,f;if(d){for(c+=l,u+=l,h=0,f=l;h<f&&o(a(t[c%l][n]),i,r);++h)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:e.style}}function Ff(e,t,s){if(!s)return[e];const{property:n,start:i,end:r}=s,o=t.length,{compare:a,between:l,normalize:c}=Nf(n),{start:u,end:d,loop:h,style:f}=lw(e,t,s),p=[];let m=!1,g=null,b,x,w;const v=()=>l(i,w,b)&&a(i,w)!==0,S=()=>a(r,b)===0||l(r,w,b),P=()=>m||v(),R=()=>!m||S();for(let _=u,C=u;_<=d;++_)x=t[_%o],!x.skip&&(b=c(x[n]),b!==w&&(m=l(b,i,r),g===null&&P()&&(g=a(b,i)===0?_:C),g!==null&&R()&&(p.push(pu({start:g,end:_,loop:h,count:o,style:f})),g=null),C=_,w=b));return g!==null&&p.push(pu({start:g,end:d,loop:h,count:o,style:f})),p}function If(e,t){const s=[],n=e.segments;for(let i=0;i<n.length;i++){const r=Ff(n[i],e.points,t);r.length&&s.push(...r)}return s}function cw(e,t,s,n){let i=0,r=t-1;if(s&&!n)for(;i<t&&!e[i].skip;)i++;for(;i<t&&e[i].skip;)i++;for(i%=t,s&&(r+=i);r>i&&e[r%t].skip;)r--;return r%=t,{start:i,end:r}}function uw(e,t,s,n){const i=e.length,r=[];let o=t,a=e[t],l;for(l=t+1;l<=s;++l){const c=e[l%i];c.skip||c.stop?a.skip||(n=!1,r.push({start:t%i,end:(l-1)%i,loop:n}),t=o=c.stop?l:null):(o=l,a.skip&&(t=l)),a=c}return o!==null&&r.push({start:t%i,end:o%i,loop:n}),r}function dw(e,t){const s=e.points,n=e.options.spanGaps,i=s.length;if(!i)return[];const r=!!e._loop,{start:o,end:a}=cw(s,i,r,n);if(n===!0)return mu(e,[{start:o,end:a,loop:r}],s,t);const l=a<o?a+i:a,c=!!e._fullLoop&&o===0&&a===i-1;return mu(e,uw(s,o,l,c),s,t)}function mu(e,t,s,n){return!n||!n.setContext||!s?t:hw(e,t,s,n)}function hw(e,t,s,n){const i=e._chart.getContext(),r=gu(e.options),{_datasetIndex:o,options:{spanGaps:a}}=e,l=s.length,c=[];let u=r,d=t[0].start,h=d;function f(p,m,g,b){const x=a?-1:1;if(p!==m){for(p+=l;s[p%l].skip;)p-=x;for(;s[m%l].skip;)m+=x;p%l!==m%l&&(c.push({start:p%l,end:m%l,loop:g,style:b}),u=b,d=m%l)}}for(const p of t){d=a?d:p.start;let m=s[d%l],g;for(h=d+1;h<=p.end;h++){const b=s[h%l];g=gu(n.setContext(bs(i,{type:"segment",p0:m,p1:b,p0DataIndex:(h-1)%l,p1DataIndex:h%l,datasetIndex:o}))),fw(g,u)&&f(d,h-1,p.loop,u),m=b,u=g}d<h-1&&f(d,h-1,p.loop,u)}return c}function gu(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function fw(e,t){if(!t)return!1;const s=[],n=function(i,r){return nl(r)?(s.includes(r)||s.push(r),s.indexOf(r)):r};return JSON.stringify(e,n)!==JSON.stringify(t,n)}function zi(e,t,s){return e.options.clip?e[s]:t[s]}function pw(e,t){const{xScale:s,yScale:n}=e;return s&&n?{left:zi(s,t,"left"),right:zi(s,t,"right"),top:zi(n,t,"top"),bottom:zi(n,t,"bottom")}:t}function jf(e,t){const s=t._clip;if(s.disabled)return!1;const n=pw(t,e.chartArea);return{left:s.left===!1?0:n.left-(s.left===!0?0:s.left),right:s.right===!1?e.width:n.right+(s.right===!0?0:s.right),top:s.top===!1?0:n.top-(s.top===!0?0:s.top),bottom:s.bottom===!1?e.height:n.bottom+(s.bottom===!0?0:s.bottom)}}class mw{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,s,n,i){const r=s.listeners[i],o=s.duration;r.forEach(a=>a({chart:t,initial:s.initial,numSteps:o,currentStep:Math.min(n-s.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=vf.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let s=0;this._charts.forEach((n,i)=>{if(!n.running||!n.items.length)return;const r=n.items;let o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>n.duration&&(n.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(i.draw(),this._notify(i,n,t,"progress")),r.length||(n.running=!1,this._notify(i,n,t,"complete"),n.initial=!1),s+=r.length}),this._lastDate=t,s===0&&(this._running=!1)}_getAnims(t){const s=this._charts;let n=s.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},s.set(t,n)),n}listen(t,s,n){this._getAnims(t).listeners[s].push(n)}add(t,s){!s||!s.length||this._getAnims(t).items.push(...s)}has(t){return this._getAnims(t).items.length>0}start(t){const s=this._charts.get(t);s&&(s.running=!0,s.start=Date.now(),s.duration=s.items.reduce((n,i)=>Math.max(n,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const s=this._charts.get(t);return!(!s||!s.running||!s.items.length)}stop(t){const s=this._charts.get(t);if(!s||!s.items.length)return;const n=s.items;let i=n.length-1;for(;i>=0;--i)n[i].cancel();s.items=[],this._notify(t,s,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Ue=new mw;const bu="transparent",gw={boolean(e,t,s){return s>.5?t:e},color(e,t,s){const n=au(e||bu),i=n.valid&&au(t||bu);return i&&i.valid?i.mix(n,s).hexString():t},number(e,t,s){return e+(t-e)*s}};class bw{constructor(t,s,n,i){const r=s[n];i=Bn([t.to,i,r,t.from]);const o=Bn([t.from,r,i]);this._active=!0,this._fn=t.fn||gw[t.type||typeof o],this._easing=Yn[t.easing]||Yn.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=s,this._prop=n,this._from=o,this._to=i,this._promises=void 0}active(){return this._active}update(t,s,n){if(this._active){this._notify(!1);const i=this._target[this._prop],r=n-this._start,o=this._duration-r;this._start=n,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Bn([t.to,s,i,t.from]),this._from=Bn([t.from,i,s])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const s=t-this._start,n=this._duration,i=this._prop,r=this._from,o=this._loop,a=this._to;let l;if(this._active=r!==a&&(o||s<n),!this._active){this._target[i]=a,this._notify(!0);return}if(s<0){this._target[i]=r;return}l=s/n%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(r,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((s,n)=>{t.push({res:s,rej:n})})}_notify(t){const s=t?"res":"rej",n=this._promises||[];for(let i=0;i<n.length;i++)n[i][s]()}}class Bf{constructor(t,s){this._chart=t,this._properties=new Map,this.configure(s)}configure(t){if(!ut(t))return;const s=Object.keys(wt.animation),n=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const r=t[i];if(!ut(r))return;const o={};for(const a of s)o[a]=r[a];(_t(r.properties)&&r.properties||[i]).forEach(a=>{(a===i||!n.has(a))&&n.set(a,o)})})}_animateOptions(t,s){const n=s.options,i=xw(t,n);if(!i)return[];const r=this._createAnimations(i,n);return n.$shared&&yw(t.options.$animations,n).then(()=>{t.options=n},()=>{}),r}_createAnimations(t,s){const n=this._properties,i=[],r=t.$animations||(t.$animations={}),o=Object.keys(s),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){i.push(...this._animateOptions(t,s));continue}const u=s[c];let d=r[c];const h=n.get(c);if(d)if(h&&d.active()){d.update(h,u,a);continue}else d.cancel();if(!h||!h.duration){t[c]=u;continue}r[c]=d=new bw(h,t,c,u),i.push(d)}return i}update(t,s){if(this._properties.size===0){Object.assign(t,s);return}const n=this._createAnimations(t,s);if(n.length)return Ue.add(this._chart,n),!0}}function yw(e,t){const s=[],n=Object.keys(t);for(let i=0;i<n.length;i++){const r=e[n[i]];r&&r.active()&&s.push(r.wait())}return Promise.all(s)}function xw(e,t){if(!t)return;let s=e.options;if(!s){e.options=t;return}return s.$shared&&(e.options=s=Object.assign({},s,{$shared:!1,$animations:{}})),s}function yu(e,t){const s=e&&e.options||{},n=s.reverse,i=s.min===void 0?t:0,r=s.max===void 0?t:0;return{start:n?r:i,end:n?i:r}}function vw(e,t,s){if(s===!1)return!1;const n=yu(e,s),i=yu(t,s);return{top:i.end,right:n.end,bottom:i.start,left:n.start}}function _w(e){let t,s,n,i;return ut(e)?(t=e.top,s=e.right,n=e.bottom,i=e.left):t=s=n=i=e,{top:t,right:s,bottom:n,left:i,disabled:e===!1}}function Vf(e,t){const s=[],n=e._getSortedDatasetMetas(t);let i,r;for(i=0,r=n.length;i<r;++i)s.push(n[i].index);return s}function xu(e,t,s,n={}){const i=e.keys,r=n.mode==="single";let o,a,l,c;if(t===null)return;let u=!1;for(o=0,a=i.length;o<a;++o){if(l=+i[o],l===s){if(u=!0,n.all)continue;break}c=e.values[l],Pt(c)&&(r||t===0||Fe(t)===Fe(c))&&(t+=c)}return!u&&!n.all?0:t}function ww(e,t){const{iScale:s,vScale:n}=t,i=s.axis==="x"?"x":"y",r=n.axis==="x"?"x":"y",o=Object.keys(e),a=new Array(o.length);let l,c,u;for(l=0,c=o.length;l<c;++l)u=o[l],a[l]={[i]:u,[r]:e[u]};return a}function Ro(e,t){const s=e&&e.options.stacked;return s||s===void 0&&t.stack!==void 0}function Sw(e,t,s){return`${e.id}.${t.id}.${s.stack||s.type}`}function kw(e){const{min:t,max:s,minDefined:n,maxDefined:i}=e.getUserBounds();return{min:n?t:Number.NEGATIVE_INFINITY,max:i?s:Number.POSITIVE_INFINITY}}function Rw(e,t,s){const n=e[t]||(e[t]={});return n[s]||(n[s]={})}function vu(e,t,s,n){for(const i of t.getMatchingVisibleMetas(n).reverse()){const r=e[i.index];if(s&&r>0||!s&&r<0)return i.index}return null}function _u(e,t){const{chart:s,_cachedMeta:n}=e,i=s._stacks||(s._stacks={}),{iScale:r,vScale:o,index:a}=n,l=r.axis,c=o.axis,u=Sw(r,o,n),d=t.length;let h;for(let f=0;f<d;++f){const p=t[f],{[l]:m,[c]:g}=p,b=p._stacks||(p._stacks={});h=b[c]=Rw(i,u,m),h[a]=g,h._top=vu(h,o,!0,n.type),h._bottom=vu(h,o,!1,n.type);const x=h._visualValues||(h._visualValues={});x[a]=g}}function Po(e,t){const s=e.scales;return Object.keys(s).filter(n=>s[n].axis===t).shift()}function Pw(e,t){return bs(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Ew(e,t,s){return bs(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:s,index:t,mode:"default",type:"data"})}function Mn(e,t){const s=e.controller.index,n=e.vScale&&e.vScale.axis;if(n){t=t||e._parsed;for(const i of t){const r=i._stacks;if(!r||r[n]===void 0||r[n][s]===void 0)return;delete r[n][s],r[n]._visualValues!==void 0&&r[n]._visualValues[s]!==void 0&&delete r[n]._visualValues[s]}}}const Eo=e=>e==="reset"||e==="none",wu=(e,t)=>t?e:Object.assign({},e),Cw=(e,t,s)=>e&&!t.hidden&&t._stacked&&{keys:Vf(s,!0),values:null};class ys{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,s){this.chart=t,this._ctx=t.ctx,this.index=s,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=Ro(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&&Mn(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,s=this._cachedMeta,n=this.getDataset(),i=(d,h,f,p)=>d==="x"?h:d==="r"?p:f,r=s.xAxisID=nt(n.xAxisID,Po(t,"x")),o=s.yAxisID=nt(n.yAxisID,Po(t,"y")),a=s.rAxisID=nt(n.rAxisID,Po(t,"r")),l=s.indexAxis,c=s.iAxisID=i(l,r,o,a),u=s.vAxisID=i(l,o,r,a);s.xScale=this.getScaleForId(r),s.yScale=this.getScaleForId(o),s.rScale=this.getScaleForId(a),s.iScale=this.getScaleForId(c),s.vScale=this.getScaleForId(u)}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 s=this._cachedMeta;return t===s.iScale?s.vScale:s.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&iu(this._data,this),t._stacked&&Mn(t)}_dataCheck(){const t=this.getDataset(),s=t.data||(t.data=[]),n=this._data;if(ut(s)){const i=this._cachedMeta;this._data=ww(s,i)}else if(n!==s){if(n){iu(n,this);const i=this._cachedMeta;Mn(i),i._parsed=[]}s&&Object.isExtensible(s)&&h_(s,this),this._syncList=[],this._data=s}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const s=this._cachedMeta,n=this.getDataset();let i=!1;this._dataCheck();const r=s._stacked;s._stacked=Ro(s.vScale,s),s.stack!==n.stack&&(i=!0,Mn(s),s.stack=n.stack),this._resyncElements(t),(i||r!==s._stacked)&&(_u(this,s._parsed),s._stacked=Ro(s.vScale,s))}configure(){const t=this.chart.config,s=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),s,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,s){const{_cachedMeta:n,_data:i}=this,{iScale:r,_stacked:o}=n,a=r.axis;let l=t===0&&s===i.length?!0:n._sorted,c=t>0&&n._parsed[t-1],u,d,h;if(this._parsing===!1)n._parsed=i,n._sorted=!0,h=i;else{_t(i[t])?h=this.parseArrayData(n,i,t,s):ut(i[t])?h=this.parseObjectData(n,i,t,s):h=this.parsePrimitiveData(n,i,t,s);const f=()=>d[a]===null||c&&d[a]<c[a];for(u=0;u<s;++u)n._parsed[u+t]=d=h[u],l&&(f()&&(l=!1),c=d);n._sorted=l}o&&_u(this,h)}parsePrimitiveData(t,s,n,i){const{iScale:r,vScale:o}=t,a=r.axis,l=o.axis,c=r.getLabels(),u=r===o,d=new Array(i);let h,f,p;for(h=0,f=i;h<f;++h)p=h+n,d[h]={[a]:u||r.parse(c[p],p),[l]:o.parse(s[p],p)};return d}parseArrayData(t,s,n,i){const{xScale:r,yScale:o}=t,a=new Array(i);let l,c,u,d;for(l=0,c=i;l<c;++l)u=l+n,d=s[u],a[l]={x:r.parse(d[0],u),y:o.parse(d[1],u)};return a}parseObjectData(t,s,n,i){const{xScale:r,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(i);let u,d,h,f;for(u=0,d=i;u<d;++u)h=u+n,f=s[h],c[u]={x:r.parse(ms(f,a),h),y:o.parse(ms(f,l),h)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,s,n){const i=this.chart,r=this._cachedMeta,o=s[t.axis],a={keys:Vf(i,!0),values:s._stacks[t.axis]._visualValues};return xu(a,o,r.index,{mode:n})}updateRangeFromParsed(t,s,n,i){const r=n[s.axis];let o=r===null?NaN:r;const a=i&&n._stacks[s.axis];i&&a&&(i.values=a,o=xu(i,r,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,s){const n=this._cachedMeta,i=n._parsed,r=n._sorted&&t===n.iScale,o=i.length,a=this._getOtherScale(t),l=Cw(s,n,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=kw(a);let h,f;function p(){f=i[h];const m=f[a.axis];return!Pt(f[t.axis])||u>m||d<m}for(h=0;h<o&&!(!p()&&(this.updateRangeFromParsed(c,t,f,l),r));++h);if(r){for(h=o-1;h>=0;--h)if(!p()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const s=this._cachedMeta._parsed,n=[];let i,r,o;for(i=0,r=s.length;i<r;++i)o=s[i][t.axis],Pt(o)&&n.push(o);return n}getMaxOverflow(){return!1}getLabelAndValue(t){const s=this._cachedMeta,n=s.iScale,i=s.vScale,r=this.getParsed(t);return{label:n?""+n.getLabelForValue(r[n.axis]):"",value:i?""+i.getLabelForValue(r[i.axis]):""}}_update(t){const s=this._cachedMeta;this.update(t||"default"),s._clip=_w(nt(this.options.clip,vw(s.xScale,s.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,s=this.chart,n=this._cachedMeta,i=n.data||[],r=s.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||i.length-a,c=this.options.drawActiveElementsOnTop;let u;for(n.dataset&&n.dataset.draw(t,r,a,l),u=a;u<a+l;++u){const d=i[u];d.hidden||(d.active&&c?o.push(d):d.draw(t,r))}for(u=0;u<o.length;++u)o[u].draw(t,r)}getStyle(t,s){const n=s?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,s,n){const i=this.getDataset();let r;if(t>=0&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];r=o.$context||(o.$context=Ew(this.getContext(),t,o)),r.parsed=this.getParsed(t),r.raw=i.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=Pw(this.chart.getContext(),this.index)),r.dataset=i,r.index=r.datasetIndex=this.index;return r.active=!!s,r.mode=n,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,s){return this._resolveElementOptions(this.dataElementType.id,s,t)}_resolveElementOptions(t,s="default",n){const i=s==="active",r=this._cachedDataOpts,o=t+"-"+s,a=r[o],l=this.enableOptionSharing&&si(n);if(a)return wu(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=i?[`${t}Hover`,"hover",t,""]:[t,""],h=c.getOptionScopes(this.getDataset(),u),f=Object.keys(wt.elements[t]),p=()=>this.getContext(n,i,s),m=c.resolveNamedOptions(h,f,p,d);return m.$shared&&(m.$shared=l,r[o]=Object.freeze(wu(m,l))),m}_resolveAnimations(t,s,n){const i=this.chart,r=this._cachedDataOpts,o=`animation-${s}`,a=r[o];if(a)return a;let l;if(i.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,s),h=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(h,this.getContext(t,n,s))}const c=new Bf(i,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,s){return!s||Eo(t)||this.chart._animationsDisabled}_getSharedOptions(t,s){const n=this.resolveDataElementOptions(t,s),i=this._sharedOptions,r=this.getSharedOptions(n),o=this.includeOptions(s,r)||r!==i;return this.updateSharedOptions(r,s,n),{sharedOptions:r,includeOptions:o}}updateElement(t,s,n,i){Eo(i)?Object.assign(t,n):this._resolveAnimations(s,i).update(t,n)}updateSharedOptions(t,s,n){t&&!Eo(s)&&this._resolveAnimations(void 0,s).update(t,n)}_setStyle(t,s,n,i){t.active=i;const r=this.getStyle(s,i);this._resolveAnimations(s,n,i).update(t,{options:!i&&this.getSharedOptions(r)||r})}removeHoverStyle(t,s,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,s,n){this._setStyle(t,n,"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 s=this._data,n=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const i=n.length,r=s.length,o=Math.min(r,i);o&&this.parse(0,o),r>i?this._insertElements(i,r-i,t):r<i&&this._removeElements(r,i-r)}_insertElements(t,s,n=!0){const i=this._cachedMeta,r=i.data,o=t+s;let a;const l=c=>{for(c.length+=s,a=c.length-1;a>=o;a--)c[a]=c[a-s]};for(l(r),a=t;a<o;++a)r[a]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,s),n&&this.updateElements(r,t,s,"reset")}updateElements(t,s,n,i){}_removeElements(t,s){const n=this._cachedMeta;if(this._parsing){const i=n._parsed.splice(t,s);n._stacked&&Mn(n,i)}n.data.splice(t,s)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[s,n,i]=t;this[s](n,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,s){s&&this._sync(["_removeElements",t,s]);const n=arguments.length-2;n&&this._sync(["_insertElements",t,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function Ow(e,t){if(!e._cache.$bar){const s=e.getMatchingVisibleMetas(t);let n=[];for(let i=0,r=s.length;i<r;i++)n=n.concat(s[i].controller.getAllParsedValues(e));e._cache.$bar=xf(n.sort((i,r)=>i-r))}return e._cache.$bar}function Tw(e){const t=e.iScale,s=Ow(t,e.type);let n=t._length,i,r,o,a;const l=()=>{o===32767||o===-32768||(si(a)&&(n=Math.min(n,Math.abs(o-a)||n)),a=o)};for(i=0,r=s.length;i<r;++i)o=t.getPixelForValue(s[i]),l();for(a=void 0,i=0,r=t.ticks.length;i<r;++i)o=t.getPixelForTick(i),l();return n}function Mw(e,t,s,n){const i=s.barThickness;let r,o;return lt(i)?(r=t.min*s.categoryPercentage,o=s.barPercentage):(r=i*n,o=1),{chunk:r/n,ratio:o,start:t.pixels[e]-r/2}}function Aw(e,t,s,n){const i=t.pixels,r=i[e];let o=e>0?i[e-1]:null,a=e<i.length-1?i[e+1]:null;const l=s.categoryPercentage;o===null&&(o=r-(a===null?t.end-t.start:a-r)),a===null&&(a=r+r-o);const c=r-(r-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/n,ratio:s.barPercentage,start:c}}function Lw(e,t,s,n){const i=s.parse(e[0],n),r=s.parse(e[1],n),o=Math.min(i,r),a=Math.max(i,r);let l=o,c=a;Math.abs(o)>Math.abs(a)&&(l=a,c=o),t[s.axis]=c,t._custom={barStart:l,barEnd:c,start:i,end:r,min:o,max:a}}function zf(e,t,s,n){return _t(e)?Lw(e,t,s,n):t[s.axis]=s.parse(e,n),t}function Su(e,t,s,n){const i=e.iScale,r=e.vScale,o=i.getLabels(),a=i===r,l=[];let c,u,d,h;for(c=s,u=s+n;c<u;++c)h=t[c],d={},d[i.axis]=a||i.parse(o[c],c),l.push(zf(h,d,r,c));return l}function Co(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function Dw(e,t,s){return e!==0?Fe(e):(t.isHorizontal()?1:-1)*(t.min>=s?1:-1)}function Nw(e){let t,s,n,i,r;return e.horizontal?(t=e.base>e.x,s="left",n="right"):(t=e.base<e.y,s="bottom",n="top"),t?(i="end",r="start"):(i="start",r="end"),{start:s,end:n,reverse:t,top:i,bottom:r}}function Fw(e,t,s,n){let i=t.borderSkipped;const r={};if(!i){e.borderSkipped=r;return}if(i===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:a,reverse:l,top:c,bottom:u}=Nw(e);i==="middle"&&s&&(e.enableBorderRadius=!0,(s._top||0)===n?i=c:(s._bottom||0)===n?i=u:(r[ku(u,o,a,l)]=!0,i=c)),r[ku(i,o,a,l)]=!0,e.borderSkipped=r}function ku(e,t,s,n){return n?(e=Iw(e,t,s),e=Ru(e,s,t)):e=Ru(e,t,s),e}function Iw(e,t,s){return e===t?s:e===s?t:e}function Ru(e,t,s){return e==="start"?t:e==="end"?s:e}function jw(e,{inflateAmount:t},s){e.inflateAmount=t==="auto"?s===1?.33:0:t}class Bw extends ys{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,s,n,i){return Su(t,s,n,i)}parseArrayData(t,s,n,i){return Su(t,s,n,i)}parseObjectData(t,s,n,i){const{iScale:r,vScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=r.axis==="x"?a:l,u=o.axis==="x"?a:l,d=[];let h,f,p,m;for(h=n,f=n+i;h<f;++h)m=s[h],p={},p[r.axis]=r.parse(ms(m,c),h),d.push(zf(ms(m,u),p,o,h));return d}updateRangeFromParsed(t,s,n,i){super.updateRangeFromParsed(t,s,n,i);const r=n._custom;r&&s===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const s=this._cachedMeta,{iScale:n,vScale:i}=s,r=this.getParsed(t),o=r._custom,a=Co(o)?"["+o.start+", "+o.end+"]":""+i.getLabelForValue(r[i.axis]);return{label:""+n.getLabelForValue(r[n.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const s=this._cachedMeta;this.updateElements(s.data,0,s.data.length,t)}updateElements(t,s,n,i){const r=i==="reset",{index:o,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:h}=this._getSharedOptions(s,i);for(let f=s;f<s+n;f++){const p=this.getParsed(f),m=r||lt(p[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),g=this._calculateBarIndexPixels(f,u),b=(p._stacks||{})[a.axis],x={horizontal:c,base:m.base,enableBorderRadius:!b||Co(p._custom)||o===b._top||o===b._bottom,x:c?m.head:g.center,y:c?g.center:m.head,height:c?g.size:Math.abs(m.size),width:c?Math.abs(m.size):g.size};h&&(x.options=d||this.resolveDataElementOptions(f,t[f].active?"active":i));const w=x.options||t[f].options;Fw(x,w,b,o),jw(x,w,u.ratio),this.updateElement(t[f],f,x,i)}}_getStacks(t,s){const{iScale:n}=this._cachedMeta,i=n.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),r=n.options.stacked,o=[],a=this._cachedMeta.controller.getParsed(s),l=a&&a[n.axis],c=u=>{const d=u._parsed.find(f=>f[n.axis]===l),h=d&&d[u.vScale.axis];if(lt(h)||isNaN(h))return!0};for(const u of i)if(!(s!==void 0&&c(u))&&((r===!1||o.indexOf(u.stack)===-1||r===void 0&&u.stack===void 0)&&o.push(u.stack),u.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,s=this.chart.options.indexAxis;return Object.keys(t).filter(n=>t[n].axis===s).shift()}_getAxis(){const t={},s=this.getFirstScaleIdForIndexAxis();for(const n of this.chart.data.datasets)t[nt(this.chart.options.indexAxis==="x"?n.xAxisID:n.yAxisID,s)]=!0;return Object.keys(t)}_getStackIndex(t,s,n){const i=this._getStacks(t,n),r=s!==void 0?i.indexOf(s):-1;return r===-1?i.length-1:r}_getRuler(){const t=this.options,s=this._cachedMeta,n=s.iScale,i=[];let r,o;for(r=0,o=s.data.length;r<o;++r)i.push(n.getPixelForValue(this.getParsed(r)[n.axis],r));const a=t.barThickness;return{min:a||Tw(s),pixels:i,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:s,_stacked:n,index:i},options:{base:r,minBarLength:o}}=this,a=r||0,l=this.getParsed(t),c=l._custom,u=Co(c);let d=l[s.axis],h=0,f=n?this.applyStack(s,l,n):d,p,m;f!==d&&(h=f-d,f=d),u&&(d=c.barStart,f=c.barEnd-c.barStart,d!==0&&Fe(d)!==Fe(c.barEnd)&&(h=0),h+=d);const g=!lt(r)&&!u?r:h;let b=s.getPixelForValue(g);if(this.chart.getDataVisibility(t)?p=s.getPixelForValue(h+f):p=b,m=p-b,Math.abs(m)<o){m=Dw(m,s,a)*o,d===a&&(b-=m/2);const x=s.getPixelForDecimal(0),w=s.getPixelForDecimal(1),v=Math.min(x,w),S=Math.max(x,w);b=Math.max(Math.min(b,S),v),p=b+m,n&&!u&&(l._stacks[s.axis]._visualValues[i]=s.getValueForPixel(p)-s.getValueForPixel(b))}if(b===s.getPixelForValue(a)){const x=Fe(m)*s.getLineWidthForValue(a)/2;b+=x,m-=x}return{size:m,base:b,head:p,center:p+m/2}}_calculateBarIndexPixels(t,s){const n=s.scale,i=this.options,r=i.skipNull,o=nt(i.maxBarThickness,1/0);let a,l;const c=this._getAxisCount();if(s.grouped){const u=r?this._getStackCount(t):s.stackCount,d=i.barThickness==="flex"?Aw(t,s,i,u*c):Mw(t,s,i,u*c),h=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,f=this._getAxis().indexOf(nt(h,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0)+f;a=d.start+d.chunk*p+d.chunk/2,l=Math.min(o,d.chunk*d.ratio)}else a=n.getPixelForValue(this.getParsed(t)[n.axis],t),l=Math.min(o,s.min*s.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,s=t.vScale,n=t.data,i=n.length;let r=0;for(;r<i;++r)this.getParsed(r)[s.axis]!==null&&!n[r].hidden&&n[r].draw(this._ctx)}}class Vw extends ys{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,s,n,i){const r=super.parsePrimitiveData(t,s,n,i);for(let o=0;o<r.length;o++)r[o]._custom=this.resolveDataElementOptions(o+n).radius;return r}parseArrayData(t,s,n,i){const r=super.parseArrayData(t,s,n,i);for(let o=0;o<r.length;o++){const a=s[n+o];r[o]._custom=nt(a[2],this.resolveDataElementOptions(o+n).radius)}return r}parseObjectData(t,s,n,i){const r=super.parseObjectData(t,s,n,i);for(let o=0;o<r.length;o++){const a=s[n+o];r[o]._custom=nt(a&&a.r&&+a.r,this.resolveDataElementOptions(o+n).radius)}return r}getMaxOverflow(){const t=this._cachedMeta.data;let s=0;for(let n=t.length-1;n>=0;--n)s=Math.max(s,t[n].size(this.resolveDataElementOptions(n))/2);return s>0&&s}getLabelAndValue(t){const s=this._cachedMeta,n=this.chart.data.labels||[],{xScale:i,yScale:r}=s,o=this.getParsed(t),a=i.getLabelForValue(o.x),l=r.getLabelForValue(o.y),c=o._custom;return{label:n[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const s=this._cachedMeta.data;this.updateElements(s,0,s.length,t)}updateElements(t,s,n,i){const r=i==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(s,i),u=o.axis,d=a.axis;for(let h=s;h<s+n;h++){const f=t[h],p=!r&&this.getParsed(h),m={},g=m[u]=r?o.getPixelForDecimal(.5):o.getPixelForValue(p[u]),b=m[d]=r?a.getBasePixel():a.getPixelForValue(p[d]);m.skip=isNaN(g)||isNaN(b),c&&(m.options=l||this.resolveDataElementOptions(h,f.active?"active":i),r&&(m.options.radius=0)),this.updateElement(f,h,m,i)}}resolveDataElementOptions(t,s){const n=this.getParsed(t);let i=super.resolveDataElementOptions(t,s);i.$shared&&(i=Object.assign({},i,{$shared:!1}));const r=i.radius;return s!=="active"&&(i.radius=0),i.radius+=nt(n&&n._custom,r),i}}function zw(e,t,s){let n=1,i=1,r=0,o=0;if(t<xt){const a=e,l=a+t,c=Math.cos(a),u=Math.sin(a),d=Math.cos(l),h=Math.sin(l),f=(w,v,S)=>ni(w,a,l,!0)?1:Math.max(v,v*s,S,S*s),p=(w,v,S)=>ni(w,a,l,!0)?-1:Math.min(v,v*s,S,S*s),m=f(0,c,d),g=f(Et,u,h),b=p(pt,c,d),x=p(pt+Et,u,h);n=(m-b)/2,i=(g-x)/2,r=-(m+b)/2,o=-(g+x)/2}return{ratioX:n,ratioY:i,offsetX:r,offsetY:o}}class ul extends ys{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const s=t.data,{labels:{pointStyle:n,textAlign:i,color:r,useBorderRadius:o,borderRadius:a}}=t.legend.options;return s.labels.length&&s.datasets.length?s.labels.map((l,c)=>{const d=t.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:d.backgroundColor,fontColor:r,hidden:!t.getDataVisibility(c),lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:d.borderWidth,strokeStyle:d.borderColor,textAlign:i,pointStyle:n,borderRadius:o&&(a||d.borderRadius),index:c}}):[]}},onClick(t,s,n){n.chart.toggleDataVisibility(s.index),n.chart.update()}}}};constructor(t,s){super(t,s),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,s){const n=this.getDataset().data,i=this._cachedMeta;if(this._parsing===!1)i._parsed=n;else{let r=l=>+n[l];if(ut(n[t])){const{key:l="value"}=this._parsing;r=c=>+ms(n[c],l)}let o,a;for(o=t,a=t+s;o<a;++o)i._parsed[o]=r(o)}}_getRotation(){return ke(this.options.rotation-90)}_getCircumference(){return ke(this.options.circumference)}_getRotationExtents(){let t=xt,s=-xt;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){const i=this.chart.getDatasetMeta(n).controller,r=i._getRotation(),o=i._getCircumference();t=Math.min(t,r),s=Math.max(s,r+o)}return{rotation:t,circumference:s-t}}update(t){const s=this.chart,{chartArea:n}=s,i=this._cachedMeta,r=i.data,o=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,a=Math.max((Math.min(n.width,n.height)-o)/2,0),l=Math.min(Qv(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:h,ratioY:f,offsetX:p,offsetY:m}=zw(d,u,l),g=(n.width-o)/h,b=(n.height-o)/f,x=Math.max(Math.min(g,b)/2,0),w=pf(this.options.radius,x),v=Math.max(w*l,0),S=(w-v)/this._getVisibleDatasetWeightTotal();this.offsetX=p*w,this.offsetY=m*w,i.total=this.calculateTotal(),this.outerRadius=w-S*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-S*c,0),this.updateElements(r,0,r.length,t)}_circumference(t,s){const n=this.options,i=this._cachedMeta,r=this._getCircumference();return s&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||i._parsed[t]===null||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*r/xt)}updateElements(t,s,n,i){const r=i==="reset",o=this.chart,a=o.chartArea,c=o.options.animation,u=(a.left+a.right)/2,d=(a.top+a.bottom)/2,h=r&&c.animateScale,f=h?0:this.innerRadius,p=h?0:this.outerRadius,{sharedOptions:m,includeOptions:g}=this._getSharedOptions(s,i);let b=this._getRotation(),x;for(x=0;x<s;++x)b+=this._circumference(x,r);for(x=s;x<s+n;++x){const w=this._circumference(x,r),v=t[x],S={x:u+this.offsetX,y:d+this.offsetY,startAngle:b,endAngle:b+w,circumference:w,outerRadius:p,innerRadius:f};g&&(S.options=m||this.resolveDataElementOptions(x,v.active?"active":i)),b+=w,this.updateElement(v,x,S,i)}}calculateTotal(){const t=this._cachedMeta,s=t.data;let n=0,i;for(i=0;i<s.length;i++){const r=t._parsed[i];r!==null&&!isNaN(r)&&this.chart.getDataVisibility(i)&&!s[i].hidden&&(n+=Math.abs(r))}return n}calculateCircumference(t){const s=this._cachedMeta.total;return s>0&&!isNaN(t)?xt*(Math.abs(t)/s):0}getLabelAndValue(t){const s=this._cachedMeta,n=this.chart,i=n.data.labels||[],r=gi(s._parsed[t],n.options.locale);return{label:i[t]||"",value:r}}getMaxBorderWidth(t){let s=0;const n=this.chart;let i,r,o,a,l;if(!t){for(i=0,r=n.data.datasets.length;i<r;++i)if(n.isDatasetVisible(i)){o=n.getDatasetMeta(i),t=o.data,a=o.controller;break}}if(!t)return 0;for(i=0,r=t.length;i<r;++i)l=a.resolveDataElementOptions(i),l.borderAlign!=="inner"&&(s=Math.max(s,l.borderWidth||0,l.hoverBorderWidth||0));return s}getMaxOffset(t){let s=0;for(let n=0,i=t.length;n<i;++n){const r=this.resolveDataElementOptions(n);s=Math.max(s,r.offset||0,r.hoverOffset||0)}return s}_getRingWeightOffset(t){let s=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(s+=this._getRingWeight(n));return s}_getRingWeight(t){return Math.max(nt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class Hf extends ys{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const s=this._cachedMeta,{dataset:n,data:i=[],_dataset:r}=s,o=this.chart._animationsDisabled;let{start:a,count:l}=wf(s,i,o);this._drawStart=a,this._drawCount=l,Sf(s)&&(a=0,l=i.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!r._decimated,n.points=i;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(n,void 0,{animated:!o,options:c},t),this.updateElements(i,a,l,t)}updateElements(t,s,n,i){const r=i==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(s,i),h=o.axis,f=a.axis,{spanGaps:p,segment:m}=this.options,g=dn(p)?p:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||r||i==="none",x=s+n,w=t.length;let v=s>0&&this.getParsed(s-1);for(let S=0;S<w;++S){const P=t[S],R=b?P:{};if(S<s||S>=x){R.skip=!0;continue}const _=this.getParsed(S),C=lt(_[f]),N=R[h]=o.getPixelForValue(_[h],S),j=R[f]=r||C?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,_,l):_[f],S);R.skip=isNaN(N)||isNaN(j)||C,R.stop=S>0&&Math.abs(_[h]-v[h])>g,m&&(R.parsed=_,R.raw=c.data[S]),d&&(R.options=u||this.resolveDataElementOptions(S,P.active?"active":i)),b||this.updateElement(P,S,R,i),v=_}}getMaxOverflow(){const t=this._cachedMeta,s=t.dataset,n=s.options&&s.options.borderWidth||0,i=t.data||[];if(!i.length)return n;const r=i[0].size(this.resolveDataElementOptions(0)),o=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(n,r,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class Uf extends ys{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const s=t.data;if(s.labels.length&&s.datasets.length){const{labels:{pointStyle:n,color:i}}=t.legend.options;return s.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,lineWidth:l.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,s,n){n.chart.toggleDataVisibility(s.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,s){super(t,s),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const s=this._cachedMeta,n=this.chart,i=n.data.labels||[],r=gi(s._parsed[t].r,n.options.locale);return{label:i[t]||"",value:r}}parseObjectData(t,s,n,i){return Mf.bind(this)(t,s,n,i)}update(t){const s=this._cachedMeta.data;this._updateRadius(),this.updateElements(s,0,s.length,t)}getMinMax(){const t=this._cachedMeta,s={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((n,i)=>{const r=this.getParsed(i).r;!isNaN(r)&&this.chart.getDataVisibility(i)&&(r<s.min&&(s.min=r),r>s.max&&(s.max=r))}),s}_updateRadius(){const t=this.chart,s=t.chartArea,n=t.options,i=Math.min(s.right-s.left,s.bottom-s.top),r=Math.max(i/2,0),o=Math.max(n.cutoutPercentage?r/100*n.cutoutPercentage:1,0),a=(r-o)/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,s,n,i){const r=i==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,h=c.getIndexAngle(0)-.5*pt;let f=h,p;const m=360/this.countVisibleElements();for(p=0;p<s;++p)f+=this._computeAngle(p,i,m);for(p=s;p<s+n;p++){const g=t[p];let b=f,x=f+this._computeAngle(p,i,m),w=o.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;f=x,r&&(l.animateScale&&(w=0),l.animateRotate&&(b=x=h));const v={x:u,y:d,innerRadius:0,outerRadius:w,startAngle:b,endAngle:x,options:this.resolveDataElementOptions(p,g.active?"active":i)};this.updateElement(g,p,v,i)}}countVisibleElements(){const t=this._cachedMeta;let s=0;return t.data.forEach((n,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&s++}),s}_computeAngle(t,s,n){return this.chart.getDataVisibility(t)?ke(this.resolveDataElementOptions(t,s).angle||n):0}}class Hw extends ul{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class Uw extends ys{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const s=this._cachedMeta.vScale,n=this.getParsed(t);return{label:s.getLabels()[t],value:""+s.getLabelForValue(n[s.axis])}}parseObjectData(t,s,n,i){return Mf.bind(this)(t,s,n,i)}update(t){const s=this._cachedMeta,n=s.dataset,i=s.data||[],r=s.iScale.getLabels();if(n.points=i,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:r.length===i.length,options:o};this.updateElement(n,void 0,a,t)}this.updateElements(i,0,i.length,t)}updateElements(t,s,n,i){const r=this._cachedMeta.rScale,o=i==="reset";for(let a=s;a<s+n;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":i),u=r.getPointPositionForValue(a,this.getParsed(a).r),d=o?r.xCenter:u.x,h=o?r.yCenter:u.y,f={x:d,y:h,angle:u.angle,skip:isNaN(d)||isNaN(h),options:c};this.updateElement(l,a,f,i)}}}class Ww extends ys{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const s=this._cachedMeta,n=this.chart.data.labels||[],{xScale:i,yScale:r}=s,o=this.getParsed(t),a=i.getLabelForValue(o.x),l=r.getLabelForValue(o.y);return{label:n[t]||"",value:"("+a+", "+l+")"}}update(t){const s=this._cachedMeta,{data:n=[]}=s,i=this.chart._animationsDisabled;let{start:r,count:o}=wf(s,n,i);if(this._drawStart=r,this._drawCount=o,Sf(s)&&(r=0,o=n.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=s;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=n;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!i,options:c},t)}else this.datasetElementType&&(delete s.dataset,this.datasetElementType=!1);this.updateElements(n,r,o,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,s,n,i){const r=i==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(s,i),d=this.getSharedOptions(u),h=this.includeOptions(i,d),f=o.axis,p=a.axis,{spanGaps:m,segment:g}=this.options,b=dn(m)?m:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||r||i==="none";let w=s>0&&this.getParsed(s-1);for(let v=s;v<s+n;++v){const S=t[v],P=this.getParsed(v),R=x?S:{},_=lt(P[p]),C=R[f]=o.getPixelForValue(P[f],v),N=R[p]=r||_?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,P,l):P[p],v);R.skip=isNaN(C)||isNaN(N)||_,R.stop=v>0&&Math.abs(P[f]-w[f])>b,g&&(R.parsed=P,R.raw=c.data[v]),h&&(R.options=d||this.resolveDataElementOptions(v,S.active?"active":i)),x||this.updateElement(S,v,R,i),w=P}this.updateSharedOptions(d,i,u)}getMaxOverflow(){const t=this._cachedMeta,s=t.data||[];if(!this.options.showLine){let a=0;for(let l=s.length-1;l>=0;--l)a=Math.max(a,s[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const n=t.dataset,i=n.options&&n.options.borderWidth||0;if(!s.length)return i;const r=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,o)/2}}var $w=Object.freeze({__proto__:null,BarController:Bw,BubbleController:Vw,DoughnutController:ul,LineController:Hf,PieController:Hw,PolarAreaController:Uf,RadarController:Uw,ScatterController:Ww});function Ps(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class dl{static override(t){Object.assign(dl.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Ps()}parse(){return Ps()}format(){return Ps()}add(){return Ps()}diff(){return Ps()}startOf(){return Ps()}endOf(){return Ps()}}var qw={_date:dl};function Kw(e,t,s,n){const{controller:i,data:r,_sorted:o}=e,a=i._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&o&&r.length){const c=a._reversePixels?u_:Ge;if(n){if(i._sharedOptions){const u=r[0],d=typeof u.getRange=="function"&&u.getRange(t);if(d){const h=c(r,t,s-d),f=c(r,t,s+d);return{lo:h.lo,hi:f.hi}}}}else{const u=c(r,t,s);if(l){const{vScale:d}=i._cachedMeta,{_parsed:h}=e,f=h.slice(0,u.lo+1).reverse().findIndex(m=>!lt(m[d.axis]));u.lo-=Math.max(0,f);const p=h.slice(u.hi).findIndex(m=>!lt(m[d.axis]));u.hi+=Math.max(0,p)}return u}}return{lo:0,hi:r.length-1}}function Kr(e,t,s,n,i){const r=e.getSortedVisibleDatasetMetas(),o=s[t];for(let a=0,l=r.length;a<l;++a){const{index:c,data:u}=r[a],{lo:d,hi:h}=Kw(r[a],t,o,i);for(let f=d;f<=h;++f){const p=u[f];p.skip||n(p,c,f)}}}function Yw(e){const t=e.indexOf("x")!==-1,s=e.indexOf("y")!==-1;return function(n,i){const r=t?Math.abs(n.x-i.x):0,o=s?Math.abs(n.y-i.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(o,2))}}function Oo(e,t,s,n,i){const r=[];return!i&&!e.isPointInArea(t)||Kr(e,s,t,function(a,l,c){!i&&!Xe(a,e.chartArea,0)||a.inRange(t.x,t.y,n)&&r.push({element:a,datasetIndex:l,index:c})},!0),r}function Gw(e,t,s,n){let i=[];function r(o,a,l){const{startAngle:c,endAngle:u}=o.getProps(["startAngle","endAngle"],n),{angle:d}=bf(o,{x:t.x,y:t.y});ni(d,c,u)&&i.push({element:o,datasetIndex:a,index:l})}return Kr(e,s,t,r),i}function Xw(e,t,s,n,i,r){let o=[];const a=Yw(s);let l=Number.POSITIVE_INFINITY;function c(u,d,h){const f=u.inRange(t.x,t.y,i);if(n&&!f)return;const p=u.getCenterPoint(i);if(!(!!r||e.isPointInArea(p))&&!f)return;const g=a(t,p);g<l?(o=[{element:u,datasetIndex:d,index:h}],l=g):g===l&&o.push({element:u,datasetIndex:d,index:h})}return Kr(e,s,t,c),o}function To(e,t,s,n,i,r){return!r&&!e.isPointInArea(t)?[]:s==="r"&&!n?Gw(e,t,s,i):Xw(e,t,s,n,i,r)}function Pu(e,t,s,n,i){const r=[],o=s==="x"?"inXRange":"inYRange";let a=!1;return Kr(e,s,t,(l,c,u)=>{l[o]&&l[o](t[s],i)&&(r.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,i))}),n&&!a?[]:r}var Qw={modes:{index(e,t,s,n){const i=Cs(t,e),r=s.axis||"x",o=s.includeInvisible||!1,a=s.intersect?Oo(e,i,r,n,o):To(e,i,r,!1,n,o),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,s,n){const i=Cs(t,e),r=s.axis||"xy",o=s.includeInvisible||!1;let a=s.intersect?Oo(e,i,r,n,o):To(e,i,r,!1,n,o);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(e,t,s,n){const i=Cs(t,e),r=s.axis||"xy",o=s.includeInvisible||!1;return Oo(e,i,r,n,o)},nearest(e,t,s,n){const i=Cs(t,e),r=s.axis||"xy",o=s.includeInvisible||!1;return To(e,i,r,s.intersect,n,o)},x(e,t,s,n){const i=Cs(t,e);return Pu(e,i,"x",s.intersect,n)},y(e,t,s,n){const i=Cs(t,e);return Pu(e,i,"y",s.intersect,n)}}};const Wf=["left","top","right","bottom"];function An(e,t){return e.filter(s=>s.pos===t)}function Eu(e,t){return e.filter(s=>Wf.indexOf(s.pos)===-1&&s.box.axis===t)}function Ln(e,t){return e.sort((s,n)=>{const i=t?n:s,r=t?s:n;return i.weight===r.weight?i.index-r.index:i.weight-r.weight})}function Jw(e){const t=[];let s,n,i,r,o,a;for(s=0,n=(e||[]).length;s<n;++s)i=e[s],{position:r,options:{stack:o,stackWeight:a=1}}=i,t.push({index:s,box:i,pos:r,horizontal:i.isHorizontal(),weight:i.weight,stack:o&&r+o,stackWeight:a});return t}function Zw(e){const t={};for(const s of e){const{stack:n,pos:i,stackWeight:r}=s;if(!n||!Wf.includes(i))continue;const o=t[n]||(t[n]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=r}return t}function tS(e,t){const s=Zw(e),{vBoxMaxWidth:n,hBoxMaxHeight:i}=t;let r,o,a;for(r=0,o=e.length;r<o;++r){a=e[r];const{fullSize:l}=a.box,c=s[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*n:l&&t.availableWidth,a.height=i):(a.width=n,a.height=u?u*i:l&&t.availableHeight)}return s}function eS(e){const t=Jw(e),s=Ln(t.filter(c=>c.box.fullSize),!0),n=Ln(An(t,"left"),!0),i=Ln(An(t,"right")),r=Ln(An(t,"top"),!0),o=Ln(An(t,"bottom")),a=Eu(t,"x"),l=Eu(t,"y");return{fullSize:s,leftAndTop:n.concat(r),rightAndBottom:i.concat(l).concat(o).concat(a),chartArea:An(t,"chartArea"),vertical:n.concat(i).concat(l),horizontal:r.concat(o).concat(a)}}function Cu(e,t,s,n){return Math.max(e[s],t[s])+Math.max(e[n],t[n])}function $f(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 sS(e,t,s,n){const{pos:i,box:r}=s,o=e.maxPadding;if(!ut(i)){s.size&&(e[i]-=s.size);const d=n[s.stack]||{size:0,count:1};d.size=Math.max(d.size,s.horizontal?r.height:r.width),s.size=d.size/d.count,e[i]+=s.size}r.getPadding&&$f(o,r.getPadding());const a=Math.max(0,t.outerWidth-Cu(o,e,"left","right")),l=Math.max(0,t.outerHeight-Cu(o,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,s.horizontal?{same:c,other:u}:{same:u,other:c}}function nS(e){const t=e.maxPadding;function s(n){const i=Math.max(t[n]-e[n],0);return e[n]+=i,i}e.y+=s("top"),e.x+=s("left"),s("right"),s("bottom")}function iS(e,t){const s=t.maxPadding;function n(i){const r={left:0,top:0,right:0,bottom:0};return i.forEach(o=>{r[o]=Math.max(t[o],s[o])}),r}return n(e?["left","right"]:["top","bottom"])}function Vn(e,t,s,n){const i=[];let r,o,a,l,c,u;for(r=0,o=e.length,c=0;r<o;++r){a=e[r],l=a.box,l.update(a.width||t.w,a.height||t.h,iS(a.horizontal,t));const{same:d,other:h}=sS(t,s,a,n);c|=d&&i.length,u=u||h,l.fullSize||i.push(a)}return c&&Vn(i,t,s,n)||u}function Hi(e,t,s,n,i){e.top=s,e.left=t,e.right=t+n,e.bottom=s+i,e.width=n,e.height=i}function Ou(e,t,s,n){const i=s.padding;let{x:r,y:o}=t;for(const a of e){const l=a.box,c=n[a.stack]||{placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*u,h=c.size||l.height;si(c.start)&&(o=c.start),l.fullSize?Hi(l,i.left,o,s.outerWidth-i.right-i.left,h):Hi(l,t.left+c.placed,o,d,h),c.start=o,c.placed+=d,o=l.bottom}else{const d=t.h*u,h=c.size||l.width;si(c.start)&&(r=c.start),l.fullSize?Hi(l,r,i.top,h,s.outerHeight-i.bottom-i.top):Hi(l,r,t.top+c.placed,h,d),c.start=r,c.placed+=d,r=l.right}}t.x=r,t.y=o}var Kt={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(s){t.draw(s)}}]},e.boxes.push(t)},removeBox(e,t){const s=e.boxes?e.boxes.indexOf(t):-1;s!==-1&&e.boxes.splice(s,1)},configure(e,t,s){t.fullSize=s.fullSize,t.position=s.position,t.weight=s.weight},update(e,t,s,n){if(!e)return;const i=Yt(e.options.layout.padding),r=Math.max(t-i.width,0),o=Math.max(s-i.height,0),a=eS(e.boxes),l=a.vertical,c=a.horizontal;mt(e.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=l.reduce((m,g)=>g.box.options&&g.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:s,padding:i,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/u,hBoxMaxHeight:o/2}),h=Object.assign({},i);$f(h,Yt(n));const f=Object.assign({maxPadding:h,w:r,h:o,x:i.left,y:i.top},i),p=tS(l.concat(c),d);Vn(a.fullSize,f,d,p),Vn(l,f,d,p),Vn(c,f,d,p)&&Vn(l,f,d,p),nS(f),Ou(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,Ou(a.rightAndBottom,f,d,p),e.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},mt(a.chartArea,m=>{const g=m.box;Object.assign(g,e.chartArea),g.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class qf{acquireContext(t,s){}releaseContext(t){return!1}addEventListener(t,s,n){}removeEventListener(t,s,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,s,n,i){return s=Math.max(0,s||t.width),n=n||t.height,{width:s,height:Math.max(0,i?Math.floor(s/i):n)}}isAttached(t){return!0}updateConfig(t){}}class rS extends qf{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const or="$chartjs",oS={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Tu=e=>e===null||e==="";function aS(e,t){const s=e.style,n=e.getAttribute("height"),i=e.getAttribute("width");if(e[or]={initial:{height:n,width:i,style:{display:s.display,height:s.height,width:s.width}}},s.display=s.display||"block",s.boxSizing=s.boxSizing||"border-box",Tu(i)){const r=fu(e,"width");r!==void 0&&(e.width=r)}if(Tu(n))if(e.style.height==="")e.height=e.width/(t||2);else{const r=fu(e,"height");r!==void 0&&(e.height=r)}return e}const Kf=nw?{passive:!0}:!1;function lS(e,t,s){e&&e.addEventListener(t,s,Kf)}function cS(e,t,s){e&&e.canvas&&e.canvas.removeEventListener(t,s,Kf)}function uS(e,t){const s=oS[e.type]||e.type,{x:n,y:i}=Cs(e,t);return{type:s,chart:t,native:e,x:n!==void 0?n:null,y:i!==void 0?i:null}}function Er(e,t){for(const s of e)if(s===t||s.contains(t))return!0}function dS(e,t,s){const n=e.canvas,i=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||Er(a.addedNodes,n),o=o&&!Er(a.removedNodes,n);o&&s()});return i.observe(document,{childList:!0,subtree:!0}),i}function hS(e,t,s){const n=e.canvas,i=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||Er(a.removedNodes,n),o=o&&!Er(a.addedNodes,n);o&&s()});return i.observe(document,{childList:!0,subtree:!0}),i}const ri=new Map;let Mu=0;function Yf(){const e=window.devicePixelRatio;e!==Mu&&(Mu=e,ri.forEach((t,s)=>{s.currentDevicePixelRatio!==e&&t()}))}function fS(e,t){ri.size||window.addEventListener("resize",Yf),ri.set(e,t)}function pS(e){ri.delete(e),ri.size||window.removeEventListener("resize",Yf)}function mS(e,t,s){const n=e.canvas,i=n&&cl(n);if(!i)return;const r=_f((a,l)=>{const c=i.clientWidth;s(a,l),c<i.clientWidth&&s()},window),o=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return o.observe(i),fS(e,r),o}function Mo(e,t,s){s&&s.disconnect(),t==="resize"&&pS(e)}function gS(e,t,s){const n=e.canvas,i=_f(r=>{e.ctx!==null&&s(uS(r,e))},e);return lS(n,t,i),i}class bS extends qf{acquireContext(t,s){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(aS(t,s),n):null}releaseContext(t){const s=t.canvas;if(!s[or])return!1;const n=s[or].initial;["height","width"].forEach(r=>{const o=n[r];lt(o)?s.removeAttribute(r):s.setAttribute(r,o)});const i=n.style||{};return Object.keys(i).forEach(r=>{s.style[r]=i[r]}),s.width=s.width,delete s[or],!0}addEventListener(t,s,n){this.removeEventListener(t,s);const i=t.$proxies||(t.$proxies={}),o={attach:dS,detach:hS,resize:mS}[s]||gS;i[s]=o(t,s,n)}removeEventListener(t,s){const n=t.$proxies||(t.$proxies={}),i=n[s];if(!i)return;({attach:Mo,detach:Mo,resize:Mo}[s]||cS)(t,s,i),n[s]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,s,n,i){return sw(t,s,n,i)}isAttached(t){const s=t&&cl(t);return!!(s&&s.isConnected)}}function yS(e){return!ll()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?rS:bS}class Je{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:s,y:n}=this.getProps(["x","y"],t);return{x:s,y:n}}hasValue(){return dn(this.x)&&dn(this.y)}getProps(t,s){const n=this.$animations;if(!s||!n)return this;const i={};return t.forEach(r=>{i[r]=n[r]&&n[r].active()?n[r]._to:this[r]}),i}}function xS(e,t){const s=e.options.ticks,n=vS(e),i=Math.min(s.maxTicksLimit||n,n),r=s.major.enabled?wS(t):[],o=r.length,a=r[0],l=r[o-1],c=[];if(o>i)return SS(t,c,r,o/i),c;const u=_S(r,t,i);if(o>0){let d,h;const f=o>1?Math.round((l-a)/(o-1)):null;for(Ui(t,c,u,lt(f)?0:a-f,a),d=0,h=o-1;d<h;d++)Ui(t,c,u,r[d],r[d+1]);return Ui(t,c,u,l,lt(f)?t.length:l+f),c}return Ui(t,c,u),c}function vS(e){const t=e.options.offset,s=e._tickSize(),n=e._length/s+(t?0:1),i=e._maxLength/s;return Math.floor(Math.min(n,i))}function _S(e,t,s){const n=kS(e),i=t.length/s;if(!n)return Math.max(i,1);const r=r_(n);for(let o=0,a=r.length-1;o<a;o++){const l=r[o];if(l>i)return l}return Math.max(i,1)}function wS(e){const t=[];let s,n;for(s=0,n=e.length;s<n;s++)e[s].major&&t.push(s);return t}function SS(e,t,s,n){let i=0,r=s[0],o;for(n=Math.ceil(n),o=0;o<e.length;o++)o===r&&(t.push(e[o]),i++,r=s[i*n])}function Ui(e,t,s,n,i){const r=nt(n,0),o=Math.min(nt(i,e.length),e.length);let a=0,l,c,u;for(s=Math.ceil(s),i&&(l=i-n,s=l/Math.floor(l/s)),u=r;u<0;)a++,u=Math.round(r+a*s);for(c=Math.max(r,0);c<o;c++)c===u&&(t.push(e[c]),a++,u=Math.round(r+a*s))}function kS(e){const t=e.length;let s,n;if(t<2)return!1;for(n=e[0],s=1;s<t;++s)if(e[s]-e[s-1]!==n)return!1;return n}const RS=e=>e==="left"?"right":e==="right"?"left":e,Au=(e,t,s)=>t==="top"||t==="left"?e[t]+s:e[t]-s,Lu=(e,t)=>Math.min(t||e,e);function Du(e,t){const s=[],n=e.length/t,i=e.length;let r=0;for(;r<i;r+=n)s.push(e[Math.floor(r)]);return s}function PS(e,t,s){const n=e.ticks.length,i=Math.min(t,n-1),r=e._startPixel,o=e._endPixel,a=1e-6;let l=e.getPixelForTick(i),c;if(!(s&&(n===1?c=Math.max(l-r,o-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(i-1))/2,l+=i<t?c:-c,l<r-a||l>o+a)))return l}function ES(e,t){mt(e,s=>{const n=s.gc,i=n.length/2;let r;if(i>t){for(r=0;r<i;++r)delete s.data[n[r]];n.splice(0,i)}})}function Dn(e){return e.drawTicks?e.tickLength:0}function Nu(e,t){if(!e.display)return 0;const s=Nt(e.font,t),n=Yt(e.padding);return(_t(e.text)?e.text.length:1)*s.lineHeight+n.height}function CS(e,t){return bs(e,{scale:t,type:"scale"})}function OS(e,t,s){return bs(e,{tick:s,index:t,type:"tick"})}function TS(e,t,s){let n=sl(e);return(s&&t!=="right"||!s&&t==="right")&&(n=RS(n)),n}function MS(e,t,s,n){const{top:i,left:r,bottom:o,right:a,chart:l}=e,{chartArea:c,scales:u}=l;let d=0,h,f,p;const m=o-i,g=a-r;if(e.isHorizontal()){if(f=Wt(n,r,a),ut(s)){const b=Object.keys(s)[0],x=s[b];p=u[b].getPixelForValue(x)+m-t}else s==="center"?p=(c.bottom+c.top)/2+m-t:p=Au(e,s,t);h=a-r}else{if(ut(s)){const b=Object.keys(s)[0],x=s[b];f=u[b].getPixelForValue(x)-g+t}else s==="center"?f=(c.left+c.right)/2-g+t:f=Au(e,s,t);p=Wt(n,o,i),d=s==="left"?-Et:Et}return{titleX:f,titleY:p,maxWidth:h,rotation:d}}class Ys extends Je{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,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._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,s){return t}getUserBounds(){let{_userMin:t,_userMax:s,_suggestedMin:n,_suggestedMax:i}=this;return t=ae(t,Number.POSITIVE_INFINITY),s=ae(s,Number.NEGATIVE_INFINITY),n=ae(n,Number.POSITIVE_INFINITY),i=ae(i,Number.NEGATIVE_INFINITY),{min:ae(t,n),max:ae(s,i),minDefined:Pt(t),maxDefined:Pt(s)}}getMinMax(t){let{min:s,max:n,minDefined:i,maxDefined:r}=this.getUserBounds(),o;if(i&&r)return{min:s,max:n};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)o=a[l].controller.getMinMax(this,t),i||(s=Math.min(s,o.min)),r||(n=Math.max(n,o.max));return s=r&&s>n?n:s,n=i&&s>n?s:n,{min:ae(s,ae(n,s)),max:ae(n,ae(s,n))}}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(){gt(this.options.beforeUpdate,[this])}update(t,s,n){const{beginAtZero:i,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=s,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=D_(this,r,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Du(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=xS(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,s,n;this.isHorizontal()?(s=this.left,n=this.right):(s=this.top,n=this.bottom,t=!t),this._startPixel=s,this._endPixel=n,this._reversePixels=t,this._length=n-s,this._alignToPixels=this.options.alignToPixels}afterUpdate(){gt(this.options.afterUpdate,[this])}beforeSetDimensions(){gt(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){gt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),gt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){gt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const s=this.options.ticks;let n,i,r;for(n=0,i=t.length;n<i;n++)r=t[n],r.label=gt(s.callback,[r.value,n,t],this)}afterTickToLabelConversion(){gt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){gt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,s=t.ticks,n=Lu(this.ticks.length,t.ticks.maxTicksLimit),i=s.minRotation||0,r=s.maxRotation;let o=i,a,l,c;if(!this._isVisible()||!s.display||i>=r||n<=1||!this.isHorizontal()){this.labelRotation=i;return}const u=this._getLabelSizes(),d=u.widest.width,h=u.highest.height,f=jt(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/n:f/(n-1),d+6>a&&(a=f/(n-(t.offset?.5:1)),l=this.maxHeight-Dn(t.grid)-s.padding-Nu(t.title,this.chart.options.font),c=Math.sqrt(d*d+h*h),o=tl(Math.min(Math.asin(jt((u.highest.height+6)/a,-1,1)),Math.asin(jt(l/c,-1,1))-Math.asin(jt(h/c,-1,1)))),o=Math.max(i,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){gt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){gt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:s,options:{ticks:n,title:i,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=Nu(i,s.options.font);if(a?(t.width=this.maxWidth,t.height=Dn(r)+l):(t.height=this.maxHeight,t.width=Dn(r)+l),n.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:h}=this._getLabelSizes(),f=n.padding*2,p=ke(this.labelRotation),m=Math.cos(p),g=Math.sin(p);if(a){const b=n.mirror?0:g*d.width+m*h.height;t.height=Math.min(this.maxHeight,t.height+b+f)}else{const b=n.mirror?0:m*d.width+g*h.height;t.width=Math.min(this.maxWidth,t.width+b+f)}this._calculatePadding(c,u,g,m)}}this._handleMargins(),a?(this.width=this._length=s.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=s.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,s,n,i){const{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,f=0;l?c?(h=i*t.width,f=n*s.height):(h=n*t.height,f=i*s.width):r==="start"?f=s.width:r==="end"?h=t.width:r!=="inner"&&(h=t.width/2,f=s.width/2),this.paddingLeft=Math.max((h-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((f-d+o)*this.width/(this.width-d),0)}else{let u=s.height/2,d=t.height/2;r==="start"?(u=0,d=t.height):r==="end"&&(u=s.height,d=0),this.paddingTop=u+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(){gt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:s}=this.options;return s==="top"||s==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let s,n;for(s=0,n=t.length;s<n;s++)lt(t[s].label)&&(t.splice(s,1),n--,s--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const s=this.options.ticks.sampleSize;let n=this.ticks;s<n.length&&(n=Du(n,s)),this._labelSizes=t=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,s,n){const{ctx:i,_longestTextCache:r}=this,o=[],a=[],l=Math.floor(s/Lu(s,n));let c=0,u=0,d,h,f,p,m,g,b,x,w,v,S;for(d=0;d<s;d+=l){if(p=t[d].label,m=this._resolveTickFontOptions(d),i.font=g=m.string,b=r[g]=r[g]||{data:{},gc:[]},x=m.lineHeight,w=v=0,!lt(p)&&!_t(p))w=Rr(i,b.data,b.gc,w,p),v=x;else if(_t(p))for(h=0,f=p.length;h<f;++h)S=p[h],!lt(S)&&!_t(S)&&(w=Rr(i,b.data,b.gc,w,S),v+=x);o.push(w),a.push(v),c=Math.max(w,c),u=Math.max(v,u)}ES(r,s);const P=o.indexOf(c),R=a.indexOf(u),_=C=>({width:o[C]||0,height:a[C]||0});return{first:_(0),last:_(s-1),widest:_(P),highest:_(R),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,s){return NaN}getValueForPixel(t){}getPixelForTick(t){const s=this.ticks;return t<0||t>s.length-1?null:this.getPixelForValue(s[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const s=this._startPixel+t*this._length;return c_(this._alignToPixels?Rs(this.chart,s,0):s)}getDecimalForPixel(t){const s=(t-this._startPixel)/this._length;return this._reversePixels?1-s:s}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:s}=this;return t<0&&s<0?s:t>0&&s>0?t:0}getContext(t){const s=this.ticks||[];if(t>=0&&t<s.length){const n=s[t];return n.$context||(n.$context=OS(this.getContext(),t,n))}return this.$context||(this.$context=CS(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,s=ke(this.labelRotation),n=Math.abs(Math.cos(s)),i=Math.abs(Math.sin(s)),r=this._getLabelSizes(),o=t.autoSkipPadding||0,a=r?r.widest.width+o:0,l=r?r.highest.height+o:0;return this.isHorizontal()?l*n>a*i?a/n:l/i:l*i<a*n?l/n:a/i}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const s=this.axis,n=this.chart,i=this.options,{grid:r,position:o,border:a}=i,l=r.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),h=Dn(r),f=[],p=a.setContext(this.getContext()),m=p.display?p.width:0,g=m/2,b=function(I){return Rs(n,I,m)};let x,w,v,S,P,R,_,C,N,j,A,F;if(o==="top")x=b(this.bottom),R=this.bottom-h,C=x-g,j=b(t.top)+g,F=t.bottom;else if(o==="bottom")x=b(this.top),j=t.top,F=b(t.bottom)-g,R=x+g,C=this.top+h;else if(o==="left")x=b(this.right),P=this.right-h,_=x-g,N=b(t.left)+g,A=t.right;else if(o==="right")x=b(this.left),N=t.left,A=b(t.right)-g,P=x+g,_=this.left+h;else if(s==="x"){if(o==="center")x=b((t.top+t.bottom)/2+.5);else if(ut(o)){const I=Object.keys(o)[0],q=o[I];x=b(this.chart.scales[I].getPixelForValue(q))}j=t.top,F=t.bottom,R=x+g,C=R+h}else if(s==="y"){if(o==="center")x=b((t.left+t.right)/2);else if(ut(o)){const I=Object.keys(o)[0],q=o[I];x=b(this.chart.scales[I].getPixelForValue(q))}P=x-g,_=P-h,N=t.left,A=t.right}const V=nt(i.ticks.maxTicksLimit,d),W=Math.max(1,Math.ceil(d/V));for(w=0;w<d;w+=W){const I=this.getContext(w),q=r.setContext(I),z=a.setContext(I),rt=q.lineWidth,dt=q.color,M=z.dash||[],Y=z.dashOffset,B=q.tickWidth,U=q.tickColor,et=q.tickBorderDash||[],ft=q.tickBorderDashOffset;v=PS(this,w,l),v!==void 0&&(S=Rs(n,v,rt),c?P=_=N=A=S:R=C=j=F=S,f.push({tx1:P,ty1:R,tx2:_,ty2:C,x1:N,y1:j,x2:A,y2:F,width:rt,color:dt,borderDash:M,borderDashOffset:Y,tickWidth:B,tickColor:U,tickBorderDash:et,tickBorderDashOffset:ft}))}return this._ticksLength=d,this._borderValue=x,f}_computeLabelItems(t){const s=this.axis,n=this.options,{position:i,ticks:r}=n,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=r,h=Dn(n.grid),f=h+u,p=d?-u:f,m=-ke(this.labelRotation),g=[];let b,x,w,v,S,P,R,_,C,N,j,A,F="middle";if(i==="top")P=this.bottom-p,R=this._getXAxisLabelAlignment();else if(i==="bottom")P=this.top+p,R=this._getXAxisLabelAlignment();else if(i==="left"){const W=this._getYAxisLabelAlignment(h);R=W.textAlign,S=W.x}else if(i==="right"){const W=this._getYAxisLabelAlignment(h);R=W.textAlign,S=W.x}else if(s==="x"){if(i==="center")P=(t.top+t.bottom)/2+f;else if(ut(i)){const W=Object.keys(i)[0],I=i[W];P=this.chart.scales[W].getPixelForValue(I)+f}R=this._getXAxisLabelAlignment()}else if(s==="y"){if(i==="center")S=(t.left+t.right)/2-f;else if(ut(i)){const W=Object.keys(i)[0],I=i[W];S=this.chart.scales[W].getPixelForValue(I)}R=this._getYAxisLabelAlignment(h).textAlign}s==="y"&&(l==="start"?F="top":l==="end"&&(F="bottom"));const V=this._getLabelSizes();for(b=0,x=a.length;b<x;++b){w=a[b],v=w.label;const W=r.setContext(this.getContext(b));_=this.getPixelForTick(b)+r.labelOffset,C=this._resolveTickFontOptions(b),N=C.lineHeight,j=_t(v)?v.length:1;const I=j/2,q=W.color,z=W.textStrokeColor,rt=W.textStrokeWidth;let dt=R;o?(S=_,R==="inner"&&(b===x-1?dt=this.options.reverse?"left":"right":b===0?dt=this.options.reverse?"right":"left":dt="center"),i==="top"?c==="near"||m!==0?A=-j*N+N/2:c==="center"?A=-V.highest.height/2-I*N+N:A=-V.highest.height+N/2:c==="near"||m!==0?A=N/2:c==="center"?A=V.highest.height/2-I*N:A=V.highest.height-j*N,d&&(A*=-1),m!==0&&!W.showLabelBackdrop&&(S+=N/2*Math.sin(m))):(P=_,A=(1-j)*N/2);let M;if(W.showLabelBackdrop){const Y=Yt(W.backdropPadding),B=V.heights[b],U=V.widths[b];let et=A-Y.top,ft=0-Y.left;switch(F){case"middle":et-=B/2;break;case"bottom":et-=B;break}switch(R){case"center":ft-=U/2;break;case"right":ft-=U;break;case"inner":b===x-1?ft-=U:b>0&&(ft-=U/2);break}M={left:ft,top:et,width:U+Y.width,height:B+Y.height,color:W.backdropColor}}g.push({label:v,font:C,textOffset:A,options:{rotation:m,color:q,strokeColor:z,strokeWidth:rt,textAlign:dt,textBaseline:F,translation:[S,P],backdrop:M}})}return g}_getXAxisLabelAlignment(){const{position:t,ticks:s}=this.options;if(-ke(this.labelRotation))return t==="top"?"left":"right";let i="center";return s.align==="start"?i="left":s.align==="end"?i="right":s.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:s,ticks:{crossAlign:n,mirror:i,padding:r}}=this.options,o=this._getLabelSizes(),a=t+r,l=o.widest.width;let c,u;return s==="left"?i?(u=this.right+r,n==="near"?c="left":n==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,n==="near"?c="right":n==="center"?(c="center",u-=l/2):(c="left",u=this.left)):s==="right"?i?(u=this.left+r,n==="near"?c="right":n==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,n==="near"?c="left":n==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,s=this.options.position;if(s==="left"||s==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(s==="top"||s==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:s},left:n,top:i,width:r,height:o}=this;s&&(t.save(),t.fillStyle=s,t.fillRect(n,i,r,o),t.restore())}getLineWidthForValue(t){const s=this.options.grid;if(!this._isVisible()||!s.display)return 0;const i=this.ticks.findIndex(r=>r.value===t);return i>=0?s.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const s=this.options.grid,n=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,o;const a=(l,c,u)=>{!u.width||!u.color||(n.save(),n.lineWidth=u.width,n.strokeStyle=u.color,n.setLineDash(u.borderDash||[]),n.lineDashOffset=u.borderDashOffset,n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(c.x,c.y),n.stroke(),n.restore())};if(s.display)for(r=0,o=i.length;r<o;++r){const l=i[r];s.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),s.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:s,options:{border:n,grid:i}}=this,r=n.setContext(this.getContext()),o=n.display?r.width:0;if(!o)return;const a=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,h;this.isHorizontal()?(c=Rs(t,this.left,o)-o/2,u=Rs(t,this.right,a)+a/2,d=h=l):(d=Rs(t,this.top,o)-o/2,h=Rs(t,this.bottom,a)+a/2,c=u=l),s.save(),s.lineWidth=r.width,s.strokeStyle=r.color,s.beginPath(),s.moveTo(c,d),s.lineTo(u,h),s.stroke(),s.restore()}drawLabels(t){if(!this.options.ticks.display)return;const n=this.ctx,i=this._computeLabelArea();i&&Wr(n,i);const r=this.getLabelItems(t);for(const o of r){const a=o.options,l=o.font,c=o.label,u=o.textOffset;$s(n,c,0,u,l,a)}i&&$r(n)}drawTitle(){const{ctx:t,options:{position:s,title:n,reverse:i}}=this;if(!n.display)return;const r=Nt(n.font),o=Yt(n.padding),a=n.align;let l=r.lineHeight/2;s==="bottom"||s==="center"||ut(s)?(l+=o.bottom,_t(n.text)&&(l+=r.lineHeight*(n.text.length-1))):l+=o.top;const{titleX:c,titleY:u,maxWidth:d,rotation:h}=MS(this,l,s,a);$s(t,n.text,0,0,r,{color:n.color,maxWidth:d,rotation:h,textAlign:TS(a,s,i),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,s=t.ticks&&t.ticks.z||0,n=nt(t.grid&&t.grid.z,-1),i=nt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Ys.prototype.draw?[{z:s,draw:r=>{this.draw(r)}}]:[{z:n,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:s,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(t){const s=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",i=[];let r,o;for(r=0,o=s.length;r<o;++r){const a=s[r];a[n]===this.id&&(!t||a.type===t)&&i.push(a)}return i}_resolveTickFontOptions(t){const s=this.options.ticks.setContext(this.getContext(t));return Nt(s.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Wi{constructor(t,s,n){this.type=t,this.scope=s,this.override=n,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const s=Object.getPrototypeOf(t);let n;DS(s)&&(n=this.register(s));const i=this.items,r=t.id,o=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in i||(i[r]=t,AS(t,o,n),this.override&&wt.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const s=this.items,n=t.id,i=this.scope;n in s&&delete s[n],i&&n in wt[i]&&(delete wt[i][n],this.override&&delete Ws[n])}}function AS(e,t,s){const n=ei(Object.create(null),[s?wt.get(s):{},wt.get(t),e.defaults]);wt.set(t,n),e.defaultRoutes&&LS(t,e.defaultRoutes),e.descriptors&&wt.describe(t,e.descriptors)}function LS(e,t){Object.keys(t).forEach(s=>{const n=s.split("."),i=n.pop(),r=[e].concat(n).join("."),o=t[s].split("."),a=o.pop(),l=o.join(".");wt.route(r,i,l,a)})}function DS(e){return"id"in e&&"defaults"in e}class NS{constructor(){this.controllers=new Wi(ys,"datasets",!0),this.elements=new Wi(Je,"elements"),this.plugins=new Wi(Object,"plugins"),this.scales=new Wi(Ys,"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,s,n){[...s].forEach(i=>{const r=n||this._getRegistryForType(i);n||r.isForType(i)||r===this.plugins&&i.id?this._exec(t,r,i):mt(i,o=>{const a=n||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,s,n){const i=Za(t);gt(n["before"+i],[],n),s[t](n),gt(n["after"+i],[],n)}_getRegistryForType(t){for(let s=0;s<this._typedRegistries.length;s++){const n=this._typedRegistries[s];if(n.isForType(t))return n}return this.plugins}_get(t,s,n){const i=s.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+n+".");return i}}var Te=new NS;class FS{constructor(){this._init=void 0}notify(t,s,n,i){if(s==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const r=i?this._descriptors(t).filter(i):this._descriptors(t),o=this._notify(r,t,s,n);return s==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),o}_notify(t,s,n,i){i=i||{};for(const r of t){const o=r.plugin,a=o[n],l=[s,i,r.options];if(gt(a,l,o)===!1&&i.cancelable)return!1}return!0}invalidate(){lt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const s=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),s}_createDescriptors(t,s){const n=t&&t.config,i=nt(n.options&&n.options.plugins,{}),r=IS(n);return i===!1&&!s?[]:BS(t,r,i,s)}_notifyStateChanges(t){const s=this._oldCache||[],n=this._cache,i=(r,o)=>r.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(i(s,n),t,"stop"),this._notify(i(n,s),t,"start")}}function IS(e){const t={},s=[],n=Object.keys(Te.plugins.items);for(let r=0;r<n.length;r++)s.push(Te.getPlugin(n[r]));const i=e.plugins||[];for(let r=0;r<i.length;r++){const o=i[r];s.indexOf(o)===-1&&(s.push(o),t[o.id]=!0)}return{plugins:s,localIds:t}}function jS(e,t){return!t&&e===!1?null:e===!0?{}:e}function BS(e,{plugins:t,localIds:s},n,i){const r=[],o=e.getContext();for(const a of t){const l=a.id,c=jS(n[l],i);c!==null&&r.push({plugin:a,options:VS(e.config,{plugin:a,local:s[l]},c,o)})}return r}function VS(e,{plugin:t,local:s},n,i){const r=e.pluginScopeKeys(t),o=e.getOptionScopes(n,r);return s&&t.defaults&&o.push(t.defaults),e.createResolver(o,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ma(e,t){const s=wt.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||s.indexAxis||"x"}function zS(e,t){let s=e;return e==="_index_"?s=t:e==="_value_"&&(s=t==="x"?"y":"x"),s}function HS(e,t){return e===t?"_index_":"_value_"}function Fu(e){if(e==="x"||e==="y"||e==="r")return e}function US(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function ga(e,...t){if(Fu(e))return e;for(const s of t){const n=s.axis||US(s.position)||e.length>1&&Fu(e[0].toLowerCase());if(n)return n}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Iu(e,t,s){if(s[t+"AxisID"]===e)return{axis:t}}function WS(e,t){if(t.data&&t.data.datasets){const s=t.data.datasets.filter(n=>n.xAxisID===e||n.yAxisID===e);if(s.length)return Iu(e,"x",s[0])||Iu(e,"y",s[0])}return{}}function $S(e,t){const s=Ws[e.type]||{scales:{}},n=t.scales||{},i=ma(e.type,t),r=Object.create(null);return Object.keys(n).forEach(o=>{const a=n[o];if(!ut(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=ga(o,a,WS(o,e),wt.scales[a.type]),c=HS(l,i),u=s.scales||{};r[o]=qn(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(o=>{const a=o.type||e.type,l=o.indexAxis||ma(a,t),u=(Ws[a]||{}).scales||{};Object.keys(u).forEach(d=>{const h=zS(d,l),f=o[h+"AxisID"]||h;r[f]=r[f]||Object.create(null),qn(r[f],[{axis:h},n[f],u[d]])})}),Object.keys(r).forEach(o=>{const a=r[o];qn(a,[wt.scales[a.type],wt.scale])}),r}function Gf(e){const t=e.options||(e.options={});t.plugins=nt(t.plugins,{}),t.scales=$S(e,t)}function Xf(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function qS(e){return e=e||{},e.data=Xf(e.data),Gf(e),e}const ju=new Map,Qf=new Set;function $i(e,t){let s=ju.get(e);return s||(s=t(),ju.set(e,s),Qf.add(s)),s}const Nn=(e,t,s)=>{const n=ms(t,s);n!==void 0&&e.add(n)};class KS{constructor(t){this._config=qS(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=Xf(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(),Gf(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return $i(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,s){return $i(`${t}.transition.${s}`,()=>[[`datasets.${t}.transitions.${s}`,`transitions.${s}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,s){return $i(`${t}-${s}`,()=>[[`datasets.${t}.elements.${s}`,`datasets.${t}`,`elements.${s}`,""]])}pluginScopeKeys(t){const s=t.id,n=this.type;return $i(`${n}-plugin-${s}`,()=>[[`plugins.${s}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,s){const n=this._scopeCache;let i=n.get(t);return(!i||s)&&(i=new Map,n.set(t,i)),i}getOptionScopes(t,s,n){const{options:i,type:r}=this,o=this._cachedScopes(t,n),a=o.get(s);if(a)return a;const l=new Set;s.forEach(u=>{t&&(l.add(t),u.forEach(d=>Nn(l,t,d))),u.forEach(d=>Nn(l,i,d)),u.forEach(d=>Nn(l,Ws[r]||{},d)),u.forEach(d=>Nn(l,wt,d)),u.forEach(d=>Nn(l,fa,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Qf.has(s)&&o.set(s,c),c}chartOptionScopes(){const{options:t,type:s}=this;return[t,Ws[s]||{},wt.datasets[s]||{},{type:s},wt,fa]}resolveNamedOptions(t,s,n,i=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=Bu(this._resolverCache,t,i);let l=o;if(GS(o,s)){r.$shared=!1,n=gs(n)?n():n;const c=this.createResolver(t,n,a);l=hn(o,n,c)}for(const c of s)r[c]=l[c];return r}createResolver(t,s,n=[""],i){const{resolver:r}=Bu(this._resolverCache,t,n);return ut(s)?hn(r,s,void 0,i):r}}function Bu(e,t,s){let n=e.get(t);n||(n=new Map,e.set(t,n));const i=s.join();let r=n.get(i);return r||(r={resolver:rl(t,s),subPrefixes:s.filter(a=>!a.toLowerCase().includes("hover"))},n.set(i,r)),r}const YS=e=>ut(e)&&Object.getOwnPropertyNames(e).some(t=>gs(e[t]));function GS(e,t){const{isScriptable:s,isIndexable:n}=Ef(e);for(const i of t){const r=s(i),o=n(i),a=(o||r)&&e[i];if(r&&(gs(a)||YS(a))||o&&_t(a))return!0}return!1}var XS="4.5.1";const QS=["top","bottom","left","right","chartArea"];function Vu(e,t){return e==="top"||e==="bottom"||QS.indexOf(e)===-1&&t==="x"}function zu(e,t){return function(s,n){return s[e]===n[e]?s[t]-n[t]:s[e]-n[e]}}function Hu(e){const t=e.chart,s=t.options.animation;t.notifyPlugins("afterRender"),gt(s&&s.onComplete,[e],t)}function JS(e){const t=e.chart,s=t.options.animation;gt(s&&s.onProgress,[e],t)}function Jf(e){return ll()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const ar={},Uu=e=>{const t=Jf(e);return Object.values(ar).filter(s=>s.canvas===t).pop()};function ZS(e,t,s){const n=Object.keys(e);for(const i of n){const r=+i;if(r>=t){const o=e[i];delete e[i],(s>0||r>t)&&(e[r+s]=o)}}}function tk(e,t,s,n){return!s||e.type==="mouseout"?null:n?t:e}let bi=class{static defaults=wt;static instances=ar;static overrides=Ws;static registry=Te;static version=XS;static getChart=Uu;static register(...t){Te.add(...t),Wu()}static unregister(...t){Te.remove(...t),Wu()}constructor(t,s){const n=this.config=new KS(s),i=Jf(t),r=Uu(i);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||yS(i)),this.platform.updateConfig(n);const a=this.platform.acquireContext(i,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=Xv(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,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 FS,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=f_(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],ar[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Ue.listen(this,"complete",Hu),Ue.listen(this,"progress",JS),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:s},width:n,height:i,_aspectRatio:r}=this;return lt(t)?s&&r?r:i?n/i: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 Te}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():hu(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return cu(this.canvas,this.ctx),this}stop(){return Ue.stop(this),this}resize(t,s){Ue.running(this)?this._resizeBeforeDraw={width:t,height:s}:this._resize(t,s)}_resize(t,s){const n=this.options,i=this.canvas,r=n.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(i,t,s,r),a=n.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,hu(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),gt(n.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const s=this.options.scales||{};mt(s,(n,i)=>{n.id=i})}buildOrUpdateScales(){const t=this.options,s=t.scales,n=this.scales,i=Object.keys(n).reduce((o,a)=>(o[a]=!1,o),{});let r=[];s&&(r=r.concat(Object.keys(s).map(o=>{const a=s[o],l=ga(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),mt(r,o=>{const a=o.options,l=a.id,c=ga(l,a),u=nt(a.type,o.dtype);(a.position===void 0||Vu(a.position,c)!==Vu(o.dposition))&&(a.position=o.dposition),i[l]=!0;let d=null;if(l in n&&n[l].type===u)d=n[l];else{const h=Te.getScale(u);d=new h({id:l,type:u,ctx:this.ctx,chart:this}),n[d.id]=d}d.init(a,t)}),mt(i,(o,a)=>{o||delete n[a]}),mt(n,o=>{Kt.configure(this,o,o.options),Kt.addBox(this,o)})}_updateMetasets(){const t=this._metasets,s=this.data.datasets.length,n=t.length;if(t.sort((i,r)=>i.index-r.index),n>s){for(let i=s;i<n;++i)this._destroyDatasetMeta(i);t.splice(s,n-s)}this._sortedMetasets=t.slice(0).sort(zu("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:s}}=this;t.length>s.length&&delete this._stacks,t.forEach((n,i)=>{s.filter(r=>r===n._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],s=this.data.datasets;let n,i;for(this._removeUnreferencedMetasets(),n=0,i=s.length;n<i;n++){const r=s[n];let o=this.getDatasetMeta(n);const a=r.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(n),o=this.getDatasetMeta(n)),o.type=a,o.indexAxis=r.indexAxis||ma(a,this.options),o.order=r.order||0,o.index=n,o.label=""+r.label,o.visible=this.isDatasetVisible(n),o.controller)o.controller.updateIndex(n),o.controller.linkScales();else{const l=Te.getController(a),{datasetElementType:c,dataElementType:u}=wt.datasets[a];Object.assign(l,{dataElementType:Te.getElement(u),datasetElementType:c&&Te.getElement(c)}),o.controller=new l(this,n),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){mt(this.data.datasets,(t,s)=>{this.getDatasetMeta(s).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const s=this.config;s.update();const n=this._options=s.createResolver(s.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),h=!i&&r.indexOf(d)===-1;d.buildOrUpdateElements(h),o=Math.max(+d.getMaxOverflow(),o)}o=this._minPadding=n.layout.autoPadding?o:0,this._updateLayout(o),i||mt(r,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(zu("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){mt(this.scales,t=>{Kt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,s=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!tu(s,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,s=this._getUniformDataChanges()||[];for(const{method:n,start:i,count:r}of s){const o=n==="_removeElements"?-r:r;ZS(t,i,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const s=this.data.datasets.length,n=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),i=n(0);for(let r=1;r<s;r++)if(!tu(i,n(r)))return;return Array.from(i).map(r=>r.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Kt.update(this,this.width,this.height,t);const s=this.chartArea,n=s.width<=0||s.height<=0;this._layers=[],mt(this.boxes,i=>{n&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,r)=>{i._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let s=0,n=this.data.datasets.length;s<n;++s)this.getDatasetMeta(s).controller.configure();for(let s=0,n=this.data.datasets.length;s<n;++s)this._updateDataset(s,gs(t)?t({datasetIndex:s}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,s){const n=this.getDatasetMeta(t),i={meta:n,index:t,mode:s,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(n.controller._update(s),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Ue.has(this)?this.attached&&!Ue.running(this)&&Ue.start(this):(this.draw(),Hu({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:n,height:i}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(n,i)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const s=this._layers;for(t=0;t<s.length&&s[t].z<=0;++t)s[t].draw(this.chartArea);for(this._drawDatasets();t<s.length;++t)s[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const s=this._sortedMetasets,n=[];let i,r;for(i=0,r=s.length;i<r;++i){const o=s[i];(!t||o.visible)&&n.push(o)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let s=t.length-1;s>=0;--s)this._drawDataset(t[s]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const s=this.ctx,n={meta:t,index:t.index,cancelable:!0},i=jf(this,t);this.notifyPlugins("beforeDatasetDraw",n)!==!1&&(i&&Wr(s,i),t.controller.draw(),i&&$r(s),n.cancelable=!1,this.notifyPlugins("afterDatasetDraw",n))}isPointInArea(t){return Xe(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,s,n,i){const r=Qw.modes[s];return typeof r=="function"?r(this,t,n,i):[]}getDatasetMeta(t){const s=this.data.datasets[t],n=this._metasets;let i=n.filter(r=>r&&r._dataset===s).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:s&&s.order||0,index:t,_dataset:s,_parsed:[],_sorted:!1},n.push(i)),i}getContext(){return this.$context||(this.$context=bs(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const s=this.data.datasets[t];if(!s)return!1;const n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!s.hidden}setDatasetVisibility(t,s){const n=this.getDatasetMeta(t);n.hidden=!s}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,s,n){const i=n?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,i);si(s)?(r.data[s].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),o.update(r,{visible:n}),this.update(a=>a.datasetIndex===t?i:void 0))}hide(t,s){this._updateVisibility(t,s,!1)}show(t,s){this._updateVisibility(t,s,!0)}_destroyDatasetMeta(t){const s=this._metasets[t];s&&s.controller&&s.controller._destroy(),delete this._metasets[t]}_stop(){let t,s;for(this.stop(),Ue.remove(this),t=0,s=this.data.datasets.length;t<s;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:s}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),cu(t,s),this.platform.releaseContext(s),this.canvas=null,this.ctx=null),delete ar[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,s=this.platform,n=(r,o)=>{s.addEventListener(this,r,o),t[r]=o},i=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};mt(this.options.events,r=>n(r,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,s=this.platform,n=(l,c)=>{s.addEventListener(this,l,c),t[l]=c},i=(l,c)=>{t[l]&&(s.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{i("attach",a),this.attached=!0,this.resize(),n("resize",r),n("detach",o)};o=()=>{this.attached=!1,i("resize",r),this._stop(),this._resize(0,0),n("attach",a)},s.isAttached(this.canvas)?a():o()}unbindEvents(){mt(this._listeners,(t,s)=>{this.platform.removeEventListener(this,s,t)}),this._listeners={},mt(this._responsiveListeners,(t,s)=>{this.platform.removeEventListener(this,s,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,s,n){const i=n?"set":"remove";let r,o,a,l;for(s==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+i+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){o=t[a];const c=o&&this.getDatasetMeta(o.datasetIndex).controller;c&&c[i+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const s=this._active||[],n=t.map(({datasetIndex:r,index:o})=>{const a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!wr(n,s)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,s))}notifyPlugins(t,s,n){return this._plugins.notify(this,t,s,n)}isPluginEnabled(t){return this._plugins._cache.filter(s=>s.plugin.id===t).length===1}_updateHoverStyles(t,s,n){const i=this.options.hover,r=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),o=r(s,t),a=n?t:r(t,s);o.length&&this.updateHoverStyle(o,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(t,s){const n={event:t,replay:s,cancelable:!0,inChartArea:this.isPointInArea(t)},i=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",n,i)===!1)return;const r=this._handleEvent(t,s,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,i),(r||n.changed)&&this.render(),this}_handleEvent(t,s,n){const{_active:i=[],options:r}=this,o=s,a=this._getActiveElements(t,i,n,o),l=s_(t),c=tk(t,this._lastEvent,n,l);n&&(this._lastEvent=null,gt(r.onHover,[t,a,this],this),l&&gt(r.onClick,[t,a,this],this));const u=!wr(a,i);return(u||s)&&(this._active=a,this._updateHoverStyles(a,i,s)),this._lastEvent=c,u}_getActiveElements(t,s,n,i){if(t.type==="mouseout")return[];if(!n)return s;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,i)}};function Wu(){return mt(bi.instances,e=>e._plugins.invalidate())}function ek(e,t,s){const{startAngle:n,x:i,y:r,outerRadius:o,innerRadius:a,options:l}=t,{borderWidth:c,borderJoinStyle:u}=l,d=Math.min(c/o,$t(n-s));if(e.beginPath(),e.arc(i,r,o-c/2,n+d/2,s-d/2),a>0){const h=Math.min(c/a,$t(n-s));e.arc(i,r,a+c/2,s-h/2,n+h/2,!0)}else{const h=Math.min(c/2,o*$t(n-s));if(u==="round")e.arc(i,r,h,s-pt/2,n+pt/2,!0);else if(u==="bevel"){const f=2*h*h,p=-f*Math.cos(s+pt/2)+i,m=-f*Math.sin(s+pt/2)+r,g=f*Math.cos(n+pt/2)+i,b=f*Math.sin(n+pt/2)+r;e.lineTo(p,m),e.lineTo(g,b)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function sk(e,t,s){const{startAngle:n,pixelMargin:i,x:r,y:o,outerRadius:a,innerRadius:l}=t;let c=i/a;e.beginPath(),e.arc(r,o,a,n-c,s+c),l>i?(c=i/l,e.arc(r,o,l,s+c,n-c,!0)):e.arc(r,o,i,s+Et,n-Et),e.closePath(),e.clip()}function nk(e){return il(e,["outerStart","outerEnd","innerStart","innerEnd"])}function ik(e,t,s,n){const i=nk(e.options.borderRadius),r=(s-t)/2,o=Math.min(r,n*t/2),a=l=>{const c=(s-Math.min(r,l))*n/2;return jt(l,0,Math.min(r,c))};return{outerStart:a(i.outerStart),outerEnd:a(i.outerEnd),innerStart:jt(i.innerStart,0,o),innerEnd:jt(i.innerEnd,0,o)}}function tn(e,t,s,n){return{x:s+e*Math.cos(t),y:n+e*Math.sin(t)}}function Cr(e,t,s,n,i,r){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+n+s-c,0),h=u>0?u+n+s+c:0;let f=0;const p=i-l;if(n){const W=u>0?u-n:0,I=d>0?d-n:0,q=(W+I)/2,z=q!==0?p*q/(q+n):p;f=(p-z)/2}const m=Math.max(.001,p*d-s/pt)/d,g=(p-m)/2,b=l+g+f,x=i-g-f,{outerStart:w,outerEnd:v,innerStart:S,innerEnd:P}=ik(t,h,d,x-b),R=d-w,_=d-v,C=b+w/R,N=x-v/_,j=h+S,A=h+P,F=b+S/j,V=x-P/A;if(e.beginPath(),r){const W=(C+N)/2;if(e.arc(o,a,d,C,W),e.arc(o,a,d,W,N),v>0){const rt=tn(_,N,o,a);e.arc(rt.x,rt.y,v,N,x+Et)}const I=tn(A,x,o,a);if(e.lineTo(I.x,I.y),P>0){const rt=tn(A,V,o,a);e.arc(rt.x,rt.y,P,x+Et,V+Math.PI)}const q=(x-P/h+(b+S/h))/2;if(e.arc(o,a,h,x-P/h,q,!0),e.arc(o,a,h,q,b+S/h,!0),S>0){const rt=tn(j,F,o,a);e.arc(rt.x,rt.y,S,F+Math.PI,b-Et)}const z=tn(R,b,o,a);if(e.lineTo(z.x,z.y),w>0){const rt=tn(R,C,o,a);e.arc(rt.x,rt.y,w,b-Et,C)}}else{e.moveTo(o,a);const W=Math.cos(C)*d+o,I=Math.sin(C)*d+a;e.lineTo(W,I);const q=Math.cos(N)*d+o,z=Math.sin(N)*d+a;e.lineTo(q,z)}e.closePath()}function rk(e,t,s,n,i){const{fullCircles:r,startAngle:o,circumference:a}=t;let l=t.endAngle;if(r){Cr(e,t,s,n,l,i);for(let c=0;c<r;++c)e.fill();isNaN(a)||(l=o+(a%xt||xt))}return Cr(e,t,s,n,l,i),e.fill(),l}function ok(e,t,s,n,i){const{fullCircles:r,startAngle:o,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:h,borderRadius:f}=l,p=l.borderAlign==="inner";if(!c)return;e.setLineDash(d||[]),e.lineDashOffset=h,p?(e.lineWidth=c*2,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let m=t.endAngle;if(r){Cr(e,t,s,n,m,i);for(let g=0;g<r;++g)e.stroke();isNaN(a)||(m=o+(a%xt||xt))}p&&sk(e,t,m),l.selfJoin&&m-o>=pt&&f===0&&u!=="miter"&&ek(e,t,m),r||(Cr(e,t,s,n,m,i),e.stroke())}class ak extends Je{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,s,n){const i=this.getProps(["x","y"],n),{angle:r,distance:o}=bf(i,{x:t,y:s}),{startAngle:a,endAngle:l,innerRadius:c,outerRadius:u,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),h=(this.options.spacing+this.options.borderWidth)/2,f=nt(d,l-a),p=ni(r,a,l)&&a!==l,m=f>=xt||p,g=Ye(o,c+h,u+h);return m&&g}getCenterPoint(t){const{x:s,y:n,startAngle:i,endAngle:r,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:l,spacing:c}=this.options,u=(i+r)/2,d=(o+a+c+l)/2;return{x:s+Math.cos(u)*d,y:n+Math.sin(u)*d}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:s,circumference:n}=this,i=(s.offset||0)/4,r=(s.spacing||0)/2,o=s.circular;if(this.pixelMargin=s.borderAlign==="inner"?.33:0,this.fullCircles=n>xt?Math.floor(n/xt):0,n===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*i,Math.sin(a)*i);const l=1-Math.sin(Math.min(pt,n||0)),c=i*l;t.fillStyle=s.backgroundColor,t.strokeStyle=s.borderColor,rk(t,this,c,r,o),ok(t,this,c,r,o),t.restore()}}function Zf(e,t,s=t){e.lineCap=nt(s.borderCapStyle,t.borderCapStyle),e.setLineDash(nt(s.borderDash,t.borderDash)),e.lineDashOffset=nt(s.borderDashOffset,t.borderDashOffset),e.lineJoin=nt(s.borderJoinStyle,t.borderJoinStyle),e.lineWidth=nt(s.borderWidth,t.borderWidth),e.strokeStyle=nt(s.borderColor,t.borderColor)}function lk(e,t,s){e.lineTo(s.x,s.y)}function ck(e){return e.stepped?R_:e.tension||e.cubicInterpolationMode==="monotone"?P_:lk}function tp(e,t,s={}){const n=e.length,{start:i=0,end:r=n-1}=s,{start:o,end:a}=t,l=Math.max(i,o),c=Math.min(r,a),u=i<o&&r<o||i>a&&r>a;return{count:n,start:l,loop:t.loop,ilen:c<l&&!u?n+c-l:c-l}}function uk(e,t,s,n){const{points:i,options:r}=t,{count:o,start:a,loop:l,ilen:c}=tp(i,s,n),u=ck(r);let{move:d=!0,reverse:h}=n||{},f,p,m;for(f=0;f<=c;++f)p=i[(a+(h?c-f:f))%o],!p.skip&&(d?(e.moveTo(p.x,p.y),d=!1):u(e,m,p,h,r.stepped),m=p);return l&&(p=i[(a+(h?c:0))%o],u(e,m,p,h,r.stepped)),!!l}function dk(e,t,s,n){const i=t.points,{count:r,start:o,ilen:a}=tp(i,s,n),{move:l=!0,reverse:c}=n||{};let u=0,d=0,h,f,p,m,g,b;const x=v=>(o+(c?a-v:v))%r,w=()=>{m!==g&&(e.lineTo(u,g),e.lineTo(u,m),e.lineTo(u,b))};for(l&&(f=i[x(0)],e.moveTo(f.x,f.y)),h=0;h<=a;++h){if(f=i[x(h)],f.skip)continue;const v=f.x,S=f.y,P=v|0;P===p?(S<m?m=S:S>g&&(g=S),u=(d*u+v)/++d):(w(),e.lineTo(v,S),p=P,d=0,m=g=S),b=S}w()}function ba(e){const t=e.options,s=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!s?dk:uk}function hk(e){return e.stepped?iw:e.tension||e.cubicInterpolationMode==="monotone"?rw:Os}function fk(e,t,s,n){let i=t._path;i||(i=t._path=new Path2D,t.path(i,s,n)&&i.closePath()),Zf(e,t.options),e.stroke(i)}function pk(e,t,s,n){const{segments:i,options:r}=t,o=ba(t);for(const a of i)Zf(e,r,a.style),e.beginPath(),o(e,t,a,{start:s,end:s+n-1})&&e.closePath(),e.stroke()}const mk=typeof Path2D=="function";function gk(e,t,s,n){mk&&!t.options.segment?fk(e,t,s,n):pk(e,t,s,n)}class yi extends Je{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};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,s){const n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){const i=n.spanGaps?this._loop:this._fullLoop;X_(this._points,n,t,i,s),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=dw(this,this.options.segment))}first(){const t=this.segments,s=this.points;return t.length&&s[t[0].start]}last(){const t=this.segments,s=this.points,n=t.length;return n&&s[t[n-1].end]}interpolate(t,s){const n=this.options,i=t[s],r=this.points,o=If(this,{property:s,start:i,end:i});if(!o.length)return;const a=[],l=hk(n);let c,u;for(c=0,u=o.length;c<u;++c){const{start:d,end:h}=o[c],f=r[d],p=r[h];if(f===p){a.push(f);continue}const m=Math.abs((i-f[s])/(p[s]-f[s])),g=l(f,p,m,n.stepped);g[s]=t[s],a.push(g)}return a.length===1?a[0]:a}pathSegment(t,s,n){return ba(this)(t,this,s,n)}path(t,s,n){const i=this.segments,r=ba(this);let o=this._loop;s=s||0,n=n||this.points.length-s;for(const a of i)o&=r(t,this,a,{start:s,end:s+n-1});return!!o}draw(t,s,n,i){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),gk(t,this,n,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function $u(e,t,s,n){const i=e.options,{[s]:r}=e.getProps([s],n);return Math.abs(t-r)<i.radius+i.hitRadius}class ep extends Je{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,s,n){const i=this.options,{x:r,y:o}=this.getProps(["x","y"],n);return Math.pow(t-r,2)+Math.pow(s-o,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(t,s){return $u(this,t,"x",s)}inYRange(t,s){return $u(this,t,"y",s)}getCenterPoint(t){const{x:s,y:n}=this.getProps(["x","y"],t);return{x:s,y:n}}size(t){t=t||this.options||{};let s=t.radius||0;s=Math.max(s,s&&t.hoverRadius||0);const n=s&&t.borderWidth||0;return(s+n)*2}draw(t,s){const n=this.options;this.skip||n.radius<.1||!Xe(this,s,this.size(n)/2)||(t.strokeStyle=n.borderColor,t.lineWidth=n.borderWidth,t.fillStyle=n.backgroundColor,pa(t,n,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function sp(e,t){const{x:s,y:n,base:i,width:r,height:o}=e.getProps(["x","y","base","width","height"],t);let a,l,c,u,d;return e.horizontal?(d=o/2,a=Math.min(s,i),l=Math.max(s,i),c=n-d,u=n+d):(d=r/2,a=s-d,l=s+d,c=Math.min(n,i),u=Math.max(n,i)),{left:a,top:c,right:l,bottom:u}}function cs(e,t,s,n){return e?0:jt(t,s,n)}function bk(e,t,s){const n=e.options.borderWidth,i=e.borderSkipped,r=Pf(n);return{t:cs(i.top,r.top,0,s),r:cs(i.right,r.right,0,t),b:cs(i.bottom,r.bottom,0,s),l:cs(i.left,r.left,0,t)}}function yk(e,t,s){const{enableBorderRadius:n}=e.getProps(["enableBorderRadius"]),i=e.options.borderRadius,r=js(i),o=Math.min(t,s),a=e.borderSkipped,l=n||ut(i);return{topLeft:cs(!l||a.top||a.left,r.topLeft,0,o),topRight:cs(!l||a.top||a.right,r.topRight,0,o),bottomLeft:cs(!l||a.bottom||a.left,r.bottomLeft,0,o),bottomRight:cs(!l||a.bottom||a.right,r.bottomRight,0,o)}}function xk(e){const t=sp(e),s=t.right-t.left,n=t.bottom-t.top,i=bk(e,s/2,n/2),r=yk(e,s/2,n/2);return{outer:{x:t.left,y:t.top,w:s,h:n,radius:r},inner:{x:t.left+i.l,y:t.top+i.t,w:s-i.l-i.r,h:n-i.t-i.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,r.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(i.b,i.r))}}}}function Ao(e,t,s,n){const i=t===null,r=s===null,a=e&&!(i&&r)&&sp(e,n);return a&&(i||Ye(t,a.left,a.right))&&(r||Ye(s,a.top,a.bottom))}function vk(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function _k(e,t){e.rect(t.x,t.y,t.w,t.h)}function Lo(e,t,s={}){const n=e.x!==s.x?-t:0,i=e.y!==s.y?-t:0,r=(e.x+e.w!==s.x+s.w?t:0)-n,o=(e.y+e.h!==s.y+s.h?t:0)-i;return{x:e.x+n,y:e.y+i,w:e.w+r,h:e.h+o,radius:e.radius}}class wk extends Je{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:s,options:{borderColor:n,backgroundColor:i}}=this,{inner:r,outer:o}=xk(this),a=vk(o.radius)?ii:_k;t.save(),(o.w!==r.w||o.h!==r.h)&&(t.beginPath(),a(t,Lo(o,s,r)),t.clip(),a(t,Lo(r,-s,o)),t.fillStyle=n,t.fill("evenodd")),t.beginPath(),a(t,Lo(r,s)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,s,n){return Ao(this,t,s,n)}inXRange(t,s){return Ao(this,t,null,s)}inYRange(t,s){return Ao(this,null,t,s)}getCenterPoint(t){const{x:s,y:n,base:i,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(s+i)/2:s,y:r?n:(n+i)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}var Sk=Object.freeze({__proto__:null,ArcElement:ak,BarElement:wk,LineElement:yi,PointElement:ep});const ya=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],qu=ya.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function np(e){return ya[e%ya.length]}function ip(e){return qu[e%qu.length]}function kk(e,t){return e.borderColor=np(t),e.backgroundColor=ip(t),++t}function Rk(e,t){return e.backgroundColor=e.data.map(()=>np(t++)),t}function Pk(e,t){return e.backgroundColor=e.data.map(()=>ip(t++)),t}function Ek(e){let t=0;return(s,n)=>{const i=e.getDatasetMeta(n).controller;i instanceof ul?t=Rk(s,t):i instanceof Uf?t=Pk(s,t):i&&(t=kk(s,t))}}function Ku(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function Ck(e){return e&&(e.borderColor||e.backgroundColor)}function Ok(){return wt.borderColor!=="rgba(0,0,0,0.1)"||wt.backgroundColor!=="rgba(0,0,0,0.1)"}var Tk={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,s){if(!s.enabled)return;const{data:{datasets:n},options:i}=e.config,{elements:r}=i,o=Ku(n)||Ck(i)||r&&Ku(r)||Ok();if(!s.forceOverride&&o)return;const a=Ek(e);n.forEach(a)}};function Mk(e,t,s,n,i){const r=i.samples||n;if(r>=s)return e.slice(t,t+s);const o=[],a=(s-2)/(r-2);let l=0;const c=t+s-1;let u=t,d,h,f,p,m;for(o[l++]=e[u],d=0;d<r-2;d++){let g=0,b=0,x;const w=Math.floor((d+1)*a)+1+t,v=Math.min(Math.floor((d+2)*a)+1,s)+t,S=v-w;for(x=w;x<v;x++)g+=e[x].x,b+=e[x].y;g/=S,b/=S;const P=Math.floor(d*a)+1+t,R=Math.min(Math.floor((d+1)*a)+1,s)+t,{x:_,y:C}=e[u];for(f=p=-1,x=P;x<R;x++)p=.5*Math.abs((_-g)*(e[x].y-C)-(_-e[x].x)*(b-C)),p>f&&(f=p,h=e[x],m=x);o[l++]=h,u=m}return o[l++]=e[c],o}function Ak(e,t,s,n){let i=0,r=0,o,a,l,c,u,d,h,f,p,m;const g=[],b=t+s-1,x=e[t].x,v=e[b].x-x;for(o=t;o<t+s;++o){a=e[o],l=(a.x-x)/v*n,c=a.y;const S=l|0;if(S===u)c<p?(p=c,d=o):c>m&&(m=c,h=o),i=(r*i+a.x)/++r;else{const P=o-1;if(!lt(d)&&!lt(h)){const R=Math.min(d,h),_=Math.max(d,h);R!==f&&R!==P&&g.push({...e[R],x:i}),_!==f&&_!==P&&g.push({...e[_],x:i})}o>0&&P!==f&&g.push(e[P]),g.push(a),u=S,r=0,p=m=c,d=h=f=o}}return g}function rp(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Yu(e){e.data.datasets.forEach(t=>{rp(t)})}function Lk(e,t){const s=t.length;let n=0,i;const{iScale:r}=e,{min:o,max:a,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(n=jt(Ge(t,r.axis,o).lo,0,s-1)),c?i=jt(Ge(t,r.axis,a).hi+1,n,s)-n:i=s-n,{start:n,count:i}}var Dk={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,s)=>{if(!s.enabled){Yu(e);return}const n=e.width;e.data.datasets.forEach((i,r)=>{const{_data:o,indexAxis:a}=i,l=e.getDatasetMeta(r),c=o||i.data;if(Bn([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:d,count:h}=Lk(l,c);const f=s.threshold||4*n;if(h<=f){rp(i);return}lt(o)&&(i._data=c,delete i.data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let p;switch(s.algorithm){case"lttb":p=Mk(c,d,h,n,s);break;case"min-max":p=Ak(c,d,h,n);break;default:throw new Error(`Unsupported decimation algorithm '${s.algorithm}'`)}i._decimated=p})},destroy(e){Yu(e)}};function Nk(e,t,s){const n=e.segments,i=e.points,r=t.points,o=[];for(const a of n){let{start:l,end:c}=a;c=Yr(l,c,i);const u=xa(s,i[l],i[c],a.loop);if(!t.segments){o.push({source:a,target:u,start:i[l],end:i[c]});continue}const d=If(t,u);for(const h of d){const f=xa(s,r[h.start],r[h.end],h.loop),p=Ff(a,i,f);for(const m of p)o.push({source:m,target:h,start:{[s]:Gu(u,f,"start",Math.max)},end:{[s]:Gu(u,f,"end",Math.min)}})}}return o}function xa(e,t,s,n){if(n)return;let i=t[e],r=s[e];return e==="angle"&&(i=$t(i),r=$t(r)),{property:e,start:i,end:r}}function Fk(e,t){const{x:s=null,y:n=null}=e||{},i=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=Yr(o,a,i);const l=i[o],c=i[a];n!==null?(r.push({x:l.x,y:n}),r.push({x:c.x,y:n})):s!==null&&(r.push({x:s,y:l.y}),r.push({x:s,y:c.y}))}),r}function Yr(e,t,s){for(;t>e;t--){const n=s[t];if(!isNaN(n.x)&&!isNaN(n.y))break}return t}function Gu(e,t,s,n){return e&&t?n(e[s],t[s]):e?e[s]:t?t[s]:0}function op(e,t){let s=[],n=!1;return _t(e)?(n=!0,s=e):s=Fk(e,t),s.length?new yi({points:s,options:{tension:0},_loop:n,_fullLoop:n}):null}function Xu(e){return e&&e.fill!==!1}function Ik(e,t,s){let i=e[t].fill;const r=[t];let o;if(!s)return i;for(;i!==!1&&r.indexOf(i)===-1;){if(!Pt(i))return i;if(o=e[i],!o)return!1;if(o.visible)return i;r.push(i),i=o.fill}return!1}function jk(e,t,s){const n=Hk(e);if(ut(n))return isNaN(n.value)?!1:n;let i=parseFloat(n);return Pt(i)&&Math.floor(i)===i?Bk(n[0],t,i,s):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function Bk(e,t,s,n){return(e==="-"||e==="+")&&(s=t+s),s===t||s<0||s>=n?!1:s}function Vk(e,t){let s=null;return e==="start"?s=t.bottom:e==="end"?s=t.top:ut(e)?s=t.getPixelForValue(e.value):t.getBasePixel&&(s=t.getBasePixel()),s}function zk(e,t,s){let n;return e==="start"?n=s:e==="end"?n=t.options.reverse?t.min:t.max:ut(e)?n=e.value:n=t.getBaseValue(),n}function Hk(e){const t=e.options,s=t.fill;let n=nt(s&&s.target,s);return n===void 0&&(n=!!t.backgroundColor),n===!1||n===null?!1:n===!0?"origin":n}function Uk(e){const{scale:t,index:s,line:n}=e,i=[],r=n.segments,o=n.points,a=Wk(t,s);a.push(op({x:null,y:t.bottom},n));for(let l=0;l<r.length;l++){const c=r[l];for(let u=c.start;u<=c.end;u++)$k(i,o[u],a)}return new yi({points:i,options:{}})}function Wk(e,t){const s=[],n=e.getMatchingVisibleMetas("line");for(let i=0;i<n.length;i++){const r=n[i];if(r.index===t)break;r.hidden||s.unshift(r.dataset)}return s}function $k(e,t,s){const n=[];for(let i=0;i<s.length;i++){const r=s[i],{first:o,last:a,point:l}=qk(r,t,"x");if(!(!l||o&&a)){if(o)n.unshift(l);else if(e.push(l),!a)break}}e.push(...n)}function qk(e,t,s){const n=e.interpolate(t,s);if(!n)return{};const i=n[s],r=e.segments,o=e.points;let a=!1,l=!1;for(let c=0;c<r.length;c++){const u=r[c],d=o[u.start][s],h=o[u.end][s];if(Ye(i,d,h)){a=i===d,l=i===h;break}}return{first:a,last:l,point:n}}class ap{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,s,n){const{x:i,y:r,radius:o}=this;return s=s||{start:0,end:xt},t.arc(i,r,o,s.end,s.start,!0),!n.bounds}interpolate(t){const{x:s,y:n,radius:i}=this,r=t.angle;return{x:s+Math.cos(r)*i,y:n+Math.sin(r)*i,angle:r}}}function Kk(e){const{chart:t,fill:s,line:n}=e;if(Pt(s))return Yk(t,s);if(s==="stack")return Uk(e);if(s==="shape")return!0;const i=Gk(e);return i instanceof ap?i:op(i,n)}function Yk(e,t){const s=e.getDatasetMeta(t);return s&&e.isDatasetVisible(t)?s.dataset:null}function Gk(e){return(e.scale||{}).getPointPositionForValue?Qk(e):Xk(e)}function Xk(e){const{scale:t={},fill:s}=e,n=Vk(s,t);if(Pt(n)){const i=t.isHorizontal();return{x:i?n:null,y:i?null:n}}return null}function Qk(e){const{scale:t,fill:s}=e,n=t.options,i=t.getLabels().length,r=n.reverse?t.max:t.min,o=zk(s,t,r),a=[];if(n.grid.circular){const l=t.getPointPositionForValue(0,r);return new ap({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(o)})}for(let l=0;l<i;++l)a.push(t.getPointPositionForValue(l,o));return a}function Do(e,t,s){const n=Kk(t),{chart:i,index:r,line:o,scale:a,axis:l}=t,c=o.options,u=c.fill,d=c.backgroundColor,{above:h=d,below:f=d}=u||{},p=i.getDatasetMeta(r),m=jf(i,p);n&&o.points.length&&(Wr(e,s),Jk(e,{line:o,target:n,above:h,below:f,area:s,scale:a,axis:l,clip:m}),$r(e))}function Jk(e,t){const{line:s,target:n,above:i,below:r,area:o,scale:a,clip:l}=t,c=s._loop?"angle":t.axis;e.save();let u=r;r!==i&&(c==="x"?(Qu(e,n,o.top),No(e,{line:s,target:n,color:i,scale:a,property:c,clip:l}),e.restore(),e.save(),Qu(e,n,o.bottom)):c==="y"&&(Ju(e,n,o.left),No(e,{line:s,target:n,color:r,scale:a,property:c,clip:l}),e.restore(),e.save(),Ju(e,n,o.right),u=i)),No(e,{line:s,target:n,color:u,scale:a,property:c,clip:l}),e.restore()}function Qu(e,t,s){const{segments:n,points:i}=t;let r=!0,o=!1;e.beginPath();for(const a of n){const{start:l,end:c}=a,u=i[l],d=i[Yr(l,c,i)];r?(e.moveTo(u.x,u.y),r=!1):(e.lineTo(u.x,s),e.lineTo(u.x,u.y)),o=!!t.pathSegment(e,a,{move:o}),o?e.closePath():e.lineTo(d.x,s)}e.lineTo(t.first().x,s),e.closePath(),e.clip()}function Ju(e,t,s){const{segments:n,points:i}=t;let r=!0,o=!1;e.beginPath();for(const a of n){const{start:l,end:c}=a,u=i[l],d=i[Yr(l,c,i)];r?(e.moveTo(u.x,u.y),r=!1):(e.lineTo(s,u.y),e.lineTo(u.x,u.y)),o=!!t.pathSegment(e,a,{move:o}),o?e.closePath():e.lineTo(s,d.y)}e.lineTo(s,t.first().y),e.closePath(),e.clip()}function No(e,t){const{line:s,target:n,property:i,color:r,scale:o,clip:a}=t,l=Nk(s,n,i);for(const{source:c,target:u,start:d,end:h}of l){const{style:{backgroundColor:f=r}={}}=c,p=n!==!0;e.save(),e.fillStyle=f,Zk(e,o,a,p&&xa(i,d,h)),e.beginPath();const m=!!s.pathSegment(e,c);let g;if(p){m?e.closePath():Zu(e,n,h,i);const b=!!n.pathSegment(e,u,{move:m,reverse:!0});g=m&&b,g||Zu(e,n,d,i)}e.closePath(),e.fill(g?"evenodd":"nonzero"),e.restore()}}function Zk(e,t,s,n){const i=t.chart.chartArea,{property:r,start:o,end:a}=n||{};if(r==="x"||r==="y"){let l,c,u,d;r==="x"?(l=o,c=i.top,u=a,d=i.bottom):(l=i.left,c=o,u=i.right,d=a),e.beginPath(),s&&(l=Math.max(l,s.left),u=Math.min(u,s.right),c=Math.max(c,s.top),d=Math.min(d,s.bottom)),e.rect(l,c,u-l,d-c),e.clip()}}function Zu(e,t,s,n){const i=t.interpolate(s,n);i&&e.lineTo(i.x,i.y)}var lp={id:"filler",afterDatasetsUpdate(e,t,s){const n=(e.data.datasets||[]).length,i=[];let r,o,a,l;for(o=0;o<n;++o)r=e.getDatasetMeta(o),a=r.dataset,l=null,a&&a.options&&a instanceof yi&&(l={visible:e.isDatasetVisible(o),index:o,fill:jk(a,o,n),chart:e,axis:r.controller.options.indexAxis,scale:r.vScale,line:a}),r.$filler=l,i.push(l);for(o=0;o<n;++o)l=i[o],!(!l||l.fill===!1)&&(l.fill=Ik(i,o,s.propagate))},beforeDraw(e,t,s){const n=s.drawTime==="beforeDraw",i=e.getSortedVisibleDatasetMetas(),r=e.chartArea;for(let o=i.length-1;o>=0;--o){const a=i[o].$filler;a&&(a.line.updateControlPoints(r,a.axis),n&&a.fill&&Do(e.ctx,a,r))}},beforeDatasetsDraw(e,t,s){if(s.drawTime!=="beforeDatasetsDraw")return;const n=e.getSortedVisibleDatasetMetas();for(let i=n.length-1;i>=0;--i){const r=n[i].$filler;Xu(r)&&Do(e.ctx,r,e.chartArea)}},beforeDatasetDraw(e,t,s){const n=t.meta.$filler;!Xu(n)||s.drawTime!=="beforeDatasetDraw"||Do(e.ctx,n,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const td=(e,t)=>{let{boxHeight:s=t,boxWidth:n=t}=e;return e.usePointStyle&&(s=Math.min(s,t),n=e.pointStyleWidth||Math.min(n,t)),{boxWidth:n,boxHeight:s,itemHeight:Math.max(t,s)}},tR=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class ed extends Je{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,s,n){this.maxWidth=t,this.maxHeight=s,this._margins=n,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 s=gt(t.generateLabels,[this.chart],this)||[];t.filter&&(s=s.filter(n=>t.filter(n,this.chart.data))),t.sort&&(s=s.sort((n,i)=>t.sort(n,i,this.chart.data))),this.options.reverse&&s.reverse(),this.legendItems=s}fit(){const{options:t,ctx:s}=this;if(!t.display){this.width=this.height=0;return}const n=t.labels,i=Nt(n.font),r=i.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=td(n,r);let c,u;s.font=i.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,r,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,i,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,s,n,i){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=i+a;let d=t;r.textAlign="left",r.textBaseline="middle";let h=-1,f=-u;return this.legendItems.forEach((p,m)=>{const g=n+s/2+r.measureText(p.text).width;(m===0||c[c.length-1]+g+2*a>o)&&(d+=u,c[c.length-(m>0?0:1)]=0,f+=u,h++),l[m]={left:0,top:f,row:h,width:g,height:i},c[c.length-1]+=g+a}),d}_fitCols(t,s,n,i){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-t;let d=a,h=0,f=0,p=0,m=0;return this.legendItems.forEach((g,b)=>{const{itemWidth:x,itemHeight:w}=eR(n,s,r,g,i);b>0&&f+w+2*a>u&&(d+=h+a,c.push({width:h,height:f}),p+=h+a,m++,h=f=0),l[b]={left:p,top:f,col:m,width:x,height:w},h=Math.max(h,x),f+=w+a}),d+=h,c.push({width:h,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:s,options:{align:n,labels:{padding:i},rtl:r}}=this,o=on(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=Wt(n,this.left+i,this.right-this.lineWidths[a]);for(const c of s)a!==c.row&&(a=c.row,l=Wt(n,this.left+i,this.right-this.lineWidths[a])),c.top+=this.top+t+i,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+i}else{let a=0,l=Wt(n,this.top+t+i,this.bottom-this.columnSizes[a].height);for(const c of s)c.col!==a&&(a=c.col,l=Wt(n,this.top+t+i,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+i,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Wr(t,this),this._draw(),$r(t)}}_draw(){const{options:t,columnSizes:s,lineWidths:n,ctx:i}=this,{align:r,labels:o}=t,a=wt.color,l=on(t.rtl,this.left,this.width),c=Nt(o.font),{padding:u}=o,d=c.size,h=d/2;let f;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=c.string;const{boxWidth:p,boxHeight:m,itemHeight:g}=td(o,d),b=function(P,R,_){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;i.save();const C=nt(_.lineWidth,1);if(i.fillStyle=nt(_.fillStyle,a),i.lineCap=nt(_.lineCap,"butt"),i.lineDashOffset=nt(_.lineDashOffset,0),i.lineJoin=nt(_.lineJoin,"miter"),i.lineWidth=C,i.strokeStyle=nt(_.strokeStyle,a),i.setLineDash(nt(_.lineDash,[])),o.usePointStyle){const N={radius:m*Math.SQRT2/2,pointStyle:_.pointStyle,rotation:_.rotation,borderWidth:C},j=l.xPlus(P,p/2),A=R+h;Rf(i,N,j,A,o.pointStyleWidth&&p)}else{const N=R+Math.max((d-m)/2,0),j=l.leftForLtr(P,p),A=js(_.borderRadius);i.beginPath(),Object.values(A).some(F=>F!==0)?ii(i,{x:j,y:N,w:p,h:m,radius:A}):i.rect(j,N,p,m),i.fill(),C!==0&&i.stroke()}i.restore()},x=function(P,R,_){$s(i,_.text,P,R+g/2,c,{strikethrough:_.hidden,textAlign:l.textAlign(_.textAlign)})},w=this.isHorizontal(),v=this._computeTitleHeight();w?f={x:Wt(r,this.left+u,this.right-n[0]),y:this.top+u+v,line:0}:f={x:this.left+u,y:Wt(r,this.top+v+u,this.bottom-s[0].height),line:0},Lf(this.ctx,t.textDirection);const S=g+u;this.legendItems.forEach((P,R)=>{i.strokeStyle=P.fontColor,i.fillStyle=P.fontColor;const _=i.measureText(P.text).width,C=l.textAlign(P.textAlign||(P.textAlign=o.textAlign)),N=p+h+_;let j=f.x,A=f.y;l.setWidth(this.width),w?R>0&&j+N+u>this.right&&(A=f.y+=S,f.line++,j=f.x=Wt(r,this.left+u,this.right-n[f.line])):R>0&&A+S>this.bottom&&(j=f.x=j+s[f.line].width+u,f.line++,A=f.y=Wt(r,this.top+v+u,this.bottom-s[f.line].height));const F=l.x(j);if(b(F,A,P),j=p_(C,j+p+h,w?j+N:this.right,t.rtl),x(l.x(j),A,P),w)f.x+=N+u;else if(typeof P.text!="string"){const V=c.lineHeight;f.y+=cp(P,V)+u}else f.y+=S}),Df(this.ctx,t.textDirection)}drawTitle(){const t=this.options,s=t.title,n=Nt(s.font),i=Yt(s.padding);if(!s.display)return;const r=on(t.rtl,this.left,this.width),o=this.ctx,a=s.position,l=n.size/2,c=i.top+l;let u,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+c,d=Wt(t.align,d,this.right-h);else{const p=this.columnSizes.reduce((m,g)=>Math.max(m,g.height),0);u=c+Wt(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const f=Wt(a,d,d+h);o.textAlign=r.textAlign(sl(a)),o.textBaseline="middle",o.strokeStyle=s.color,o.fillStyle=s.color,o.font=n.string,$s(o,s.text,f,u,n)}_computeTitleHeight(){const t=this.options.title,s=Nt(t.font),n=Yt(t.padding);return t.display?s.lineHeight+n.height:0}_getLegendItemAt(t,s){let n,i,r;if(Ye(t,this.left,this.right)&&Ye(s,this.top,this.bottom)){for(r=this.legendHitBoxes,n=0;n<r.length;++n)if(i=r[n],Ye(t,i.left,i.left+i.width)&&Ye(s,i.top,i.top+i.height))return this.legendItems[n]}return null}handleEvent(t){const s=this.options;if(!iR(t.type,s))return;const n=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,r=tR(i,n);i&&!r&&gt(s.onLeave,[t,i,this],this),this._hoveredItem=n,n&&!r&&gt(s.onHover,[t,n,this],this)}else n&&gt(s.onClick,[t,n,this],this)}}function eR(e,t,s,n,i){const r=sR(n,e,t,s),o=nR(i,n,t.lineHeight);return{itemWidth:r,itemHeight:o}}function sR(e,t,s,n){let i=e.text;return i&&typeof i!="string"&&(i=i.reduce((r,o)=>r.length>o.length?r:o)),t+s.size/2+n.measureText(i).width}function nR(e,t,s){let n=e;return typeof t.text!="string"&&(n=cp(t,s)),n}function cp(e,t){const s=e.text?e.text.length:0;return t*s}function iR(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var up={id:"legend",_element:ed,start(e,t,s){const n=e.legend=new ed({ctx:e.ctx,options:s,chart:e});Kt.configure(e,n,s),Kt.addBox(e,n)},stop(e){Kt.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,s){const n=e.legend;Kt.configure(e,n,s),n.options=s},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,s){const n=t.datasetIndex,i=s.chart;i.isDatasetVisible(n)?(i.hide(n),t.hidden=!0):(i.show(n),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:s,pointStyle:n,textAlign:i,color:r,useBorderRadius:o,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(s?0:void 0),u=Yt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:r,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:n||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.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 hl extends Je{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,s){const n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=s;const i=_t(n.text)?n.text.length:1;this._padding=Yt(n.padding);const r=i*Nt(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:s,left:n,bottom:i,right:r,options:o}=this,a=o.align;let l=0,c,u,d;return this.isHorizontal()?(u=Wt(a,n,r),d=s+t,c=r-n):(o.position==="left"?(u=n+t,d=Wt(a,i,s),l=pt*-.5):(u=r-t,d=Wt(a,s,i),l=pt*.5),c=i-s),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,s=this.options;if(!s.display)return;const n=Nt(s.font),r=n.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);$s(t,s.text,0,0,n,{color:s.color,maxWidth:l,rotation:c,textAlign:sl(s.align),textBaseline:"middle",translation:[o,a]})}}function rR(e,t){const s=new hl({ctx:e.ctx,options:t,chart:e});Kt.configure(e,s,t),Kt.addBox(e,s),e.titleBlock=s}var oR={id:"title",_element:hl,start(e,t,s){rR(e,s)},stop(e){const t=e.titleBlock;Kt.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,s){const n=e.titleBlock;Kt.configure(e,n,s),n.options=s},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 qi=new WeakMap;var aR={id:"subtitle",start(e,t,s){const n=new hl({ctx:e.ctx,options:s,chart:e});Kt.configure(e,n,s),Kt.addBox(e,n),qi.set(e,n)},stop(e){Kt.removeBox(e,qi.get(e)),qi.delete(e)},beforeUpdate(e,t,s){const n=qi.get(e);Kt.configure(e,n,s),n.options=s},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const zn={average(e){if(!e.length)return!1;let t,s,n=new Set,i=0,r=0;for(t=0,s=e.length;t<s;++t){const a=e[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();n.add(l.x),i+=l.y,++r}}return r===0||n.size===0?!1:{x:[...n].reduce((a,l)=>a+l)/n.size,y:i/r}},nearest(e,t){if(!e.length)return!1;let s=t.x,n=t.y,i=Number.POSITIVE_INFINITY,r,o,a;for(r=0,o=e.length;r<o;++r){const l=e[r].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=ha(t,c);u<i&&(i=u,a=l)}}if(a){const l=a.tooltipPosition();s=l.x,n=l.y}return{x:s,y:n}}};function Oe(e,t){return t&&(_t(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function We(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
12
+ `)>-1?e.split(`
13
+ `):e}function lR(e,t){const{element:s,datasetIndex:n,index:i}=t,r=e.getDatasetMeta(n).controller,{label:o,value:a}=r.getLabelAndValue(i);return{chart:e,label:o,parsed:r.getParsed(i),raw:e.data.datasets[n].data[i],formattedValue:a,dataset:r.getDataset(),dataIndex:i,datasetIndex:n,element:s}}function sd(e,t){const s=e.chart.ctx,{body:n,footer:i,title:r}=e,{boxWidth:o,boxHeight:a}=t,l=Nt(t.bodyFont),c=Nt(t.titleFont),u=Nt(t.footerFont),d=r.length,h=i.length,f=n.length,p=Yt(t.padding);let m=p.height,g=0,b=n.reduce((v,S)=>v+S.before.length+S.lines.length+S.after.length,0);if(b+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const v=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=f*v+(b-f)*l.lineHeight+(b-1)*t.bodySpacing}h&&(m+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let x=0;const w=function(v){g=Math.max(g,s.measureText(v).width+x)};return s.save(),s.font=c.string,mt(e.title,w),s.font=l.string,mt(e.beforeBody.concat(e.afterBody),w),x=t.displayColors?o+2+t.boxPadding:0,mt(n,v=>{mt(v.before,w),mt(v.lines,w),mt(v.after,w)}),x=0,s.font=u.string,mt(e.footer,w),s.restore(),g+=p.width,{width:g,height:m}}function cR(e,t){const{y:s,height:n}=t;return s<n/2?"top":s>e.height-n/2?"bottom":"center"}function uR(e,t,s,n){const{x:i,width:r}=n,o=s.caretSize+s.caretPadding;if(e==="left"&&i+r+o>t.width||e==="right"&&i-r-o<0)return!0}function dR(e,t,s,n){const{x:i,width:r}=s,{width:o,chartArea:{left:a,right:l}}=e;let c="center";return n==="center"?c=i<=(a+l)/2?"left":"right":i<=r/2?c="left":i>=o-r/2&&(c="right"),uR(c,e,t,s)&&(c="center"),c}function nd(e,t,s){const n=s.yAlign||t.yAlign||cR(e,s);return{xAlign:s.xAlign||t.xAlign||dR(e,t,s,n),yAlign:n}}function hR(e,t){let{x:s,width:n}=e;return t==="right"?s-=n:t==="center"&&(s-=n/2),s}function fR(e,t,s){let{y:n,height:i}=e;return t==="top"?n+=s:t==="bottom"?n-=i+s:n-=i/2,n}function id(e,t,s,n){const{caretSize:i,caretPadding:r,cornerRadius:o}=e,{xAlign:a,yAlign:l}=s,c=i+r,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:f}=js(o);let p=hR(t,a);const m=fR(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,h)+i:a==="right"&&(p+=Math.max(d,f)+i),{x:jt(p,0,n.width-t.width),y:jt(m,0,n.height-t.height)}}function Ki(e,t,s){const n=Yt(s.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-n.right:e.x+n.left}function rd(e){return Oe([],We(e))}function pR(e,t,s){return bs(e,{tooltip:t,tooltipItems:s,type:"tooltip"})}function od(e,t){const s=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return s?e.override(s):e}const dp={beforeTitle:ze,title(e){if(e.length>0){const t=e[0],s=t.chart.data.labels,n=s?s.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(n>0&&t.dataIndex<n)return s[t.dataIndex]}return""},afterTitle:ze,beforeBody:ze,beforeLabel:ze,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const s=e.formattedValue;return lt(s)||(t+=s),t},labelColor(e){const s=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:s.borderColor,backgroundColor:s.backgroundColor,borderWidth:s.borderWidth,borderDash:s.borderDash,borderDashOffset:s.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const s=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:s.pointStyle,rotation:s.rotation}},afterLabel:ze,afterBody:ze,beforeFooter:ze,footer:ze,afterFooter:ze};function Jt(e,t,s,n){const i=e[t].call(s,n);return typeof i>"u"?dp[t].call(s,n):i}class ad extends Je{static positioners=zn;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 s=this.chart,n=this.options.setContext(this.getContext()),i=n.enabled&&s.options.animation&&n.animations,r=new Bf(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=pR(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,s){const{callbacks:n}=s,i=Jt(n,"beforeTitle",this,t),r=Jt(n,"title",this,t),o=Jt(n,"afterTitle",this,t);let a=[];return a=Oe(a,We(i)),a=Oe(a,We(r)),a=Oe(a,We(o)),a}getBeforeBody(t,s){return rd(Jt(s.callbacks,"beforeBody",this,t))}getBody(t,s){const{callbacks:n}=s,i=[];return mt(t,r=>{const o={before:[],lines:[],after:[]},a=od(n,r);Oe(o.before,We(Jt(a,"beforeLabel",this,r))),Oe(o.lines,Jt(a,"label",this,r)),Oe(o.after,We(Jt(a,"afterLabel",this,r))),i.push(o)}),i}getAfterBody(t,s){return rd(Jt(s.callbacks,"afterBody",this,t))}getFooter(t,s){const{callbacks:n}=s,i=Jt(n,"beforeFooter",this,t),r=Jt(n,"footer",this,t),o=Jt(n,"afterFooter",this,t);let a=[];return a=Oe(a,We(i)),a=Oe(a,We(r)),a=Oe(a,We(o)),a}_createItems(t){const s=this._active,n=this.chart.data,i=[],r=[],o=[];let a=[],l,c;for(l=0,c=s.length;l<c;++l)a.push(lR(this.chart,s[l]));return t.filter&&(a=a.filter((u,d,h)=>t.filter(u,d,h,n))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,n))),mt(a,u=>{const d=od(t.callbacks,u);i.push(Jt(d,"labelColor",this,u)),r.push(Jt(d,"labelPointStyle",this,u)),o.push(Jt(d,"labelTextColor",this,u))}),this.labelColors=i,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,s){const n=this.options.setContext(this.getContext()),i=this._active;let r,o=[];if(!i.length)this.opacity!==0&&(r={opacity:0});else{const a=zn[n.position].call(this,i,this._eventPosition);o=this._createItems(n),this.title=this.getTitle(o,n),this.beforeBody=this.getBeforeBody(o,n),this.body=this.getBody(o,n),this.afterBody=this.getAfterBody(o,n),this.footer=this.getFooter(o,n);const l=this._size=sd(this,n),c=Object.assign({},a,l),u=nd(this.chart,n,c),d=id(n,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:s})}drawCaret(t,s,n,i){const r=this.getCaretPosition(t,n,i);s.lineTo(r.x1,r.y1),s.lineTo(r.x2,r.y2),s.lineTo(r.x3,r.y3)}getCaretPosition(t,s,n){const{xAlign:i,yAlign:r}=this,{caretSize:o,cornerRadius:a}=n,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=js(a),{x:h,y:f}=t,{width:p,height:m}=s;let g,b,x,w,v,S;return r==="center"?(v=f+m/2,i==="left"?(g=h,b=g-o,w=v+o,S=v-o):(g=h+p,b=g+o,w=v-o,S=v+o),x=g):(i==="left"?b=h+Math.max(l,u)+o:i==="right"?b=h+p-Math.max(c,d)-o:b=this.caretX,r==="top"?(w=f,v=w-o,g=b-o,x=b+o):(w=f+m,v=w+o,g=b+o,x=b-o),S=w),{x1:g,x2:b,x3:x,y1:w,y2:v,y3:S}}drawTitle(t,s,n){const i=this.title,r=i.length;let o,a,l;if(r){const c=on(n.rtl,this.x,this.width);for(t.x=Ki(this,n.titleAlign,n),s.textAlign=c.textAlign(n.titleAlign),s.textBaseline="middle",o=Nt(n.titleFont),a=n.titleSpacing,s.fillStyle=n.titleColor,s.font=o.string,l=0;l<r;++l)s.fillText(i[l],c.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===r&&(t.y+=n.titleMarginBottom-a)}}_drawColorBox(t,s,n,i,r){const o=this.labelColors[n],a=this.labelPointStyles[n],{boxHeight:l,boxWidth:c}=r,u=Nt(r.bodyFont),d=Ki(this,"left",r),h=i.x(d),f=l<u.lineHeight?(u.lineHeight-l)/2:0,p=s.y+f;if(r.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},g=i.leftForLtr(h,c)+c/2,b=p+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,pa(t,m,g,b),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,pa(t,m,g,b)}else{t.lineWidth=ut(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const m=i.leftForLtr(h,c),g=i.leftForLtr(i.xPlus(h,1),c-2),b=js(o.borderRadius);Object.values(b).some(x=>x!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,ii(t,{x:m,y:p,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),ii(t,{x:g,y:p+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(m,p,c,l),t.strokeRect(m,p,c,l),t.fillStyle=o.backgroundColor,t.fillRect(g,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,s,n){const{body:i}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=n,d=Nt(n.bodyFont);let h=d.lineHeight,f=0;const p=on(n.rtl,this.x,this.width),m=function(_){s.fillText(_,p.x(t.x+f),t.y+h/2),t.y+=h+r},g=p.textAlign(o);let b,x,w,v,S,P,R;for(s.textAlign=o,s.textBaseline="middle",s.font=d.string,t.x=Ki(this,g,n),s.fillStyle=n.bodyColor,mt(this.beforeBody,m),f=a&&g!=="right"?o==="center"?c/2+u:c+2+u:0,v=0,P=i.length;v<P;++v){for(b=i[v],x=this.labelTextColors[v],s.fillStyle=x,mt(b.before,m),w=b.lines,a&&w.length&&(this._drawColorBox(s,t,v,p,n),h=Math.max(d.lineHeight,l)),S=0,R=w.length;S<R;++S)m(w[S]),h=d.lineHeight;mt(b.after,m)}f=0,h=d.lineHeight,mt(this.afterBody,m),t.y-=r}drawFooter(t,s,n){const i=this.footer,r=i.length;let o,a;if(r){const l=on(n.rtl,this.x,this.width);for(t.x=Ki(this,n.footerAlign,n),t.y+=n.footerMarginTop,s.textAlign=l.textAlign(n.footerAlign),s.textBaseline="middle",o=Nt(n.footerFont),s.fillStyle=n.footerColor,s.font=o.string,a=0;a<r;++a)s.fillText(i[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+n.footerSpacing}}drawBackground(t,s,n,i){const{xAlign:r,yAlign:o}=this,{x:a,y:l}=t,{width:c,height:u}=n,{topLeft:d,topRight:h,bottomLeft:f,bottomRight:p}=js(i.cornerRadius);s.fillStyle=i.backgroundColor,s.strokeStyle=i.borderColor,s.lineWidth=i.borderWidth,s.beginPath(),s.moveTo(a+d,l),o==="top"&&this.drawCaret(t,s,n,i),s.lineTo(a+c-h,l),s.quadraticCurveTo(a+c,l,a+c,l+h),o==="center"&&r==="right"&&this.drawCaret(t,s,n,i),s.lineTo(a+c,l+u-p),s.quadraticCurveTo(a+c,l+u,a+c-p,l+u),o==="bottom"&&this.drawCaret(t,s,n,i),s.lineTo(a+f,l+u),s.quadraticCurveTo(a,l+u,a,l+u-f),o==="center"&&r==="left"&&this.drawCaret(t,s,n,i),s.lineTo(a,l+d),s.quadraticCurveTo(a,l,a+d,l),s.closePath(),s.fill(),i.borderWidth>0&&s.stroke()}_updateAnimationTarget(t){const s=this.chart,n=this.$animations,i=n&&n.x,r=n&&n.y;if(i||r){const o=zn[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=sd(this,t),l=Object.assign({},o,this._size),c=nd(s,t,l),u=id(t,l,c,s);(i._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const s=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(s);const i={width:this.width,height:this.height},r={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const o=Yt(s.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;s.enabled&&a&&(t.save(),t.globalAlpha=n,this.drawBackground(r,t,i,s),Lf(t,s.textDirection),r.y+=o.top,this.drawTitle(r,t,s),this.drawBody(r,t,s),this.drawFooter(r,t,s),Df(t,s.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,s){const n=this._active,i=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!wr(n,i),o=this._positionChanged(i,s);(r||o)&&(this._active=i,this._eventPosition=s,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,s,n=!0){if(s&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,r=this._active||[],o=this._getActiveElements(t,r,s,n),a=this._positionChanged(o,t),l=s||!wr(o,r)||a;return l&&(this._active=o,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,s))),l}_getActiveElements(t,s,n,i){const r=this.options;if(t.type==="mouseout")return[];if(!i)return s.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,r.mode,r,n);return r.reverse&&o.reverse(),o}_positionChanged(t,s){const{caretX:n,caretY:i,options:r}=this,o=zn[r.position].call(this,t,s);return o!==!1&&(n!==o.x||i!==o.y)}}var hp={id:"tooltip",_element:ad,positioners:zn,afterInit(e,t,s){s&&(e.tooltip=new ad({chart:e,options:s}))},beforeUpdate(e,t,s){e.tooltip&&e.tooltip.initialize(s)},reset(e,t,s){e.tooltip&&e.tooltip.initialize(s)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const s={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...s,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",s)}},afterEvent(e,t){if(e.tooltip){const s=t.replay;e.tooltip.handleEvent(t.event,s,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:dp},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"]},mR=Object.freeze({__proto__:null,Colors:Tk,Decimation:Dk,Filler:lp,Legend:up,SubTitle:aR,Title:oR,Tooltip:hp});const gR=(e,t,s,n)=>(typeof t=="string"?(s=e.push(t)-1,n.unshift({index:s,label:t})):isNaN(t)&&(s=null),s);function bR(e,t,s,n){const i=e.indexOf(t);if(i===-1)return gR(e,t,s,n);const r=e.lastIndexOf(t);return i!==r?s:i}const yR=(e,t)=>e===null?null:jt(Math.round(e),0,t);function ld(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class fp extends Ys{static id="category";static defaults={ticks:{callback:ld}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const s=this._addedLabels;if(s.length){const n=this.getLabels();for(const{index:i,label:r}of s)n[i]===r&&n.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,s){if(lt(t))return null;const n=this.getLabels();return s=isFinite(s)&&n[s]===t?s:bR(n,t,nt(s,t),this._addedLabels),yR(s,n.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:s}=this.getUserBounds();let{min:n,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(n=0),s||(i=this.getLabels().length-1)),this.min=n,this.max=i}buildTicks(){const t=this.min,s=this.max,n=this.options.offset,i=[];let r=this.getLabels();r=t===0&&s===r.length-1?r:r.slice(t,s+1),this._valueRange=Math.max(r.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let o=t;o<=s;o++)i.push({value:o});return i}getLabelForValue(t){return ld.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const s=this.ticks;return t<0||t>s.length-1?null:this.getPixelForValue(s[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function xR(e,t){const s=[],{bounds:i,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=e,f=r||1,p=u-1,{min:m,max:g}=t,b=!lt(o),x=!lt(a),w=!lt(c),v=(g-m)/(d+1);let S=su((g-m)/p/f)*f,P,R,_,C;if(S<1e-14&&!b&&!x)return[{value:m},{value:g}];C=Math.ceil(g/S)-Math.floor(m/S),C>p&&(S=su(C*S/p/f)*f),lt(l)||(P=Math.pow(10,l),S=Math.ceil(S*P)/P),i==="ticks"?(R=Math.floor(m/S)*S,_=Math.ceil(g/S)*S):(R=m,_=g),b&&x&&r&&a_((a-o)/r,S/1e3)?(C=Math.round(Math.min((a-o)/S,u)),S=(a-o)/C,R=o,_=a):w?(R=b?o:R,_=x?a:_,C=c-1,S=(_-R)/C):(C=(_-R)/S,Kn(C,Math.round(C),S/1e3)?C=Math.round(C):C=Math.ceil(C));const N=Math.max(nu(S),nu(R));P=Math.pow(10,lt(l)?N:l),R=Math.round(R*P)/P,_=Math.round(_*P)/P;let j=0;for(b&&(h&&R!==o?(s.push({value:o}),R<o&&j++,Kn(Math.round((R+j*S)*P)/P,o,cd(o,v,e))&&j++):R<o&&j++);j<C;++j){const A=Math.round((R+j*S)*P)/P;if(x&&A>a)break;s.push({value:A})}return x&&h&&_!==a?s.length&&Kn(s[s.length-1].value,a,cd(a,v,e))?s[s.length-1].value=a:s.push({value:a}):(!x||_===a)&&s.push({value:_}),s}function cd(e,t,{horizontal:s,minRotation:n}){const i=ke(n),r=(s?Math.sin(i):Math.cos(i))||.001,o=.75*t*(""+e).length;return Math.min(t/r,o)}class Or extends Ys{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,s){return lt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:s,maxDefined:n}=this.getUserBounds();let{min:i,max:r}=this;const o=l=>i=s?i:l,a=l=>r=n?r:l;if(t){const l=Fe(i),c=Fe(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(i===r){let l=r===0?1:Math.abs(r*.05);a(r+l),t||o(i-l)}this.min=i,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:s,stepSize:n}=t,i;return n?(i=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),s=s||11),s&&(i=Math.min(s,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,s=t.ticks;let n=this.getTickLimit();n=Math.max(2,n);const i={maxTicks:n,bounds:t.bounds,min:t.min,max:t.max,precision:s.precision,step:s.stepSize,count:s.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:s.minRotation||0,includeBounds:s.includeBounds!==!1},r=this._range||this,o=xR(i,r);return t.bounds==="ticks"&&gf(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 s=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){const i=(n-s)/Math.max(t.length-1,1)/2;s-=i,n+=i}this._startValue=s,this._endValue=n,this._valueRange=n-s}getLabelForValue(t){return gi(t,this.chart.options.locale,this.options.ticks.format)}}class pp extends Or{static id="linear";static defaults={ticks:{callback:Ur.formatters.numeric}};determineDataLimits(){const{min:t,max:s}=this.getMinMax(!0);this.min=Pt(t)?t:0,this.max=Pt(s)?s:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),s=t?this.width:this.height,n=ke(this.options.ticks.minRotation),i=(t?Math.sin(n):Math.cos(n))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(s/Math.min(40,r.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const oi=e=>Math.floor(as(e)),Es=(e,t)=>Math.pow(10,oi(e)+t);function ud(e){return e/Math.pow(10,oi(e))===1}function dd(e,t,s){const n=Math.pow(10,s),i=Math.floor(e/n);return Math.ceil(t/n)-i}function vR(e,t){const s=t-e;let n=oi(s);for(;dd(e,t,n)>10;)n++;for(;dd(e,t,n)<10;)n--;return Math.min(n,oi(e))}function _R(e,{min:t,max:s}){t=ae(e.min,t);const n=[],i=oi(t);let r=vR(t,s),o=r<0?Math.pow(10,Math.abs(r)):1;const a=Math.pow(10,r),l=i>r?Math.pow(10,i):0,c=Math.round((t-l)*o)/o,u=Math.floor((t-l)/a/10)*a*10;let d=Math.floor((c-u)/Math.pow(10,r)),h=ae(e.min,Math.round((l+u+d*Math.pow(10,r))*o)/o);for(;h<s;)n.push({value:h,major:ud(h),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(r++,d=2,o=r>=0?1:o),h=Math.round((l+u+d*Math.pow(10,r))*o)/o;const f=ae(e.max,h);return n.push({value:f,major:ud(f),significand:d}),n}class wR extends Ys{static id="logarithmic";static defaults={ticks:{callback:Ur.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,s){const n=Or.prototype.parse.apply(this,[t,s]);if(n===0){this._zero=!0;return}return Pt(n)&&n>0?n:null}determineDataLimits(){const{min:t,max:s}=this.getMinMax(!0);this.min=Pt(t)?Math.max(0,t):null,this.max=Pt(s)?Math.max(0,s):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Pt(this._userMin)&&(this.min=t===Es(this.min,0)?Es(this.min,-1):Es(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:s}=this.getUserBounds();let n=this.min,i=this.max;const r=a=>n=t?n:a,o=a=>i=s?i:a;n===i&&(n<=0?(r(1),o(10)):(r(Es(n,-1)),o(Es(i,1)))),n<=0&&r(Es(i,-1)),i<=0&&o(Es(n,1)),this.min=n,this.max=i}buildTicks(){const t=this.options,s={min:this._userMin,max:this._userMax},n=_R(s,this);return t.bounds==="ticks"&&gf(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}getLabelForValue(t){return t===void 0?"0":gi(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=as(t),this._valueRange=as(this.max)-as(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(as(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const s=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+s*this._valueRange)}}function va(e){const t=e.ticks;if(t.display&&e.display){const s=Yt(t.backdropPadding);return nt(t.font&&t.font.size,wt.font.size)+s.height}return 0}function SR(e,t,s){return s=_t(s)?s:[s],{w:k_(e,t.string,s),h:s.length*t.lineHeight}}function hd(e,t,s,n,i){return e===n||e===i?{start:t-s/2,end:t+s/2}:e<n||e>i?{start:t-s,end:t}:{start:t,end:t+s}}function kR(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},s=Object.assign({},t),n=[],i=[],r=e._pointLabels.length,o=e.options.pointLabels,a=o.centerPointLabels?pt/r:0;for(let l=0;l<r;l++){const c=o.setContext(e.getPointLabelContext(l));i[l]=c.padding;const u=e.getPointPosition(l,e.drawingArea+i[l],a),d=Nt(c.font),h=SR(e.ctx,d,e._pointLabels[l]);n[l]=h;const f=$t(e.getIndexAngle(l)+a),p=Math.round(tl(f)),m=hd(p,u.x,h.w,0,180),g=hd(p,u.y,h.h,90,270);RR(s,t,f,m,g)}e.setCenterPoint(t.l-s.l,s.r-t.r,t.t-s.t,s.b-t.b),e._pointLabelItems=CR(e,n,i)}function RR(e,t,s,n,i){const r=Math.abs(Math.sin(s)),o=Math.abs(Math.cos(s));let a=0,l=0;n.start<t.l?(a=(t.l-n.start)/r,e.l=Math.min(e.l,t.l-a)):n.end>t.r&&(a=(n.end-t.r)/r,e.r=Math.max(e.r,t.r+a)),i.start<t.t?(l=(t.t-i.start)/o,e.t=Math.min(e.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/o,e.b=Math.max(e.b,t.b+l))}function PR(e,t,s){const n=e.drawingArea,{extra:i,additionalAngle:r,padding:o,size:a}=s,l=e.getPointPosition(t,n+i+o,r),c=Math.round(tl($t(l.angle+Et))),u=MR(l.y,a.h,c),d=OR(c),h=TR(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+a.w,bottom:u+a.h}}function ER(e,t){if(!t)return!0;const{left:s,top:n,right:i,bottom:r}=e;return!(Xe({x:s,y:n},t)||Xe({x:s,y:r},t)||Xe({x:i,y:n},t)||Xe({x:i,y:r},t))}function CR(e,t,s){const n=[],i=e._pointLabels.length,r=e.options,{centerPointLabels:o,display:a}=r.pointLabels,l={extra:va(r)/2,additionalAngle:o?pt/i:0};let c;for(let u=0;u<i;u++){l.padding=s[u],l.size=t[u];const d=PR(e,u,l);n.push(d),a==="auto"&&(d.visible=ER(d,c),d.visible&&(c=d))}return n}function OR(e){return e===0||e===180?"center":e<180?"left":"right"}function TR(e,t,s){return s==="right"?e-=t:s==="center"&&(e-=t/2),e}function MR(e,t,s){return s===90||s===270?e-=t/2:(s>270||s<90)&&(e-=t),e}function AR(e,t,s){const{left:n,top:i,right:r,bottom:o}=s,{backdropColor:a}=t;if(!lt(a)){const l=js(t.borderRadius),c=Yt(t.backdropPadding);e.fillStyle=a;const u=n-c.left,d=i-c.top,h=r-n+c.width,f=o-i+c.height;Object.values(l).some(p=>p!==0)?(e.beginPath(),ii(e,{x:u,y:d,w:h,h:f,radius:l}),e.fill()):e.fillRect(u,d,h,f)}}function LR(e,t){const{ctx:s,options:{pointLabels:n}}=e;for(let i=t-1;i>=0;i--){const r=e._pointLabelItems[i];if(!r.visible)continue;const o=n.setContext(e.getPointLabelContext(i));AR(s,o,r);const a=Nt(o.font),{x:l,y:c,textAlign:u}=r;$s(s,e._pointLabels[i],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function mp(e,t,s,n){const{ctx:i}=e;if(s)i.arc(e.xCenter,e.yCenter,t,0,xt);else{let r=e.getPointPosition(0,t);i.moveTo(r.x,r.y);for(let o=1;o<n;o++)r=e.getPointPosition(o,t),i.lineTo(r.x,r.y)}}function DR(e,t,s,n,i){const r=e.ctx,o=t.circular,{color:a,lineWidth:l}=t;!o&&!n||!a||!l||s<0||(r.save(),r.strokeStyle=a,r.lineWidth=l,r.setLineDash(i.dash||[]),r.lineDashOffset=i.dashOffset,r.beginPath(),mp(e,s,o,n),r.closePath(),r.stroke(),r.restore())}function NR(e,t,s){return bs(e,{label:s,index:t,type:"pointLabel"})}class FR extends Or{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ur.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=Yt(va(this.options)/2),s=this.width=this.maxWidth-t.width,n=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+s/2+t.left),this.yCenter=Math.floor(this.top+n/2+t.top),this.drawingArea=Math.floor(Math.min(s,n)/2)}determineDataLimits(){const{min:t,max:s}=this.getMinMax(!1);this.min=Pt(t)&&!isNaN(t)?t:0,this.max=Pt(s)&&!isNaN(s)?s:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/va(this.options))}generateTickLabels(t){Or.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((s,n)=>{const i=gt(this.options.pointLabels.callback,[s,n],this);return i||i===0?i:""}).filter((s,n)=>this.chart.getDataVisibility(n))}fit(){const t=this.options;t.display&&t.pointLabels.display?kR(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,s,n,i){this.xCenter+=Math.floor((t-s)/2),this.yCenter+=Math.floor((n-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,s,n,i))}getIndexAngle(t){const s=xt/(this._pointLabels.length||1),n=this.options.startAngle||0;return $t(t*s+ke(n))}getDistanceFromCenterForValue(t){if(lt(t))return NaN;const s=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*s:(t-this.min)*s}getValueForDistanceFromCenter(t){if(lt(t))return NaN;const s=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-s:this.min+s}getPointLabelContext(t){const s=this._pointLabels||[];if(t>=0&&t<s.length){const n=s[t];return NR(this.getContext(),t,n)}}getPointPosition(t,s,n=0){const i=this.getIndexAngle(t)-Et+n;return{x:Math.cos(i)*s+this.xCenter,y:Math.sin(i)*s+this.yCenter,angle:i}}getPointPositionForValue(t,s){return this.getPointPosition(t,this.getDistanceFromCenterForValue(s))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:s,top:n,right:i,bottom:r}=this._pointLabelItems[t];return{left:s,top:n,right:i,bottom:r}}drawBackground(){const{backgroundColor:t,grid:{circular:s}}=this.options;if(t){const n=this.ctx;n.save(),n.beginPath(),mp(this,this.getDistanceFromCenterForValue(this._endValue),s,this._pointLabels.length),n.closePath(),n.fillStyle=t,n.fill(),n.restore()}}drawGrid(){const t=this.ctx,s=this.options,{angleLines:n,grid:i,border:r}=s,o=this._pointLabels.length;let a,l,c;if(s.pointLabels.display&&LR(this,o),i.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(d),f=i.setContext(h),p=r.setContext(h);DR(this,f,l,o,p)}}),n.display){for(t.save(),a=o-1;a>=0;a--){const u=n.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:h}=u;!h||!d||(t.lineWidth=h,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(s.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,s=this.options,n=s.ticks;if(!n.display)return;const i=this.getIndexAngle(0);let r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!s.reverse)return;const c=n.setContext(this.getContext(l)),u=Nt(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=Yt(c.backdropPadding);t.fillRect(-o/2-d.left,-r-u.size/2-d.top,o+d.width,u.size+d.height)}$s(t,a.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}const Gr={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}},ne=Object.keys(Gr);function fd(e,t){return e-t}function pd(e,t){if(lt(t))return null;const s=e._adapter,{parser:n,round:i,isoWeekday:r}=e._parseOpts;let o=t;return typeof n=="function"&&(o=n(o)),Pt(o)||(o=typeof n=="string"?s.parse(o,n):s.parse(o)),o===null?null:(i&&(o=i==="week"&&(dn(r)||r===!0)?s.startOf(o,"isoWeek",r):s.startOf(o,i)),+o)}function md(e,t,s,n){const i=ne.length;for(let r=ne.indexOf(e);r<i-1;++r){const o=Gr[ne[r]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((s-t)/(a*o.size))<=n)return ne[r]}return ne[i-1]}function IR(e,t,s,n,i){for(let r=ne.length-1;r>=ne.indexOf(s);r--){const o=ne[r];if(Gr[o].common&&e._adapter.diff(i,n,o)>=t-1)return o}return ne[s?ne.indexOf(s):0]}function jR(e){for(let t=ne.indexOf(e)+1,s=ne.length;t<s;++t)if(Gr[ne[t]].common)return ne[t]}function gd(e,t,s){if(!s)e[t]=!0;else if(s.length){const{lo:n,hi:i}=el(s,t),r=s[n]>=t?s[n]:s[i];e[r]=!0}}function BR(e,t,s,n){const i=e._adapter,r=+i.startOf(t[0].value,n),o=t[t.length-1].value;let a,l;for(a=r;a<=o;a=+i.add(a,1,n))l=s[a],l>=0&&(t[l].major=!0);return t}function bd(e,t,s){const n=[],i={},r=t.length;let o,a;for(o=0;o<r;++o)a=t[o],i[a]=o,n.push({value:a,major:!1});return r===0||!s?n:BR(e,n,i,s)}class Tr extends Ys{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,s={}){const n=t.time||(t.time={}),i=this._adapter=new qw._date(t.adapters.date);i.init(s),qn(n.displayFormats,i.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=s.normalized}parse(t,s){return t===void 0?null:pd(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,s=this._adapter,n=t.time.unit||"day";let{min:i,max:r,minDefined:o,maxDefined:a}=this.getUserBounds();function l(c){!o&&!isNaN(c.min)&&(i=Math.min(i,c.min)),!a&&!isNaN(c.max)&&(r=Math.max(r,c.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=Pt(i)&&!isNaN(i)?i:+s.startOf(Date.now(),n),r=Pt(r)&&!isNaN(r)?r:+s.endOf(Date.now(),n)+1,this.min=Math.min(i,r-1),this.max=Math.max(i+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let s=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(s=t[0],n=t[t.length-1]),{min:s,max:n}}buildTicks(){const t=this.options,s=t.time,n=t.ticks,i=n.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const r=this.min,o=this.max,a=d_(i,r,o);return this._unit=s.unit||(n.autoSkip?md(s.minUnit,this.min,this.max,this._getLabelCapacity(r)):IR(this,a.length,s.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit==="year"?void 0:jR(this._unit),this.initOffsets(i),t.reverse&&a.reverse(),bd(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let s=0,n=0,i,r;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?s=1-i:s=(this.getDecimalForValue(t[1])-i)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?n=r:n=(r-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;s=jt(s,0,o),n=jt(n,0,o),this._offsets={start:s,end:n,factor:1/(s+1+n)}}_generate(){const t=this._adapter,s=this.min,n=this.max,i=this.options,r=i.time,o=r.unit||md(r.minUnit,s,n,this._getLabelCapacity(s)),a=nt(i.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=dn(l)||l===!0,u={};let d=s,h,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":o),t.diff(n,s,o)>1e5*a)throw new Error(s+" and "+n+" are too far apart with stepSize of "+a+" "+o);const p=i.ticks.source==="data"&&this.getDataTimestamps();for(h=d,f=0;h<n;h=+t.add(h,a,o),f++)gd(u,h,p);return(h===n||i.bounds==="ticks"||f===1)&&gd(u,h,p),Object.keys(u).sort(fd).map(m=>+m)}getLabelForValue(t){const s=this._adapter,n=this.options.time;return n.tooltipFormat?s.format(t,n.tooltipFormat):s.format(t,n.displayFormats.datetime)}format(t,s){const i=this.options.time.displayFormats,r=this._unit,o=s||i[r];return this._adapter.format(t,o)}_tickFormatFunction(t,s,n,i){const r=this.options,o=r.ticks.callback;if(o)return gt(o,[t,s,n],this);const a=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],h=n[s],f=c&&d&&h&&h.major;return this._adapter.format(t,i||(f?d:u))}generateTickLabels(t){let s,n,i;for(s=0,n=t.length;s<n;++s)i=t[s],i.label=this._tickFormatFunction(i.value,s,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const s=this._offsets,n=this.getDecimalForValue(t);return this.getPixelForDecimal((s.start+n)*s.factor)}getValueForPixel(t){const s=this._offsets,n=this.getDecimalForPixel(t)/s.factor-s.end;return this.min+n*(this.max-this.min)}_getLabelSize(t){const s=this.options.ticks,n=this.ctx.measureText(t).width,i=ke(this.isHorizontal()?s.maxRotation:s.minRotation),r=Math.cos(i),o=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:n*r+a*o,h:n*o+a*r}}_getLabelCapacity(t){const s=this.options.time,n=s.displayFormats,i=n[s.unit]||n.millisecond,r=this._tickFormatFunction(t,0,bd(this,[t],this._majorUnit),i),o=this._getLabelSize(r),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],s,n;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(s=0,n=i.length;s<n;++s)t=t.concat(i[s].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let s,n;if(t.length)return t;const i=this.getLabels();for(s=0,n=i.length;s<n;++s)t.push(pd(this,i[s]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return xf(t.sort(fd))}}function Yi(e,t,s){let n=0,i=e.length-1,r,o,a,l;s?(t>=e[n].pos&&t<=e[i].pos&&({lo:n,hi:i}=Ge(e,"pos",t)),{pos:r,time:a}=e[n],{pos:o,time:l}=e[i]):(t>=e[n].time&&t<=e[i].time&&({lo:n,hi:i}=Ge(e,"time",t)),{time:r,pos:a}=e[n],{time:o,pos:l}=e[i]);const c=o-r;return c?a+(l-a)*(t-r)/c:a}class VR extends Tr{static id="timeseries";static defaults=Tr.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),s=this._table=this.buildLookupTable(t);this._minPos=Yi(s,this.min),this._tableRange=Yi(s,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:s,max:n}=this,i=[],r=[];let o,a,l,c,u;for(o=0,a=t.length;o<a;++o)c=t[o],c>=s&&c<=n&&i.push(c);if(i.length<2)return[{time:s,pos:0},{time:n,pos:1}];for(o=0,a=i.length;o<a;++o)u=i[o+1],l=i[o-1],c=i[o],Math.round((u+l)/2)!==c&&r.push({time:c,pos:o/(a-1)});return r}_generate(){const t=this.min,s=this.max;let n=super.getDataTimestamps();return(!n.includes(t)||!n.length)&&n.splice(0,0,t),(!n.includes(s)||n.length===1)&&n.push(s),n.sort((i,r)=>i-r)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const s=this.getDataTimestamps(),n=this.getLabelTimestamps();return s.length&&n.length?t=this.normalize(s.concat(n)):t=s.length?s:n,t=this._cache.all=t,t}getDecimalForValue(t){return(Yi(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const s=this._offsets,n=this.getDecimalForPixel(t)/s.factor-s.end;return Yi(this._table,n*this._tableRange+this._minPos,!0)}}var zR=Object.freeze({__proto__:null,CategoryScale:fp,LinearScale:pp,LogarithmicScale:wR,RadialLinearScale:FR,TimeScale:Tr,TimeSeriesScale:VR});const HR=[$w,Sk,mR,zR],gp="label";function yd(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function UR(e,t){const s=e.options;s&&t&&Object.assign(s,t)}function bp(e,t){e.labels=t}function yp(e,t,s=gp){const n=[];e.datasets=t.map(i=>{const r=e.datasets.find(o=>o[s]===i[s]);return!r||!i.data||n.includes(r)?{...i}:(n.push(r),Object.assign(r,i),r)})}function WR(e,t=gp){const s={labels:[],datasets:[]};return bp(s,e.labels),yp(s,e.datasets,t),s}function $R(e,t){const{height:s=150,width:n=300,redraw:i=!1,datasetIdKey:r,type:o,data:a,options:l,plugins:c=[],fallbackContent:u,updateMode:d,...h}=e,f=L.useRef(null),p=L.useRef(null),m=()=>{f.current&&(p.current=new bi(f.current,{type:o,data:WR(a,r),options:l&&{...l},plugins:c}),yd(t,p.current))},g=()=>{yd(t,null),p.current&&(p.current.destroy(),p.current=null)};return L.useEffect(()=>{!i&&p.current&&l&&UR(p.current,l)},[i,l]),L.useEffect(()=>{!i&&p.current&&bp(p.current.config.data,a.labels)},[i,a.labels]),L.useEffect(()=>{!i&&p.current&&a.datasets&&yp(p.current.config.data,a.datasets,r)},[i,a.datasets]),L.useEffect(()=>{p.current&&(i?(g(),setTimeout(m)):p.current.update(d))},[i,l,a.labels,a.datasets,d]),L.useEffect(()=>{p.current&&(g(),setTimeout(m))},[o]),L.useEffect(()=>(m(),()=>g()),[]),y.jsx("canvas",{ref:f,role:"img",height:s,width:n,...h,children:u})}const qR=L.forwardRef($R);function KR(e,t){return bi.register(t),L.forwardRef((s,n)=>y.jsx(qR,{...s,ref:n,type:e}))}const YR=KR("line",Hf);bi.register(...HR);bi.register(fp,pp,ep,yi,lp,hp,up,Tr);const GR={id:"downBandPlugin",beforeDraw:e=>{const{ctx:t,chartArea:s,data:n}=e;if(!s)return;n?.datasets?.[0]?.meta?.raw;const i=n?.datasets?.[0]?.status??[];if(!Array.isArray(i)||i.length===0)return;t.save(),t.fillStyle="rgba(239, 68, 68, 0.14)";const r=e.scales.x;for(let o=0;o<i.length;o++){if(i[o]!=="down")continue;const a=r.getPixelForValue(o-.5),l=r.getPixelForValue(o+.5);t.fillRect(a,s.top,l-a,s.bottom-s.top)}t.restore()}};function XR({points:e}){const t=e.map(o=>new Date(o.t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})),s=e.map(o=>o.status==="down"?null:o.ping),n=e.map(o=>o.status),i={labels:t,datasets:[{label:"Ping (ms)",data:s,tension:.25,pointRadius:0,fill:!0,status:n}]},r={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{callbacks:{label:o=>{const a=o.dataIndex;if(n[a]==="down")return"Down";const c=o.parsed.y;return c!=null?`${c} ms`:"—"}}}},scales:{x:{ticks:{maxTicksLimit:8}},y:{beginAtZero:!0}},animation:!1};return y.jsxs("div",{className:"h-64 w-full rounded-2xl border border-neutral-200 bg-white p-3 dark:border-neutral-800 dark:bg-neutral-950",children:[y.jsx("div",{className:"mb-2 text-sm font-semibold",children:"Response Time"}),y.jsx("div",{className:"h-[220px]",children:y.jsx(YR,{data:i,options:r,plugins:[GR]})})]})}function QR(){const{id:e}=ai({strict:!1}),t=qs(),{data:s,refetch:n}=ps({queryKey:["monitors"],queryFn:async()=>(await bt.get("/monitors")).data.monitors,refetchInterval:3e4}),i=(s??[]).find(v=>v.id===e),{data:r,refetch:o}=ps({queryKey:["monitor-results",e],queryFn:async()=>(await bt.get(`/monitors/${e}/results?limit=180`)).data.results,enabled:!!e,refetchInterval:3e4}),[a,l]=Q.useState(null);if(Q.useEffect(()=>{if(!e)return;let v=null;return v=rr(Zo.apiBase,{path:Zo.wsPath,transports:["websocket"]}),v.on("monitor:update",S=>{S.monitorId===e&&(l(S),o())}),()=>{v?.disconnect()}},[e,o]),!i)return y.jsx("div",{className:"text-sm text-neutral-500",children:"Monitor not found."});const c=(r??[]).slice().reverse(),u=a??r?.[0]??null,d=u?.status??"unknown",h=d==="up"?"bg-emerald-500":d==="down"?"bg-red-500":"bg-neutral-400",f=c.map(v=>({t:new Date(v.checkedAt).getTime(),ping:v.pingMs??null,status:v.status??"unknown"})),p=c.filter(v=>v.status==="up"||v.status==="down"),m=p.length?p.filter(v=>v.status==="up").length/p.length*100:0,g=(()=>{const v=c.map(S=>S.pingMs).filter(S=>typeof S=="number");return v.length?Math.round(v.reduce((S,P)=>S+P,0)/v.length):null})();async function b(){try{await bt.post(`/monitors/${e}/pause`,{paused:!i.isPaused}),yt.success(i.isPaused?"Resumed":"Paused"),await n()}catch(v){yt.error(v?.response?.data?.detail??"Failed")}}async function x(){try{const S=(await bt.post(`/monitors/${e}/clone`)).data.monitor.id;yt.success("Cloned (paused)"),await n(),t({to:"/monitors/$id",params:{id:S}})}catch(v){yt.error(v?.response?.data?.detail??"Clone failed")}}async function w(){if(confirm(`Delete monitor "${i.name}"?`))try{await bt.delete(`/monitors/${e}`),yt.success("Deleted"),await n(),t({to:"/"})}catch(v){yt.error(v?.response?.data?.detail??"Delete failed")}}return y.jsxs("div",{className:"space-y-4",children:[y.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[y.jsxs("div",{children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("div",{className:Ke("h-3 w-3 rounded-full",h)}),y.jsx("div",{className:"text-xl font-semibold",children:i.name}),i.isPaused?y.jsx("span",{className:"rounded-full bg-neutral-200 px-2 py-0.5 text-xs dark:bg-neutral-800",children:"Paused"}):null]}),y.jsxs("div",{className:"mt-1 text-sm text-neutral-500 dark:text-neutral-400",children:[i.type," • interval ",i.intervalSeconds,"s"]})]}),y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsxs("button",{className:"inline-flex items-center gap-2 rounded-xl border px-3 py-2 hover:bg-neutral-50 dark:border-neutral-800 dark:hover:bg-neutral-900",onClick:b,children:[i.isPaused?y.jsx(Gh,{size:16}):y.jsx(Kh,{size:16}),i.isPaused?"Resume":"Pause"]}),y.jsxs("button",{className:"inline-flex items-center gap-2 rounded-xl border px-3 py-2 hover:bg-neutral-50 dark:border-neutral-800 dark:hover:bg-neutral-900",onClick:()=>t({to:"/monitors/$id/edit",params:{id:e}}),children:[y.jsx(Yh,{size:16})," Edit"]}),y.jsxs("button",{className:"inline-flex items-center gap-2 rounded-xl border px-3 py-2 hover:bg-neutral-50 dark:border-neutral-800 dark:hover:bg-neutral-900",onClick:x,children:[y.jsx(qh,{size:16})," Clone"]}),y.jsxs("button",{className:"inline-flex items-center gap-2 rounded-xl border px-3 py-2 text-red-600 hover:bg-neutral-50 dark:border-neutral-800 dark:hover:bg-neutral-900",onClick:w,children:[y.jsx(Xh,{size:16})," Delete"]})]})]}),y.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[y.jsxs(Ae,{children:[y.jsx(Le,{children:y.jsx("div",{className:"text-sm font-semibold",children:"Status"})}),y.jsxs(De,{children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("div",{className:Ke("h-2.5 w-2.5 rounded-full",h)}),y.jsx("div",{className:"text-lg font-semibold",children:d.toUpperCase()})]}),y.jsx("div",{className:"mt-1 text-sm text-neutral-500 dark:text-neutral-400",children:u?.message??"—"})]})]}),y.jsxs(Ae,{children:[y.jsx(Le,{children:y.jsx("div",{className:"text-sm font-semibold",children:"Uptime"})}),y.jsxs(De,{children:[y.jsxs("div",{className:"text-2xl font-semibold",children:[m.toFixed(1),"%"]}),y.jsxs("div",{className:"mt-1 text-sm text-neutral-500 dark:text-neutral-400",children:["(last ",c.length," checks)"]})]})]}),y.jsxs(Ae,{children:[y.jsx(Le,{children:y.jsx("div",{className:"text-sm font-semibold",children:"Avg Response"})}),y.jsxs(De,{children:[y.jsx("div",{className:"text-2xl font-semibold",children:g!=null?`${g} ms`:"—"}),y.jsxs("div",{className:"mt-1 text-sm text-neutral-500 dark:text-neutral-400",children:["Latest: ",u?.pingMs!=null?`${u.pingMs} ms`:"—"]})]})]})]}),y.jsx(XR,{points:f.slice(-120)}),y.jsx(JR,{monitorId:e})]})}function JR({monitorId:e}){const{data:t}=ps({queryKey:["notifications"],queryFn:async()=>(await bt.get("/notifications")).data.notifications}),{data:s,refetch:n}=ps({queryKey:["monitor-notifications",e],queryFn:async()=>(await bt.get(`/notifications/monitor/${e}`)).data.links}),i=new Set((s??[]).map(o=>o.notificationId));async function r(o){await bt.post(`/notifications/monitor/${e}`,{notificationIds:o}),yt.success("Notifications updated"),await n()}return y.jsxs(Ae,{children:[y.jsxs(Le,{children:[y.jsx("div",{className:"text-sm font-semibold",children:"Notifications"}),y.jsx("div",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:"Send webhook when status changes."})]}),y.jsx(De,{children:!t||t.length===0?y.jsx("div",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:"No notifications configured. Go to Settings → Notifications."}):y.jsx("div",{className:"space-y-2",children:t.map(o=>y.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[y.jsx("input",{type:"checkbox",checked:i.has(o.id),onChange:a=>{const l=new Set(i);a.target.checked?l.add(o.id):l.delete(o.id),r(Array.from(l))}}),y.jsx("span",{className:"font-medium",children:o.name}),y.jsx("span",{className:"text-neutral-500 dark:text-neutral-400 truncate",children:o.webhookUrl})]},o.id))})})]})}function ZR(){const e=ps({queryKey:["statusPages"],queryFn:async()=>(await bt.get("/status-pages")).data.statusPages});ps({queryKey:["monitors"],queryFn:async()=>(await bt.get("/monitors")).data.monitors});const[t,s]=Q.useState(!1),[n,i]=Q.useState("My Status Page"),[r,o]=Q.useState("my-status");async function a(){s(!0);try{await bt.post("/status-pages",{name:n,slug:r,domains:[]}),yt.success("Created"),e.refetch()}catch(l){yt.error(l?.response?.data?.detail??"Create failed")}finally{s(!1)}}return y.jsxs("div",{className:"space-y-4",children:[y.jsxs("div",{children:[y.jsx("div",{className:"text-2xl font-semibold",children:"Status Pages"}),y.jsx("div",{className:"text-sm text-neutral-600",children:"This scaffold includes JSON endpoints for a public status page."})]}),y.jsxs(Ae,{children:[y.jsx(Le,{className:"font-semibold",children:"Create"}),y.jsxs(De,{className:"grid gap-3 sm:grid-cols-3",children:[y.jsxs("div",{children:[y.jsx("label",{className:"text-sm",children:"Name"}),y.jsx("input",{className:"mt-1 w-full rounded-xl border px-3 py-2",value:n,onChange:l=>i(l.target.value)})]}),y.jsxs("div",{children:[y.jsx("label",{className:"text-sm",children:"Slug"}),y.jsx("input",{className:"mt-1 w-full rounded-xl border px-3 py-2",value:r,onChange:l=>o(l.target.value)})]}),y.jsx("div",{className:"flex items-end",children:y.jsx("button",{disabled:t,className:"w-full rounded-xl bg-neutral-900 px-3 py-2 text-white hover:bg-neutral-800 disabled:opacity-60",onClick:a,children:t?"Creating...":"Create"})})]})]}),y.jsx("div",{className:"grid gap-3",children:(e.data??[]).map(l=>y.jsxs(Ae,{children:[y.jsxs(Le,{className:"flex items-center justify-between",children:[y.jsxs("div",{children:[y.jsx("div",{className:"font-semibold",children:l.name}),y.jsxs("div",{className:"text-xs text-neutral-600",children:["slug: ",l.slug]})]}),y.jsx("a",{className:"rounded-xl border px-3 py-1 text-sm hover:bg-neutral-50",href:`/status-pages/public/${l.slug}`,target:"_blank",rel:"noreferrer",children:"Public JSON"})]}),y.jsxs(De,{className:"text-sm text-neutral-700",children:["Mapping UI is intentionally minimal in this scaffold; integrate a proper editor when needed.",y.jsx("div",{className:"mt-2 text-xs text-neutral-500",children:"Tip: map status pages to domains using Host / X-Forwarded-Host header like Uptime Kuma does."})]})]},l.id))})]})}function tP(){const{data:e,refetch:t}=ps({queryKey:["notifications"],queryFn:async()=>(await bt.get("/notifications")).data.notifications}),[s,n]=Q.useState(""),[i,r]=Q.useState("");async function o(){if(!s.trim()||!i.trim()){yt.error("Name and webhook URL required");return}try{await bt.post("/notifications",{name:s,webhookUrl:i}),n(""),r(""),yt.success("Notification created"),await t()}catch(l){yt.error(l?.response?.data?.detail??"Failed")}}async function a(l){if(confirm("Delete this notification?"))try{await bt.delete(`/notifications/${l}`),yt.success("Deleted"),await t()}catch(c){yt.error(c?.response?.data?.detail??"Delete failed")}}return y.jsxs("div",{className:"mx-auto max-w-3xl space-y-4",children:[y.jsxs(Ae,{children:[y.jsxs(Le,{children:[y.jsx("div",{className:"text-lg font-semibold",children:"Notifications"}),y.jsx("div",{className:"text-sm text-neutral-600 dark:text-neutral-400",children:"Webhook notifications on monitor status changes."})]}),y.jsxs(De,{children:[y.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[y.jsxs("div",{children:[y.jsx("label",{className:"text-sm",children:"Name"}),y.jsx("input",{value:s,onChange:l=>n(l.target.value),className:"mt-1 w-full rounded-xl border px-3 py-2 dark:border-neutral-800 dark:bg-neutral-950"})]}),y.jsxs("div",{className:"md:col-span-2",children:[y.jsx("label",{className:"text-sm",children:"Webhook URL"}),y.jsx("input",{value:i,onChange:l=>r(l.target.value),placeholder:"https://...",className:"mt-1 w-full rounded-xl border px-3 py-2 dark:border-neutral-800 dark:bg-neutral-950"})]})]}),y.jsx("div",{className:"mt-3",children:y.jsx("button",{onClick:o,className:"rounded-xl bg-neutral-900 px-4 py-2 text-white hover:bg-neutral-800 dark:bg-neutral-100 dark:text-neutral-900 dark:hover:bg-neutral-200",children:"Add"})})]})]}),y.jsxs(Ae,{children:[y.jsx(Le,{children:y.jsx("div",{className:"text-sm font-semibold",children:"Configured Notifications"})}),y.jsx(De,{children:(e??[]).length===0?y.jsx("div",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:"No notifications yet."}):y.jsx("div",{className:"space-y-2",children:(e??[]).map(l=>y.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-xl border p-3 dark:border-neutral-800",children:[y.jsxs("div",{className:"min-w-0",children:[y.jsx("div",{className:"font-semibold",children:l.name}),y.jsx("div",{className:"truncate text-sm text-neutral-500 dark:text-neutral-400",children:l.webhookUrl})]}),y.jsx("button",{className:"rounded-xl border px-3 py-2 text-red-600 hover:bg-neutral-50 dark:border-neutral-800 dark:hover:bg-neutral-900",onClick:()=>a(l.id),children:"Delete"})]},l.id))})})]})]})}function eP(){const e=Br(),t=Sh();return y.jsxs("div",{className:"min-h-screen bg-neutral-50 text-neutral-900 dark:bg-neutral-950 dark:text-neutral-100",children:[y.jsx("header",{className:"sticky top-0 z-10 h-14 border-b border-neutral-200 bg-white/80 backdrop-blur dark:border-neutral-800 dark:bg-neutral-950/80",children:y.jsxs("div",{className:"mx-auto flex h-14 max-w-7xl items-center justify-between px-4",children:[y.jsx("div",{className:"font-semibold",children:"PulseWatch"}),y.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[y.jsx("button",{className:"rounded-xl border border-neutral-200 px-3 py-1 hover:bg-neutral-50 dark:border-neutral-800 dark:hover:bg-neutral-900",onClick:()=>t.toggle(),title:"Toggle theme",children:t.mode==="dark"?"Dark":"Light"}),e.email?y.jsx("span",{className:"text-neutral-600 dark:text-neutral-400",children:e.email}):null,e.token?y.jsx("button",{className:"rounded-xl border border-neutral-200 px-3 py-1 hover:bg-neutral-50 dark:border-neutral-800 dark:hover:bg-neutral-900",onClick:e.logout,children:"Logout"}):null]})]})}),y.jsx("main",{className:"h-[calc(100vh-56px)]",children:y.jsx(Ma,{})}),y.jsx(wb,{richColors:!0})]})}const Gi=eg({component:eP}),sP=()=>{const{token:e}=Br.getState();if(!e)throw Ed({to:"/login"})};function fl(e=!0){const t=He({getParentRoute:()=>Gi,id:"workspace",beforeLoad:e?sP:void 0,component:D0}),s=t.addChildren([He({getParentRoute:()=>t,path:"/",component:N0}),He({getParentRoute:()=>t,path:"/monitors/new",component:Uc}),He({getParentRoute:()=>t,path:"/monitors/$id",component:QR}),He({getParentRoute:()=>t,path:"/monitors/$id/edit",component:Uc}),He({getParentRoute:()=>t,path:"/status-pages",component:ZR}),He({getParentRoute:()=>t,path:"/settings/notifications",component:tP})]);if(e){const n=He({getParentRoute:()=>Gi,path:"/login",component:y0});return Gi.addChildren([s,n])}else return Gi.addChildren([s])}Hd({routeTree:fl(!0)});const nP=new Fg;function iP({apiBase:e}){L.useEffect(()=>{e&&(bt.defaults.baseURL=e),ix()},[e]);const t=L.useMemo(()=>Hd({routeTree:fl(!1)}),[]);return y.jsx(jg,{client:nP,children:y.jsx(dg,{router:t})})}exports.PulseWatch=iP;exports.api=bt;exports.createRouteTree=fl;