diff --git "a/assets/index-7d9241f0.js" "b/assets/index-7d9241f0.js" new file mode 100644--- /dev/null +++ "b/assets/index-7d9241f0.js" @@ -0,0 +1,58 @@ +var Hp=Object.defineProperty;var Vp=(e,t,n)=>t in e?Hp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var R=(e,t,n)=>(Vp(e,typeof t!="symbol"?t+"":t,n),n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();function Wp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Vf={exports:{}},Js={},Wf={exports:{}},A={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var vr=Symbol.for("react.element"),$p=Symbol.for("react.portal"),Up=Symbol.for("react.fragment"),Yp=Symbol.for("react.strict_mode"),Kp=Symbol.for("react.profiler"),Xp=Symbol.for("react.provider"),Qp=Symbol.for("react.context"),Gp=Symbol.for("react.forward_ref"),Zp=Symbol.for("react.suspense"),qp=Symbol.for("react.memo"),Jp=Symbol.for("react.lazy"),mu=Symbol.iterator;function tg(e){return e===null||typeof e!="object"?null:(e=mu&&e[mu]||e["@@iterator"],typeof e=="function"?e:null)}var $f={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Uf=Object.assign,Yf={};function hi(e,t,n){this.props=e,this.context=t,this.refs=Yf,this.updater=n||$f}hi.prototype.isReactComponent={};hi.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};hi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Kf(){}Kf.prototype=hi.prototype;function sa(e,t,n){this.props=e,this.context=t,this.refs=Yf,this.updater=n||$f}var oa=sa.prototype=new Kf;oa.constructor=sa;Uf(oa,hi.prototype);oa.isPureReactComponent=!0;var yu=Array.isArray,Xf=Object.prototype.hasOwnProperty,la={current:null},Qf={key:!0,ref:!0,__self:!0,__source:!0};function Gf(e,t,n){var i,r={},s=null,o=null;if(t!=null)for(i in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)Xf.call(t,i)&&!Qf.hasOwnProperty(i)&&(r[i]=t[i]);var l=arguments.length-2;if(l===1)r.children=n;else if(1>>1,K=P[W];if(0>>1;Wr(xe,D))Ptr(Cr,xe)?(P[W]=Cr,P[Pt]=D,W=Pt):(P[W]=xe,P[Mt]=D,W=Mt);else if(Ptr(Cr,D))P[W]=Cr,P[Pt]=D,W=Pt;else break t}}return z}function r(P,z){var D=P.sortIndex-z.sortIndex;return D!==0?D:P.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var a=[],u=[],c=1,f=null,d=3,h=!1,m=!1,v=!1,x=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(P){for(var z=n(u);z!==null;){if(z.callback===null)i(u);else if(z.startTime<=P)i(u),z.sortIndex=z.expirationTime,t(a,z);else break;z=n(u)}}function _(P){if(v=!1,y(P),!m)if(n(a)!==null)m=!0,st(k);else{var z=n(u);z!==null&&vt(_,z.startTime-P)}}function k(P,z){m=!1,v&&(v=!1,g(b),b=-1),h=!0;var D=d;try{for(y(z),f=n(a);f!==null&&(!(f.expirationTime>z)||P&&!O());){var W=f.callback;if(typeof W=="function"){f.callback=null,d=f.priorityLevel;var K=W(f.expirationTime<=z);z=e.unstable_now(),typeof K=="function"?f.callback=K:f===n(a)&&i(a),y(z)}else i(a);f=n(a)}if(f!==null)var ue=!0;else{var Mt=n(u);Mt!==null&&vt(_,Mt.startTime-z),ue=!1}return ue}finally{f=null,d=D,h=!1}}var w=!1,S=null,b=-1,L=5,M=-1;function O(){return!(e.unstable_now()-MP||125W?(P.sortIndex=D,t(u,P),n(a)===null&&P===n(u)&&(v?(g(b),b=-1):v=!0,vt(_,D-W))):(P.sortIndex=K,t(a,P),m||h||(m=!0,st(k))),P},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(P){var z=d;return function(){var D=d;d=z;try{return P.apply(this,arguments)}finally{d=D}}}})(td);Jf.exports=td;var fg=Jf.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var ed=$,$t=fg;function C(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rl=Object.prototype.hasOwnProperty,dg=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,xu={},_u={};function hg(e){return rl.call(_u,e)?!0:rl.call(xu,e)?!1:dg.test(e)?_u[e]=!0:(xu[e]=!0,!1)}function pg(e,t,n,i){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function gg(e,t,n,i){if(t===null||typeof t>"u"||pg(e,t,n,i))return!0;if(i)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ot(e,t,n,i,r,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=r,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var yt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){yt[e]=new Ot(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];yt[t]=new Ot(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){yt[e]=new Ot(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){yt[e]=new Ot(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){yt[e]=new Ot(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){yt[e]=new Ot(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){yt[e]=new Ot(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){yt[e]=new Ot(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){yt[e]=new Ot(e,5,!1,e.toLowerCase(),null,!1,!1)});var ca=/[\-:]([a-z])/g;function fa(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ca,fa);yt[t]=new Ot(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ca,fa);yt[t]=new Ot(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ca,fa);yt[t]=new Ot(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){yt[e]=new Ot(e,1,!1,e.toLowerCase(),null,!1,!1)});yt.xlinkHref=new Ot("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){yt[e]=new Ot(e,1,!1,e.toLowerCase(),null,!0,!0)});function da(e,t,n,i){var r=yt.hasOwnProperty(t)?yt[t]:null;(r!==null?r.type!==0:i||!(2l||r[o]!==s[l]){var a=` +`+r[o].replace(" at new "," at ");return e.displayName&&a.includes("")&&(a=a.replace("",e.displayName)),a}while(1<=o&&0<=l);break}}}finally{wo=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Li(e):""}function mg(e){switch(e.tag){case 5:return Li(e.type);case 16:return Li("Lazy");case 13:return Li("Suspense");case 19:return Li("SuspenseList");case 0:case 2:case 15:return e=So(e.type,!1),e;case 11:return e=So(e.type.render,!1),e;case 1:return e=So(e.type,!0),e;default:return""}}function al(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Nn:return"Fragment";case In:return"Portal";case sl:return"Profiler";case ha:return"StrictMode";case ol:return"Suspense";case ll:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case rd:return(e.displayName||"Context")+".Consumer";case id:return(e._context.displayName||"Context")+".Provider";case pa:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ga:return t=e.displayName||null,t!==null?t:al(e.type)||"Memo";case Ae:t=e._payload,e=e._init;try{return al(e(t))}catch{}}return null}function yg(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return al(t);case 8:return t===ha?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function nn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function od(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function vg(e){var t=od(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(o){i=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Er(e){e._valueTracker||(e._valueTracker=vg(e))}function ld(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=od(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function _s(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ul(e,t){var n=t.checked;return et({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function wu(e,t){var n=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;n=nn(t.value!=null?t.value:n),e._wrapperState={initialChecked:i,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function ad(e,t){t=t.checked,t!=null&&da(e,"checked",t,!1)}function cl(e,t){ad(e,t);var n=nn(t.value),i=t.type;if(n!=null)i==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?fl(e,t.type,n):t.hasOwnProperty("defaultValue")&&fl(e,t.type,nn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Su(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function fl(e,t,n){(t!=="number"||_s(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ti=Array.isArray;function Zn(e,t,n,i){if(e=e.options,t){t={};for(var r=0;r"+t.valueOf().toString()+"",t=Lr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Gi(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ai={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},xg=["Webkit","ms","Moz","O"];Object.keys(Ai).forEach(function(e){xg.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ai[t]=Ai[e]})});function dd(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ai.hasOwnProperty(e)&&Ai[e]?(""+t).trim():t+"px"}function hd(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var i=n.indexOf("--")===0,r=dd(n,t[n],i);n==="float"&&(n="cssFloat"),i?e.setProperty(n,r):e[n]=r}}var _g=et({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function pl(e,t){if(t){if(_g[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(C(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(C(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(C(61))}if(t.style!=null&&typeof t.style!="object")throw Error(C(62))}}function gl(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ml=null;function ma(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var yl=null,qn=null,Jn=null;function Mu(e){if(e=kr(e)){if(typeof yl!="function")throw Error(C(280));var t=e.stateNode;t&&(t=ro(t),yl(e.stateNode,e.type,t))}}function pd(e){qn?Jn?Jn.push(e):Jn=[e]:qn=e}function gd(){if(qn){var e=qn,t=Jn;if(Jn=qn=null,Mu(e),t)for(e=0;e>>=0,e===0?32:31-(Og(e)/zg|0)|0}var Tr=64,Or=4194304;function Oi(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function bs(e,t){var n=e.pendingLanes;if(n===0)return 0;var i=0,r=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~r;l!==0?i=Oi(l):(s&=o,s!==0&&(i=Oi(s)))}else o=n&~r,o!==0?i=Oi(o):s!==0&&(i=Oi(s));if(i===0)return 0;if(t!==0&&t!==i&&!(t&r)&&(r=i&-i,s=t&-t,r>=s||r===16&&(s&4194240)!==0))return t;if(i&4&&(i|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=i;0n;n++)t.push(e);return t}function xr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-oe(t),e[t]=n}function Ag(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0=Ni),Fu=String.fromCharCode(32),Au=!1;function Fd(e,t){switch(e){case"keyup":return cm.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ad(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var jn=!1;function dm(e,t){switch(e){case"compositionend":return Ad(t);case"keypress":return t.which!==32?null:(Au=!0,Fu);case"textInput":return e=t.data,e===Fu&&Au?null:e;default:return null}}function hm(e,t){if(jn)return e==="compositionend"||!ba&&Fd(e,t)?(e=Dd(),os=ka=Be=null,jn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=i}t:{for(;n;){if(n.nextSibling){n=n.nextSibling;break t}n=n.parentNode}n=void 0}n=Bu(n)}}function Bd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Bd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Hd(){for(var e=window,t=_s();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=_s(e.document)}return t}function Ca(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function wm(e){var t=Hd(),n=e.focusedElem,i=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Bd(n.ownerDocument.documentElement,n)){if(i!==null&&Ca(n)){if(t=i.start,e=i.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var r=n.textContent.length,s=Math.min(i.start,r);i=i.end===void 0?s:Math.min(i.end,r),!e.extend&&s>i&&(r=i,i=s,s=r),r=Hu(n,s);var o=Hu(n,i);r&&o&&(e.rangeCount!==1||e.anchorNode!==r.node||e.anchorOffset!==r.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(r.node,r.offset),e.removeAllRanges(),s>i?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Bn=null,Sl=null,Bi=null,bl=!1;function Vu(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;bl||Bn==null||Bn!==_s(i)||(i=Bn,"selectionStart"in i&&Ca(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Bi&&nr(Bi,i)||(Bi=i,i=Ps(Sl,"onSelect"),0Wn||(e.current=Tl[Wn],Tl[Wn]=null,Wn--)}function Y(e,t){Wn++,Tl[Wn]=e.current,e.current=t}var rn={},St=an(rn),At=an(!1),bn=rn;function si(e,t){var n=e.type.contextTypes;if(!n)return rn;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var r={},s;for(s in n)r[s]=t[s];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=r),r}function It(e){return e=e.childContextTypes,e!=null}function Ls(){Q(At),Q(St)}function Qu(e,t,n){if(St.current!==rn)throw Error(C(168));Y(St,t),Y(At,n)}function Gd(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var r in i)if(!(r in t))throw Error(C(108,yg(e)||"Unknown",r));return et({},n,i)}function Ts(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||rn,bn=St.current,Y(St,e),Y(At,At.current),!0}function Gu(e,t,n){var i=e.stateNode;if(!i)throw Error(C(169));n?(e=Gd(e,t,bn),i.__reactInternalMemoizedMergedChildContext=e,Q(At),Q(St),Y(St,e)):Q(At),Y(At,n)}var be=null,so=!1,Io=!1;function Zd(e){be===null?be=[e]:be.push(e)}function Rm(e){so=!0,Zd(e)}function un(){if(!Io&&be!==null){Io=!0;var e=0,t=H;try{var n=be;for(H=1;e>=o,r-=o,Me=1<<32-oe(t)+r|n<b?(L=S,S=null):L=S.sibling;var M=d(g,S,y[b],_);if(M===null){S===null&&(S=L);break}e&&S&&M.alternate===null&&t(g,S),p=s(M,p,b),w===null?k=M:w.sibling=M,w=M,S=L}if(b===y.length)return n(g,S),G&&pn(g,b),k;if(S===null){for(;bb?(L=S,S=null):L=S.sibling;var O=d(g,S,M.value,_);if(O===null){S===null&&(S=L);break}e&&S&&O.alternate===null&&t(g,S),p=s(O,p,b),w===null?k=O:w.sibling=O,w=O,S=L}if(M.done)return n(g,S),G&&pn(g,b),k;if(S===null){for(;!M.done;b++,M=y.next())M=f(g,M.value,_),M!==null&&(p=s(M,p,b),w===null?k=M:w.sibling=M,w=M);return G&&pn(g,b),k}for(S=i(g,S);!M.done;b++,M=y.next())M=h(S,g,b,M.value,_),M!==null&&(e&&M.alternate!==null&&S.delete(M.key===null?b:M.key),p=s(M,p,b),w===null?k=M:w.sibling=M,w=M);return e&&S.forEach(function(F){return t(g,F)}),G&&pn(g,b),k}function x(g,p,y,_){if(typeof y=="object"&&y!==null&&y.type===Nn&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Pr:t:{for(var k=y.key,w=p;w!==null;){if(w.key===k){if(k=y.type,k===Nn){if(w.tag===7){n(g,w.sibling),p=r(w,y.props.children),p.return=g,g=p;break t}}else if(w.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Ae&&ic(k)===w.type){n(g,w.sibling),p=r(w,y.props),p.ref=ki(g,w,y),p.return=g,g=p;break t}n(g,w);break}else t(g,w);w=w.sibling}y.type===Nn?(p=kn(y.props.children,g.mode,_,y.key),p.return=g,g=p):(_=ps(y.type,y.key,y.props,null,g.mode,_),_.ref=ki(g,p,y),_.return=g,g=_)}return o(g);case In:t:{for(w=y.key;p!==null;){if(p.key===w)if(p.tag===4&&p.stateNode.containerInfo===y.containerInfo&&p.stateNode.implementation===y.implementation){n(g,p.sibling),p=r(p,y.children||[]),p.return=g,g=p;break t}else{n(g,p);break}else t(g,p);p=p.sibling}p=Uo(y,g.mode,_),p.return=g,g=p}return o(g);case Ae:return w=y._init,x(g,p,w(y._payload),_)}if(Ti(y))return m(g,p,y,_);if(mi(y))return v(g,p,y,_);Nr(g,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,p!==null&&p.tag===6?(n(g,p.sibling),p=r(p,y),p.return=g,g=p):(n(g,p),p=$o(y,g.mode,_),p.return=g,g=p),o(g)):n(g,p)}return x}var li=sh(!0),oh=sh(!1),wr={},ye=an(wr),or=an(wr),lr=an(wr);function xn(e){if(e===wr)throw Error(C(174));return e}function Ra(e,t){switch(Y(lr,t),Y(or,e),Y(ye,wr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:hl(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=hl(t,e)}Q(ye),Y(ye,t)}function ai(){Q(ye),Q(or),Q(lr)}function lh(e){xn(lr.current);var t=xn(ye.current),n=hl(t,e.type);t!==n&&(Y(or,e),Y(ye,n))}function Fa(e){or.current===e&&(Q(ye),Q(or))}var J=an(0);function As(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var No=[];function Aa(){for(var e=0;en?n:4,e(!0);var i=jo.transition;jo.transition={};try{e(!1),t()}finally{H=n,jo.transition=i}}function Sh(){return te().memoizedState}function Nm(e,t,n){var i=qe(e);if(n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},bh(e))Ch(t,n);else if(n=eh(e,t,n,i),n!==null){var r=Lt();le(n,e,i,r),Mh(n,t,i)}}function jm(e,t,n){var i=qe(e),r={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(bh(e))Ch(t,r);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,l=s(o,n);if(r.hasEagerState=!0,r.eagerState=l,ae(l,o)){var a=t.interleaved;a===null?(r.next=r,za(t)):(r.next=a.next,a.next=r),t.interleaved=r;return}}catch{}finally{}n=eh(e,t,r,i),n!==null&&(r=Lt(),le(n,e,i,r),Mh(n,t,i))}}function bh(e){var t=e.alternate;return e===tt||t!==null&&t===tt}function Ch(e,t){Hi=Is=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Mh(e,t,n){if(n&4194240){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,va(e,n)}}var Ns={readContext:Jt,useCallback:xt,useContext:xt,useEffect:xt,useImperativeHandle:xt,useInsertionEffect:xt,useLayoutEffect:xt,useMemo:xt,useReducer:xt,useRef:xt,useState:xt,useDebugValue:xt,useDeferredValue:xt,useTransition:xt,useMutableSource:xt,useSyncExternalStore:xt,useId:xt,unstable_isNewReconciler:!1},Bm={readContext:Jt,useCallback:function(e,t){return de().memoizedState=[e,t===void 0?null:t],e},useContext:Jt,useEffect:sc,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,cs(4194308,4,vh.bind(null,t,e),n)},useLayoutEffect:function(e,t){return cs(4194308,4,e,t)},useInsertionEffect:function(e,t){return cs(4,2,e,t)},useMemo:function(e,t){var n=de();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var i=de();return t=n!==void 0?n(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=Nm.bind(null,tt,e),[i.memoizedState,e]},useRef:function(e){var t=de();return e={current:e},t.memoizedState=e},useState:rc,useDebugValue:Ha,useDeferredValue:function(e){return de().memoizedState=e},useTransition:function(){var e=rc(!1),t=e[0];return e=Im.bind(null,e[1]),de().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=tt,r=de();if(G){if(n===void 0)throw Error(C(407));n=n()}else{if(n=t(),ht===null)throw Error(C(349));Mn&30||ch(i,t,n)}r.memoizedState=n;var s={value:n,getSnapshot:t};return r.queue=s,sc(dh.bind(null,i,s,e),[e]),i.flags|=2048,cr(9,fh.bind(null,i,s,n,t),void 0,null),n},useId:function(){var e=de(),t=ht.identifierPrefix;if(G){var n=Pe,i=Me;n=(i&~(1<<32-oe(i)-1)).toString(32)+n,t=":"+t+"R"+n,n=ar++,0<\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=o.createElement(n,{is:i.is}):(e=o.createElement(n),n==="select"&&(o=e,i.multiple?o.multiple=!0:i.size&&(o.size=i.size))):e=o.createElementNS(e,n),e[ge]=t,e[sr]=i,Fh(e,t,!1,!1),t.stateNode=e;t:{switch(o=gl(n,i),n){case"dialog":X("cancel",e),X("close",e),r=i;break;case"iframe":case"object":case"embed":X("load",e),r=i;break;case"video":case"audio":for(r=0;rci&&(t.flags|=128,i=!0,wi(s,!1),t.lanes=4194304)}else{if(!i)if(e=As(o),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),wi(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!G)return _t(t),null}else 2*ot()-s.renderingStartTime>ci&&n!==1073741824&&(t.flags|=128,i=!0,wi(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=ot(),t.sibling=null,n=J.current,Y(J,i?n&1|2:n&1),t):(_t(t),null);case 22:case 23:return Ka(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?Bt&1073741824&&(_t(t),t.subtreeFlags&6&&(t.flags|=8192)):_t(t),null;case 24:return null;case 25:return null}throw Error(C(156,t.tag))}function Xm(e,t){switch(Pa(t),t.tag){case 1:return It(t.type)&&Ls(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ai(),Q(At),Q(St),Aa(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Fa(t),null;case 13:if(Q(J),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(C(340));oi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Q(J),null;case 4:return ai(),null;case 10:return Oa(t.type._context),null;case 22:case 23:return Ka(),null;case 24:return null;default:return null}}var Br=!1,wt=!1,Qm=typeof WeakSet=="function"?WeakSet:Set,E=null;function Kn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(i){it(e,t,i)}else n.current=null}function Vl(e,t,n){try{n()}catch(i){it(e,t,i)}}var pc=!1;function Gm(e,t){if(Cl=Cs,e=Hd(),Ca(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else t:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break t}var o=0,l=-1,a=-1,u=0,c=0,f=e,d=null;e:for(;;){for(var h;f!==n||r!==0&&f.nodeType!==3||(l=o+r),f!==s||i!==0&&f.nodeType!==3||(a=o+i),f.nodeType===3&&(o+=f.nodeValue.length),(h=f.firstChild)!==null;)d=f,f=h;for(;;){if(f===e)break e;if(d===n&&++u===r&&(l=o),d===s&&++c===i&&(a=o),(h=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=h}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ml={focusedElem:e,selectionRange:n},Cs=!1,E=t;E!==null;)if(t=E,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,E=e;else for(;E!==null;){t=E;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var v=m.memoizedProps,x=m.memoizedState,g=t.stateNode,p=g.getSnapshotBeforeUpdate(t.elementType===t.type?v:ne(t.type,v),x);g.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(C(163))}}catch(_){it(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,E=e;break}E=t.return}return m=pc,pc=!1,m}function Vi(e,t,n){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var r=i=i.next;do{if((r.tag&e)===e){var s=r.destroy;r.destroy=void 0,s!==void 0&&Vl(t,n,s)}r=r.next}while(r!==i)}}function ao(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var i=n.create;n.destroy=i()}n=n.next}while(n!==t)}}function Wl(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Nh(e){var t=e.alternate;t!==null&&(e.alternate=null,Nh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ge],delete t[sr],delete t[Ll],delete t[zm],delete t[Dm])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function jh(e){return e.tag===5||e.tag===3||e.tag===4}function gc(e){t:for(;;){for(;e.sibling===null;){if(e.return===null||jh(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue t;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function $l(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Es));else if(i!==4&&(e=e.child,e!==null))for($l(e,t,n),e=e.sibling;e!==null;)$l(e,t,n),e=e.sibling}function Ul(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(Ul(e,t,n),e=e.sibling;e!==null;)Ul(e,t,n),e=e.sibling}var gt=null,ie=!1;function Re(e,t,n){for(n=n.child;n!==null;)Bh(e,t,n),n=n.sibling}function Bh(e,t,n){if(me&&typeof me.onCommitFiberUnmount=="function")try{me.onCommitFiberUnmount(to,n)}catch{}switch(n.tag){case 5:wt||Kn(n,t);case 6:var i=gt,r=ie;gt=null,Re(e,t,n),gt=i,ie=r,gt!==null&&(ie?(e=gt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):gt.removeChild(n.stateNode));break;case 18:gt!==null&&(ie?(e=gt,n=n.stateNode,e.nodeType===8?Ao(e.parentNode,n):e.nodeType===1&&Ao(e,n),tr(e)):Ao(gt,n.stateNode));break;case 4:i=gt,r=ie,gt=n.stateNode.containerInfo,ie=!0,Re(e,t,n),gt=i,ie=r;break;case 0:case 11:case 14:case 15:if(!wt&&(i=n.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){r=i=i.next;do{var s=r,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Vl(n,t,o),r=r.next}while(r!==i)}Re(e,t,n);break;case 1:if(!wt&&(Kn(n,t),i=n.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.componentWillUnmount()}catch(l){it(n,t,l)}Re(e,t,n);break;case 21:Re(e,t,n);break;case 22:n.mode&1?(wt=(i=wt)||n.memoizedState!==null,Re(e,t,n),wt=i):Re(e,t,n);break;default:Re(e,t,n)}}function mc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Qm),t.forEach(function(i){var r=s0.bind(null,e,i);n.has(i)||(n.add(i),i.then(r,r))})}}function ee(e,t){var n=t.deletions;if(n!==null)for(var i=0;ir&&(r=o),i&=~s}if(i=r,i=ot()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*qm(i/1960))-i,10e?16:e,He===null)var i=!1;else{if(e=He,He=null,Hs=0,I&6)throw Error(C(331));var r=I;for(I|=4,E=e.current;E!==null;){var s=E,o=s.child;if(E.flags&16){var l=s.deletions;if(l!==null){for(var a=0;aot()-Ua?_n(e,0):$a|=n),Nt(e,t)}function Xh(e,t){t===0&&(e.mode&1?(t=Or,Or<<=1,!(Or&130023424)&&(Or=4194304)):t=1);var n=Lt();e=Oe(e,t),e!==null&&(xr(e,t,n),Nt(e,n))}function r0(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Xh(e,n)}function s0(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(C(314))}i!==null&&i.delete(t),Xh(e,n)}var Qh;Qh=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||At.current)Ft=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ft=!1,Ym(e,t,n);Ft=!!(e.flags&131072)}else Ft=!1,G&&t.flags&1048576&&qd(t,zs,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;fs(e,t),e=t.pendingProps;var r=si(t,St.current);ei(t,n),r=Na(null,t,i,e,r,n);var s=ja();return t.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,It(i)?(s=!0,Ts(t)):s=!1,t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,Da(t),r.updater=oo,t.stateNode=r,r._reactInternals=t,Fl(t,i,e,n),t=Nl(null,t,i,!0,s,n)):(t.tag=0,G&&s&&Ma(t),Et(null,t,r,n),t=t.child),t;case 16:i=t.elementType;t:{switch(fs(e,t),e=t.pendingProps,r=i._init,i=r(i._payload),t.type=i,r=t.tag=l0(i),e=ne(i,e),r){case 0:t=Il(null,t,i,e,n);break t;case 1:t=fc(null,t,i,e,n);break t;case 11:t=uc(null,t,i,e,n);break t;case 14:t=cc(null,t,i,ne(i.type,e),n);break t}throw Error(C(306,i,""))}return t;case 0:return i=t.type,r=t.pendingProps,r=t.elementType===i?r:ne(i,r),Il(e,t,i,r,n);case 1:return i=t.type,r=t.pendingProps,r=t.elementType===i?r:ne(i,r),fc(e,t,i,r,n);case 3:t:{if(zh(t),e===null)throw Error(C(387));i=t.pendingProps,s=t.memoizedState,r=s.element,nh(e,t),Fs(t,i,null,n);var o=t.memoizedState;if(i=o.element,s.isDehydrated)if(s={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){r=ui(Error(C(423)),t),t=dc(e,t,i,n,r);break t}else if(i!==r){r=ui(Error(C(424)),t),t=dc(e,t,i,n,r);break t}else for(Ht=Qe(t.stateNode.containerInfo.firstChild),Wt=t,G=!0,re=null,n=oh(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(oi(),i===r){t=ze(e,t,n);break t}Et(e,t,i,n)}t=t.child}return t;case 5:return lh(t),e===null&&zl(t),i=t.type,r=t.pendingProps,s=e!==null?e.memoizedProps:null,o=r.children,Pl(i,r)?o=null:s!==null&&Pl(i,s)&&(t.flags|=32),Oh(e,t),Et(e,t,o,n),t.child;case 6:return e===null&&zl(t),null;case 13:return Dh(e,t,n);case 4:return Ra(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=li(t,null,i,n):Et(e,t,i,n),t.child;case 11:return i=t.type,r=t.pendingProps,r=t.elementType===i?r:ne(i,r),uc(e,t,i,r,n);case 7:return Et(e,t,t.pendingProps,n),t.child;case 8:return Et(e,t,t.pendingProps.children,n),t.child;case 12:return Et(e,t,t.pendingProps.children,n),t.child;case 10:t:{if(i=t.type._context,r=t.pendingProps,s=t.memoizedProps,o=r.value,Y(Ds,i._currentValue),i._currentValue=o,s!==null)if(ae(s.value,o)){if(s.children===r.children&&!At.current){t=ze(e,t,n);break t}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var l=s.dependencies;if(l!==null){o=s.child;for(var a=l.firstContext;a!==null;){if(a.context===i){if(s.tag===1){a=Ee(-1,n&-n),a.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?a.next=a:(a.next=c.next,c.next=a),u.pending=a}}s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Dl(s.return,n,t),l.lanes|=n;break}a=a.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(C(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Dl(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Et(e,t,r.children,n),t=t.child}return t;case 9:return r=t.type,i=t.pendingProps.children,ei(t,n),r=Jt(r),i=i(r),t.flags|=1,Et(e,t,i,n),t.child;case 14:return i=t.type,r=ne(i,t.pendingProps),r=ne(i.type,r),cc(e,t,i,r,n);case 15:return Lh(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,r=t.pendingProps,r=t.elementType===i?r:ne(i,r),fs(e,t),t.tag=1,It(i)?(e=!0,Ts(t)):e=!1,ei(t,n),rh(t,i,r),Fl(t,i,r,n),Nl(null,t,i,!0,e,n);case 19:return Rh(e,t,n);case 22:return Th(e,t,n)}throw Error(C(156,t.tag))};function Gh(e,t){return wd(e,t)}function o0(e,t,n,i){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Gt(e,t,n,i){return new o0(e,t,n,i)}function Qa(e){return e=e.prototype,!(!e||!e.isReactComponent)}function l0(e){if(typeof e=="function")return Qa(e)?1:0;if(e!=null){if(e=e.$$typeof,e===pa)return 11;if(e===ga)return 14}return 2}function Je(e,t){var n=e.alternate;return n===null?(n=Gt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ps(e,t,n,i,r,s){var o=2;if(i=e,typeof e=="function")Qa(e)&&(o=1);else if(typeof e=="string")o=5;else t:switch(e){case Nn:return kn(n.children,r,s,t);case ha:o=8,r|=8;break;case sl:return e=Gt(12,n,t,r|2),e.elementType=sl,e.lanes=s,e;case ol:return e=Gt(13,n,t,r),e.elementType=ol,e.lanes=s,e;case ll:return e=Gt(19,n,t,r),e.elementType=ll,e.lanes=s,e;case sd:return co(n,r,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case id:o=10;break t;case rd:o=9;break t;case pa:o=11;break t;case ga:o=14;break t;case Ae:o=16,i=null;break t}throw Error(C(130,e==null?e:typeof e,""))}return t=Gt(o,n,t,r),t.elementType=e,t.type=i,t.lanes=s,t}function kn(e,t,n,i){return e=Gt(7,e,i,t),e.lanes=n,e}function co(e,t,n,i){return e=Gt(22,e,i,t),e.elementType=sd,e.lanes=n,e.stateNode={isHidden:!1},e}function $o(e,t,n){return e=Gt(6,e,null,t),e.lanes=n,e}function Uo(e,t,n){return t=Gt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function a0(e,t,n,i,r){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Co(0),this.expirationTimes=Co(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Co(0),this.identifierPrefix=i,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function Ga(e,t,n,i,r,s,o,l,a){return e=new a0(e,t,n,l,a),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Gt(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Da(s),e}function u0(e,t,n){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(tp)}catch(e){console.error(e)}}tp(),qf.exports=Ut;var p0=qf.exports,bc=p0;il.createRoot=bc.createRoot,il.hydrateRoot=bc.hydrateRoot;const Cc=["bg-purple-300","bg-green-300","bg-yellow-300","bg-red-300","bg-blue-300"];function g0({text:e,position:t,margin:n}){const i=e.split(` +`).map((r,s,o)=>T.jsxs($.Fragment,{children:[r,s!==o.length-1&&T.jsx("br",{})]},s));return T.jsx("span",{style:{marginLeft:n},className:`leading-5 ${i.length===1?"inline-block ":""}${Cc[t%Cc.length]}`,children:i})}/*! + * @kurkle/color v0.3.2 + * https://github.com/kurkle/color#readme + * (c) 2023 Jukka Kurkela + * Released under the MIT License + */function Sr(e){return e+.5|0}const Ve=(e,t,n)=>Math.max(Math.min(e,n),t);function Di(e){return Ve(Sr(e*2.55),0,255)}function tn(e){return Ve(Sr(e*255),0,255)}function Ce(e){return Ve(Sr(e/2.55)/100,0,1)}function Mc(e){return Ve(Sr(e*100),0,100)}const Kt={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},Gl=[..."0123456789ABCDEF"],m0=e=>Gl[e&15],y0=e=>Gl[(e&240)>>4]+Gl[e&15],Wr=e=>(e&240)>>4===(e&15),v0=e=>Wr(e.r)&&Wr(e.g)&&Wr(e.b)&&Wr(e.a);function x0(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&Kt[e[1]]*17,g:255&Kt[e[2]]*17,b:255&Kt[e[3]]*17,a:t===5?Kt[e[4]]*17:255}:(t===7||t===9)&&(n={r:Kt[e[1]]<<4|Kt[e[2]],g:Kt[e[3]]<<4|Kt[e[4]],b:Kt[e[5]]<<4|Kt[e[6]],a:t===9?Kt[e[7]]<<4|Kt[e[8]]:255})),n}const _0=(e,t)=>e<255?t(e):"";function k0(e){var t=v0(e)?m0:y0;return e?"#"+t(e.r)+t(e.g)+t(e.b)+_0(e.a,t):void 0}const w0=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function ep(e,t,n){const i=t*Math.min(n,1-n),r=(s,o=(s+e/30)%12)=>n-i*Math.max(Math.min(o-3,9-o,1),-1);return[r(0),r(8),r(4)]}function S0(e,t,n){const i=(r,s=(r+e/60)%6)=>n-n*t*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function b0(e,t,n){const i=ep(e,1,.5);let r;for(t+n>1&&(r=1/(t+n),t*=r,n*=r),r=0;r<3;r++)i[r]*=1-t-n,i[r]+=t;return i}function C0(e,t,n,i,r){return e===r?(t-n)/i+(t.5?c/(2-s-o):c/(s+o),a=C0(n,i,r,c,s),a=a*60+.5),[a|0,u||0,l]}function eu(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(tn)}function nu(e,t,n){return eu(ep,e,t,n)}function M0(e,t,n){return eu(b0,e,t,n)}function P0(e,t,n){return eu(S0,e,t,n)}function np(e){return(e%360+360)%360}function E0(e){const t=w0.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?Di(+t[5]):tn(+t[5]));const r=np(+t[2]),s=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?i=M0(r,s,o):t[1]==="hsv"?i=P0(r,s,o):i=nu(r,s,o),{r:i[0],g:i[1],b:i[2],a:n}}function L0(e,t){var n=tu(e);n[0]=np(n[0]+t),n=nu(n),e.r=n[0],e.g=n[1],e.b=n[2]}function T0(e){if(!e)return;const t=tu(e),n=t[0],i=Mc(t[1]),r=Mc(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${r}%, ${Ce(e.a)})`:`hsl(${n}, ${i}%, ${r}%)`}const Pc={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"},Ec={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 O0(){const e={},t=Object.keys(Ec),n=Object.keys(Pc);let i,r,s,o,l;for(i=0;i>16&255,s>>8&255,s&255]}return e}let $r;function z0(e){$r||($r=O0(),$r.transparent=[0,0,0,0]);const t=$r[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const D0=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function R0(e){const t=D0.exec(e);let n=255,i,r,s;if(t){if(t[7]!==i){const o=+t[7];n=t[8]?Di(o):Ve(o*255,0,255)}return i=+t[1],r=+t[3],s=+t[5],i=255&(t[2]?Di(i):Ve(i,0,255)),r=255&(t[4]?Di(r):Ve(r,0,255)),s=255&(t[6]?Di(s):Ve(s,0,255)),{r:i,g:r,b:s,a:n}}}function F0(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Ce(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Yo=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,An=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function A0(e,t,n){const i=An(Ce(e.r)),r=An(Ce(e.g)),s=An(Ce(e.b));return{r:tn(Yo(i+n*(An(Ce(t.r))-i))),g:tn(Yo(r+n*(An(Ce(t.g))-r))),b:tn(Yo(s+n*(An(Ce(t.b))-s))),a:e.a+n*(t.a-e.a)}}function Ur(e,t,n){if(e){let i=tu(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=nu(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function ip(e,t){return e&&Object.assign(t||{},e)}function Lc(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=tn(e[3]))):(t=ip(e,{r:0,g:0,b:0,a:1}),t.a=tn(t.a)),t}function I0(e){return e.charAt(0)==="r"?R0(e):E0(e)}class dr{constructor(t){if(t instanceof dr)return t;const n=typeof t;let i;n==="object"?i=Lc(t):n==="string"&&(i=x0(t)||z0(t)||I0(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=ip(this._rgb);return t&&(t.a=Ce(t.a)),t}set rgb(t){this._rgb=Lc(t)}rgbString(){return this._valid?F0(this._rgb):void 0}hexString(){return this._valid?k0(this._rgb):void 0}hslString(){return this._valid?T0(this._rgb):void 0}mix(t,n){if(t){const i=this.rgb,r=t.rgb;let s;const o=n===s?.5:n,l=2*o-1,a=i.a-r.a,u=((l*a===-1?l:(l+a)/(1+l*a))+1)/2;s=1-u,i.r=255&u*i.r+s*r.r+.5,i.g=255&u*i.g+s*r.g+.5,i.b=255&u*i.b+s*r.b+.5,i.a=o*i.a+(1-o)*r.a,this.rgb=i}return this}interpolate(t,n){return t&&(this._rgb=A0(this._rgb,t._rgb,n)),this}clone(){return new dr(this.rgb)}alpha(t){return this._rgb.a=tn(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=Sr(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Ur(this._rgb,2,t),this}darken(t){return Ur(this._rgb,2,-t),this}saturate(t){return Ur(this._rgb,1,t),this}desaturate(t){return Ur(this._rgb,1,-t),this}rotate(t){return L0(this._rgb,t),this}}/*! + * Chart.js v4.4.2 + * https://www.chartjs.org + * (c) 2024 Chart.js Contributors + * Released under the MIT License + */function _e(){}const N0=(()=>{let e=0;return()=>e++})();function V(e){return e===null||typeof e>"u"}function Z(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 N(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function dt(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function jt(e,t){return dt(e)?e:t}function j(e,t){return typeof e>"u"?t:e}const j0=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function U(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function B(e,t,n,i){let r,s,o;if(Z(e))if(s=e.length,i)for(r=s-1;r>=0;r--)t.call(n,e[r],r);else for(r=0;re,x:e=>e.x,y:e=>e.y};function V0(e){const t=e.split("."),n=[];let i="";for(const r of t)i+=r,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function W0(e){const t=V0(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function fi(e,t){return(Tc[t]||(Tc[t]=W0(t)))(e)}function iu(e){return e.charAt(0).toUpperCase()+e.slice(1)}const pr=e=>typeof e<"u",sn=e=>typeof e=="function",Oc=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function $0(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const pt=Math.PI,ve=2*pt,Ys=Number.POSITIVE_INFINITY,U0=pt/180,Vt=pt/2,cn=pt/4,zc=pt*2/3,We=Math.log10,en=Math.sign;function gs(e,t,n){return Math.abs(e-t)r-s).pop(),t}function Ks(e){return!isNaN(parseFloat(e))&&isFinite(e)}function K0(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function sp(e,t,n){let i,r,s;for(i=0,r=e.length;ia&&u=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function su(e,t,n){n=n||(o=>e[o]1;)s=r+i>>1,n(s)?r=s:i=s;return{lo:r,hi:i}}const Zl=(e,t,n,i)=>su(e,n,i?r=>{const s=e[r][t];return se[r][t]su(e,n,i=>e[i][t]>=n);function J0(e,t,n){let i=0,r=e.length;for(;ii&&e[r-1]>n;)r--;return i>0||r{const i="_onData"+iu(n),r=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...s){const o=r.apply(this,s);return e._chartjs.listeners.forEach(l=>{typeof l[i]=="function"&&l[i](...s)}),o}})})}function Fc(e,t){const n=e._chartjs;if(!n)return;const i=n.listeners,r=i.indexOf(t);r!==-1&&i.splice(r,1),!(i.length>0)&&(op.forEach(s=>{delete e[s]}),delete e._chartjs)}function lp(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const ap=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function up(e,t){let n=[],i=!1;return function(...r){n=r,i||(i=!0,ap.call(window,()=>{i=!1,e.apply(t,n)}))}}function ey(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const ou=e=>e==="start"?"left":e==="end"?"right":"center",kt=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,ny=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t,Yr=e=>e===0||e===1,Ac=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*ve/n)),Ic=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*ve/n)+1,Yi={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*Vt)+1,easeOutSine:e=>Math.sin(e*Vt),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=>Yr(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=>Yr(e)?e:Ac(e,.075,.3),easeOutElastic:e=>Yr(e)?e:Ic(e,.075,.3),easeInOutElastic(e){return Yr(e)?e:e<.5?.5*Ac(e*2,.1125,.45):.5+.5*Ic(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-Yi.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?Yi.easeInBounce(e*2)*.5:Yi.easeOutBounce(e*2-1)*.5+.5};function cp(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Nc(e){return cp(e)?e:new dr(e)}function Ko(e){return cp(e)?e:new dr(e).saturate(.5).darken(.1).hexString()}const iy=["x","y","borderWidth","radius","tension"],ry=["color","borderColor","backgroundColor"];function sy(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:ry},numbers:{type:"number",properties:iy}}),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 oy(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const jc=new Map;function ly(e,t){t=t||{};const n=e+JSON.stringify(t);let i=jc.get(n);return i||(i=new Intl.NumberFormat(e,t),jc.set(n,i)),i}function lu(e,t,n){return ly(t,n).format(e)}const fp={values(e){return Z(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const i=this.chart.options.locale;let r,s=e;if(n.length>1){const u=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(u<1e-4||u>1e15)&&(r="scientific"),s=ay(e,n)}const o=We(Math.abs(s)),l=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),a={notation:r,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(a,this.options.ticks.format),lu(e,i,a)},logarithmic(e,t,n){if(e===0)return"0";const i=n[t].significand||e/Math.pow(10,Math.floor(We(e)));return[1,2,3,5,10,15].includes(i)||t>.8*n.length?fp.numeric.call(this,e,t,n):""}};function ay(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var mo={formatters:fp};function uy(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,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:mo.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 Ln=Object.create(null),ql=Object.create(null);function Ki(e,t){if(!t)return e;const n=t.split(".");for(let i=0,r=n.length;ii.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,r)=>Ko(r.backgroundColor),this.hoverBorderColor=(i,r)=>Ko(r.borderColor),this.hoverColor=(i,r)=>Ko(r.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return Xo(this,t,n)}get(t){return Ki(this,t)}describe(t,n){return Xo(ql,t,n)}override(t,n){return Xo(Ln,t,n)}route(t,n,i,r){const s=Ki(this,t),o=Ki(this,i),l="_"+n;Object.defineProperties(s,{[l]:{value:s[n],writable:!0},[n]:{enumerable:!0,get(){const a=this[l],u=o[r];return N(a)?Object.assign({},u,a):j(a,u)},set(a){this[l]=a}}})}apply(t){t.forEach(n=>n(this))}}var rt=new cy({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[sy,oy,uy]);function fy(e){return!e||V(e.size)||V(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Xs(e,t,n,i,r){let s=t[r];return s||(s=t[r]=e.measureText(r).width,n.push(r)),s>i&&(i=s),i}function dy(e,t,n,i){i=i||{};let r=i.data=i.data||{},s=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(r=i.data={},s=i.garbageCollect=[],i.font=t),e.save(),e.font=t;let o=0;const l=n.length;let a,u,c,f,d;for(a=0;an.length){for(a=0;a0&&e.stroke()}}function Gn(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.xt.top-n&&e.y0&&s.strokeColor!=="";let a,u;for(e.save(),e.font=r.string,hy(e,s),a=0;a+e||0;function hp(e,t){const n={},i=N(t),r=i?Object.keys(t):t,s=N(e)?i?o=>j(e[o],e[t[o]]):o=>e[o]:()=>e;for(const o of r)n[o]=xy(s(o));return n}function pp(e){return hp(e,{top:"y",right:"x",bottom:"y",left:"x"})}function wn(e){return hp(e,["topLeft","topRight","bottomLeft","bottomRight"])}function bt(e){const t=pp(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function ct(e,t){e=e||{},t=t||rt.font;let n=j(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=j(e.style,t.style);i&&!(""+i).match(yy)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:j(e.family,t.family),lineHeight:vy(j(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:j(e.weight,t.weight),string:""};return r.string=fy(r),r}function Kr(e,t,n,i){let r=!0,s,o,l;for(s=0,o=e.length;sn&&l===0?0:l+a;return{min:o(i,-Math.abs(s)),max:o(r,s)}}function Dn(e,t){return Object.assign(Object.create(e),t)}function cu(e,t=[""],n,i,r=()=>e[0]){const s=n||e;typeof i>"u"&&(i=vp("_fallback",e));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:s,_fallback:i,_getTarget:r,override:l=>cu([l,...e],t,s,i)};return new Proxy(o,{deleteProperty(l,a){return delete l[a],delete l._keys,delete e[0][a],!0},get(l,a){return mp(l,a,()=>Ey(a,t,e,l))},getOwnPropertyDescriptor(l,a){return Reflect.getOwnPropertyDescriptor(l._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(l,a){return Wc(l).includes(a)},ownKeys(l){return Wc(l)},set(l,a,u){const c=l._storage||(l._storage=r());return l[a]=c[a]=u,delete l._keys,!0}})}function di(e,t,n,i){const r={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:gp(e,i),setContext:s=>di(e,s,n,i),override:s=>di(e.override(s),t,n,i)};return new Proxy(r,{deleteProperty(s,o){return delete s[o],delete e[o],!0},get(s,o,l){return mp(s,o,()=>wy(s,o,l))},getOwnPropertyDescriptor(s,o){return s._descriptors.allKeys?Reflect.has(e,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,o)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(s,o){return Reflect.has(e,o)},ownKeys(){return Reflect.ownKeys(e)},set(s,o,l){return e[o]=l,delete s[o],!0}})}function gp(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:r=t.allKeys}=e;return{allKeys:r,scriptable:n,indexable:i,isScriptable:sn(n)?n:()=>n,isIndexable:sn(i)?i:()=>i}}const ky=(e,t)=>e?e+iu(t):t,fu=(e,t)=>N(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function mp(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const i=n();return e[t]=i,i}function wy(e,t,n){const{_proxy:i,_context:r,_subProxy:s,_descriptors:o}=e;let l=i[t];return sn(l)&&o.isScriptable(t)&&(l=Sy(t,l,e,n)),Z(l)&&l.length&&(l=by(t,l,e,o.isIndexable)),fu(t,l)&&(l=di(l,r,s&&s[t],o)),l}function Sy(e,t,n,i){const{_proxy:r,_context:s,_subProxy:o,_stack:l}=n;if(l.has(e))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+e);l.add(e);let a=t(s,o||i);return l.delete(e),fu(e,a)&&(a=du(r._scopes,r,e,a)),a}function by(e,t,n,i){const{_proxy:r,_context:s,_subProxy:o,_descriptors:l}=n;if(typeof s.index<"u"&&i(e))return t[s.index%t.length];if(N(t[0])){const a=t,u=r._scopes.filter(c=>c!==a);t=[];for(const c of a){const f=du(u,r,e,c);t.push(di(f,s,o&&o[e],l))}}return t}function yp(e,t,n){return sn(e)?e(t,n):e}const Cy=(e,t)=>e===!0?t:typeof e=="string"?fi(t,e):void 0;function My(e,t,n,i,r){for(const s of t){const o=Cy(n,s);if(o){e.add(o);const l=yp(o._fallback,n,r);if(typeof l<"u"&&l!==n&&l!==i)return l}else if(o===!1&&typeof i<"u"&&n!==i)return null}return!1}function du(e,t,n,i){const r=t._rootScopes,s=yp(t._fallback,n,i),o=[...e,...r],l=new Set;l.add(i);let a=Vc(l,o,n,s||n,i);return a===null||typeof s<"u"&&s!==n&&(a=Vc(l,o,s,a,i),a===null)?!1:cu(Array.from(l),[""],r,s,()=>Py(t,n,i))}function Vc(e,t,n,i,r){for(;n;)n=My(e,t,n,i,r);return n}function Py(e,t,n){const i=e._getTarget();t in i||(i[t]={});const r=i[t];return Z(r)&&N(n)?n:r||{}}function Ey(e,t,n,i){let r;for(const s of t)if(r=vp(ky(s,e),n),typeof r<"u")return fu(e,r)?du(n,i,e,r):r}function vp(e,t){for(const n of t){if(!n)continue;const i=n[e];if(typeof i<"u")return i}}function Wc(e){let t=e._keys;return t||(t=e._keys=Ly(e._scopes)),t}function Ly(e){const t=new Set;for(const n of e)for(const i of Object.keys(n).filter(r=>!r.startsWith("_")))t.add(i);return Array.from(t)}function hu(){return typeof window<"u"&&typeof document<"u"}function pu(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Qs(e,t,n){let i;return typeof e=="string"?(i=parseInt(e,10),e.indexOf("%")!==-1&&(i=i/100*t.parentNode[n])):i=e,i}const yo=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function Ty(e,t){return yo(e).getPropertyValue(t)}const Oy=["top","right","bottom","left"];function Sn(e,t,n){const i={};n=n?"-"+n:"";for(let r=0;r<4;r++){const s=Oy[r];i[s]=parseFloat(e[t+"-"+s+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const zy=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function Dy(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:r,offsetY:s}=i;let o=!1,l,a;if(zy(r,s,e.target))l=r,a=s;else{const u=t.getBoundingClientRect();l=i.clientX-u.left,a=i.clientY-u.top,o=!0}return{x:l,y:a,box:o}}function mn(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,r=yo(n),s=r.boxSizing==="border-box",o=Sn(r,"padding"),l=Sn(r,"border","width"),{x:a,y:u,box:c}=Dy(e,n),f=o.left+(c&&l.left),d=o.top+(c&&l.top);let{width:h,height:m}=t;return s&&(h-=o.width+l.width,m-=o.height+l.height),{x:Math.round((a-f)/h*n.width/i),y:Math.round((u-d)/m*n.height/i)}}function Ry(e,t,n){let i,r;if(t===void 0||n===void 0){const s=pu(e);if(!s)t=e.clientWidth,n=e.clientHeight;else{const o=s.getBoundingClientRect(),l=yo(s),a=Sn(l,"border","width"),u=Sn(l,"padding");t=o.width-u.width-a.width,n=o.height-u.height-a.height,i=Qs(l.maxWidth,s,"clientWidth"),r=Qs(l.maxHeight,s,"clientHeight")}}return{width:t,height:n,maxWidth:i||Ys,maxHeight:r||Ys}}const Xr=e=>Math.round(e*10)/10;function Fy(e,t,n,i){const r=yo(e),s=Sn(r,"margin"),o=Qs(r.maxWidth,e,"clientWidth")||Ys,l=Qs(r.maxHeight,e,"clientHeight")||Ys,a=Ry(e,t,n);let{width:u,height:c}=a;if(r.boxSizing==="content-box"){const d=Sn(r,"border","width"),h=Sn(r,"padding");u-=h.width+d.width,c-=h.height+d.height}return u=Math.max(0,u-s.width),c=Math.max(0,i?u/i:c-s.height),u=Xr(Math.min(u,o,a.maxWidth)),c=Xr(Math.min(c,l,a.maxHeight)),u&&!c&&(c=Xr(u/2)),(t!==void 0||n!==void 0)&&i&&a.height&&c>a.height&&(c=a.height,u=Xr(Math.floor(c*i))),{width:u,height:c}}function $c(e,t,n){const i=t||1,r=Math.floor(e.height*i),s=Math.floor(e.width*i);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const o=e.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${e.height}px`,o.style.width=`${e.width}px`),e.currentDevicePixelRatio!==i||o.height!==r||o.width!==s?(e.currentDevicePixelRatio=i,o.height=r,o.width=s,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Ay=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};hu()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function Uc(e,t){const n=Ty(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}const Iy=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,i){return n-i},leftForLtr(n,i){return n-i}}},Ny=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function ii(e,t,n){return e?Iy(t,n):Ny()}function xp(e,t){let n,i;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)}function _p(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}/*! + * Chart.js v4.4.2 + * https://www.chartjs.org + * (c) 2024 Chart.js Contributors + * Released under the MIT License + */class jy{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,i,r){const s=n.listeners[r],o=n.duration;s.forEach(l=>l({chart:t,initial:n.initial,numSteps:o,currentStep:Math.min(i-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=ap.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,r)=>{if(!i.running||!i.items.length)return;const s=i.items;let o=s.length-1,l=!1,a;for(;o>=0;--o)a=s[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(t),l=!0):(s[o]=s[s.length-1],s.pop());l&&(r.draw(),this._notify(r,i,t,"progress")),s.length||(i.running=!1,this._notify(r,i,t,"complete"),i.initial=!1),n+=s.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((i,r)=>Math.max(i,r._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const i=n.items;let r=i.length-1;for(;r>=0;--r)i[r].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var ke=new jy;const Yc="transparent",By={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=Nc(e||Yc),r=i.valid&&Nc(t||Yc);return r&&r.valid?r.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class Hy{constructor(t,n,i,r){const s=n[i];r=Kr([t.to,r,s,t.from]);const o=Kr([t.from,s,r]);this._active=!0,this._fn=t.fn||By[t.type||typeof o],this._easing=Yi[t.easing]||Yi.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=i,this._from=o,this._to=r,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);const r=this._target[this._prop],s=i-this._start,o=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=Kr([t.to,n,r,t.from]),this._from=Kr([t.from,r,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,i=this._duration,r=this._prop,s=this._from,o=this._loop,l=this._to;let a;if(this._active=s!==l&&(o||n1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[r]=this._fn(s,l,a)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){const n=t?"res":"rej",i=this._promises||[];for(let r=0;r{const s=t[r];if(!N(s))return;const o={};for(const l of n)o[l]=s[l];(Z(s.properties)&&s.properties||[r]).forEach(l=>{(l===r||!i.has(l))&&i.set(l,o)})})}_animateOptions(t,n){const i=n.options,r=Wy(t,i);if(!r)return[];const s=this._createAnimations(r,i);return i.$shared&&Vy(t.options.$animations,i).then(()=>{t.options=i},()=>{}),s}_createAnimations(t,n){const i=this._properties,r=[],s=t.$animations||(t.$animations={}),o=Object.keys(n),l=Date.now();let a;for(a=o.length-1;a>=0;--a){const u=o[a];if(u.charAt(0)==="$")continue;if(u==="options"){r.push(...this._animateOptions(t,n));continue}const c=n[u];let f=s[u];const d=i.get(u);if(f)if(d&&f.active()){f.update(d,c,l);continue}else f.cancel();if(!d||!d.duration){t[u]=c;continue}s[u]=f=new Hy(d,t,u,c),r.push(f)}return r}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return ke.add(this._chart,i),!0}}function Vy(e,t){const n=[],i=Object.keys(t);for(let r=0;r0||!n&&s<0)return r.index}return null}function Zc(e,t){const{chart:n,_cachedMeta:i}=e,r=n._stacks||(n._stacks={}),{iScale:s,vScale:o,index:l}=i,a=s.axis,u=o.axis,c=Ky(s,o,i),f=t.length;let d;for(let h=0;hn[i].axis===t).shift()}function Gy(e,t){return Dn(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Zy(e,t,n){return Dn(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function bi(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const r of t){const s=r._stacks;if(!s||s[i]===void 0||s[i][n]===void 0)return;delete s[i][n],s[i]._visualValues!==void 0&&s[i]._visualValues[n]!==void 0&&delete s[i]._visualValues[n]}}}const Go=e=>e==="reset"||e==="none",qc=(e,t)=>t?e:Object.assign({},e),qy=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:wp(n,!0),values:null};class Xi{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Qc(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&&bi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),r=(f,d,h,m)=>f==="x"?d:f==="r"?m:h,s=n.xAxisID=j(i.xAxisID,Qo(t,"x")),o=n.yAxisID=j(i.yAxisID,Qo(t,"y")),l=n.rAxisID=j(i.rAxisID,Qo(t,"r")),a=n.indexAxis,u=n.iAxisID=r(a,s,o,l),c=n.vAxisID=r(a,o,s,l);n.xScale=this.getScaleForId(s),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(l),n.iScale=this.getScaleForId(u),n.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Fc(this._data,this),t._stacked&&bi(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(N(n))this._data=Yy(n);else if(i!==n){if(i){Fc(i,this);const r=this._cachedMeta;bi(r),r._parsed=[]}n&&Object.isExtensible(n)&&ty(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,i=this.getDataset();let r=!1;this._dataCheck();const s=n._stacked;n._stacked=Qc(n.vScale,n),n.stack!==i.stack&&(r=!0,bi(n),n.stack=i.stack),this._resyncElements(t),(r||s!==n._stacked)&&Zc(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:i,_data:r}=this,{iScale:s,_stacked:o}=i,l=s.axis;let a=t===0&&n===r.length?!0:i._sorted,u=t>0&&i._parsed[t-1],c,f,d;if(this._parsing===!1)i._parsed=r,i._sorted=!0,d=r;else{Z(r[t])?d=this.parseArrayData(i,r,t,n):N(r[t])?d=this.parseObjectData(i,r,t,n):d=this.parsePrimitiveData(i,r,t,n);const h=()=>f[l]===null||u&&f[l]v||f=0;--d)if(!m()){this.updateRangeFromParsed(u,t,h,a);break}}return u}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let r,s,o;for(r=0,s=n.length;r=0&&tthis.getContext(i,r,n),v=u.resolveNamedOptions(d,h,m,f);return v.$shared&&(v.$shared=a,s[o]=Object.freeze(qc(v,a))),v}_resolveAnimations(t,n,i){const r=this.chart,s=this._cachedDataOpts,o=`animation-${n}`,l=s[o];if(l)return l;let a;if(r.options.animation!==!1){const c=this.chart.config,f=c.datasetAnimationScopeKeys(this._type,n),d=c.getOptionScopes(this.getDataset(),f);a=c.createResolver(d,this.getContext(t,i,n))}const u=new kp(r,a&&a.animations);return a&&a._cacheable&&(s[o]=Object.freeze(u)),u}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Go(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const i=this.resolveDataElementOptions(t,n),r=this._sharedOptions,s=this.getSharedOptions(i),o=this.includeOptions(n,s)||s!==r;return this.updateSharedOptions(s,n,i),{sharedOptions:s,includeOptions:o}}updateElement(t,n,i,r){Go(r)?Object.assign(t,i):this._resolveAnimations(n,r).update(t,i)}updateSharedOptions(t,n,i){t&&!Go(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,r){t.active=r;const s=this.getStyle(n,r);this._resolveAnimations(n,i,r).update(t,{options:!r&&this.getSharedOptions(s)||s})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,i=this._cachedMeta.data;for(const[l,a,u]of this._syncList)this[l](a,u);this._syncList=[];const r=i.length,s=n.length,o=Math.min(s,r);o&&this.parse(0,o),s>r?this._insertElements(r,s-r,t):s{for(u.length+=n,l=u.length-1;l>=o;l--)u[l]=u[l-n]};for(a(s),l=t;lr-s))}return e._cache.$bar}function tv(e){const t=e.iScale,n=Jy(t,e.type);let i=t._length,r,s,o,l;const a=()=>{o===32767||o===-32768||(pr(l)&&(i=Math.min(i,Math.abs(o-l)||i)),l=o)};for(r=0,s=n.length;r0?r[e-1]:null,l=eMath.abs(l)&&(a=l,u=o),t[n.axis]=u,t._custom={barStart:a,barEnd:u,start:r,end:s,min:o,max:l}}function Sp(e,t,n,i){return Z(e)?iv(e,t,n,i):t[n.axis]=n.parse(e,i),t}function Jc(e,t,n,i){const r=e.iScale,s=e.vScale,o=r.getLabels(),l=r===s,a=[];let u,c,f,d;for(u=n,c=n+i;u=n?1:-1)}function sv(e){let t,n,i,r,s;return e.horizontal?(t=e.base>e.x,n="left",i="right"):(t=e.basea.controller.options.grouped),s=i.options.stacked,o=[],l=a=>{const u=a.controller.getParsed(n),c=u&&u[a.vScale.axis];if(V(c)||isNaN(c))return!0};for(const a of r)if(!(n!==void 0&&l(a))&&((s===!1||o.indexOf(a.stack)===-1||s===void 0&&a.stack===void 0)&&o.push(a.stack),a.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,i){const r=this._getStacks(t,i),s=n!==void 0?r.indexOf(n):-1;return s===-1?r.length-1:s}_getRuler(){const t=this.options,n=this._cachedMeta,i=n.iScale,r=[];let s,o;for(s=0,o=n.data.length;s{a[o](t[n],r)&&(s.push({element:a,datasetIndex:u,index:c}),l=l||a.inRange(t.x,t.y,r))}),i&&!l?[]:s}var pv={evaluateInteractionItems:br,modes:{index(e,t,n,i){const r=mn(t,e),s=n.axis||"x",o=n.includeInvisible||!1,l=n.intersect?qo(e,r,s,i,o):Jo(e,r,s,!1,i,o),a=[];return l.length?(e.getSortedVisibleDatasetMetas().forEach(u=>{const c=l[0].index,f=u.data[c];f&&!f.skip&&a.push({element:f,datasetIndex:u.index,index:c})}),a):[]},dataset(e,t,n,i){const r=mn(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;let l=n.intersect?qo(e,r,s,i,o):Jo(e,r,s,!1,i,o);if(l.length>0){const a=l[0].datasetIndex,u=e.getDatasetMeta(a).data;l=[];for(let c=0;cn.pos===t)}function rf(e,t){return e.filter(n=>bp.indexOf(n.pos)===-1&&n.box.axis===t)}function Mi(e,t){return e.sort((n,i)=>{const r=t?i:n,s=t?n:i;return r.weight===s.weight?r.index-s.index:r.weight-s.weight})}function gv(e){const t=[];let n,i,r,s,o,l;for(n=0,i=(e||[]).length;nu.box.fullSize),!0),i=Mi(Ci(t,"left"),!0),r=Mi(Ci(t,"right")),s=Mi(Ci(t,"top"),!0),o=Mi(Ci(t,"bottom")),l=rf(t,"x"),a=rf(t,"y");return{fullSize:n,leftAndTop:i.concat(s),rightAndBottom:r.concat(a).concat(o).concat(l),chartArea:Ci(t,"chartArea"),vertical:i.concat(r).concat(a),horizontal:s.concat(o).concat(l)}}function sf(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function Cp(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 xv(e,t,n,i){const{pos:r,box:s}=n,o=e.maxPadding;if(!N(r)){n.size&&(e[r]-=n.size);const f=i[n.stack]||{size:0,count:1};f.size=Math.max(f.size,n.horizontal?s.height:s.width),n.size=f.size/f.count,e[r]+=n.size}s.getPadding&&Cp(o,s.getPadding());const l=Math.max(0,t.outerWidth-sf(o,e,"left","right")),a=Math.max(0,t.outerHeight-sf(o,e,"top","bottom")),u=l!==e.w,c=a!==e.h;return e.w=l,e.h=a,n.horizontal?{same:u,other:c}:{same:c,other:u}}function _v(e){const t=e.maxPadding;function n(i){const r=Math.max(t[i]-e[i],0);return e[i]+=r,r}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function kv(e,t){const n=t.maxPadding;function i(r){const s={left:0,top:0,right:0,bottom:0};return r.forEach(o=>{s[o]=Math.max(t[o],n[o])}),s}return i(e?["left","right"]:["top","bottom"])}function Ri(e,t,n,i){const r=[];let s,o,l,a,u,c;for(s=0,o=e.length,u=0;s{typeof v.beforeLayout=="function"&&v.beforeLayout()});const c=a.reduce((v,x)=>x.box.options&&x.box.options.display===!1?v:v+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:n,padding:r,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/c,hBoxMaxHeight:o/2}),d=Object.assign({},r);Cp(d,bt(i));const h=Object.assign({maxPadding:d,w:s,h:o,x:r.left,y:r.top},r),m=yv(a.concat(u),f);Ri(l.fullSize,h,f,m),Ri(a,h,f,m),Ri(u,h,f,m)&&Ri(a,h,f,m),_v(h),of(l.leftAndTop,h,f,m),h.x+=h.w,h.y+=h.h,of(l.rightAndBottom,h,f,m),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},B(l.chartArea,v=>{const x=v.box;Object.assign(x,e.chartArea),x.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class Mp{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,r){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,r?Math.floor(n/r):i)}}isAttached(t){return!0}updateConfig(t){}}class wv extends Mp{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const ys="$chartjs",Sv={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},lf=e=>e===null||e==="";function bv(e,t){const n=e.style,i=e.getAttribute("height"),r=e.getAttribute("width");if(e[ys]={initial:{height:i,width:r,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",lf(r)){const s=Uc(e,"width");s!==void 0&&(e.width=s)}if(lf(i))if(e.style.height==="")e.height=e.width/(t||2);else{const s=Uc(e,"height");s!==void 0&&(e.height=s)}return e}const Pp=Ay?{passive:!0}:!1;function Cv(e,t,n){e&&e.addEventListener(t,n,Pp)}function Mv(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,Pp)}function Pv(e,t){const n=Sv[e.type]||e.type,{x:i,y:r}=mn(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:r!==void 0?r:null}}function Gs(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function Ev(e,t,n){const i=e.canvas,r=new MutationObserver(s=>{let o=!1;for(const l of s)o=o||Gs(l.addedNodes,i),o=o&&!Gs(l.removedNodes,i);o&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}function Lv(e,t,n){const i=e.canvas,r=new MutationObserver(s=>{let o=!1;for(const l of s)o=o||Gs(l.removedNodes,i),o=o&&!Gs(l.addedNodes,i);o&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}const mr=new Map;let af=0;function Ep(){const e=window.devicePixelRatio;e!==af&&(af=e,mr.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function Tv(e,t){mr.size||window.addEventListener("resize",Ep),mr.set(e,t)}function Ov(e){mr.delete(e),mr.size||window.removeEventListener("resize",Ep)}function zv(e,t,n){const i=e.canvas,r=i&&pu(i);if(!r)return;const s=up((l,a)=>{const u=r.clientWidth;n(l,a),u{const a=l[0],u=a.contentRect.width,c=a.contentRect.height;u===0&&c===0||s(u,c)});return o.observe(r),Tv(e,s),o}function tl(e,t,n){n&&n.disconnect(),t==="resize"&&Ov(e)}function Dv(e,t,n){const i=e.canvas,r=up(s=>{e.ctx!==null&&n(Pv(s,e))},e);return Cv(i,t,r),r}class Rv extends Mp{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(bv(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[ys])return!1;const i=n[ys].initial;["height","width"].forEach(s=>{const o=i[s];V(o)?n.removeAttribute(s):n.setAttribute(s,o)});const r=i.style||{};return Object.keys(r).forEach(s=>{n.style[s]=r[s]}),n.width=n.width,delete n[ys],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const r=t.$proxies||(t.$proxies={}),o={attach:Ev,detach:Lv,resize:zv}[n]||Dv;r[n]=o(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),r=i[n];if(!r)return;({attach:tl,detach:tl,resize:tl}[n]||Mv)(t,n,r),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,r){return Fy(t,n,i,r)}isAttached(t){const n=pu(t);return!!(n&&n.isConnected)}}function Fv(e){return!hu()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?wv:Rv}class on{constructor(){R(this,"x");R(this,"y");R(this,"active",!1);R(this,"options");R(this,"$animations")}tooltipPosition(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return Ks(this.x)&&Ks(this.y)}getProps(t,n){const i=this.$animations;if(!n||!i)return this;const r={};return t.forEach(s=>{r[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),r}}R(on,"defaults",{}),R(on,"defaultRoutes");function Av(e,t){const n=e.options.ticks,i=Iv(e),r=Math.min(n.maxTicksLimit||i,i),s=n.major.enabled?jv(t):[],o=s.length,l=s[0],a=s[o-1],u=[];if(o>r)return Bv(t,u,s,o/r),u;const c=Nv(s,t,r);if(o>0){let f,d;const h=o>1?Math.round((a-l)/(o-1)):null;for(Gr(t,u,c,V(h)?0:l-h,l),f=0,d=o-1;fr)return a}return Math.max(r,1)}function jv(e){const t=[];let n,i;for(n=0,i=e.length;ne==="left"?"right":e==="right"?"left":e,uf=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,cf=(e,t)=>Math.min(t||e,e);function ff(e,t){const n=[],i=e.length/t,r=e.length;let s=0;for(;so+l)))return a}function $v(e,t){B(e,n=>{const i=n.gc,r=i.length/2;let s;if(r>t){for(s=0;si?i:n,i=r&&n>i?n:i,{min:jt(n,jt(i,n)),max:jt(i,jt(n,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){U(this.options.beforeUpdate,[this])}update(t,n,i){const{beginAtZero:r,grace:s,ticks:o}=this.options,l=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=_y(this,s,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=l=s||i<=1||!this.isHorizontal()){this.labelRotation=r;return}const c=this._getLabelSizes(),f=c.widest.width,d=c.highest.height,h=se(this.chart.width-f,0,this.maxWidth);l=t.offset?this.maxWidth/i:h/(i-1),f+6>l&&(l=h/(i-(t.offset?.5:1)),a=this.maxHeight-Pi(t.grid)-n.padding-df(t.title,this.chart.options.font),u=Math.sqrt(f*f+d*d),o=ru(Math.min(Math.asin(se((c.highest.height+6)/l,-1,1)),Math.asin(se(a/u,-1,1))-Math.asin(se(d/u,-1,1)))),o=Math.max(r,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){U(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){U(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:r,grid:s}}=this,o=this._isVisible(),l=this.isHorizontal();if(o){const a=df(r,n.options.font);if(l?(t.width=this.maxWidth,t.height=Pi(s)+a):(t.height=this.maxHeight,t.width=Pi(s)+a),i.display&&this.ticks.length){const{first:u,last:c,widest:f,highest:d}=this._getLabelSizes(),h=i.padding*2,m=$e(this.labelRotation),v=Math.cos(m),x=Math.sin(m);if(l){const g=i.mirror?0:x*f.width+v*d.height;t.height=Math.min(this.maxHeight,t.height+g+h)}else{const g=i.mirror?0:v*f.width+x*d.height;t.width=Math.min(this.maxWidth,t.width+g+h)}this._calculatePadding(u,c,x,v)}}this._handleMargins(),l?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,i,r){const{ticks:{align:s,padding:o},position:l}=this.options,a=this.labelRotation!==0,u=l!=="top"&&this.axis==="x";if(this.isHorizontal()){const c=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,h=0;a?u?(d=r*t.width,h=i*n.height):(d=i*t.height,h=r*n.width):s==="start"?h=n.width:s==="end"?d=t.width:s!=="inner"&&(d=t.width/2,h=n.width/2),this.paddingLeft=Math.max((d-c+o)*this.width/(this.width-c),0),this.paddingRight=Math.max((h-f+o)*this.width/(this.width-f),0)}else{let c=n.height/2,f=t.height/2;s==="start"?(c=0,f=t.height):s==="end"&&(c=n.height,f=0),this.paddingTop=c+o,this.paddingBottom=f+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(){U(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,i;for(n=0,i=t.length;n({width:o[L]||0,height:l[L]||0});return{first:b(0),last:b(n-1),widest:b(w),highest:b(S),widths:o,heights:l}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return Z0(this._alignToPixels?fn(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&tl*r?l/i:a/r:a*r0}_computeGridLineItems(t){const n=this.axis,i=this.chart,r=this.options,{grid:s,position:o,border:l}=r,a=s.offset,u=this.isHorizontal(),f=this.ticks.length+(a?1:0),d=Pi(s),h=[],m=l.setContext(this.getContext()),v=m.display?m.width:0,x=v/2,g=function(st){return fn(i,st,v)};let p,y,_,k,w,S,b,L,M,O,F,nt;if(o==="top")p=g(this.bottom),S=this.bottom-d,L=p-x,O=g(t.top)+x,nt=t.bottom;else if(o==="bottom")p=g(this.top),O=t.top,nt=g(t.bottom)-x,S=p+x,L=this.top+d;else if(o==="left")p=g(this.right),w=this.right-d,b=p-x,M=g(t.left)+x,F=t.right;else if(o==="right")p=g(this.left),M=t.left,F=g(t.right)-x,w=p+x,b=this.left+d;else if(n==="x"){if(o==="center")p=g((t.top+t.bottom)/2+.5);else if(N(o)){const st=Object.keys(o)[0],vt=o[st];p=g(this.chart.scales[st].getPixelForValue(vt))}O=t.top,nt=t.bottom,S=p+x,L=S+d}else if(n==="y"){if(o==="center")p=g((t.left+t.right)/2);else if(N(o)){const st=Object.keys(o)[0],vt=o[st];p=g(this.chart.scales[st].getPixelForValue(vt))}w=p-x,b=w-d,M=t.left,F=t.right}const Ct=j(r.ticks.maxTicksLimit,f),q=Math.max(1,Math.ceil(f/Ct));for(y=0;y0&&(Pt-=Mt/2);break}W={left:Pt,top:xe,width:Mt+K.width,height:ue+K.height,color:q.backdropColor}}x.push({label:_,font:L,textOffset:F,options:{rotation:v,color:vt,strokeColor:P,strokeWidth:z,textAlign:D,textBaseline:nt,translation:[k,w],backdrop:W}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-$e(this.labelRotation))return t==="top"?"left":"right";let r="center";return n.align==="start"?r="left":n.align==="end"?r="right":n.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:i,mirror:r,padding:s}}=this.options,o=this._getLabelSizes(),l=t+s,a=o.widest.width;let u,c;return n==="left"?r?(c=this.right+s,i==="near"?u="left":i==="center"?(u="center",c+=a/2):(u="right",c+=a)):(c=this.right-l,i==="near"?u="right":i==="center"?(u="center",c-=a/2):(u="left",c=this.left)):n==="right"?r?(c=this.left+s,i==="near"?u="right":i==="center"?(u="center",c-=a/2):(u="left",c-=a)):(c=this.left+l,i==="near"?u="left":i==="center"?(u="center",c+=a/2):(u="right",c=this.right)):u="right",{textAlign:u,x:c}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:i,top:r,width:s,height:o}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(i,r,s,o),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const r=this.ticks.findIndex(s=>s.value===t);return r>=0?n.setContext(this.getContext(r)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,o;const l=(a,u,c)=>{!c.width||!c.color||(i.save(),i.lineWidth=c.width,i.strokeStyle=c.color,i.setLineDash(c.borderDash||[]),i.lineDashOffset=c.borderDashOffset,i.beginPath(),i.moveTo(a.x,a.y),i.lineTo(u.x,u.y),i.stroke(),i.restore())};if(n.display)for(s=0,o=r.length;s{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",r=[];let s,o;for(s=0,o=n.length;s{const i=n.split("."),r=i.pop(),s=[e].concat(i).join("."),o=t[n].split("."),l=o.pop(),a=o.join(".");rt.route(s,r,a,l)})}function Zv(e){return"id"in e&&"defaults"in e}class qv{constructor(){this.controllers=new Zr(Xi,"datasets",!0),this.elements=new Zr(on,"elements"),this.plugins=new Zr(Object,"plugins"),this.scales=new Zr(Rn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,i){[...n].forEach(r=>{const s=i||this._getRegistryForType(r);i||s.isForType(r)||s===this.plugins&&r.id?this._exec(t,s,r):B(r,o=>{const l=i||this._getRegistryForType(o);this._exec(t,l,o)})})}_exec(t,n,i){const r=iu(t);U(i["before"+r],[],i),n[t](i),U(i["after"+r],[],i)}_getRegistryForType(t){for(let n=0;ns.filter(l=>!o.some(a=>l.plugin.id===a.plugin.id));this._notify(r(n,i),t,"stop"),this._notify(r(i,n),t,"start")}}function tx(e){const t={},n=[],i=Object.keys(he.plugins.items);for(let s=0;s1&&hf(e[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function pf(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function lx(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(i=>i.xAxisID===e||i.yAxisID===e);if(n.length)return pf(e,"x",n[0])||pf(e,"y",n[0])}return{}}function ax(e,t){const n=Ln[e.type]||{scales:{}},i=t.scales||{},r=Jl(e.type,t),s=Object.create(null);return Object.keys(i).forEach(o=>{const l=i[o];if(!N(l))return console.error(`Invalid scale configuration for scale: ${o}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const a=ta(o,l,lx(o,e),rt.scales[l.type]),u=sx(a,r),c=n.scales||{};s[o]=Ui(Object.create(null),[{axis:a},l,c[a],c[u]])}),e.data.datasets.forEach(o=>{const l=o.type||e.type,a=o.indexAxis||Jl(l,t),c=(Ln[l]||{}).scales||{};Object.keys(c).forEach(f=>{const d=rx(f,a),h=o[d+"AxisID"]||d;s[h]=s[h]||Object.create(null),Ui(s[h],[{axis:d},i[h],c[f]])})}),Object.keys(s).forEach(o=>{const l=s[o];Ui(l,[rt.scales[l.type],rt.scale])}),s}function Lp(e){const t=e.options||(e.options={});t.plugins=j(t.plugins,{}),t.scales=ax(e,t)}function Tp(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function ux(e){return e=e||{},e.data=Tp(e.data),Lp(e),e}const gf=new Map,Op=new Set;function qr(e,t){let n=gf.get(e);return n||(n=t(),gf.set(e,n),Op.add(n)),n}const Ei=(e,t,n)=>{const i=fi(t,n);i!==void 0&&e.add(i)};class cx{constructor(t){this._config=ux(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=Tp(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(),Lp(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return qr(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return qr(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return qr(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return qr(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let r=i.get(t);return(!r||n)&&(r=new Map,i.set(t,r)),r}getOptionScopes(t,n,i){const{options:r,type:s}=this,o=this._cachedScopes(t,i),l=o.get(n);if(l)return l;const a=new Set;n.forEach(c=>{t&&(a.add(t),c.forEach(f=>Ei(a,t,f))),c.forEach(f=>Ei(a,r,f)),c.forEach(f=>Ei(a,Ln[s]||{},f)),c.forEach(f=>Ei(a,rt,f)),c.forEach(f=>Ei(a,ql,f))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),Op.has(n)&&o.set(n,u),u}chartOptionScopes(){const{options:t,type:n}=this;return[t,Ln[n]||{},rt.datasets[n]||{},{type:n},rt,ql]}resolveNamedOptions(t,n,i,r=[""]){const s={$shared:!0},{resolver:o,subPrefixes:l}=mf(this._resolverCache,t,r);let a=o;if(dx(o,n)){s.$shared=!1,i=sn(i)?i():i;const u=this.createResolver(t,i,l);a=di(o,i,u)}for(const u of n)s[u]=a[u];return s}createResolver(t,n,i=[""],r){const{resolver:s}=mf(this._resolverCache,t,i);return N(n)?di(s,n,void 0,r):s}}function mf(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const r=n.join();let s=i.get(r);return s||(s={resolver:cu(t,n),subPrefixes:n.filter(l=>!l.toLowerCase().includes("hover"))},i.set(r,s)),s}const fx=e=>N(e)&&Object.getOwnPropertyNames(e).some(t=>sn(e[t]));function dx(e,t){const{isScriptable:n,isIndexable:i}=gp(e);for(const r of t){const s=n(r),o=i(r),l=(o||s)&&e[r];if(s&&(sn(l)||fx(l))||o&&Z(l))return!0}return!1}var hx="4.4.2";const px=["top","bottom","left","right","chartArea"];function yf(e,t){return e==="top"||e==="bottom"||px.indexOf(e)===-1&&t==="x"}function vf(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function xf(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),U(n&&n.onComplete,[e],t)}function gx(e){const t=e.chart,n=t.options.animation;U(n&&n.onProgress,[e],t)}function zp(e){return hu()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const vs={},_f=e=>{const t=zp(e);return Object.values(vs).filter(n=>n.canvas===t).pop()};function mx(e,t,n){const i=Object.keys(e);for(const r of i){const s=+r;if(s>=t){const o=e[r];delete e[r],(n>0||s>t)&&(e[s+n]=o)}}}function yx(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}function Jr(e,t,n){return e.options.clip?e[n]:t[n]}function vx(e,t){const{xScale:n,yScale:i}=e;return n&&i?{left:Jr(n,t,"left"),right:Jr(n,t,"right"),top:Jr(i,t,"top"),bottom:Jr(i,t,"bottom")}:t}var Fe;let vo=(Fe=class{static register(...t){he.add(...t),kf()}static unregister(...t){he.remove(...t),kf()}constructor(t,n){const i=this.config=new cx(n),r=zp(t),s=_f(r);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Fv(r)),this.platform.updateConfig(i);const l=this.platform.acquireContext(r,o.aspectRatio),a=l&&l.canvas,u=a&&a.height,c=a&&a.width;if(this.id=N0(),this.ctx=l,this.canvas=a,this.width=c,this.height=u,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Jv,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=ey(f=>this.update(f),o.resizeDelay||0),this._dataChanges=[],vs[this.id]=this,!l||!a){console.error("Failed to create chart: can't acquire context from the given item");return}ke.listen(this,"complete",xf),ke.listen(this,"progress",gx),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:r,_aspectRatio:s}=this;return V(t)?n&&s?s:r?i/r:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return he}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():$c(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Bc(this.canvas,this.ctx),this}stop(){return ke.stop(this),this}resize(t,n){ke.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const i=this.options,r=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(r,t,n,s),l=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,$c(this,l,!0)&&(this.notifyPlugins("resize",{size:o}),U(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};B(n,(i,r)=>{i.id=r})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,r=Object.keys(i).reduce((o,l)=>(o[l]=!1,o),{});let s=[];n&&(s=s.concat(Object.keys(n).map(o=>{const l=n[o],a=ta(o,l),u=a==="r",c=a==="x";return{options:l,dposition:u?"chartArea":c?"bottom":"left",dtype:u?"radialLinear":c?"category":"linear"}}))),B(s,o=>{const l=o.options,a=l.id,u=ta(a,l),c=j(l.type,o.dtype);(l.position===void 0||yf(l.position,u)!==yf(o.dposition))&&(l.position=o.dposition),r[a]=!0;let f=null;if(a in i&&i[a].type===c)f=i[a];else{const d=he.getScale(c);f=new d({id:a,type:c,ctx:this.ctx,chart:this}),i[f.id]=f}f.init(l,t)}),B(r,(o,l)=>{o||delete i[l]}),B(i,o=>{Zt.configure(this,o,o.options),Zt.addBox(this,o)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((r,s)=>r.index-s.index),i>n){for(let r=n;rn.length&&delete this._stacks,t.forEach((i,r)=>{n.filter(s=>s===i._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let i,r;for(this._removeUnreferencedMetasets(),i=0,r=n.length;i{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,c=this.data.datasets.length;u{u.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(vf("z","_idx"));const{_active:l,_lastEvent:a}=this;a?this._eventHandler(a,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){B(this.scales,t=>{Zt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Oc(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:r,count:s}of n){const o=i==="_removeElements"?-s:s;mx(t,r,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=s=>new Set(t.filter(o=>o[0]===s).map((o,l)=>l+","+o.splice(1).join(","))),r=i(0);for(let s=1;ss.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Zt.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],B(this.boxes,r=>{i&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,s)=>{r._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,i=t._clip,r=!i.disabled,s=vx(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(r&&au(n,{left:i.left===!1?0:s.left-i.left,right:i.right===!1?this.width:s.right+i.right,top:i.top===!1?0:s.top-i.top,bottom:i.bottom===!1?this.height:s.bottom+i.bottom}),t.controller.draw(),r&&uu(n),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return Gn(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,r){const s=pv.modes[n];return typeof s=="function"?s(this,t,i,r):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let r=i.filter(s=>s&&s._dataset===n).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},i.push(r)),r}getContext(){return this.$context||(this.$context=Dn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){const i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){const r=i?"show":"hide",s=this.getDatasetMeta(t),o=s.controller._resolveAnimations(void 0,r);pr(n)?(s.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(s,{visible:i}),this.update(l=>l.datasetIndex===t?r:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),ke.remove(this),t=0,n=this.data.datasets.length;t{n.addEventListener(this,s,o),t[s]=o},r=(s,o,l)=>{s.offsetX=o,s.offsetY=l,this._eventHandler(s)};B(this.options.events,s=>i(s,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,i=(a,u)=>{n.addEventListener(this,a,u),t[a]=u},r=(a,u)=>{t[a]&&(n.removeEventListener(this,a,u),delete t[a])},s=(a,u)=>{this.canvas&&this.resize(a,u)};let o;const l=()=>{r("attach",l),this.attached=!0,this.resize(),i("resize",s),i("detach",o)};o=()=>{this.attached=!1,r("resize",s),this._stop(),this._resize(0,0),i("attach",l)},n.isAttached(this.canvas)?l():o()}unbindEvents(){B(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},B(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const r=i?"set":"remove";let s,o,l,a;for(n==="dataset"&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+r+"DatasetHoverStyle"]()),l=0,a=t.length;l{const l=this.getDatasetMeta(s);if(!l)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:l.data[o],index:o}});!$s(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,i){const r=this.options.hover,s=(a,u)=>a.filter(c=>!u.some(f=>c.datasetIndex===f.datasetIndex&&c.index===f.index)),o=s(n,t),l=i?t:s(t,n);o.length&&this.updateHoverStyle(o,r.mode,!1),l.length&&r.mode&&this.updateHoverStyle(l,r.mode,!0)}_eventHandler(t,n){const i={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},r=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,r)===!1)return;const s=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,r),(s||i.changed)&&this.render(),this}_handleEvent(t,n,i){const{_active:r=[],options:s}=this,o=n,l=this._getActiveElements(t,r,i,o),a=$0(t),u=yx(t,this._lastEvent,i,a);i&&(this._lastEvent=null,U(s.onHover,[t,l,this],this),a&&U(s.onClick,[t,l,this],this));const c=!$s(l,r);return(c||n)&&(this._active=l,this._updateHoverStyles(l,r,n)),this._lastEvent=u,c}_getActiveElements(t,n,i,r){if(t.type==="mouseout")return[];if(!i)return n;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,r)}},R(Fe,"defaults",rt),R(Fe,"instances",vs),R(Fe,"overrides",Ln),R(Fe,"registry",he),R(Fe,"version",hx),R(Fe,"getChart",_f),Fe);function kf(){return B(vo.instances,e=>e._plugins.invalidate())}function Dp(e,t){const{x:n,y:i,base:r,width:s,height:o}=e.getProps(["x","y","base","width","height"],t);let l,a,u,c,f;return e.horizontal?(f=o/2,l=Math.min(n,r),a=Math.max(n,r),u=i-f,c=i+f):(f=s/2,l=n-f,a=n+f,u=Math.min(i,r),c=Math.max(i,r)),{left:l,top:u,right:a,bottom:c}}function Ue(e,t,n,i){return e?0:se(t,n,i)}function xx(e,t,n){const i=e.options.borderWidth,r=e.borderSkipped,s=pp(i);return{t:Ue(r.top,s.top,0,n),r:Ue(r.right,s.right,0,t),b:Ue(r.bottom,s.bottom,0,n),l:Ue(r.left,s.left,0,t)}}function _x(e,t,n){const{enableBorderRadius:i}=e.getProps(["enableBorderRadius"]),r=e.options.borderRadius,s=wn(r),o=Math.min(t,n),l=e.borderSkipped,a=i||N(r);return{topLeft:Ue(!a||l.top||l.left,s.topLeft,0,o),topRight:Ue(!a||l.top||l.right,s.topRight,0,o),bottomLeft:Ue(!a||l.bottom||l.left,s.bottomLeft,0,o),bottomRight:Ue(!a||l.bottom||l.right,s.bottomRight,0,o)}}function kx(e){const t=Dp(e),n=t.right-t.left,i=t.bottom-t.top,r=xx(e,n/2,i/2),s=_x(e,n/2,i/2);return{outer:{x:t.left,y:t.top,w:n,h:i,radius:s},inner:{x:t.left+r.l,y:t.top+r.t,w:n-r.l-r.r,h:i-r.t-r.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,s.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(r.b,r.r))}}}}function el(e,t,n,i){const r=t===null,s=n===null,l=e&&!(r&&s)&&Dp(e,i);return l&&(r||Qn(t,l.left,l.right))&&(s||Qn(n,l.top,l.bottom))}function wx(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function Sx(e,t){e.rect(t.x,t.y,t.w,t.h)}function nl(e,t,n={}){const i=e.x!==n.x?-t:0,r=e.y!==n.y?-t:0,s=(e.x+e.w!==n.x+n.w?t:0)-i,o=(e.y+e.h!==n.y+n.h?t:0)-r;return{x:e.x+i,y:e.y+r,w:e.w+s,h:e.h+o,radius:e.radius}}class xs extends on{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:n,options:{borderColor:i,backgroundColor:r}}=this,{inner:s,outer:o}=kx(this),l=wx(o.radius)?gr:Sx;t.save(),(o.w!==s.w||o.h!==s.h)&&(t.beginPath(),l(t,nl(o,n,s)),t.clip(),l(t,nl(s,-n,o)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),l(t,nl(s,n)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,n,i){return el(this,t,n,i)}inXRange(t,n){return el(this,t,null,n)}inYRange(t,n){return el(this,null,t,n)}getCenterPoint(t){const{x:n,y:i,base:r,horizontal:s}=this.getProps(["x","y","base","horizontal"],t);return{x:s?(n+r)/2:n,y:s?i:(i+r)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}R(xs,"id","bar"),R(xs,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),R(xs,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});const wf=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}},bx=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Sf extends on{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,i){this.maxWidth=t,this.maxHeight=n,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=U(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,r)=>t.sort(i,r,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,r=ct(i.font),s=r.size,o=this._computeTitleHeight(),{boxWidth:l,itemHeight:a}=wf(i,s);let u,c;n.font=r.string,this.isHorizontal()?(u=this.maxWidth,c=this._fitRows(o,s,l,a)+10):(c=this.maxHeight,u=this._fitCols(o,r,l,a)+10),this.width=Math.min(u,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,r){const{ctx:s,maxWidth:o,options:{labels:{padding:l}}}=this,a=this.legendHitBoxes=[],u=this.lineWidths=[0],c=r+l;let f=t;s.textAlign="left",s.textBaseline="middle";let d=-1,h=-c;return this.legendItems.forEach((m,v)=>{const x=i+n/2+s.measureText(m.text).width;(v===0||u[u.length-1]+x+2*l>o)&&(f+=c,u[u.length-(v>0?0:1)]=0,h+=c,d++),a[v]={left:0,top:h,row:d,width:x,height:r},u[u.length-1]+=x+l}),f}_fitCols(t,n,i,r){const{ctx:s,maxHeight:o,options:{labels:{padding:l}}}=this,a=this.legendHitBoxes=[],u=this.columnSizes=[],c=o-t;let f=l,d=0,h=0,m=0,v=0;return this.legendItems.forEach((x,g)=>{const{itemWidth:p,itemHeight:y}=Cx(i,n,s,x,r);g>0&&h+y+2*l>c&&(f+=d+l,u.push({width:d,height:h}),m+=d+l,v++,d=h=0),a[g]={left:m,top:h,col:v,width:p,height:y},d=Math.max(d,p),h+=y+l}),f+=d,u.push({width:d,height:h}),f}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:r},rtl:s}}=this,o=ii(s,this.left,this.width);if(this.isHorizontal()){let l=0,a=kt(i,this.left+r,this.right-this.lineWidths[l]);for(const u of n)l!==u.row&&(l=u.row,a=kt(i,this.left+r,this.right-this.lineWidths[l])),u.top+=this.top+t+r,u.left=o.leftForLtr(o.x(a),u.width),a+=u.width+r}else{let l=0,a=kt(i,this.top+t+r,this.bottom-this.columnSizes[l].height);for(const u of n)u.col!==l&&(l=u.col,a=kt(i,this.top+t+r,this.bottom-this.columnSizes[l].height)),u.top=a,u.left+=this.left+r,u.left=o.leftForLtr(o.x(u.left),u.width),a+=u.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;au(t,this),this._draw(),uu(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:r}=this,{align:s,labels:o}=t,l=rt.color,a=ii(t.rtl,this.left,this.width),u=ct(o.font),{padding:c}=o,f=u.size,d=f/2;let h;this.drawTitle(),r.textAlign=a.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=u.string;const{boxWidth:m,boxHeight:v,itemHeight:x}=wf(o,f),g=function(w,S,b){if(isNaN(m)||m<=0||isNaN(v)||v<0)return;r.save();const L=j(b.lineWidth,1);if(r.fillStyle=j(b.fillStyle,l),r.lineCap=j(b.lineCap,"butt"),r.lineDashOffset=j(b.lineDashOffset,0),r.lineJoin=j(b.lineJoin,"miter"),r.lineWidth=L,r.strokeStyle=j(b.strokeStyle,l),r.setLineDash(j(b.lineDash,[])),o.usePointStyle){const M={radius:v*Math.SQRT2/2,pointStyle:b.pointStyle,rotation:b.rotation,borderWidth:L},O=a.xPlus(w,m/2),F=S+d;dp(r,M,O,F,o.pointStyleWidth&&m)}else{const M=S+Math.max((f-v)/2,0),O=a.leftForLtr(w,m),F=wn(b.borderRadius);r.beginPath(),Object.values(F).some(nt=>nt!==0)?gr(r,{x:O,y:M,w:m,h:v,radius:F}):r.rect(O,M,m,v),r.fill(),L!==0&&r.stroke()}r.restore()},p=function(w,S,b){Tn(r,b.text,w,S+x/2,u,{strikethrough:b.hidden,textAlign:a.textAlign(b.textAlign)})},y=this.isHorizontal(),_=this._computeTitleHeight();y?h={x:kt(s,this.left+c,this.right-i[0]),y:this.top+c+_,line:0}:h={x:this.left+c,y:kt(s,this.top+_+c,this.bottom-n[0].height),line:0},xp(this.ctx,t.textDirection);const k=x+c;this.legendItems.forEach((w,S)=>{r.strokeStyle=w.fontColor,r.fillStyle=w.fontColor;const b=r.measureText(w.text).width,L=a.textAlign(w.textAlign||(w.textAlign=o.textAlign)),M=m+d+b;let O=h.x,F=h.y;a.setWidth(this.width),y?S>0&&O+M+c>this.right&&(F=h.y+=k,h.line++,O=h.x=kt(s,this.left+c,this.right-i[h.line])):S>0&&F+k>this.bottom&&(O=h.x=O+n[h.line].width+c,h.line++,F=h.y=kt(s,this.top+_+c,this.bottom-n[h.line].height));const nt=a.x(O);if(g(nt,F,w),O=ny(L,O+m+d,y?O+M:this.right,t.rtl),p(a.x(O),F,w),y)h.x+=M+c;else if(typeof w.text!="string"){const Ct=u.lineHeight;h.y+=Rp(w,Ct)+c}else h.y+=k}),_p(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=ct(n.font),r=bt(n.padding);if(!n.display)return;const s=ii(t.rtl,this.left,this.width),o=this.ctx,l=n.position,a=i.size/2,u=r.top+a;let c,f=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),c=this.top+u,f=kt(t.align,f,this.right-d);else{const m=this.columnSizes.reduce((v,x)=>Math.max(v,x.height),0);c=u+kt(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}const h=kt(l,f,f+d);o.textAlign=s.textAlign(ou(l)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=i.string,Tn(o,n.text,h,c,i)}_computeTitleHeight(){const t=this.options.title,n=ct(t.font),i=bt(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,r,s;if(Qn(t,this.left,this.right)&&Qn(n,this.top,this.bottom)){for(s=this.legendHitBoxes,i=0;is.length>o.length?s:o)),t+n.size/2+i.measureText(r).width}function Px(e,t,n){let i=e;return typeof t.text!="string"&&(i=Rp(t,n)),i}function Rp(e,t){const n=e.text?e.text.length:0;return t*n}function Ex(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var Lx={id:"legend",_element:Sf,start(e,t,n){const i=e.legend=new Sf({ctx:e.ctx,options:n,chart:e});Zt.configure(e,i,n),Zt.addBox(e,i)},stop(e){Zt.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const i=e.legend;Zt.configure(e,i,n),i.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const i=t.datasetIndex,r=n.chart;r.isDatasetVisible(i)?(r.hide(i),t.hidden=!0):(r.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:r,color:s,useBorderRadius:o,borderRadius:l}}=e.legend.options;return e._getSortedDatasetMetas().map(a=>{const u=a.controller.getStyle(n?0:void 0),c=bt(u.borderWidth);return{text:t[a.index].label,fillStyle:u.backgroundColor,fontColor:s,hidden:!a.visible,lineCap:u.borderCapStyle,lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:u.borderColor,pointStyle:i||u.pointStyle,rotation:u.rotation,textAlign:r||u.textAlign,borderRadius:o&&(l||u.borderRadius),datasetIndex:a.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class Fp extends on{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const r=Z(i.text)?i.text.length:1;this._padding=bt(i.padding);const s=r*ct(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:i,bottom:r,right:s,options:o}=this,l=o.align;let a=0,u,c,f;return this.isHorizontal()?(c=kt(l,i,s),f=n+t,u=s-i):(o.position==="left"?(c=i+t,f=kt(l,r,n),a=pt*-.5):(c=s-t,f=kt(l,n,r),a=pt*.5),u=r-n),{titleX:c,titleY:f,maxWidth:u,rotation:a}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const i=ct(n.font),s=i.lineHeight/2+this._padding.top,{titleX:o,titleY:l,maxWidth:a,rotation:u}=this._drawArgs(s);Tn(t,n.text,0,0,i,{color:n.color,maxWidth:a,rotation:u,textAlign:ou(n.align),textBaseline:"middle",translation:[o,l]})}}function Tx(e,t){const n=new Fp({ctx:e.ctx,options:t,chart:e});Zt.configure(e,n,t),Zt.addBox(e,n),e.titleBlock=n}var Ox={id:"title",_element:Fp,start(e,t,n){Tx(e,n)},stop(e){const t=e.titleBlock;Zt.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;Zt.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Fi={average(e){if(!e.length)return!1;let t,n,i=new Set,r=0,s=0;for(t=0,n=e.length;tl+a)/i.size,y:r/s}},nearest(e,t){if(!e.length)return!1;let n=t.x,i=t.y,r=Number.POSITIVE_INFINITY,s,o,l;for(s=0,o=e.length;s-1?e.split(` +`):e}function zx(e,t){const{element:n,datasetIndex:i,index:r}=t,s=e.getDatasetMeta(i).controller,{label:o,value:l}=s.getLabelAndValue(r);return{chart:e,label:o,parsed:s.getParsed(r),raw:e.data.datasets[i].data[r],formattedValue:l,dataset:s.getDataset(),dataIndex:r,datasetIndex:i,element:n}}function bf(e,t){const n=e.chart.ctx,{body:i,footer:r,title:s}=e,{boxWidth:o,boxHeight:l}=t,a=ct(t.bodyFont),u=ct(t.titleFont),c=ct(t.footerFont),f=s.length,d=r.length,h=i.length,m=bt(t.padding);let v=m.height,x=0,g=i.reduce((_,k)=>_+k.before.length+k.lines.length+k.after.length,0);if(g+=e.beforeBody.length+e.afterBody.length,f&&(v+=f*u.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),g){const _=t.displayColors?Math.max(l,a.lineHeight):a.lineHeight;v+=h*_+(g-h)*a.lineHeight+(g-1)*t.bodySpacing}d&&(v+=t.footerMarginTop+d*c.lineHeight+(d-1)*t.footerSpacing);let p=0;const y=function(_){x=Math.max(x,n.measureText(_).width+p)};return n.save(),n.font=u.string,B(e.title,y),n.font=a.string,B(e.beforeBody.concat(e.afterBody),y),p=t.displayColors?o+2+t.boxPadding:0,B(i,_=>{B(_.before,y),B(_.lines,y),B(_.after,y)}),p=0,n.font=c.string,B(e.footer,y),n.restore(),x+=m.width,{width:x,height:v}}function Dx(e,t){const{y:n,height:i}=t;return ne.height-i/2?"bottom":"center"}function Rx(e,t,n,i){const{x:r,width:s}=i,o=n.caretSize+n.caretPadding;if(e==="left"&&r+s+o>t.width||e==="right"&&r-s-o<0)return!0}function Fx(e,t,n,i){const{x:r,width:s}=n,{width:o,chartArea:{left:l,right:a}}=e;let u="center";return i==="center"?u=r<=(l+a)/2?"left":"right":r<=s/2?u="left":r>=o-s/2&&(u="right"),Rx(u,e,t,n)&&(u="center"),u}function Cf(e,t,n){const i=n.yAlign||t.yAlign||Dx(e,n);return{xAlign:n.xAlign||t.xAlign||Fx(e,t,n,i),yAlign:i}}function Ax(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function Ix(e,t,n){let{y:i,height:r}=e;return t==="top"?i+=n:t==="bottom"?i-=r+n:i-=r/2,i}function Mf(e,t,n,i){const{caretSize:r,caretPadding:s,cornerRadius:o}=e,{xAlign:l,yAlign:a}=n,u=r+s,{topLeft:c,topRight:f,bottomLeft:d,bottomRight:h}=wn(o);let m=Ax(t,l);const v=Ix(t,a,u);return a==="center"?l==="left"?m+=u:l==="right"&&(m-=u):l==="left"?m-=Math.max(c,d)+r:l==="right"&&(m+=Math.max(f,h)+r),{x:se(m,0,i.width-t.width),y:se(v,0,i.height-t.height)}}function ts(e,t,n){const i=bt(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function Pf(e){return fe([],we(e))}function Nx(e,t,n){return Dn(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function Ef(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const Ap={beforeTitle:_e,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex"u"?Ap[t].call(n,i):r}class ea extends on{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,i=this.options.setContext(this.getContext()),r=i.enabled&&n.options.animation&&i.animations,s=new kp(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=Nx(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,r=zt(i,"beforeTitle",this,t),s=zt(i,"title",this,t),o=zt(i,"afterTitle",this,t);let l=[];return l=fe(l,we(r)),l=fe(l,we(s)),l=fe(l,we(o)),l}getBeforeBody(t,n){return Pf(zt(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,r=[];return B(t,s=>{const o={before:[],lines:[],after:[]},l=Ef(i,s);fe(o.before,we(zt(l,"beforeLabel",this,s))),fe(o.lines,zt(l,"label",this,s)),fe(o.after,we(zt(l,"afterLabel",this,s))),r.push(o)}),r}getAfterBody(t,n){return Pf(zt(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,r=zt(i,"beforeFooter",this,t),s=zt(i,"footer",this,t),o=zt(i,"afterFooter",this,t);let l=[];return l=fe(l,we(r)),l=fe(l,we(s)),l=fe(l,we(o)),l}_createItems(t){const n=this._active,i=this.chart.data,r=[],s=[],o=[];let l=[],a,u;for(a=0,u=n.length;at.filter(c,f,d,i))),t.itemSort&&(l=l.sort((c,f)=>t.itemSort(c,f,i))),B(l,c=>{const f=Ef(t.callbacks,c);r.push(zt(f,"labelColor",this,c)),s.push(zt(f,"labelPointStyle",this,c)),o.push(zt(f,"labelTextColor",this,c))}),this.labelColors=r,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=l,l}update(t,n){const i=this.options.setContext(this.getContext()),r=this._active;let s,o=[];if(!r.length)this.opacity!==0&&(s={opacity:0});else{const l=Fi[i.position].call(this,r,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const a=this._size=bf(this,i),u=Object.assign({},l,a),c=Cf(this.chart,i,u),f=Mf(i,u,c,this.chart);this.xAlign=c.xAlign,this.yAlign=c.yAlign,s={opacity:1,x:f.x,y:f.y,width:a.width,height:a.height,caretX:l.x,caretY:l.y}}this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,r){const s=this.getCaretPosition(t,i,r);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(t,n,i){const{xAlign:r,yAlign:s}=this,{caretSize:o,cornerRadius:l}=i,{topLeft:a,topRight:u,bottomLeft:c,bottomRight:f}=wn(l),{x:d,y:h}=t,{width:m,height:v}=n;let x,g,p,y,_,k;return s==="center"?(_=h+v/2,r==="left"?(x=d,g=x-o,y=_+o,k=_-o):(x=d+m,g=x+o,y=_-o,k=_+o),p=x):(r==="left"?g=d+Math.max(a,c)+o:r==="right"?g=d+m-Math.max(u,f)-o:g=this.caretX,s==="top"?(y=h,_=y-o,x=g-o,p=g+o):(y=h+v,_=y+o,x=g+o,p=g-o),k=y),{x1:x,x2:g,x3:p,y1:y,y2:_,y3:k}}drawTitle(t,n,i){const r=this.title,s=r.length;let o,l,a;if(s){const u=ii(i.rtl,this.x,this.width);for(t.x=ts(this,i.titleAlign,i),n.textAlign=u.textAlign(i.titleAlign),n.textBaseline="middle",o=ct(i.titleFont),l=i.titleSpacing,n.fillStyle=i.titleColor,n.font=o.string,a=0;ap!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,gr(t,{x:v,y:m,w:u,h:a,radius:g}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),gr(t,{x,y:m+1,w:u-2,h:a-2,radius:g}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(v,m,u,a),t.strokeRect(v,m,u,a),t.fillStyle=o.backgroundColor,t.fillRect(x,m+1,u-2,a-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:r}=this,{bodySpacing:s,bodyAlign:o,displayColors:l,boxHeight:a,boxWidth:u,boxPadding:c}=i,f=ct(i.bodyFont);let d=f.lineHeight,h=0;const m=ii(i.rtl,this.x,this.width),v=function(b){n.fillText(b,m.x(t.x+h),t.y+d/2),t.y+=d+s},x=m.textAlign(o);let g,p,y,_,k,w,S;for(n.textAlign=o,n.textBaseline="middle",n.font=f.string,t.x=ts(this,x,i),n.fillStyle=i.bodyColor,B(this.beforeBody,v),h=l&&x!=="right"?o==="center"?u/2+c:u+2+c:0,_=0,w=r.length;_0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,r=i&&i.x,s=i&&i.y;if(r||s){const o=Fi[t.position].call(this,this._active,this._eventPosition);if(!o)return;const l=this._size=bf(this,t),a=Object.assign({},o,this._size),u=Cf(n,t,a),c=Mf(t,a,u,n);(r._to!==c.x||s._to!==c.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=l.width,this.height=l.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const r={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=bt(n.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&l&&(t.save(),t.globalAlpha=i,this.drawBackground(s,t,r,n),xp(t,n.textDirection),s.y+=o.top,this.drawTitle(s,t,n),this.drawBody(s,t,n),this.drawFooter(s,t,n),_p(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const i=this._active,r=t.map(({datasetIndex:l,index:a})=>{const u=this.chart.getDatasetMeta(l);if(!u)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:u.data[a],index:a}}),s=!$s(i,r),o=this._positionChanged(r,n);(s||o)&&(this._active=r,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,s=this._active||[],o=this._getActiveElements(t,s,n,i),l=this._positionChanged(o,t),a=n||!$s(o,s)||l;return a&&(this._active=o,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),a}_getActiveElements(t,n,i,r){const s=this.options;if(t.type==="mouseout")return[];if(!r)return n.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,s.mode,s,i);return s.reverse&&o.reverse(),o}_positionChanged(t,n){const{caretX:i,caretY:r,options:s}=this,o=Fi[s.position].call(this,t,n);return o!==!1&&(i!==o.x||r!==o.y)}}R(ea,"positioners",Fi);var jx={id:"tooltip",_element:ea,positioners:Fi,afterInit(e,t,n){n&&(e.tooltip=new ea({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Ap},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const Bx=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function Hx(e,t,n,i){const r=e.indexOf(t);if(r===-1)return Bx(e,t,n,i);const s=e.lastIndexOf(t);return r!==s?n:r}const Vx=(e,t)=>e===null?null:se(Math.round(e),0,t);function Lf(e){const t=this.getLabels();return e>=0&&en.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}R(na,"id","category"),R(na,"defaults",{ticks:{callback:Lf}});function Wx(e,t){const n=[],{bounds:r,step:s,min:o,max:l,precision:a,count:u,maxTicks:c,maxDigits:f,includeBounds:d}=e,h=s||1,m=c-1,{min:v,max:x}=t,g=!V(o),p=!V(l),y=!V(u),_=(x-v)/(f+1);let k=Dc((x-v)/m/h)*h,w,S,b,L;if(k<1e-14&&!g&&!p)return[{value:v},{value:x}];L=Math.ceil(x/k)-Math.floor(v/k),L>m&&(k=Dc(L*k/m/h)*h),V(a)||(w=Math.pow(10,a),k=Math.ceil(k*w)/w),r==="ticks"?(S=Math.floor(v/k)*k,b=Math.ceil(x/k)*k):(S=v,b=x),g&&p&&s&&K0((l-o)/s,k/1e3)?(L=Math.round(Math.min((l-o)/k,c)),k=(l-o)/L,S=o,b=l):y?(S=g?o:S,b=p?l:b,L=u-1,k=(b-S)/L):(L=(b-S)/k,gs(L,Math.round(L),k/1e3)?L=Math.round(L):L=Math.ceil(L));const M=Math.max(Rc(k),Rc(S));w=Math.pow(10,V(a)?M:a),S=Math.round(S*w)/w,b=Math.round(b*w)/w;let O=0;for(g&&(d&&S!==o?(n.push({value:o}),Sl)break;n.push({value:F})}return p&&d&&b!==l?n.length&&gs(n[n.length-1].value,l,Tf(l,_,e))?n[n.length-1].value=l:n.push({value:l}):(!p||b===l)&&n.push({value:b}),n}function Tf(e,t,{horizontal:n,minRotation:i}){const r=$e(i),s=(n?Math.sin(r):Math.cos(r))||.001,o=.75*t*(""+e).length;return Math.min(t/s,o)}class Zs extends Rn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return V(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:r,max:s}=this;const o=a=>r=n?r:a,l=a=>s=i?s:a;if(t){const a=en(r),u=en(s);a<0&&u<0?l(0):a>0&&u>0&&o(0)}if(r===s){let a=s===0?1:Math.abs(s*.05);l(s+a),t||o(r-a)}this.min=r,this.max=s}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:i}=t,r;return i?(r=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),n=n||11),n&&(r=Math.min(n,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const r={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},s=this._range||this,o=Wx(r,s);return t.bounds==="ticks"&&sp(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let n=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const r=(i-n)/Math.max(t.length-1,1)/2;n-=r,i+=r}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return lu(t,this.chart.options.locale,this.options.ticks.format)}}class ia extends Zs{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=dt(t)?t:0,this.max=dt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=$e(this.options.ticks.minRotation),r=(t?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,s.lineHeight/r))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}R(ia,"id","linear"),R(ia,"defaults",{ticks:{callback:mo.formatters.numeric}});const yr=e=>Math.floor(We(e)),hn=(e,t)=>Math.pow(10,yr(e)+t);function Of(e){return e/Math.pow(10,yr(e))===1}function zf(e,t,n){const i=Math.pow(10,n),r=Math.floor(e/i);return Math.ceil(t/i)-r}function $x(e,t){const n=t-e;let i=yr(n);for(;zf(e,t,i)>10;)i++;for(;zf(e,t,i)<10;)i--;return Math.min(i,yr(e))}function Ux(e,{min:t,max:n}){t=jt(e.min,t);const i=[],r=yr(t);let s=$x(t,n),o=s<0?Math.pow(10,Math.abs(s)):1;const l=Math.pow(10,s),a=r>s?Math.pow(10,r):0,u=Math.round((t-a)*o)/o,c=Math.floor((t-a)/l/10)*l*10;let f=Math.floor((u-c)/Math.pow(10,s)),d=jt(e.min,Math.round((a+c+f*Math.pow(10,s))*o)/o);for(;d=10?f=f<15?15:20:f++,f>=20&&(s++,f=2,o=s>=0?1:o),d=Math.round((a+c+f*Math.pow(10,s))*o)/o;const h=jt(e.max,d);return i.push({value:h,major:Of(h),significand:f}),i}class Df extends Rn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const i=Zs.prototype.parse.apply(this,[t,n]);if(i===0){this._zero=!0;return}return dt(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=dt(t)?Math.max(0,t):null,this.max=dt(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!dt(this._userMin)&&(this.min=t===hn(this.min,0)?hn(this.min,-1):hn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let i=this.min,r=this.max;const s=l=>i=t?i:l,o=l=>r=n?r:l;i===r&&(i<=0?(s(1),o(10)):(s(hn(i,-1)),o(hn(r,1)))),i<=0&&s(hn(r,-1)),r<=0&&o(hn(i,1)),this.min=i,this.max=r}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},i=Ux(n,this);return t.bounds==="ticks"&&sp(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":lu(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=We(t),this._valueRange=We(this.max)-We(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(We(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}R(Df,"id","logarithmic"),R(Df,"defaults",{ticks:{callback:mo.formatters.logarithmic,major:{enabled:!0}}});function ra(e){const t=e.ticks;if(t.display&&e.display){const n=bt(t.backdropPadding);return j(t.font&&t.font.size,rt.font.size)+n.height}return 0}function Yx(e,t,n){return n=Z(n)?n:[n],{w:dy(e,t.string,n),h:n.length*t.lineHeight}}function Rf(e,t,n,i,r){return e===i||e===r?{start:t-n/2,end:t+n/2}:er?{start:t-n,end:t}:{start:t,end:t+n}}function Kx(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),i=[],r=[],s=e._pointLabels.length,o=e.options.pointLabels,l=o.centerPointLabels?pt/s:0;for(let a=0;at.r&&(l=(i.end-t.r)/s,e.r=Math.max(e.r,t.r+l)),r.startt.b&&(a=(r.end-t.b)/o,e.b=Math.max(e.b,t.b+a))}function Qx(e,t,n){const i=e.drawingArea,{extra:r,additionalAngle:s,padding:o,size:l}=n,a=e.getPointPosition(t,i+r+o,s),u=Math.round(ru(pe(a.angle+Vt))),c=t1(a.y,l.h,u),f=qx(u),d=Jx(a.x,l.w,f);return{visible:!0,x:a.x,y:c,textAlign:f,left:d,top:c,right:d+l.w,bottom:c+l.h}}function Gx(e,t){if(!t)return!0;const{left:n,top:i,right:r,bottom:s}=e;return!(Gn({x:n,y:i},t)||Gn({x:n,y:s},t)||Gn({x:r,y:i},t)||Gn({x:r,y:s},t))}function Zx(e,t,n){const i=[],r=e._pointLabels.length,s=e.options,{centerPointLabels:o,display:l}=s.pointLabels,a={extra:ra(s)/2,additionalAngle:o?pt/r:0};let u;for(let c=0;c270||n<90)&&(e-=t),e}function e1(e,t,n){const{left:i,top:r,right:s,bottom:o}=n,{backdropColor:l}=t;if(!V(l)){const a=wn(t.borderRadius),u=bt(t.backdropPadding);e.fillStyle=l;const c=i-u.left,f=r-u.top,d=s-i+u.width,h=o-r+u.height;Object.values(a).some(m=>m!==0)?(e.beginPath(),gr(e,{x:c,y:f,w:d,h,radius:a}),e.fill()):e.fillRect(c,f,d,h)}}function n1(e,t){const{ctx:n,options:{pointLabels:i}}=e;for(let r=t-1;r>=0;r--){const s=e._pointLabelItems[r];if(!s.visible)continue;const o=i.setContext(e.getPointLabelContext(r));e1(n,o,s);const l=ct(o.font),{x:a,y:u,textAlign:c}=s;Tn(n,e._pointLabels[r],a,u+l.lineHeight/2,l,{color:o.color,textAlign:c,textBaseline:"middle"})}}function Ip(e,t,n,i){const{ctx:r}=e;if(n)r.arc(e.xCenter,e.yCenter,t,0,ve);else{let s=e.getPointPosition(0,t);r.moveTo(s.x,s.y);for(let o=1;o{const r=U(this.options.pointLabels.callback,[n,i],this);return r||r===0?r:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?Kx(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,r){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,r))}getIndexAngle(t){const n=ve/(this._pointLabels.length||1),i=this.options.startAngle||0;return pe(t*n+$e(i))}getDistanceFromCenterForValue(t){if(V(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(V(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t{if(f!==0||f===0&&this.min<0){a=this.getDistanceFromCenterForValue(c.value);const d=this.getContext(f),h=r.setContext(d),m=s.setContext(d);i1(this,h,a,o,m)}}),i.display){for(t.save(),l=o-1;l>=0;l--){const c=i.setContext(this.getPointLabelContext(l)),{color:f,lineWidth:d}=c;!d||!f||(t.lineWidth=d,t.strokeStyle=f,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,a=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),u=this.getPointPosition(l,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(u.x,u.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;const r=this.getIndexAngle(0);let s,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(r),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((l,a)=>{if(a===0&&this.min>=0&&!n.reverse)return;const u=i.setContext(this.getContext(a)),c=ct(u.font);if(s=this.getDistanceFromCenterForValue(this.ticks[a].value),u.showLabelBackdrop){t.font=c.string,o=t.measureText(l.label).width,t.fillStyle=u.backdropColor;const f=bt(u.backdropPadding);t.fillRect(-o/2-f.left,-s-c.size/2-f.top,o+f.width,c.size+f.height)}Tn(t,l.label,0,-s,c,{color:u.color,strokeColor:u.textStrokeColor,strokeWidth:u.textStrokeWidth})}),t.restore()}drawTitle(){}}R(es,"id","radialLinear"),R(es,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:mo.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),R(es,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),R(es,"descriptors",{angleLines:{_fallback:"grid"}});const xo={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}},Rt=Object.keys(xo);function Ff(e,t){return e-t}function Af(e,t){if(V(t))return null;const n=e._adapter,{parser:i,round:r,isoWeekday:s}=e._parseOpts;let o=t;return typeof i=="function"&&(o=i(o)),dt(o)||(o=typeof i=="string"?n.parse(o,i):n.parse(o)),o===null?null:(r&&(o=r==="week"&&(Ks(s)||s===!0)?n.startOf(o,"isoWeek",s):n.startOf(o,r)),+o)}function If(e,t,n,i){const r=Rt.length;for(let s=Rt.indexOf(e);s=Rt.indexOf(n);s--){const o=Rt[s];if(xo[o].common&&e._adapter.diff(r,i,o)>=t-1)return o}return Rt[n?Rt.indexOf(n):0]}function o1(e){for(let t=Rt.indexOf(e)+1,n=Rt.length;t=t?n[i]:n[r];e[s]=!0}}function l1(e,t,n,i){const r=e._adapter,s=+r.startOf(t[0].value,i),o=t[t.length-1].value;let l,a;for(l=s;l<=o;l=+r.add(l,1,i))a=n[l],a>=0&&(t[a].major=!0);return t}function jf(e,t,n){const i=[],r={},s=t.length;let o,l;for(o=0;o+t.value))}initOffsets(t=[]){let n=0,i=0,r,s;this.options.offset&&t.length&&(r=this.getDecimalForValue(t[0]),t.length===1?n=1-r:n=(this.getDecimalForValue(t[1])-r)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?i=s:i=(s-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=se(n,0,o),i=se(i,0,o),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,r=this.options,s=r.time,o=s.unit||If(s.minUnit,n,i,this._getLabelCapacity(n)),l=j(r.ticks.stepSize,1),a=o==="week"?s.isoWeekday:!1,u=Ks(a)||a===!0,c={};let f=n,d,h;if(u&&(f=+t.startOf(f,"isoWeek",a)),f=+t.startOf(f,u?"day":o),t.diff(i,n,o)>1e5*l)throw new Error(n+" and "+i+" are too far apart with stepSize of "+l+" "+o);const m=r.ticks.source==="data"&&this.getDataTimestamps();for(d=f,h=0;d+v)}getLabelForValue(t){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){const r=this.options.time.displayFormats,s=this._unit,o=n||r[s];return this._adapter.format(t,o)}_tickFormatFunction(t,n,i,r){const s=this.options,o=s.ticks.callback;if(o)return U(o,[t,n,i],this);const l=s.time.displayFormats,a=this._unit,u=this._majorUnit,c=a&&l[a],f=u&&l[u],d=i[n],h=u&&f&&d&&d.major;return this._adapter.format(t,r||(h?f:c))}generateTickLabels(t){let n,i,r;for(n=0,i=t.length;n0?l:1}getDataTimestamps(){let t=this._cache.data||[],n,i;if(t.length)return t;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(n=0,i=r.length;n=e[i].pos&&t<=e[r].pos&&({lo:i,hi:r}=Zl(e,"pos",t)),{pos:s,time:l}=e[i],{pos:o,time:a}=e[r]):(t>=e[i].time&&t<=e[r].time&&({lo:i,hi:r}=Zl(e,"time",t)),{time:s,pos:l}=e[i],{time:o,pos:a}=e[r]);const u=o-s;return u?l+(a-l)*(t-s)/u:l}class Bf extends qs{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=ns(n,this.min),this._tableRange=ns(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,r=[],s=[];let o,l,a,u,c;for(o=0,l=t.length;o=n&&u<=i&&r.push(u);if(r.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(o=0,l=r.length;or-s)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?t=this.normalize(n.concat(i)):t=n.length?n:i,t=this._cache.all=t,t}getDecimalForValue(t){return(ns(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return ns(this._table,i*this._tableRange+this._minPos,!0)}}R(Bf,"id","timeseries"),R(Bf,"defaults",qs.defaults);const Np="label";function Hf(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function a1(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function jp(e,t){e.labels=t}function Bp(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Np;const i=[];e.datasets=t.map(r=>{const s=e.datasets.find(o=>o[n]===r[n]);return!s||!r.data||i.includes(s)?{...r}:(i.push(s),Object.assign(s,r),s)})}function u1(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Np;const n={labels:[],datasets:[]};return jp(n,e.labels),Bp(n,e.datasets,t),n}function c1(e,t){const{height:n=150,width:i=300,redraw:r=!1,datasetIdKey:s,type:o,data:l,options:a,plugins:u=[],fallbackContent:c,updateMode:f,...d}=e,h=$.useRef(null),m=$.useRef(),v=()=>{h.current&&(m.current=new vo(h.current,{type:o,data:u1(l,s),options:a&&{...a},plugins:u}),Hf(t,m.current))},x=()=>{Hf(t,null),m.current&&(m.current.destroy(),m.current=null)};return $.useEffect(()=>{!r&&m.current&&a&&a1(m.current,a)},[r,a]),$.useEffect(()=>{!r&&m.current&&jp(m.current.config.data,l.labels)},[r,l.labels]),$.useEffect(()=>{!r&&m.current&&l.datasets&&Bp(m.current.config.data,l.datasets,s)},[r,l.datasets]),$.useEffect(()=>{m.current&&(r?(x(),setTimeout(v)):m.current.update(f))},[r,a,l.labels,l.datasets,f]),$.useEffect(()=>{m.current&&(x(),setTimeout(v))},[o]),$.useEffect(()=>(v(),()=>x()),[]),ua.createElement("canvas",Object.assign({ref:h,role:"img",height:n,width:i},d),c)}const f1=$.forwardRef(c1);function d1(e,t){return vo.register(t),$.forwardRef((n,i)=>ua.createElement(f1,Object.assign({},n,{ref:i,type:e})))}const h1=d1("bar",ms);vo.register(na,ia,xs,Ox,jx,Lx);function p1(){var k;const e=new URLSearchParams(window.location.search),t=e.get("tokenizer"),n=e.get("text"),[i]=$.useState([]),[r,s]=$.useState({"Xenova/gpt-4":{tokenIds:[],decodedTokens:[],margins:[]}}),[o,l]=$.useState("text"),[a,u]=$.useState(!1),[c,f]=$.useState(t??"Xenova/gpt-4"),d=$.useRef(null),h=$.useRef(null),m=$.useRef(null),v={responsive:!0,plugins:{legend:{position:"bottom"}}},x=Object.keys(r),g={labels:x,datasets:[{label:"Tokenizer Arena",data:x.map(w=>r[w].tokenIds.length),backgroundColor:"rgba(216, 180, 254, 0.7)"}]};$.useEffect(()=>{m.current||(m.current=new Worker(new URL("/assets/worker-81f59b56.js",self.location),{type:"module"}));function w(b,L,M,O,F,nt){nt(Ct=>({...Ct,[b]:{tokenIds:[...L],decodedTokens:[...M],margins:[...O]}}))}const S=b=>{w(b.data.model_id,b.data.token_ids,b.data.decoded,b.data.margins,r,s)};return m.current.addEventListener("message",S),()=>m.current.removeEventListener("message",S)},[r]);const p=$.useCallback(w=>{const S=w.target.value;S.length>1e4&&(l(null),console.log("User most likely pasted in a large body of text (> 10k chars), so we hide the output (until specifically requested by the user).")),Object.entries(r).forEach(([b])=>{m.current.postMessage({model_id:b,text:S})})},[r]);$.useEffect(()=>{n&&p({target:{value:n}})},[p,n]);const y=$.useCallback(w=>{const S=w.target.value;f(S),S!=="custom"&&s(b=>({...b,[S]:{tokenIds:[],decodedTokens:[],margins:[]}})),m.current.postMessage({model_id:S,text:d.current.value})},[]),_=w=>{s(S=>{const b={...S};return f(""),delete b[w],b})};return T.jsxs("div",{className:"w-full max-w-100vw flex flex-col gap-4 items-center",children:[T.jsxs("div",{children:[T.jsx("h1",{className:"text-5xl font-bold mb-2",children:"Tokenizer Arena"}),T.jsx("h2",{className:"text-lg font-normal",children:"Easily compare between different tokenizers simultaneously"}),T.jsxs("h3",{children:["Create by"," ",T.jsx("a",{className:"font-semibold text-white",href:"https://twitter.com/adithya_s_k",children:"Adithya S K"})," ","on top of"," ",T.jsx("a",{className:"font-semibold text-white",href:"https://github.com/xenova/transformers.js",children:"Transformer js"})]})]}),T.jsx("div",{children:T.jsxs("select",{value:c,onChange:y,className:"border-gray-700 bg-gray-100/10 text-slate-400 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2",children:[T.jsx("option",{value:"Xenova/gpt-4",children:"gpt-4 / gpt-3.5-turbo / text-embedding-ada-002"}),T.jsx("option",{value:"Xenova/text-davinci-003",children:"text-davinci-003 / text-davinci-002"}),T.jsx("option",{value:"Xenova/gpt-3",children:"gpt-3"}),T.jsx("option",{value:"Xenova/grok-1-tokenizer",children:"Grok-1"}),T.jsx("option",{value:"Xenova/claude-tokenizer",children:"Claude"}),T.jsx("option",{value:"Xenova/mistral-tokenizer",children:"Mistral"}),T.jsx("option",{value:"Xenova/gemma-tokenizer",children:"Gemma"}),T.jsx("option",{value:"Xenova/llama-tokenizer",children:"LLaMA / Llama 2"}),T.jsx("option",{value:"AdithyaSK/LLama3Tokenizer",children:"Llama 3"}),T.jsx("option",{value:"microsoft/Phi-3-mini-128k-instruct",children:"Phi 3"}),T.jsx("option",{value:"Xenova/c4ai-command-r-v01-tokenizer",children:"Cohere Command-R"}),T.jsx("option",{value:"Xenova/t5-small",children:"T5"}),T.jsx("option",{value:"Xenova/bert-base-cased",children:"bert-base-cased"})]})}),T.jsx("textarea",{ref:d,onChange:p,rows:"2",className:"font-mono text-md text-white block w-full p-2.5 bg-gray-100/10 rounded-lg border-gray-700 ",placeholder:"Enter some text",defaultValue:n??((k=d.current)==null?void 0:k.value)??""}),T.jsx("div",{className:"grid grid-cols-2 gap-4 w-full",children:Object.entries(r).map(([w,S])=>{var b;return T.jsxs("div",{className:"flex flex-col",children:[T.jsxs("p",{children:["Tokenizer Name: ",w]}),T.jsxs("div",{className:"flex justify-center gap-5",children:[T.jsxs("div",{className:"flex flex-col",children:["Tokens: ",S.tokenIds.length.toLocaleString()]}),T.jsxs("div",{className:"flex flex-col",children:["Characters :"," ",(((b=d.current)==null?void 0:b.value.length)??0).toLocaleString()]})]}),T.jsx("div",{ref:h,className:"font-mono text-black text-lg p-2.5 bg-gray-100/10 rounded-t-lg whitespace-pre-wrap text-left h-[150px] overflow-y-auto w-full",children:o==="text"?S.decodedTokens.map((L,M)=>T.jsx(g0,{text:L,position:M,margin:i[M]},M)):o==="token_ids"?T.jsxs("div",{className:"text-white",children:["[",S.tokenIds.join(", "),"]"]}):null}),T.jsx("button",{className:"bg-slate-800 rounded-b-lg",onClick:()=>_(w),children:"Remove"})]},w)})}),T.jsxs("div",{className:"flex items-center gap-2 self-end",children:[T.jsxs("div",{className:"flex items-center",children:[T.jsx("input",{checked:o==="text",onChange:()=>l("text"),id:"output-radio-1",type:"radio",value:"",name:"output-radio",className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 focus:ring-blue-500"}),T.jsx("label",{htmlFor:"output-radio-1",className:"ml-1 text-sm font-medium text-gray-900 dark:text-gray-300",children:"Text"})]}),T.jsxs("div",{className:"flex items-center",children:[T.jsx("input",{checked:o==="token_ids",onChange:()=>l("token_ids"),id:"output-radio-2",type:"radio",value:"",name:"output-radio",className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 focus:ring-blue-500"}),T.jsx("label",{htmlFor:"output-radio-2",className:"ml-1 text-sm font-medium text-gray-900 dark:text-gray-300",children:"Token IDs"})]}),T.jsxs("div",{className:"flex items-center",children:[T.jsx("input",{checked:o===null,onChange:()=>l(null),id:"output-radio-3",type:"radio",value:"",name:"output-radio",className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 focus:ring-blue-500"}),T.jsx("label",{htmlFor:"output-radio-3",className:"ml-1 text-sm font-medium text-gray-900 dark:text-gray-300",children:"Hide"})]}),T.jsxs("div",{children:[T.jsx("input",{id:"output-checkbox-4",type:"checkbox",checked:a,className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 focus:ring-blue-500",onChange:w=>u(w.target.checked)}),T.jsx("label",{htmlFor:"output-checkbox-4",className:"ml-1 text-sm font-medium text-gray-900 dark:text-gray-300",children:"Show Visualization"})]})]}),a&&T.jsxs("div",{className:"w-1/2",children:[" ",T.jsx(h1,{options:v,data:g})," "]})]})}il.createRoot(document.getElementById("root")).render(T.jsx(ua.StrictMode,{children:T.jsx(p1,{})}));