HumanBreak/assets/common-legacy.925ddab7.js
2023-02-21 12:24:31 +00:00

29 lines
276 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

!function(){function t(t,e,i){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}System.register(["./antdv-legacy.2ce7b1f4.js"],(function(e,i){"use strict";var n;return{setters:[t=>{n=t.c}],execute:function(){e({O:function(...t){const e=[0].concat(t);e.push(1);const i=e.length,n=Array(i).fill(0).map(((t,e)=>((t,e)=>Math.round(c(e)/(c(t)*c(e-t))))(e,i-1)));return t=>((...t)=>t.reduce(((t,e)=>t+e),0))(...n.map(((n,r)=>n*e[r]*(1-t)**(i-r-1)*t**r)))},S:async function(t){return new Promise((e=>setTimeout(e,t)))},a:function(t,e){if("sin"===t)return u(e,(t=>(Math.cosh(2*t)-1)/(f-1)));if("tan"===t){const t=t=>1*Math.tanh(3*t)/p;return u(e,(e=>1-t(1-e)),t)}if("sec"===t){const t=t=>1/Math.cosh(t);return u(e,(e=>1-2*(t(e*d)-.5)))}throw new TypeError("Unexpected parameters are delivered in hyper timing function.")},j:function(){return t=>t}});var i=Object.defineProperty,r=(t,e,n)=>(((t,e,n)=>{e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n})(t,"symbol"!=typeof e?e+"":e,n),n);let s=[];const o=t=>{for(const i of s)if("running"===i.status)try{for(const e of i.funcs)e(t-i.startTime)}catch(e){i.destroy(),console.error(e)}requestAnimationFrame(o)};requestAnimationFrame(o);class a{constructor(){r(this,"funcs",[]),r(this,"status","stop"),r(this,"startTime",0),this.status="running",s.push(this),requestAnimationFrame((t=>this.startTime=t))}add(t,e=!1){return e?this.funcs.unshift(t):this.funcs.push(t),this}remove(t){const e=this.funcs.findIndex((e=>e===t));if(-1===e)throw new ReferenceError("You are going to remove nonexistent ticker function.");return this.funcs.splice(e,1),this}clear(){this.funcs=[]}destroy(){this.clear(),this.stop()}stop(){this.status="stop",s=s.filter((t=>t!==this))}}class l{constructor(){r(this,"timing"),r(this,"relation","absolute"),r(this,"easeTime",0),r(this,"applying",{}),r(this,"ticker",new a),r(this,"value",{}),r(this,"listener",{}),this.timing=t=>t}async all(){if(Object.values(this.applying).every((t=>!0===t)))throw new ReferenceError("There is no animates to be waited.");await new Promise((t=>{const e=()=>{Object.values(this.applying).every((t=>!1===t))&&(this.unlisten("end",e),t("all animated."))};this.listen("end",e)}))}async n(t){const e=Object.values(this.applying).filter((t=>!0===t)).length;if(e<t)throw new ReferenceError(`You are trying to wait ${t} animate, but there are only ${e} animate animating.`);let i=0;await new Promise((e=>{const n=()=>{i++,i===t&&(this.unlisten("end",n),e(`${t} animated.`))};this.listen("end",n)}))}async w(t){if(!1===this.applying[t])throw new ReferenceError(`The ${t} animate is not animating.`);await new Promise((e=>{const i=()=>{!1===this.applying[t]&&(this.unlisten("end",i),e(`${t} animated.`))};this.listen("end",i)}))}listen(t,e){var i;null!=(i=this.listener)[t]||(i[t]=[]),this.listener[t].push(e)}unlisten(t,e){const i=this.listener[t].findIndex((t=>t===e));if(-1===i)throw new ReferenceError("You are trying to remove a nonexistent listener.");this.listener[t].splice(i,1)}hook(...t){const e=Object.entries(this.listener).filter((e=>t.includes(e[0])));for(const[i,n]of e)for(const t of n)t(this,i)}}function h(t){return null!=t}e("R",class extends l{constructor(){super(),r(this,"shakeTiming"),r(this,"path"),r(this,"multiTiming"),r(this,"value",{}),r(this,"size",1),r(this,"angle",0),r(this,"targetValue",{system:{move:[0,0],moveAs:[0,0],resize:0,rotate:0,shake:0,"@@bind":[]},custom:{}}),r(this,"animateFn",{system:{move:[()=>0,()=>0],moveAs:()=>0,resize:()=>0,rotate:()=>0,shake:()=>0,"@@bind":()=>0},custom:{}}),r(this,"ox",0),r(this,"oy",0),r(this,"sx",0),r(this,"sy",0),r(this,"bindInfo",[]),this.timing=t=>t,this.shakeTiming=t=>t,this.multiTiming=t=>[t,t],this.path=t=>[t,t],this.applying={move:!1,scale:!1,rotate:!1,shake:!1},this.ticker.add((()=>{const{running:t}=this.listener;if(h(t))for(const e of t)e(this,"running")}))}get x(){return this.ox+this.sx}get y(){return this.oy+this.sy}mode(t,e=!1){return"number"==typeof t(0)?e?this.shakeTiming=t:this.timing=t:this.multiTiming=t,this}time(t){return this.easeTime=t,this}relative(){return this.relation="relative",this}absolute(){return this.relation="absolute",this}bind(...t){return!0===this.applying["@@bind"]&&this.end(!1,"@@bind"),this.bindInfo=t,this}unbind(){return!0===this.applying["@@bind"]&&this.end(!1,"@@bind"),this.bindInfo=[],this}move(t,e){return this.applying.move&&this.end(!0,"move"),this.applySys("ox",t,"move"),this.applySys("oy",e,"move"),this}rotate(t){return this.applySys("angle",t,"rotate"),this}scale(t){return this.applySys("size",t,"resize"),this}shake(t,e){!0===this.applying.shake&&this.end(!0,"shake"),this.applying.shake=!0;const{easeTime:i,shakeTiming:n}=this,r=Date.now();this.hook("start","shakestart");const s=()=>{const o=Date.now()-r;o>i&&(this.ticker.remove(s),this.applying.shake=!1,this.sx=0,this.sy=0,this.hook("end","shakeend"));const a=n(o/i);this.sx=a*t,this.sy=a*e};return this.ticker.add(s),this.animateFn.system.shake=s,this}moveAs(t){this.applying.moveAs&&this.end(!0,"moveAs"),this.applying.moveAs=!0,this.path=t;const{easeTime:e,relation:i,timing:n}=this,r=Date.now(),[s,o]=[this.x,this.y],[a,l]=(()=>{if("absolute"===i)return t(1);{const[e,i]=t(1);return[s+e,o+i]}})();this.hook("start","movestart");const h=()=>{const a=Date.now()-r;if(a>e)return void this.end(!0,"moveAs");const l=a/e,[h,c]=t(n(l));"absolute"===i?(this.ox=h,this.oy=c):(this.ox=s+h,this.oy=o+c)};return this.ticker.add(h,!0),this.animateFn.system.moveAs=h,this.targetValue.system.moveAs=[a,l],this}register(t,e){if("number"==typeof this.value[t])return this.error(`Property ${t} has been regietered twice.`,"reregister");this.value[t]=e,this.applying[t]=!1}apply(t,e,i=!1){!0===this.applying[t]&&this.end(!1,t),t in this.value||this.error(`You are trying to execute nonexistent property ${t}.`),this.applying[t]=!0;const n=this.value[t],r=Date.now(),{timing:s,relation:o,easeTime:a}=this,l="absolute"===o?e-n:e;this.hook("start");const h=()=>{const e=Date.now()-r;if(e>a)return void this.end(!1,t);const i=s(e/a);this.value[t]=n+i*l};return this.ticker.add(h,i),this.animateFn.custom[t]=h,this.targetValue.custom[t]=l+n,this}applyMulti(t=!1){!0===this.applying["@@bind"]&&this.end(!1,"@@bind"),this.applying["@@bind"]=!0;const e=this.bindInfo,i=e.map((t=>this.value[t])),n=Date.now(),{multiTiming:r,relation:s,easeTime:o}=this,a=r(1);if(a.length!==i.length)throw new TypeError(`The number of binded animate attributes and timing function returns's length does not match. binded: ${e.length}, timing: ${a.length}`);this.hook("start");const l=()=>{const t=Date.now()-n;if(t>o)return void this.end(!1,"@@bind");const a=r(t/o);e.forEach(((t,e)=>{this.value[t]="absolute"===s?a[e]:i[e]+a[e]}))};return this.ticker.add(l,t),this.animateFn.custom["@@bind"]=l,this.targetValue.system["@@bind"]=a,this}applySys(t,e,i){"move"!==i&&!0===this.applying[i]&&this.end(!0,i),this.applying[i]=!0;const n=this[t],r=Date.now(),s=this.timing,o=this.relation,a=this.easeTime,l="absolute"===o?e-n:e;this.hook("start",`${i}start`);const h=()=>{const e=Date.now()-r;if(e>a)return void this.end(!0,i);const o=s(e/a);this[t]=n+l*o,"oy"!==t&&this.hook(i)};this.ticker.add(h,!0),"ox"===t?this.animateFn.system.move[0]=h:"oy"===t?this.animateFn.system.move[1]=h:this.animateFn.system[i]=h,"move"===i?("ox"===t&&(this.targetValue.system.move[0]=l+n),"oy"===t&&(this.targetValue.system.move[1]=l+n)):"shake"!==i&&(this.targetValue.system[i]=l+n)}error(t,e){throw"repeat"===e?new Error(`Cannot execute the same animation twice. Info: ${t}`):"reregister"===e?new Error(`Cannot register a animated property twice. Info: ${t}`):new Error(t)}end(t,e){if(!0===t)if(this.applying[e]=!1,"move"===e?(this.ticker.remove(this.animateFn.system.move[0]),this.ticker.remove(this.animateFn.system.move[1])):"moveAs"===e?this.ticker.remove(this.animateFn.system.moveAs):"@@bind"===e?this.ticker.remove(this.animateFn.system["@@bind"]):this.ticker.remove(this.animateFn.system[e]),"move"===e){const[t,e]=this.targetValue.system.move;this.ox=t,this.oy=e,this.hook("moveend","end")}else if("moveAs"===e){const[t,e]=this.targetValue.system.moveAs;this.ox=t,this.oy=e,this.hook("moveend","end")}else"rotate"===e?(this.angle=this.targetValue.system.rotate,this.hook("rotateend","end")):"resize"===e?(this.size=this.targetValue.system.resize,this.hook("resizeend","end")):"@@bind"===e?this.bindInfo.forEach(((t,e)=>{this.value[t]=this.targetValue.system["@@bind"][e]})):(this.sx=0,this.sy=0,this.hook("shakeend","end"));else this.applying[e]=!1,this.ticker.remove(this.animateFn.custom[e]),this.value[e]=this.targetValue.custom[e],this.hook("end")}});e("Y",class extends l{constructor(){super(),r(this,"now",{}),r(this,"target",{}),r(this,"transitionFn",{}),r(this,"value"),r(this,"handleSet",((t,e,i)=>(this.transition(e,i),!0))),r(this,"handleGet",((t,e)=>this.now[e])),this.timing=t=>t,this.value=new Proxy(this.target,{set:this.handleSet,get:this.handleGet})}mode(t){return this.timing=t,this}time(t){return this.easeTime=t,this}relative(){return this.relation="relative",this}absolute(){return this.relation="absolute",this}transition(t,e){if(e===this.target[t])return this;if(!h(this.now[t]))return this.now[t]=e,this;this.applying[t]&&this.end(t,!0),this.applying[t]=!0,this.hook("start");const i=Date.now(),n=this.easeTime,r=this.timing,s=this.now[t],o=e+("absolute"===this.relation?0:s),a=o-s;this.target[t]=o;const l=()=>{const e=Date.now()-i;e>=n&&this.end(t);const o=e/n;this.now[t]=r(o)*a+s,this.hook("running")};return this.transitionFn[t]=l,this.ticker.add(l),this}end(t,e=!1){if(!h(this.transitionFn[t]))throw new ReferenceError(`You are trying to end an ended transition: ${t}`);this.ticker.remove(this.transitionFn[t]),delete this.transitionFn[t],this.applying[t]=!1,this.hook("end"),e||(this.now[t]=this.target[t])}});const c=t=>{if(0===t)return 1;let e=t;for(;t>1;)e*=--t;return e},u=(t,e,i=(t=>1-e(1-t)))=>"in"===t?e:"out"===t?i:"in-out"===t?t=>t<.5?e(2*t)/2:.5+i(2*(t-.5))/2:t=>t<.5?i(2*t)/2:.5+e(2*(t-.5))/2,f=Math.cosh(2),d=Math.acosh(2),p=Math.tanh(3);var g=e("l",{exports:{}});
/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
/*!
* @kurkle/color v0.3.2
* https://github.com/kurkle/color#readme
* (c) 2023 Jukka Kurkela
* Released under the MIT License
*/
function m(t){return t+.5|0}!function(t,e){(function(){var i,r="Expected a function",s="__lodash_hash_undefined__",o="__lodash_placeholder__",a=16,l=32,h=64,c=128,u=256,f=1/0,d=9007199254740991,p=NaN,g=4294967295,m=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",a],["flip",512],["partial",l],["partialRight",h],["rearg",u]],b="[object Arguments]",_="[object Array]",x="[object Boolean]",v="[object Date]",y="[object Error]",w="[object Function]",k="[object GeneratorFunction]",M="[object Map]",S="[object Number]",P="[object Object]",A="[object Promise]",D="[object RegExp]",O="[object Set]",C="[object String]",T="[object Symbol]",E="[object WeakMap]",L="[object ArrayBuffer]",R="[object DataView]",I="[object Float32Array]",z="[object Float64Array]",F="[object Int8Array]",j="[object Int16Array]",V="[object Int32Array]",B="[object Uint8Array]",W="[object Uint8ClampedArray]",N="[object Uint16Array]",H="[object Uint32Array]",$=/\b__p \+= '';/g,U=/\b(__p \+=) '' \+/g,Y=/(__e\(.*?\)|\b__t\)) \+\n'';/g,q=/&(?:amp|lt|gt|quot|#39);/g,X=/[&<>"']/g,K=RegExp(q.source),Z=RegExp(X.source),G=/<%-([\s\S]+?)%>/g,J=/<%([\s\S]+?)%>/g,Q=/<%=([\s\S]+?)%>/g,tt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,et=/^\w*$/,it=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nt=/[\\^$.*+?()[\]{}|]/g,rt=RegExp(nt.source),st=/^\s+/,ot=/\s/,at=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,lt=/\{\n\/\* \[wrapped with (.+)\] \*/,ht=/,? & /,ct=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ut=/[()=,{}\[\]\/\s]/,ft=/\\(\\)?/g,dt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pt=/\w*$/,gt=/^[-+]0x[0-9a-f]+$/i,mt=/^0b[01]+$/i,bt=/^\[object .+?Constructor\]$/,_t=/^0o[0-7]+$/i,xt=/^(?:0|[1-9]\d*)$/,vt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,yt=/($^)/,wt=/['\n\r\u2028\u2029\\]/g,kt="\\ud800-\\udfff",Mt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",St="\\u2700-\\u27bf",Pt="a-z\\xdf-\\xf6\\xf8-\\xff",At="A-Z\\xc0-\\xd6\\xd8-\\xde",Dt="\\ufe0e\\ufe0f",Ot="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ct="[']",Tt="["+kt+"]",Et="["+Ot+"]",Lt="["+Mt+"]",Rt="\\d+",It="["+St+"]",zt="["+Pt+"]",Ft="[^"+kt+Ot+Rt+St+Pt+At+"]",jt="\\ud83c[\\udffb-\\udfff]",Vt="[^"+kt+"]",Bt="(?:\\ud83c[\\udde6-\\uddff]){2}",Wt="[\\ud800-\\udbff][\\udc00-\\udfff]",Nt="["+At+"]",Ht="\\u200d",$t="(?:"+zt+"|"+Ft+")",Ut="(?:"+Nt+"|"+Ft+")",Yt="(?:['](?:d|ll|m|re|s|t|ve))?",qt="(?:['](?:D|LL|M|RE|S|T|VE))?",Xt="(?:"+Lt+"|"+jt+")"+"?",Kt="["+Dt+"]?",Zt=Kt+Xt+("(?:"+Ht+"(?:"+[Vt,Bt,Wt].join("|")+")"+Kt+Xt+")*"),Gt="(?:"+[It,Bt,Wt].join("|")+")"+Zt,Jt="(?:"+[Vt+Lt+"?",Lt,Bt,Wt,Tt].join("|")+")",Qt=RegExp(Ct,"g"),te=RegExp(Lt,"g"),ee=RegExp(jt+"(?="+jt+")|"+Jt+Zt,"g"),ie=RegExp([Nt+"?"+zt+"+"+Yt+"(?="+[Et,Nt,"$"].join("|")+")",Ut+"+"+qt+"(?="+[Et,Nt+$t,"$"].join("|")+")",Nt+"?"+$t+"+"+Yt,Nt+"+"+qt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Rt,Gt].join("|"),"g"),ne=RegExp("["+Ht+kt+Mt+Dt+"]"),re=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,se=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],oe=-1,ae={};ae[I]=ae[z]=ae[F]=ae[j]=ae[V]=ae[B]=ae[W]=ae[N]=ae[H]=!0,ae[b]=ae[_]=ae[L]=ae[x]=ae[R]=ae[v]=ae[y]=ae[w]=ae[M]=ae[S]=ae[P]=ae[D]=ae[O]=ae[C]=ae[E]=!1;var le={};le[b]=le[_]=le[L]=le[R]=le[x]=le[v]=le[I]=le[z]=le[F]=le[j]=le[V]=le[M]=le[S]=le[P]=le[D]=le[O]=le[C]=le[T]=le[B]=le[W]=le[N]=le[H]=!0,le[y]=le[w]=le[E]=!1;var he={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ce=parseFloat,ue=parseInt,fe="object"==typeof n&&n&&n.Object===Object&&n,de="object"==typeof self&&self&&self.Object===Object&&self,pe=fe||de||Function("return this")(),ge=e&&!e.nodeType&&e,me=ge&&t&&!t.nodeType&&t,be=me&&me.exports===ge,_e=be&&fe.process,xe=function(){try{var t=me&&me.require&&me.require("util").types;return t||_e&&_e.binding&&_e.binding("util")}catch(e){}}(),ve=xe&&xe.isArrayBuffer,ye=xe&&xe.isDate,we=xe&&xe.isMap,ke=xe&&xe.isRegExp,Me=xe&&xe.isSet,Se=xe&&xe.isTypedArray;function Pe(t,e,i){switch(i.length){case 0:return t.call(e);case 1:return t.call(e,i[0]);case 2:return t.call(e,i[0],i[1]);case 3:return t.call(e,i[0],i[1],i[2])}return t.apply(e,i)}function Ae(t,e,i,n){for(var r=-1,s=null==t?0:t.length;++r<s;){var o=t[r];e(n,o,i(o),t)}return n}function De(t,e){for(var i=-1,n=null==t?0:t.length;++i<n&&!1!==e(t[i],i,t););return t}function Oe(t,e){for(var i=null==t?0:t.length;i--&&!1!==e(t[i],i,t););return t}function Ce(t,e){for(var i=-1,n=null==t?0:t.length;++i<n;)if(!e(t[i],i,t))return!1;return!0}function Te(t,e){for(var i=-1,n=null==t?0:t.length,r=0,s=[];++i<n;){var o=t[i];e(o,i,t)&&(s[r++]=o)}return s}function Ee(t,e){return!!(null==t?0:t.length)&&Ne(t,e,0)>-1}function Le(t,e,i){for(var n=-1,r=null==t?0:t.length;++n<r;)if(i(e,t[n]))return!0;return!1}function Re(t,e){for(var i=-1,n=null==t?0:t.length,r=Array(n);++i<n;)r[i]=e(t[i],i,t);return r}function Ie(t,e){for(var i=-1,n=e.length,r=t.length;++i<n;)t[r+i]=e[i];return t}function ze(t,e,i,n){var r=-1,s=null==t?0:t.length;for(n&&s&&(i=t[++r]);++r<s;)i=e(i,t[r],r,t);return i}function Fe(t,e,i,n){var r=null==t?0:t.length;for(n&&r&&(i=t[--r]);r--;)i=e(i,t[r],r,t);return i}function je(t,e){for(var i=-1,n=null==t?0:t.length;++i<n;)if(e(t[i],i,t))return!0;return!1}var Ve=Ye("length");function Be(t,e,i){var n;return i(t,(function(t,i,r){if(e(t,i,r))return n=i,!1})),n}function We(t,e,i,n){for(var r=t.length,s=i+(n?1:-1);n?s--:++s<r;)if(e(t[s],s,t))return s;return-1}function Ne(t,e,i){return e==e?function(t,e,i){var n=i-1,r=t.length;for(;++n<r;)if(t[n]===e)return n;return-1}(t,e,i):We(t,$e,i)}function He(t,e,i,n){for(var r=i-1,s=t.length;++r<s;)if(n(t[r],e))return r;return-1}function $e(t){return t!=t}function Ue(t,e){var i=null==t?0:t.length;return i?Ke(t,e)/i:p}function Ye(t){return function(e){return null==e?i:e[t]}}function qe(t){return function(e){return null==t?i:t[e]}}function Xe(t,e,i,n,r){return r(t,(function(t,r,s){i=n?(n=!1,t):e(i,t,r,s)})),i}function Ke(t,e){for(var n,r=-1,s=t.length;++r<s;){var o=e(t[r]);o!==i&&(n=n===i?o:n+o)}return n}function Ze(t,e){for(var i=-1,n=Array(t);++i<t;)n[i]=e(i);return n}function Ge(t){return t?t.slice(0,gi(t)+1).replace(st,""):t}function Je(t){return function(e){return t(e)}}function Qe(t,e){return Re(e,(function(e){return t[e]}))}function ti(t,e){return t.has(e)}function ei(t,e){for(var i=-1,n=t.length;++i<n&&Ne(e,t[i],0)>-1;);return i}function ii(t,e){for(var i=t.length;i--&&Ne(e,t[i],0)>-1;);return i}function ni(t,e){for(var i=t.length,n=0;i--;)t[i]===e&&++n;return n}var ri=qe({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),si=qe({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function oi(t){return"\\"+he[t]}function ai(t){return ne.test(t)}function li(t){var e=-1,i=Array(t.size);return t.forEach((function(t,n){i[++e]=[n,t]})),i}function hi(t,e){return function(i){return t(e(i))}}function ci(t,e){for(var i=-1,n=t.length,r=0,s=[];++i<n;){var a=t[i];a!==e&&a!==o||(t[i]=o,s[r++]=i)}return s}function ui(t){var e=-1,i=Array(t.size);return t.forEach((function(t){i[++e]=t})),i}function fi(t){var e=-1,i=Array(t.size);return t.forEach((function(t){i[++e]=[t,t]})),i}function di(t){return ai(t)?function(t){var e=ee.lastIndex=0;for(;ee.test(t);)++e;return e}(t):Ve(t)}function pi(t){return ai(t)?function(t){return t.match(ee)||[]}(t):function(t){return t.split("")}(t)}function gi(t){for(var e=t.length;e--&&ot.test(t.charAt(e)););return e}var mi=qe({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var bi=function t(e){var n=(e=null==e?pe:bi.defaults(pe.Object(),e,bi.pick(pe,se))).Array,ot=e.Date,kt=e.Error,Mt=e.Function,St=e.Math,Pt=e.Object,At=e.RegExp,Dt=e.String,Ot=e.TypeError,Ct=n.prototype,Tt=Mt.prototype,Et=Pt.prototype,Lt=e["__core-js_shared__"],Rt=Tt.toString,It=Et.hasOwnProperty,zt=0,Ft=function(){var t=/[^.]+$/.exec(Lt&&Lt.keys&&Lt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),jt=Et.toString,Vt=Rt.call(Pt),Bt=pe._,Wt=At("^"+Rt.call(It).replace(nt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Nt=be?e.Buffer:i,Ht=e.Symbol,$t=e.Uint8Array,Ut=Nt?Nt.allocUnsafe:i,Yt=hi(Pt.getPrototypeOf,Pt),qt=Pt.create,Xt=Et.propertyIsEnumerable,Kt=Ct.splice,Zt=Ht?Ht.isConcatSpreadable:i,Gt=Ht?Ht.iterator:i,Jt=Ht?Ht.toStringTag:i,ee=function(){try{var t=fs(Pt,"defineProperty");return t({},"",{}),t}catch(e){}}(),ne=e.clearTimeout!==pe.clearTimeout&&e.clearTimeout,he=ot&&ot.now!==pe.Date.now&&ot.now,fe=e.setTimeout!==pe.setTimeout&&e.setTimeout,de=St.ceil,ge=St.floor,me=Pt.getOwnPropertySymbols,_e=Nt?Nt.isBuffer:i,xe=e.isFinite,Ve=Ct.join,qe=hi(Pt.keys,Pt),_i=St.max,xi=St.min,vi=ot.now,yi=e.parseInt,wi=St.random,ki=Ct.reverse,Mi=fs(e,"DataView"),Si=fs(e,"Map"),Pi=fs(e,"Promise"),Ai=fs(e,"Set"),Di=fs(e,"WeakMap"),Oi=fs(Pt,"create"),Ci=Di&&new Di,Ti={},Ei=Vs(Mi),Li=Vs(Si),Ri=Vs(Pi),Ii=Vs(Ai),zi=Vs(Di),Fi=Ht?Ht.prototype:i,ji=Fi?Fi.valueOf:i,Vi=Fi?Fi.toString:i;function Bi(t){if(na(t)&&!Yo(t)&&!(t instanceof $i)){if(t instanceof Hi)return t;if(It.call(t,"__wrapped__"))return Bs(t)}return new Hi(t)}var Wi=function(){function t(){}return function(e){if(!ia(e))return{};if(qt)return qt(e);t.prototype=e;var n=new t;return t.prototype=i,n}}();function Ni(){}function Hi(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=i}function $i(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g,this.__views__=[]}function Ui(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function Yi(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function qi(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function Xi(t){var e=-1,i=null==t?0:t.length;for(this.__data__=new qi;++e<i;)this.add(t[e])}function Ki(t){var e=this.__data__=new Yi(t);this.size=e.size}function Zi(t,e){var i=Yo(t),n=!i&&Uo(t),r=!i&&!n&&Zo(t),s=!i&&!n&&!r&&ua(t),o=i||n||r||s,a=o?Ze(t.length,Dt):[],l=a.length;for(var h in t)!e&&!It.call(t,h)||o&&("length"==h||r&&("offset"==h||"parent"==h)||s&&("buffer"==h||"byteLength"==h||"byteOffset"==h)||xs(h,l))||a.push(h);return a}function Gi(t){var e=t.length;return e?t[Kn(0,e-1)]:i}function Ji(t,e){return zs(Cr(t),ln(e,0,t.length))}function Qi(t){return zs(Cr(t))}function tn(t,e,n){(n!==i&&!No(t[e],n)||n===i&&!(e in t))&&on(t,e,n)}function en(t,e,n){var r=t[e];It.call(t,e)&&No(r,n)&&(n!==i||e in t)||on(t,e,n)}function nn(t,e){for(var i=t.length;i--;)if(No(t[i][0],e))return i;return-1}function rn(t,e,i,n){return dn(t,(function(t,r,s){e(n,t,i(t),s)})),n}function sn(t,e){return t&&Tr(e,La(e),t)}function on(t,e,i){"__proto__"==e&&ee?ee(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[e]=i}function an(t,e){for(var r=-1,s=e.length,o=n(s),a=null==t;++r<s;)o[r]=a?i:Da(t,e[r]);return o}function ln(t,e,n){return t==t&&(n!==i&&(t=t<=n?t:n),e!==i&&(t=t>=e?t:e)),t}function hn(t,e,n,r,s,o){var a,l=1&e,h=2&e,c=4&e;if(n&&(a=s?n(t,r,s,o):n(t)),a!==i)return a;if(!ia(t))return t;var u=Yo(t);if(u){if(a=function(t){var e=t.length,i=new t.constructor(e);e&&"string"==typeof t[0]&&It.call(t,"index")&&(i.index=t.index,i.input=t.input);return i}(t),!l)return Cr(t,a)}else{var f=gs(t),d=f==w||f==k;if(Zo(t))return Mr(t,l);if(f==P||f==b||d&&!s){if(a=h||d?{}:bs(t),!l)return h?function(t,e){return Tr(t,ps(t),e)}(t,function(t,e){return t&&Tr(e,Ra(e),t)}(a,t)):function(t,e){return Tr(t,ds(t),e)}(t,sn(a,t))}else{if(!le[f])return s?t:{};a=function(t,e,i){var n=t.constructor;switch(e){case L:return Sr(t);case x:case v:return new n(+t);case R:return function(t,e){var i=e?Sr(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.byteLength)}(t,i);case I:case z:case F:case j:case V:case B:case W:case N:case H:return Pr(t,i);case M:return new n;case S:case C:return new n(t);case D:return function(t){var e=new t.constructor(t.source,pt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case O:return new n;case T:return r=t,ji?Pt(ji.call(r)):{}}var r}(t,f,l)}}o||(o=new Ki);var p=o.get(t);if(p)return p;o.set(t,a),la(t)?t.forEach((function(i){a.add(hn(i,e,n,i,t,o))})):ra(t)&&t.forEach((function(i,r){a.set(r,hn(i,e,n,r,t,o))}));var g=u?i:(c?h?ss:rs:h?Ra:La)(t);return De(g||t,(function(i,r){g&&(i=t[r=i]),en(a,r,hn(i,e,n,r,t,o))})),a}function cn(t,e,n){var r=n.length;if(null==t)return!r;for(t=Pt(t);r--;){var s=n[r],o=e[s],a=t[s];if(a===i&&!(s in t)||!o(a))return!1}return!0}function un(t,e,n){if("function"!=typeof t)throw new Ot(r);return Es((function(){t.apply(i,n)}),e)}function fn(t,e,i,n){var r=-1,s=Ee,o=!0,a=t.length,l=[],h=e.length;if(!a)return l;i&&(e=Re(e,Je(i))),n?(s=Le,o=!1):e.length>=200&&(s=ti,o=!1,e=new Xi(e));t:for(;++r<a;){var c=t[r],u=null==i?c:i(c);if(c=n||0!==c?c:0,o&&u==u){for(var f=h;f--;)if(e[f]===u)continue t;l.push(c)}else s(e,u,n)||l.push(c)}return l}Bi.templateSettings={escape:G,evaluate:J,interpolate:Q,variable:"",imports:{_:Bi}},Bi.prototype=Ni.prototype,Bi.prototype.constructor=Bi,Hi.prototype=Wi(Ni.prototype),Hi.prototype.constructor=Hi,$i.prototype=Wi(Ni.prototype),$i.prototype.constructor=$i,Ui.prototype.clear=function(){this.__data__=Oi?Oi(null):{},this.size=0},Ui.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Ui.prototype.get=function(t){var e=this.__data__;if(Oi){var n=e[t];return n===s?i:n}return It.call(e,t)?e[t]:i},Ui.prototype.has=function(t){var e=this.__data__;return Oi?e[t]!==i:It.call(e,t)},Ui.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Oi&&e===i?s:e,this},Yi.prototype.clear=function(){this.__data__=[],this.size=0},Yi.prototype.delete=function(t){var e=this.__data__,i=nn(e,t);return!(i<0)&&(i==e.length-1?e.pop():Kt.call(e,i,1),--this.size,!0)},Yi.prototype.get=function(t){var e=this.__data__,n=nn(e,t);return n<0?i:e[n][1]},Yi.prototype.has=function(t){return nn(this.__data__,t)>-1},Yi.prototype.set=function(t,e){var i=this.__data__,n=nn(i,t);return n<0?(++this.size,i.push([t,e])):i[n][1]=e,this},qi.prototype.clear=function(){this.size=0,this.__data__={hash:new Ui,map:new(Si||Yi),string:new Ui}},qi.prototype.delete=function(t){var e=cs(this,t).delete(t);return this.size-=e?1:0,e},qi.prototype.get=function(t){return cs(this,t).get(t)},qi.prototype.has=function(t){return cs(this,t).has(t)},qi.prototype.set=function(t,e){var i=cs(this,t),n=i.size;return i.set(t,e),this.size+=i.size==n?0:1,this},Xi.prototype.add=Xi.prototype.push=function(t){return this.__data__.set(t,s),this},Xi.prototype.has=function(t){return this.__data__.has(t)},Ki.prototype.clear=function(){this.__data__=new Yi,this.size=0},Ki.prototype.delete=function(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i},Ki.prototype.get=function(t){return this.__data__.get(t)},Ki.prototype.has=function(t){return this.__data__.has(t)},Ki.prototype.set=function(t,e){var i=this.__data__;if(i instanceof Yi){var n=i.__data__;if(!Si||n.length<199)return n.push([t,e]),this.size=++i.size,this;i=this.__data__=new qi(n)}return i.set(t,e),this.size=i.size,this};var dn=Rr(yn),pn=Rr(wn,!0);function gn(t,e){var i=!0;return dn(t,(function(t,n,r){return i=!!e(t,n,r)})),i}function mn(t,e,n){for(var r=-1,s=t.length;++r<s;){var o=t[r],a=e(o);if(null!=a&&(l===i?a==a&&!ca(a):n(a,l)))var l=a,h=o}return h}function bn(t,e){var i=[];return dn(t,(function(t,n,r){e(t,n,r)&&i.push(t)})),i}function _n(t,e,i,n,r){var s=-1,o=t.length;for(i||(i=_s),r||(r=[]);++s<o;){var a=t[s];e>0&&i(a)?e>1?_n(a,e-1,i,n,r):Ie(r,a):n||(r[r.length]=a)}return r}var xn=Ir(),vn=Ir(!0);function yn(t,e){return t&&xn(t,e,La)}function wn(t,e){return t&&vn(t,e,La)}function kn(t,e){return Te(e,(function(e){return Qo(t[e])}))}function Mn(t,e){for(var n=0,r=(e=vr(e,t)).length;null!=t&&n<r;)t=t[js(e[n++])];return n&&n==r?t:i}function Sn(t,e,i){var n=e(t);return Yo(t)?n:Ie(n,i(t))}function Pn(t){return null==t?t===i?"[object Undefined]":"[object Null]":Jt&&Jt in Pt(t)?function(t){var e=It.call(t,Jt),n=t[Jt];try{t[Jt]=i;var r=!0}catch(o){}var s=jt.call(t);r&&(e?t[Jt]=n:delete t[Jt]);return s}(t):function(t){return jt.call(t)}(t)}function An(t,e){return t>e}function Dn(t,e){return null!=t&&It.call(t,e)}function On(t,e){return null!=t&&e in Pt(t)}function Cn(t,e,r){for(var s=r?Le:Ee,o=t[0].length,a=t.length,l=a,h=n(a),c=1/0,u=[];l--;){var f=t[l];l&&e&&(f=Re(f,Je(e))),c=xi(f.length,c),h[l]=!r&&(e||o>=120&&f.length>=120)?new Xi(l&&f):i}f=t[0];var d=-1,p=h[0];t:for(;++d<o&&u.length<c;){var g=f[d],m=e?e(g):g;if(g=r||0!==g?g:0,!(p?ti(p,m):s(u,m,r))){for(l=a;--l;){var b=h[l];if(!(b?ti(b,m):s(t[l],m,r)))continue t}p&&p.push(m),u.push(g)}}return u}function Tn(t,e,n){var r=null==(t=Ds(t,e=vr(e,t)))?t:t[js(Gs(e))];return null==r?i:Pe(r,t,n)}function En(t){return na(t)&&Pn(t)==b}function Ln(t,e,n,r,s){return t===e||(null==t||null==e||!na(t)&&!na(e)?t!=t&&e!=e:function(t,e,n,r,s,o){var a=Yo(t),l=Yo(e),h=a?_:gs(t),c=l?_:gs(e),u=(h=h==b?P:h)==P,f=(c=c==b?P:c)==P,d=h==c;if(d&&Zo(t)){if(!Zo(e))return!1;a=!0,u=!1}if(d&&!u)return o||(o=new Ki),a||ua(t)?is(t,e,n,r,s,o):function(t,e,i,n,r,s,o){switch(i){case R:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case L:return!(t.byteLength!=e.byteLength||!s(new $t(t),new $t(e)));case x:case v:case S:return No(+t,+e);case y:return t.name==e.name&&t.message==e.message;case D:case C:return t==e+"";case M:var a=li;case O:var l=1&n;if(a||(a=ui),t.size!=e.size&&!l)return!1;var h=o.get(t);if(h)return h==e;n|=2,o.set(t,e);var c=is(a(t),a(e),n,r,s,o);return o.delete(t),c;case T:if(ji)return ji.call(t)==ji.call(e)}return!1}(t,e,h,n,r,s,o);if(!(1&n)){var p=u&&It.call(t,"__wrapped__"),g=f&&It.call(e,"__wrapped__");if(p||g){var m=p?t.value():t,w=g?e.value():e;return o||(o=new Ki),s(m,w,n,r,o)}}if(!d)return!1;return o||(o=new Ki),function(t,e,n,r,s,o){var a=1&n,l=rs(t),h=l.length,c=rs(e),u=c.length;if(h!=u&&!a)return!1;var f=h;for(;f--;){var d=l[f];if(!(a?d in e:It.call(e,d)))return!1}var p=o.get(t),g=o.get(e);if(p&&g)return p==e&&g==t;var m=!0;o.set(t,e),o.set(e,t);var b=a;for(;++f<h;){var _=t[d=l[f]],x=e[d];if(r)var v=a?r(x,_,d,e,t,o):r(_,x,d,t,e,o);if(!(v===i?_===x||s(_,x,n,r,o):v)){m=!1;break}b||(b="constructor"==d)}if(m&&!b){var y=t.constructor,w=e.constructor;y==w||!("constructor"in t)||!("constructor"in e)||"function"==typeof y&&y instanceof y&&"function"==typeof w&&w instanceof w||(m=!1)}return o.delete(t),o.delete(e),m}(t,e,n,r,s,o)}(t,e,n,r,Ln,s))}function Rn(t,e,n,r){var s=n.length,o=s,a=!r;if(null==t)return!o;for(t=Pt(t);s--;){var l=n[s];if(a&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++s<o;){var h=(l=n[s])[0],c=t[h],u=l[1];if(a&&l[2]){if(c===i&&!(h in t))return!1}else{var f=new Ki;if(r)var d=r(c,u,h,t,e,f);if(!(d===i?Ln(u,c,3,r,f):d))return!1}}return!0}function In(t){return!(!ia(t)||(e=t,Ft&&Ft in e))&&(Qo(t)?Wt:bt).test(Vs(t));var e}function zn(t){return"function"==typeof t?t:null==t?sl:"object"==typeof t?Yo(t)?Nn(t[0],t[1]):Wn(t):pl(t)}function Fn(t){if(!Ms(t))return qe(t);var e=[];for(var i in Pt(t))It.call(t,i)&&"constructor"!=i&&e.push(i);return e}function jn(t){if(!ia(t))return function(t){var e=[];if(null!=t)for(var i in Pt(t))e.push(i);return e}(t);var e=Ms(t),i=[];for(var n in t)("constructor"!=n||!e&&It.call(t,n))&&i.push(n);return i}function Vn(t,e){return t<e}function Bn(t,e){var i=-1,r=Xo(t)?n(t.length):[];return dn(t,(function(t,n,s){r[++i]=e(t,n,s)})),r}function Wn(t){var e=us(t);return 1==e.length&&e[0][2]?Ps(e[0][0],e[0][1]):function(i){return i===t||Rn(i,t,e)}}function Nn(t,e){return ys(t)&&Ss(e)?Ps(js(t),e):function(n){var r=Da(n,t);return r===i&&r===e?Oa(n,t):Ln(e,r,3)}}function Hn(t,e,n,r,s){t!==e&&xn(e,(function(o,a){if(s||(s=new Ki),ia(o))!function(t,e,n,r,s,o,a){var l=Cs(t,n),h=Cs(e,n),c=a.get(h);if(c)return void tn(t,n,c);var u=o?o(l,h,n+"",t,e,a):i,f=u===i;if(f){var d=Yo(h),p=!d&&Zo(h),g=!d&&!p&&ua(h);u=h,d||p||g?Yo(l)?u=l:Ko(l)?u=Cr(l):p?(f=!1,u=Mr(h,!0)):g?(f=!1,u=Pr(h,!0)):u=[]:oa(h)||Uo(h)?(u=l,Uo(l)?u=xa(l):ia(l)&&!Qo(l)||(u=bs(h))):f=!1}f&&(a.set(h,u),s(u,h,r,o,a),a.delete(h));tn(t,n,u)}(t,e,a,n,Hn,r,s);else{var l=r?r(Cs(t,a),o,a+"",t,e,s):i;l===i&&(l=o),tn(t,a,l)}}),Ra)}function $n(t,e){var n=t.length;if(n)return xs(e+=e<0?n:0,n)?t[e]:i}function Un(t,e,i){e=e.length?Re(e,(function(t){return Yo(t)?function(e){return Mn(e,1===t.length?t[0]:t)}:t})):[sl];var n=-1;e=Re(e,Je(hs()));var r=Bn(t,(function(t,i,r){var s=Re(e,(function(e){return e(t)}));return{criteria:s,index:++n,value:t}}));return function(t,e){var i=t.length;for(t.sort(e);i--;)t[i]=t[i].value;return t}(r,(function(t,e){return function(t,e,i){var n=-1,r=t.criteria,s=e.criteria,o=r.length,a=i.length;for(;++n<o;){var l=Ar(r[n],s[n]);if(l)return n>=a?l:l*("desc"==i[n]?-1:1)}return t.index-e.index}(t,e,i)}))}function Yn(t,e,i){for(var n=-1,r=e.length,s={};++n<r;){var o=e[n],a=Mn(t,o);i(a,o)&&tr(s,vr(o,t),a)}return s}function qn(t,e,i,n){var r=n?He:Ne,s=-1,o=e.length,a=t;for(t===e&&(e=Cr(e)),i&&(a=Re(t,Je(i)));++s<o;)for(var l=0,h=e[s],c=i?i(h):h;(l=r(a,c,l,n))>-1;)a!==t&&Kt.call(a,l,1),Kt.call(t,l,1);return t}function Xn(t,e){for(var i=t?e.length:0,n=i-1;i--;){var r=e[i];if(i==n||r!==s){var s=r;xs(r)?Kt.call(t,r,1):fr(t,r)}}return t}function Kn(t,e){return t+ge(wi()*(e-t+1))}function Zn(t,e){var i="";if(!t||e<1||e>d)return i;do{e%2&&(i+=t),(e=ge(e/2))&&(t+=t)}while(e);return i}function Gn(t,e){return Ls(As(t,e,sl),t+"")}function Jn(t){return Gi(Na(t))}function Qn(t,e){var i=Na(t);return zs(i,ln(e,0,i.length))}function tr(t,e,n,r){if(!ia(t))return t;for(var s=-1,o=(e=vr(e,t)).length,a=o-1,l=t;null!=l&&++s<o;){var h=js(e[s]),c=n;if("__proto__"===h||"constructor"===h||"prototype"===h)return t;if(s!=a){var u=l[h];(c=r?r(u,h,l):i)===i&&(c=ia(u)?u:xs(e[s+1])?[]:{})}en(l,h,c),l=l[h]}return t}var er=Ci?function(t,e){return Ci.set(t,e),t}:sl,ir=ee?function(t,e){return ee(t,"toString",{configurable:!0,enumerable:!1,value:il(e),writable:!0})}:sl;function nr(t){return zs(Na(t))}function rr(t,e,i){var r=-1,s=t.length;e<0&&(e=-e>s?0:s+e),(i=i>s?s:i)<0&&(i+=s),s=e>i?0:i-e>>>0,e>>>=0;for(var o=n(s);++r<s;)o[r]=t[r+e];return o}function sr(t,e){var i;return dn(t,(function(t,n,r){return!(i=e(t,n,r))})),!!i}function or(t,e,i){var n=0,r=null==t?n:t.length;if("number"==typeof e&&e==e&&r<=2147483647){for(;n<r;){var s=n+r>>>1,o=t[s];null!==o&&!ca(o)&&(i?o<=e:o<e)?n=s+1:r=s}return r}return ar(t,e,sl,i)}function ar(t,e,n,r){var s=0,o=null==t?0:t.length;if(0===o)return 0;for(var a=(e=n(e))!=e,l=null===e,h=ca(e),c=e===i;s<o;){var u=ge((s+o)/2),f=n(t[u]),d=f!==i,p=null===f,g=f==f,m=ca(f);if(a)var b=r||g;else b=c?g&&(r||d):l?g&&d&&(r||!p):h?g&&d&&!p&&(r||!m):!p&&!m&&(r?f<=e:f<e);b?s=u+1:o=u}return xi(o,4294967294)}function lr(t,e){for(var i=-1,n=t.length,r=0,s=[];++i<n;){var o=t[i],a=e?e(o):o;if(!i||!No(a,l)){var l=a;s[r++]=0===o?0:o}}return s}function hr(t){return"number"==typeof t?t:ca(t)?p:+t}function cr(t){if("string"==typeof t)return t;if(Yo(t))return Re(t,cr)+"";if(ca(t))return Vi?Vi.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ur(t,e,i){var n=-1,r=Ee,s=t.length,o=!0,a=[],l=a;if(i)o=!1,r=Le;else if(s>=200){var h=e?null:Zr(t);if(h)return ui(h);o=!1,r=ti,l=new Xi}else l=e?[]:a;t:for(;++n<s;){var c=t[n],u=e?e(c):c;if(c=i||0!==c?c:0,o&&u==u){for(var f=l.length;f--;)if(l[f]===u)continue t;e&&l.push(u),a.push(c)}else r(l,u,i)||(l!==a&&l.push(u),a.push(c))}return a}function fr(t,e){return null==(t=Ds(t,e=vr(e,t)))||delete t[js(Gs(e))]}function dr(t,e,i,n){return tr(t,e,i(Mn(t,e)),n)}function pr(t,e,i,n){for(var r=t.length,s=n?r:-1;(n?s--:++s<r)&&e(t[s],s,t););return i?rr(t,n?0:s,n?s+1:r):rr(t,n?s+1:0,n?r:s)}function gr(t,e){var i=t;return i instanceof $i&&(i=i.value()),ze(e,(function(t,e){return e.func.apply(e.thisArg,Ie([t],e.args))}),i)}function mr(t,e,i){var r=t.length;if(r<2)return r?ur(t[0]):[];for(var s=-1,o=n(r);++s<r;)for(var a=t[s],l=-1;++l<r;)l!=s&&(o[s]=fn(o[s]||a,t[l],e,i));return ur(_n(o,1),e,i)}function br(t,e,n){for(var r=-1,s=t.length,o=e.length,a={};++r<s;){var l=r<o?e[r]:i;n(a,t[r],l)}return a}function _r(t){return Ko(t)?t:[]}function xr(t){return"function"==typeof t?t:sl}function vr(t,e){return Yo(t)?t:ys(t,e)?[t]:Fs(va(t))}var yr=Gn;function wr(t,e,n){var r=t.length;return n=n===i?r:n,!e&&n>=r?t:rr(t,e,n)}var kr=ne||function(t){return pe.clearTimeout(t)};function Mr(t,e){if(e)return t.slice();var i=t.length,n=Ut?Ut(i):new t.constructor(i);return t.copy(n),n}function Sr(t){var e=new t.constructor(t.byteLength);return new $t(e).set(new $t(t)),e}function Pr(t,e){var i=e?Sr(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.length)}function Ar(t,e){if(t!==e){var n=t!==i,r=null===t,s=t==t,o=ca(t),a=e!==i,l=null===e,h=e==e,c=ca(e);if(!l&&!c&&!o&&t>e||o&&a&&h&&!l&&!c||r&&a&&h||!n&&h||!s)return 1;if(!r&&!o&&!c&&t<e||c&&n&&s&&!r&&!o||l&&n&&s||!a&&s||!h)return-1}return 0}function Dr(t,e,i,r){for(var s=-1,o=t.length,a=i.length,l=-1,h=e.length,c=_i(o-a,0),u=n(h+c),f=!r;++l<h;)u[l]=e[l];for(;++s<a;)(f||s<o)&&(u[i[s]]=t[s]);for(;c--;)u[l++]=t[s++];return u}function Or(t,e,i,r){for(var s=-1,o=t.length,a=-1,l=i.length,h=-1,c=e.length,u=_i(o-l,0),f=n(u+c),d=!r;++s<u;)f[s]=t[s];for(var p=s;++h<c;)f[p+h]=e[h];for(;++a<l;)(d||s<o)&&(f[p+i[a]]=t[s++]);return f}function Cr(t,e){var i=-1,r=t.length;for(e||(e=n(r));++i<r;)e[i]=t[i];return e}function Tr(t,e,n,r){var s=!n;n||(n={});for(var o=-1,a=e.length;++o<a;){var l=e[o],h=r?r(n[l],t[l],l,n,t):i;h===i&&(h=t[l]),s?on(n,l,h):en(n,l,h)}return n}function Er(t,e){return function(i,n){var r=Yo(i)?Ae:rn,s=e?e():{};return r(i,t,hs(n,2),s)}}function Lr(t){return Gn((function(e,n){var r=-1,s=n.length,o=s>1?n[s-1]:i,a=s>2?n[2]:i;for(o=t.length>3&&"function"==typeof o?(s--,o):i,a&&vs(n[0],n[1],a)&&(o=s<3?i:o,s=1),e=Pt(e);++r<s;){var l=n[r];l&&t(e,l,r,o)}return e}))}function Rr(t,e){return function(i,n){if(null==i)return i;if(!Xo(i))return t(i,n);for(var r=i.length,s=e?r:-1,o=Pt(i);(e?s--:++s<r)&&!1!==n(o[s],s,o););return i}}function Ir(t){return function(e,i,n){for(var r=-1,s=Pt(e),o=n(e),a=o.length;a--;){var l=o[t?a:++r];if(!1===i(s[l],l,s))break}return e}}function zr(t){return function(e){var n=ai(e=va(e))?pi(e):i,r=n?n[0]:e.charAt(0),s=n?wr(n,1).join(""):e.slice(1);return r[t]()+s}}function Fr(t){return function(e){return ze(Qa(Ua(e).replace(Qt,"")),t,"")}}function jr(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var i=Wi(t.prototype),n=t.apply(i,e);return ia(n)?n:i}}function Vr(t){return function(e,n,r){var s=Pt(e);if(!Xo(e)){var o=hs(n,3);e=La(e),n=function(t){return o(s[t],t,s)}}var a=t(e,n,r);return a>-1?s[o?e[a]:a]:i}}function Br(t){return ns((function(e){var n=e.length,s=n,o=Hi.prototype.thru;for(t&&e.reverse();s--;){var a=e[s];if("function"!=typeof a)throw new Ot(r);if(o&&!l&&"wrapper"==as(a))var l=new Hi([],!0)}for(s=l?s:n;++s<n;){var h=as(a=e[s]),c="wrapper"==h?os(a):i;l=c&&ws(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?l[as(c[0])].apply(l,c[3]):1==a.length&&ws(a)?l[h]():l.thru(a)}return function(){var t=arguments,i=t[0];if(l&&1==t.length&&Yo(i))return l.plant(i).value();for(var r=0,s=n?e[r].apply(this,t):i;++r<n;)s=e[r].call(this,s);return s}}))}function Wr(t,e,r,s,o,a,l,h,u,f){var d=e&c,p=1&e,g=2&e,m=24&e,b=512&e,_=g?i:jr(t);return function i(){for(var c=arguments.length,x=n(c),v=c;v--;)x[v]=arguments[v];if(m)var y=ls(i),w=ni(x,y);if(s&&(x=Dr(x,s,o,m)),a&&(x=Or(x,a,l,m)),c-=w,m&&c<f){var k=ci(x,y);return Xr(t,e,Wr,i.placeholder,r,x,k,h,u,f-c)}var M=p?r:this,S=g?M[t]:t;return c=x.length,h?x=Os(x,h):b&&c>1&&x.reverse(),d&&u<c&&(x.length=u),this&&this!==pe&&this instanceof i&&(S=_||jr(S)),S.apply(M,x)}}function Nr(t,e){return function(i,n){return function(t,e,i,n){return yn(t,(function(t,r,s){e(n,i(t),r,s)})),n}(i,t,e(n),{})}}function Hr(t,e){return function(n,r){var s;if(n===i&&r===i)return e;if(n!==i&&(s=n),r!==i){if(s===i)return r;"string"==typeof n||"string"==typeof r?(n=cr(n),r=cr(r)):(n=hr(n),r=hr(r)),s=t(n,r)}return s}}function $r(t){return ns((function(e){return e=Re(e,Je(hs())),Gn((function(i){var n=this;return t(e,(function(t){return Pe(t,n,i)}))}))}))}function Ur(t,e){var n=(e=e===i?" ":cr(e)).length;if(n<2)return n?Zn(e,t):e;var r=Zn(e,de(t/di(e)));return ai(e)?wr(pi(r),0,t).join(""):r.slice(0,t)}function Yr(t){return function(e,r,s){return s&&"number"!=typeof s&&vs(e,r,s)&&(r=s=i),e=ga(e),r===i?(r=e,e=0):r=ga(r),function(t,e,i,r){for(var s=-1,o=_i(de((e-t)/(i||1)),0),a=n(o);o--;)a[r?o:++s]=t,t+=i;return a}(e,r,s=s===i?e<r?1:-1:ga(s),t)}}function qr(t){return function(e,i){return"string"==typeof e&&"string"==typeof i||(e=_a(e),i=_a(i)),t(e,i)}}function Xr(t,e,n,r,s,o,a,c,u,f){var d=8&e;e|=d?l:h,4&(e&=~(d?h:l))||(e&=-4);var p=[t,e,s,d?o:i,d?a:i,d?i:o,d?i:a,c,u,f],g=n.apply(i,p);return ws(t)&&Ts(g,p),g.placeholder=r,Rs(g,t,e)}function Kr(t){var e=St[t];return function(t,i){if(t=_a(t),(i=null==i?0:xi(ma(i),292))&&xe(t)){var n=(va(t)+"e").split("e");return+((n=(va(e(n[0]+"e"+(+n[1]+i)))+"e").split("e"))[0]+"e"+(+n[1]-i))}return e(t)}}var Zr=Ai&&1/ui(new Ai([,-0]))[1]==f?function(t){return new Ai(t)}:cl;function Gr(t){return function(e){var i=gs(e);return i==M?li(e):i==O?fi(e):function(t,e){return Re(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Jr(t,e,s,f,d,p,g,m){var b=2&e;if(!b&&"function"!=typeof t)throw new Ot(r);var _=f?f.length:0;if(_||(e&=-97,f=d=i),g=g===i?g:_i(ma(g),0),m=m===i?m:ma(m),_-=d?d.length:0,e&h){var x=f,v=d;f=d=i}var y=b?i:os(t),w=[t,e,s,f,d,x,v,p,g,m];if(y&&function(t,e){var i=t[1],n=e[1],r=i|n,s=r<131,a=n==c&&8==i||n==c&&i==u&&t[7].length<=e[8]||384==n&&e[7].length<=e[8]&&8==i;if(!s&&!a)return t;1&n&&(t[2]=e[2],r|=1&i?0:4);var l=e[3];if(l){var h=t[3];t[3]=h?Dr(h,l,e[4]):l,t[4]=h?ci(t[3],o):e[4]}(l=e[5])&&(h=t[5],t[5]=h?Or(h,l,e[6]):l,t[6]=h?ci(t[5],o):e[6]);(l=e[7])&&(t[7]=l);n&c&&(t[8]=null==t[8]?e[8]:xi(t[8],e[8]));null==t[9]&&(t[9]=e[9]);t[0]=e[0],t[1]=r}(w,y),t=w[0],e=w[1],s=w[2],f=w[3],d=w[4],!(m=w[9]=w[9]===i?b?0:t.length:_i(w[9]-_,0))&&24&e&&(e&=-25),e&&1!=e)k=8==e||e==a?function(t,e,r){var s=jr(t);return function o(){for(var a=arguments.length,l=n(a),h=a,c=ls(o);h--;)l[h]=arguments[h];var u=a<3&&l[0]!==c&&l[a-1]!==c?[]:ci(l,c);return(a-=u.length)<r?Xr(t,e,Wr,o.placeholder,i,l,u,i,i,r-a):Pe(this&&this!==pe&&this instanceof o?s:t,this,l)}}(t,e,m):e!=l&&33!=e||d.length?Wr.apply(i,w):function(t,e,i,r){var s=1&e,o=jr(t);return function e(){for(var a=-1,l=arguments.length,h=-1,c=r.length,u=n(c+l),f=this&&this!==pe&&this instanceof e?o:t;++h<c;)u[h]=r[h];for(;l--;)u[h++]=arguments[++a];return Pe(f,s?i:this,u)}}(t,e,s,f);else var k=function(t,e,i){var n=1&e,r=jr(t);return function e(){return(this&&this!==pe&&this instanceof e?r:t).apply(n?i:this,arguments)}}(t,e,s);return Rs((y?er:Ts)(k,w),t,e)}function Qr(t,e,n,r){return t===i||No(t,Et[n])&&!It.call(r,n)?e:t}function ts(t,e,n,r,s,o){return ia(t)&&ia(e)&&(o.set(e,t),Hn(t,e,i,ts,o),o.delete(e)),t}function es(t){return oa(t)?i:t}function is(t,e,n,r,s,o){var a=1&n,l=t.length,h=e.length;if(l!=h&&!(a&&h>l))return!1;var c=o.get(t),u=o.get(e);if(c&&u)return c==e&&u==t;var f=-1,d=!0,p=2&n?new Xi:i;for(o.set(t,e),o.set(e,t);++f<l;){var g=t[f],m=e[f];if(r)var b=a?r(m,g,f,e,t,o):r(g,m,f,t,e,o);if(b!==i){if(b)continue;d=!1;break}if(p){if(!je(e,(function(t,e){if(!ti(p,e)&&(g===t||s(g,t,n,r,o)))return p.push(e)}))){d=!1;break}}else if(g!==m&&!s(g,m,n,r,o)){d=!1;break}}return o.delete(t),o.delete(e),d}function ns(t){return Ls(As(t,i,Ys),t+"")}function rs(t){return Sn(t,La,ds)}function ss(t){return Sn(t,Ra,ps)}var os=Ci?function(t){return Ci.get(t)}:cl;function as(t){for(var e=t.name+"",i=Ti[e],n=It.call(Ti,e)?i.length:0;n--;){var r=i[n],s=r.func;if(null==s||s==t)return r.name}return e}function ls(t){return(It.call(Bi,"placeholder")?Bi:t).placeholder}function hs(){var t=Bi.iteratee||ol;return t=t===ol?zn:t,arguments.length?t(arguments[0],arguments[1]):t}function cs(t,e){var i,n,r=t.__data__;return("string"==(n=typeof(i=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==i:null===i)?r["string"==typeof e?"string":"hash"]:r.map}function us(t){for(var e=La(t),i=e.length;i--;){var n=e[i],r=t[n];e[i]=[n,r,Ss(r)]}return e}function fs(t,e){var n=function(t,e){return null==t?i:t[e]}(t,e);return In(n)?n:i}var ds=me?function(t){return null==t?[]:(t=Pt(t),Te(me(t),(function(e){return Xt.call(t,e)})))}:bl,ps=me?function(t){for(var e=[];t;)Ie(e,ds(t)),t=Yt(t);return e}:bl,gs=Pn;function ms(t,e,i){for(var n=-1,r=(e=vr(e,t)).length,s=!1;++n<r;){var o=js(e[n]);if(!(s=null!=t&&i(t,o)))break;t=t[o]}return s||++n!=r?s:!!(r=null==t?0:t.length)&&ea(r)&&xs(o,r)&&(Yo(t)||Uo(t))}function bs(t){return"function"!=typeof t.constructor||Ms(t)?{}:Wi(Yt(t))}function _s(t){return Yo(t)||Uo(t)||!!(Zt&&t&&t[Zt])}function xs(t,e){var i=typeof t;return!!(e=null==e?d:e)&&("number"==i||"symbol"!=i&&xt.test(t))&&t>-1&&t%1==0&&t<e}function vs(t,e,i){if(!ia(i))return!1;var n=typeof e;return!!("number"==n?Xo(i)&&xs(e,i.length):"string"==n&&e in i)&&No(i[e],t)}function ys(t,e){if(Yo(t))return!1;var i=typeof t;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=t&&!ca(t))||(et.test(t)||!tt.test(t)||null!=e&&t in Pt(e))}function ws(t){var e=as(t),i=Bi[e];if("function"!=typeof i||!(e in $i.prototype))return!1;if(t===i)return!0;var n=os(i);return!!n&&t===n[0]}(Mi&&gs(new Mi(new ArrayBuffer(1)))!=R||Si&&gs(new Si)!=M||Pi&&gs(Pi.resolve())!=A||Ai&&gs(new Ai)!=O||Di&&gs(new Di)!=E)&&(gs=function(t){var e=Pn(t),n=e==P?t.constructor:i,r=n?Vs(n):"";if(r)switch(r){case Ei:return R;case Li:return M;case Ri:return A;case Ii:return O;case zi:return E}return e});var ks=Lt?Qo:_l;function Ms(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Et)}function Ss(t){return t==t&&!ia(t)}function Ps(t,e){return function(n){return null!=n&&(n[t]===e&&(e!==i||t in Pt(n)))}}function As(t,e,r){return e=_i(e===i?t.length-1:e,0),function(){for(var i=arguments,s=-1,o=_i(i.length-e,0),a=n(o);++s<o;)a[s]=i[e+s];s=-1;for(var l=n(e+1);++s<e;)l[s]=i[s];return l[e]=r(a),Pe(t,this,l)}}function Ds(t,e){return e.length<2?t:Mn(t,rr(e,0,-1))}function Os(t,e){for(var n=t.length,r=xi(e.length,n),s=Cr(t);r--;){var o=e[r];t[r]=xs(o,n)?s[o]:i}return t}function Cs(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Ts=Is(er),Es=fe||function(t,e){return pe.setTimeout(t,e)},Ls=Is(ir);function Rs(t,e,i){var n=e+"";return Ls(t,function(t,e){var i=e.length;if(!i)return t;var n=i-1;return e[n]=(i>1?"& ":"")+e[n],e=e.join(i>2?", ":" "),t.replace(at,"{\n/* [wrapped with "+e+"] */\n")}(n,function(t,e){return De(m,(function(i){var n="_."+i[0];e&i[1]&&!Ee(t,n)&&t.push(n)})),t.sort()}(function(t){var e=t.match(lt);return e?e[1].split(ht):[]}(n),i)))}function Is(t){var e=0,n=0;return function(){var r=vi(),s=16-(r-n);if(n=r,s>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(i,arguments)}}function zs(t,e){var n=-1,r=t.length,s=r-1;for(e=e===i?r:e;++n<e;){var o=Kn(n,s),a=t[o];t[o]=t[n],t[n]=a}return t.length=e,t}var Fs=function(t){var e=zo(t,(function(t){return 500===i.size&&i.clear(),t})),i=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(it,(function(t,i,n,r){e.push(n?r.replace(ft,"$1"):i||t)})),e}));function js(t){if("string"==typeof t||ca(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Vs(t){if(null!=t){try{return Rt.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function Bs(t){if(t instanceof $i)return t.clone();var e=new Hi(t.__wrapped__,t.__chain__);return e.__actions__=Cr(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Ws=Gn((function(t,e){return Ko(t)?fn(t,_n(e,1,Ko,!0)):[]})),Ns=Gn((function(t,e){var n=Gs(e);return Ko(n)&&(n=i),Ko(t)?fn(t,_n(e,1,Ko,!0),hs(n,2)):[]})),Hs=Gn((function(t,e){var n=Gs(e);return Ko(n)&&(n=i),Ko(t)?fn(t,_n(e,1,Ko,!0),i,n):[]}));function $s(t,e,i){var n=null==t?0:t.length;if(!n)return-1;var r=null==i?0:ma(i);return r<0&&(r=_i(n+r,0)),We(t,hs(e,3),r)}function Us(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var s=r-1;return n!==i&&(s=ma(n),s=n<0?_i(r+s,0):xi(s,r-1)),We(t,hs(e,3),s,!0)}function Ys(t){return(null==t?0:t.length)?_n(t,1):[]}function qs(t){return t&&t.length?t[0]:i}var Xs=Gn((function(t){var e=Re(t,_r);return e.length&&e[0]===t[0]?Cn(e):[]})),Ks=Gn((function(t){var e=Gs(t),n=Re(t,_r);return e===Gs(n)?e=i:n.pop(),n.length&&n[0]===t[0]?Cn(n,hs(e,2)):[]})),Zs=Gn((function(t){var e=Gs(t),n=Re(t,_r);return(e="function"==typeof e?e:i)&&n.pop(),n.length&&n[0]===t[0]?Cn(n,i,e):[]}));function Gs(t){var e=null==t?0:t.length;return e?t[e-1]:i}var Js=Gn(Qs);function Qs(t,e){return t&&t.length&&e&&e.length?qn(t,e):t}var to=ns((function(t,e){var i=null==t?0:t.length,n=an(t,e);return Xn(t,Re(e,(function(t){return xs(t,i)?+t:t})).sort(Ar)),n}));function eo(t){return null==t?t:ki.call(t)}var io=Gn((function(t){return ur(_n(t,1,Ko,!0))})),no=Gn((function(t){var e=Gs(t);return Ko(e)&&(e=i),ur(_n(t,1,Ko,!0),hs(e,2))})),ro=Gn((function(t){var e=Gs(t);return e="function"==typeof e?e:i,ur(_n(t,1,Ko,!0),i,e)}));function so(t){if(!t||!t.length)return[];var e=0;return t=Te(t,(function(t){if(Ko(t))return e=_i(t.length,e),!0})),Ze(e,(function(e){return Re(t,Ye(e))}))}function oo(t,e){if(!t||!t.length)return[];var n=so(t);return null==e?n:Re(n,(function(t){return Pe(e,i,t)}))}var ao=Gn((function(t,e){return Ko(t)?fn(t,e):[]})),lo=Gn((function(t){return mr(Te(t,Ko))})),ho=Gn((function(t){var e=Gs(t);return Ko(e)&&(e=i),mr(Te(t,Ko),hs(e,2))})),co=Gn((function(t){var e=Gs(t);return e="function"==typeof e?e:i,mr(Te(t,Ko),i,e)})),uo=Gn(so);var fo=Gn((function(t){var e=t.length,n=e>1?t[e-1]:i;return n="function"==typeof n?(t.pop(),n):i,oo(t,n)}));function po(t){var e=Bi(t);return e.__chain__=!0,e}function go(t,e){return e(t)}var mo=ns((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,s=function(e){return an(e,t)};return!(e>1||this.__actions__.length)&&r instanceof $i&&xs(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:go,args:[s],thisArg:i}),new Hi(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(i),t}))):this.thru(s)}));var bo=Er((function(t,e,i){It.call(t,i)?++t[i]:on(t,i,1)}));var _o=Vr($s),xo=Vr(Us);function vo(t,e){return(Yo(t)?De:dn)(t,hs(e,3))}function yo(t,e){return(Yo(t)?Oe:pn)(t,hs(e,3))}var wo=Er((function(t,e,i){It.call(t,i)?t[i].push(e):on(t,i,[e])}));var ko=Gn((function(t,e,i){var r=-1,s="function"==typeof e,o=Xo(t)?n(t.length):[];return dn(t,(function(t){o[++r]=s?Pe(e,t,i):Tn(t,e,i)})),o})),Mo=Er((function(t,e,i){on(t,i,e)}));function So(t,e){return(Yo(t)?Re:Bn)(t,hs(e,3))}var Po=Er((function(t,e,i){t[i?0:1].push(e)}),(function(){return[[],[]]}));var Ao=Gn((function(t,e){if(null==t)return[];var i=e.length;return i>1&&vs(t,e[0],e[1])?e=[]:i>2&&vs(e[0],e[1],e[2])&&(e=[e[0]]),Un(t,_n(e,1),[])})),Do=he||function(){return pe.Date.now()};function Oo(t,e,n){return e=n?i:e,e=t&&null==e?t.length:e,Jr(t,c,i,i,i,i,e)}function Co(t,e){var n;if("function"!=typeof e)throw new Ot(r);return t=ma(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=i),n}}var To=Gn((function(t,e,i){var n=1;if(i.length){var r=ci(i,ls(To));n|=l}return Jr(t,n,e,i,r)})),Eo=Gn((function(t,e,i){var n=3;if(i.length){var r=ci(i,ls(Eo));n|=l}return Jr(e,n,t,i,r)}));function Lo(t,e,n){var s,o,a,l,h,c,u=0,f=!1,d=!1,p=!0;if("function"!=typeof t)throw new Ot(r);function g(e){var n=s,r=o;return s=o=i,u=e,l=t.apply(r,n)}function m(t){return u=t,h=Es(_,e),f?g(t):l}function b(t){var n=t-c;return c===i||n>=e||n<0||d&&t-u>=a}function _(){var t=Do();if(b(t))return x(t);h=Es(_,function(t){var i=e-(t-c);return d?xi(i,a-(t-u)):i}(t))}function x(t){return h=i,p&&s?g(t):(s=o=i,l)}function v(){var t=Do(),n=b(t);if(s=arguments,o=this,c=t,n){if(h===i)return m(c);if(d)return kr(h),h=Es(_,e),g(c)}return h===i&&(h=Es(_,e)),l}return e=_a(e)||0,ia(n)&&(f=!!n.leading,a=(d="maxWait"in n)?_i(_a(n.maxWait)||0,e):a,p="trailing"in n?!!n.trailing:p),v.cancel=function(){h!==i&&kr(h),u=0,s=c=o=h=i},v.flush=function(){return h===i?l:x(Do())},v}var Ro=Gn((function(t,e){return un(t,1,e)})),Io=Gn((function(t,e,i){return un(t,_a(e)||0,i)}));function zo(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new Ot(r);var i=function(){var n=arguments,r=e?e.apply(this,n):n[0],s=i.cache;if(s.has(r))return s.get(r);var o=t.apply(this,n);return i.cache=s.set(r,o)||s,o};return i.cache=new(zo.Cache||qi),i}function Fo(t){if("function"!=typeof t)throw new Ot(r);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}zo.Cache=qi;var jo=yr((function(t,e){var i=(e=1==e.length&&Yo(e[0])?Re(e[0],Je(hs())):Re(_n(e,1),Je(hs()))).length;return Gn((function(n){for(var r=-1,s=xi(n.length,i);++r<s;)n[r]=e[r].call(this,n[r]);return Pe(t,this,n)}))})),Vo=Gn((function(t,e){var n=ci(e,ls(Vo));return Jr(t,l,i,e,n)})),Bo=Gn((function(t,e){var n=ci(e,ls(Bo));return Jr(t,h,i,e,n)})),Wo=ns((function(t,e){return Jr(t,u,i,i,i,e)}));function No(t,e){return t===e||t!=t&&e!=e}var Ho=qr(An),$o=qr((function(t,e){return t>=e})),Uo=En(function(){return arguments}())?En:function(t){return na(t)&&It.call(t,"callee")&&!Xt.call(t,"callee")},Yo=n.isArray,qo=ve?Je(ve):function(t){return na(t)&&Pn(t)==L};function Xo(t){return null!=t&&ea(t.length)&&!Qo(t)}function Ko(t){return na(t)&&Xo(t)}var Zo=_e||_l,Go=ye?Je(ye):function(t){return na(t)&&Pn(t)==v};function Jo(t){if(!na(t))return!1;var e=Pn(t);return e==y||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!oa(t)}function Qo(t){if(!ia(t))return!1;var e=Pn(t);return e==w||e==k||"[object AsyncFunction]"==e||"[object Proxy]"==e}function ta(t){return"number"==typeof t&&t==ma(t)}function ea(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=d}function ia(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function na(t){return null!=t&&"object"==typeof t}var ra=we?Je(we):function(t){return na(t)&&gs(t)==M};function sa(t){return"number"==typeof t||na(t)&&Pn(t)==S}function oa(t){if(!na(t)||Pn(t)!=P)return!1;var e=Yt(t);if(null===e)return!0;var i=It.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&Rt.call(i)==Vt}var aa=ke?Je(ke):function(t){return na(t)&&Pn(t)==D};var la=Me?Je(Me):function(t){return na(t)&&gs(t)==O};function ha(t){return"string"==typeof t||!Yo(t)&&na(t)&&Pn(t)==C}function ca(t){return"symbol"==typeof t||na(t)&&Pn(t)==T}var ua=Se?Je(Se):function(t){return na(t)&&ea(t.length)&&!!ae[Pn(t)]};var fa=qr(Vn),da=qr((function(t,e){return t<=e}));function pa(t){if(!t)return[];if(Xo(t))return ha(t)?pi(t):Cr(t);if(Gt&&t[Gt])return function(t){for(var e,i=[];!(e=t.next()).done;)i.push(e.value);return i}(t[Gt]());var e=gs(t);return(e==M?li:e==O?ui:Na)(t)}function ga(t){return t?(t=_a(t))===f||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ma(t){var e=ga(t),i=e%1;return e==e?i?e-i:e:0}function ba(t){return t?ln(ma(t),0,g):0}function _a(t){if("number"==typeof t)return t;if(ca(t))return p;if(ia(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ia(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ge(t);var i=mt.test(t);return i||_t.test(t)?ue(t.slice(2),i?2:8):gt.test(t)?p:+t}function xa(t){return Tr(t,Ra(t))}function va(t){return null==t?"":cr(t)}var ya=Lr((function(t,e){if(Ms(e)||Xo(e))Tr(e,La(e),t);else for(var i in e)It.call(e,i)&&en(t,i,e[i])})),wa=Lr((function(t,e){Tr(e,Ra(e),t)})),ka=Lr((function(t,e,i,n){Tr(e,Ra(e),t,n)})),Ma=Lr((function(t,e,i,n){Tr(e,La(e),t,n)})),Sa=ns(an);var Pa=Gn((function(t,e){t=Pt(t);var n=-1,r=e.length,s=r>2?e[2]:i;for(s&&vs(e[0],e[1],s)&&(r=1);++n<r;)for(var o=e[n],a=Ra(o),l=-1,h=a.length;++l<h;){var c=a[l],u=t[c];(u===i||No(u,Et[c])&&!It.call(t,c))&&(t[c]=o[c])}return t})),Aa=Gn((function(t){return t.push(i,ts),Pe(za,i,t)}));function Da(t,e,n){var r=null==t?i:Mn(t,e);return r===i?n:r}function Oa(t,e){return null!=t&&ms(t,e,On)}var Ca=Nr((function(t,e,i){null!=e&&"function"!=typeof e.toString&&(e=jt.call(e)),t[e]=i}),il(sl)),Ta=Nr((function(t,e,i){null!=e&&"function"!=typeof e.toString&&(e=jt.call(e)),It.call(t,e)?t[e].push(i):t[e]=[i]}),hs),Ea=Gn(Tn);function La(t){return Xo(t)?Zi(t):Fn(t)}function Ra(t){return Xo(t)?Zi(t,!0):jn(t)}var Ia=Lr((function(t,e,i){Hn(t,e,i)})),za=Lr((function(t,e,i,n){Hn(t,e,i,n)})),Fa=ns((function(t,e){var i={};if(null==t)return i;var n=!1;e=Re(e,(function(e){return e=vr(e,t),n||(n=e.length>1),e})),Tr(t,ss(t),i),n&&(i=hn(i,7,es));for(var r=e.length;r--;)fr(i,e[r]);return i}));var ja=ns((function(t,e){return null==t?{}:function(t,e){return Yn(t,e,(function(e,i){return Oa(t,i)}))}(t,e)}));function Va(t,e){if(null==t)return{};var i=Re(ss(t),(function(t){return[t]}));return e=hs(e),Yn(t,i,(function(t,i){return e(t,i[0])}))}var Ba=Gr(La),Wa=Gr(Ra);function Na(t){return null==t?[]:Qe(t,La(t))}var Ha=Fr((function(t,e,i){return e=e.toLowerCase(),t+(i?$a(e):e)}));function $a(t){return Ja(va(t).toLowerCase())}function Ua(t){return(t=va(t))&&t.replace(vt,ri).replace(te,"")}var Ya=Fr((function(t,e,i){return t+(i?"-":"")+e.toLowerCase()})),qa=Fr((function(t,e,i){return t+(i?" ":"")+e.toLowerCase()})),Xa=zr("toLowerCase");var Ka=Fr((function(t,e,i){return t+(i?"_":"")+e.toLowerCase()}));var Za=Fr((function(t,e,i){return t+(i?" ":"")+Ja(e)}));var Ga=Fr((function(t,e,i){return t+(i?" ":"")+e.toUpperCase()})),Ja=zr("toUpperCase");function Qa(t,e,n){return t=va(t),(e=n?i:e)===i?function(t){return re.test(t)}(t)?function(t){return t.match(ie)||[]}(t):function(t){return t.match(ct)||[]}(t):t.match(e)||[]}var tl=Gn((function(t,e){try{return Pe(t,i,e)}catch(n){return Jo(n)?n:new kt(n)}})),el=ns((function(t,e){return De(e,(function(e){e=js(e),on(t,e,To(t[e],t))})),t}));function il(t){return function(){return t}}var nl=Br(),rl=Br(!0);function sl(t){return t}function ol(t){return zn("function"==typeof t?t:hn(t,1))}var al=Gn((function(t,e){return function(i){return Tn(i,t,e)}})),ll=Gn((function(t,e){return function(i){return Tn(t,i,e)}}));function hl(t,e,i){var n=La(e),r=kn(e,n);null!=i||ia(e)&&(r.length||!n.length)||(i=e,e=t,t=this,r=kn(e,La(e)));var s=!(ia(i)&&"chain"in i&&!i.chain),o=Qo(t);return De(r,(function(i){var n=e[i];t[i]=n,o&&(t.prototype[i]=function(){var e=this.__chain__;if(s||e){var i=t(this.__wrapped__),r=i.__actions__=Cr(this.__actions__);return r.push({func:n,args:arguments,thisArg:t}),i.__chain__=e,i}return n.apply(t,Ie([this.value()],arguments))})})),t}function cl(){}var ul=$r(Re),fl=$r(Ce),dl=$r(je);function pl(t){return ys(t)?Ye(js(t)):function(t){return function(e){return Mn(e,t)}}(t)}var gl=Yr(),ml=Yr(!0);function bl(){return[]}function _l(){return!1}var xl=Hr((function(t,e){return t+e}),0),vl=Kr("ceil"),yl=Hr((function(t,e){return t/e}),1),wl=Kr("floor");var kl,Ml=Hr((function(t,e){return t*e}),1),Sl=Kr("round"),Pl=Hr((function(t,e){return t-e}),0);return Bi.after=function(t,e){if("function"!=typeof e)throw new Ot(r);return t=ma(t),function(){if(--t<1)return e.apply(this,arguments)}},Bi.ary=Oo,Bi.assign=ya,Bi.assignIn=wa,Bi.assignInWith=ka,Bi.assignWith=Ma,Bi.at=Sa,Bi.before=Co,Bi.bind=To,Bi.bindAll=el,Bi.bindKey=Eo,Bi.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Yo(t)?t:[t]},Bi.chain=po,Bi.chunk=function(t,e,r){e=(r?vs(t,e,r):e===i)?1:_i(ma(e),0);var s=null==t?0:t.length;if(!s||e<1)return[];for(var o=0,a=0,l=n(de(s/e));o<s;)l[a++]=rr(t,o,o+=e);return l},Bi.compact=function(t){for(var e=-1,i=null==t?0:t.length,n=0,r=[];++e<i;){var s=t[e];s&&(r[n++]=s)}return r},Bi.concat=function(){var t=arguments.length;if(!t)return[];for(var e=n(t-1),i=arguments[0],r=t;r--;)e[r-1]=arguments[r];return Ie(Yo(i)?Cr(i):[i],_n(e,1))},Bi.cond=function(t){var e=null==t?0:t.length,i=hs();return t=e?Re(t,(function(t){if("function"!=typeof t[1])throw new Ot(r);return[i(t[0]),t[1]]})):[],Gn((function(i){for(var n=-1;++n<e;){var r=t[n];if(Pe(r[0],this,i))return Pe(r[1],this,i)}}))},Bi.conforms=function(t){return function(t){var e=La(t);return function(i){return cn(i,t,e)}}(hn(t,1))},Bi.constant=il,Bi.countBy=bo,Bi.create=function(t,e){var i=Wi(t);return null==e?i:sn(i,e)},Bi.curry=function t(e,n,r){var s=Jr(e,8,i,i,i,i,i,n=r?i:n);return s.placeholder=t.placeholder,s},Bi.curryRight=function t(e,n,r){var s=Jr(e,a,i,i,i,i,i,n=r?i:n);return s.placeholder=t.placeholder,s},Bi.debounce=Lo,Bi.defaults=Pa,Bi.defaultsDeep=Aa,Bi.defer=Ro,Bi.delay=Io,Bi.difference=Ws,Bi.differenceBy=Ns,Bi.differenceWith=Hs,Bi.drop=function(t,e,n){var r=null==t?0:t.length;return r?rr(t,(e=n||e===i?1:ma(e))<0?0:e,r):[]},Bi.dropRight=function(t,e,n){var r=null==t?0:t.length;return r?rr(t,0,(e=r-(e=n||e===i?1:ma(e)))<0?0:e):[]},Bi.dropRightWhile=function(t,e){return t&&t.length?pr(t,hs(e,3),!0,!0):[]},Bi.dropWhile=function(t,e){return t&&t.length?pr(t,hs(e,3),!0):[]},Bi.fill=function(t,e,n,r){var s=null==t?0:t.length;return s?(n&&"number"!=typeof n&&vs(t,e,n)&&(n=0,r=s),function(t,e,n,r){var s=t.length;for((n=ma(n))<0&&(n=-n>s?0:s+n),(r=r===i||r>s?s:ma(r))<0&&(r+=s),r=n>r?0:ba(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},Bi.filter=function(t,e){return(Yo(t)?Te:bn)(t,hs(e,3))},Bi.flatMap=function(t,e){return _n(So(t,e),1)},Bi.flatMapDeep=function(t,e){return _n(So(t,e),f)},Bi.flatMapDepth=function(t,e,n){return n=n===i?1:ma(n),_n(So(t,e),n)},Bi.flatten=Ys,Bi.flattenDeep=function(t){return(null==t?0:t.length)?_n(t,f):[]},Bi.flattenDepth=function(t,e){return(null==t?0:t.length)?_n(t,e=e===i?1:ma(e)):[]},Bi.flip=function(t){return Jr(t,512)},Bi.flow=nl,Bi.flowRight=rl,Bi.fromPairs=function(t){for(var e=-1,i=null==t?0:t.length,n={};++e<i;){var r=t[e];n[r[0]]=r[1]}return n},Bi.functions=function(t){return null==t?[]:kn(t,La(t))},Bi.functionsIn=function(t){return null==t?[]:kn(t,Ra(t))},Bi.groupBy=wo,Bi.initial=function(t){return(null==t?0:t.length)?rr(t,0,-1):[]},Bi.intersection=Xs,Bi.intersectionBy=Ks,Bi.intersectionWith=Zs,Bi.invert=Ca,Bi.invertBy=Ta,Bi.invokeMap=ko,Bi.iteratee=ol,Bi.keyBy=Mo,Bi.keys=La,Bi.keysIn=Ra,Bi.map=So,Bi.mapKeys=function(t,e){var i={};return e=hs(e,3),yn(t,(function(t,n,r){on(i,e(t,n,r),t)})),i},Bi.mapValues=function(t,e){var i={};return e=hs(e,3),yn(t,(function(t,n,r){on(i,n,e(t,n,r))})),i},Bi.matches=function(t){return Wn(hn(t,1))},Bi.matchesProperty=function(t,e){return Nn(t,hn(e,1))},Bi.memoize=zo,Bi.merge=Ia,Bi.mergeWith=za,Bi.method=al,Bi.methodOf=ll,Bi.mixin=hl,Bi.negate=Fo,Bi.nthArg=function(t){return t=ma(t),Gn((function(e){return $n(e,t)}))},Bi.omit=Fa,Bi.omitBy=function(t,e){return Va(t,Fo(hs(e)))},Bi.once=function(t){return Co(2,t)},Bi.orderBy=function(t,e,n,r){return null==t?[]:(Yo(e)||(e=null==e?[]:[e]),Yo(n=r?i:n)||(n=null==n?[]:[n]),Un(t,e,n))},Bi.over=ul,Bi.overArgs=jo,Bi.overEvery=fl,Bi.overSome=dl,Bi.partial=Vo,Bi.partialRight=Bo,Bi.partition=Po,Bi.pick=ja,Bi.pickBy=Va,Bi.property=pl,Bi.propertyOf=function(t){return function(e){return null==t?i:Mn(t,e)}},Bi.pull=Js,Bi.pullAll=Qs,Bi.pullAllBy=function(t,e,i){return t&&t.length&&e&&e.length?qn(t,e,hs(i,2)):t},Bi.pullAllWith=function(t,e,n){return t&&t.length&&e&&e.length?qn(t,e,i,n):t},Bi.pullAt=to,Bi.range=gl,Bi.rangeRight=ml,Bi.rearg=Wo,Bi.reject=function(t,e){return(Yo(t)?Te:bn)(t,Fo(hs(e,3)))},Bi.remove=function(t,e){var i=[];if(!t||!t.length)return i;var n=-1,r=[],s=t.length;for(e=hs(e,3);++n<s;){var o=t[n];e(o,n,t)&&(i.push(o),r.push(n))}return Xn(t,r),i},Bi.rest=function(t,e){if("function"!=typeof t)throw new Ot(r);return Gn(t,e=e===i?e:ma(e))},Bi.reverse=eo,Bi.sampleSize=function(t,e,n){return e=(n?vs(t,e,n):e===i)?1:ma(e),(Yo(t)?Ji:Qn)(t,e)},Bi.set=function(t,e,i){return null==t?t:tr(t,e,i)},Bi.setWith=function(t,e,n,r){return r="function"==typeof r?r:i,null==t?t:tr(t,e,n,r)},Bi.shuffle=function(t){return(Yo(t)?Qi:nr)(t)},Bi.slice=function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&vs(t,e,n)?(e=0,n=r):(e=null==e?0:ma(e),n=n===i?r:ma(n)),rr(t,e,n)):[]},Bi.sortBy=Ao,Bi.sortedUniq=function(t){return t&&t.length?lr(t):[]},Bi.sortedUniqBy=function(t,e){return t&&t.length?lr(t,hs(e,2)):[]},Bi.split=function(t,e,n){return n&&"number"!=typeof n&&vs(t,e,n)&&(e=n=i),(n=n===i?g:n>>>0)?(t=va(t))&&("string"==typeof e||null!=e&&!aa(e))&&!(e=cr(e))&&ai(t)?wr(pi(t),0,n):t.split(e,n):[]},Bi.spread=function(t,e){if("function"!=typeof t)throw new Ot(r);return e=null==e?0:_i(ma(e),0),Gn((function(i){var n=i[e],r=wr(i,0,e);return n&&Ie(r,n),Pe(t,this,r)}))},Bi.tail=function(t){var e=null==t?0:t.length;return e?rr(t,1,e):[]},Bi.take=function(t,e,n){return t&&t.length?rr(t,0,(e=n||e===i?1:ma(e))<0?0:e):[]},Bi.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?rr(t,(e=r-(e=n||e===i?1:ma(e)))<0?0:e,r):[]},Bi.takeRightWhile=function(t,e){return t&&t.length?pr(t,hs(e,3),!1,!0):[]},Bi.takeWhile=function(t,e){return t&&t.length?pr(t,hs(e,3)):[]},Bi.tap=function(t,e){return e(t),t},Bi.throttle=function(t,e,i){var n=!0,s=!0;if("function"!=typeof t)throw new Ot(r);return ia(i)&&(n="leading"in i?!!i.leading:n,s="trailing"in i?!!i.trailing:s),Lo(t,e,{leading:n,maxWait:e,trailing:s})},Bi.thru=go,Bi.toArray=pa,Bi.toPairs=Ba,Bi.toPairsIn=Wa,Bi.toPath=function(t){return Yo(t)?Re(t,js):ca(t)?[t]:Cr(Fs(va(t)))},Bi.toPlainObject=xa,Bi.transform=function(t,e,i){var n=Yo(t),r=n||Zo(t)||ua(t);if(e=hs(e,4),null==i){var s=t&&t.constructor;i=r?n?new s:[]:ia(t)&&Qo(s)?Wi(Yt(t)):{}}return(r?De:yn)(t,(function(t,n,r){return e(i,t,n,r)})),i},Bi.unary=function(t){return Oo(t,1)},Bi.union=io,Bi.unionBy=no,Bi.unionWith=ro,Bi.uniq=function(t){return t&&t.length?ur(t):[]},Bi.uniqBy=function(t,e){return t&&t.length?ur(t,hs(e,2)):[]},Bi.uniqWith=function(t,e){return e="function"==typeof e?e:i,t&&t.length?ur(t,i,e):[]},Bi.unset=function(t,e){return null==t||fr(t,e)},Bi.unzip=so,Bi.unzipWith=oo,Bi.update=function(t,e,i){return null==t?t:dr(t,e,xr(i))},Bi.updateWith=function(t,e,n,r){return r="function"==typeof r?r:i,null==t?t:dr(t,e,xr(n),r)},Bi.values=Na,Bi.valuesIn=function(t){return null==t?[]:Qe(t,Ra(t))},Bi.without=ao,Bi.words=Qa,Bi.wrap=function(t,e){return Vo(xr(e),t)},Bi.xor=lo,Bi.xorBy=ho,Bi.xorWith=co,Bi.zip=uo,Bi.zipObject=function(t,e){return br(t||[],e||[],en)},Bi.zipObjectDeep=function(t,e){return br(t||[],e||[],tr)},Bi.zipWith=fo,Bi.entries=Ba,Bi.entriesIn=Wa,Bi.extend=wa,Bi.extendWith=ka,hl(Bi,Bi),Bi.add=xl,Bi.attempt=tl,Bi.camelCase=Ha,Bi.capitalize=$a,Bi.ceil=vl,Bi.clamp=function(t,e,n){return n===i&&(n=e,e=i),n!==i&&(n=(n=_a(n))==n?n:0),e!==i&&(e=(e=_a(e))==e?e:0),ln(_a(t),e,n)},Bi.clone=function(t){return hn(t,4)},Bi.cloneDeep=function(t){return hn(t,5)},Bi.cloneDeepWith=function(t,e){return hn(t,5,e="function"==typeof e?e:i)},Bi.cloneWith=function(t,e){return hn(t,4,e="function"==typeof e?e:i)},Bi.conformsTo=function(t,e){return null==e||cn(t,e,La(e))},Bi.deburr=Ua,Bi.defaultTo=function(t,e){return null==t||t!=t?e:t},Bi.divide=yl,Bi.endsWith=function(t,e,n){t=va(t),e=cr(e);var r=t.length,s=n=n===i?r:ln(ma(n),0,r);return(n-=e.length)>=0&&t.slice(n,s)==e},Bi.eq=No,Bi.escape=function(t){return(t=va(t))&&Z.test(t)?t.replace(X,si):t},Bi.escapeRegExp=function(t){return(t=va(t))&&rt.test(t)?t.replace(nt,"\\$&"):t},Bi.every=function(t,e,n){var r=Yo(t)?Ce:gn;return n&&vs(t,e,n)&&(e=i),r(t,hs(e,3))},Bi.find=_o,Bi.findIndex=$s,Bi.findKey=function(t,e){return Be(t,hs(e,3),yn)},Bi.findLast=xo,Bi.findLastIndex=Us,Bi.findLastKey=function(t,e){return Be(t,hs(e,3),wn)},Bi.floor=wl,Bi.forEach=vo,Bi.forEachRight=yo,Bi.forIn=function(t,e){return null==t?t:xn(t,hs(e,3),Ra)},Bi.forInRight=function(t,e){return null==t?t:vn(t,hs(e,3),Ra)},Bi.forOwn=function(t,e){return t&&yn(t,hs(e,3))},Bi.forOwnRight=function(t,e){return t&&wn(t,hs(e,3))},Bi.get=Da,Bi.gt=Ho,Bi.gte=$o,Bi.has=function(t,e){return null!=t&&ms(t,e,Dn)},Bi.hasIn=Oa,Bi.head=qs,Bi.identity=sl,Bi.includes=function(t,e,i,n){t=Xo(t)?t:Na(t),i=i&&!n?ma(i):0;var r=t.length;return i<0&&(i=_i(r+i,0)),ha(t)?i<=r&&t.indexOf(e,i)>-1:!!r&&Ne(t,e,i)>-1},Bi.indexOf=function(t,e,i){var n=null==t?0:t.length;if(!n)return-1;var r=null==i?0:ma(i);return r<0&&(r=_i(n+r,0)),Ne(t,e,r)},Bi.inRange=function(t,e,n){return e=ga(e),n===i?(n=e,e=0):n=ga(n),function(t,e,i){return t>=xi(e,i)&&t<_i(e,i)}(t=_a(t),e,n)},Bi.invoke=Ea,Bi.isArguments=Uo,Bi.isArray=Yo,Bi.isArrayBuffer=qo,Bi.isArrayLike=Xo,Bi.isArrayLikeObject=Ko,Bi.isBoolean=function(t){return!0===t||!1===t||na(t)&&Pn(t)==x},Bi.isBuffer=Zo,Bi.isDate=Go,Bi.isElement=function(t){return na(t)&&1===t.nodeType&&!oa(t)},Bi.isEmpty=function(t){if(null==t)return!0;if(Xo(t)&&(Yo(t)||"string"==typeof t||"function"==typeof t.splice||Zo(t)||ua(t)||Uo(t)))return!t.length;var e=gs(t);if(e==M||e==O)return!t.size;if(Ms(t))return!Fn(t).length;for(var i in t)if(It.call(t,i))return!1;return!0},Bi.isEqual=function(t,e){return Ln(t,e)},Bi.isEqualWith=function(t,e,n){var r=(n="function"==typeof n?n:i)?n(t,e):i;return r===i?Ln(t,e,i,n):!!r},Bi.isError=Jo,Bi.isFinite=function(t){return"number"==typeof t&&xe(t)},Bi.isFunction=Qo,Bi.isInteger=ta,Bi.isLength=ea,Bi.isMap=ra,Bi.isMatch=function(t,e){return t===e||Rn(t,e,us(e))},Bi.isMatchWith=function(t,e,n){return n="function"==typeof n?n:i,Rn(t,e,us(e),n)},Bi.isNaN=function(t){return sa(t)&&t!=+t},Bi.isNative=function(t){if(ks(t))throw new kt("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return In(t)},Bi.isNil=function(t){return null==t},Bi.isNull=function(t){return null===t},Bi.isNumber=sa,Bi.isObject=ia,Bi.isObjectLike=na,Bi.isPlainObject=oa,Bi.isRegExp=aa,Bi.isSafeInteger=function(t){return ta(t)&&t>=-9007199254740991&&t<=d},Bi.isSet=la,Bi.isString=ha,Bi.isSymbol=ca,Bi.isTypedArray=ua,Bi.isUndefined=function(t){return t===i},Bi.isWeakMap=function(t){return na(t)&&gs(t)==E},Bi.isWeakSet=function(t){return na(t)&&"[object WeakSet]"==Pn(t)},Bi.join=function(t,e){return null==t?"":Ve.call(t,e)},Bi.kebabCase=Ya,Bi.last=Gs,Bi.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var s=r;return n!==i&&(s=(s=ma(n))<0?_i(r+s,0):xi(s,r-1)),e==e?function(t,e,i){for(var n=i+1;n--;)if(t[n]===e)return n;return n}(t,e,s):We(t,$e,s,!0)},Bi.lowerCase=qa,Bi.lowerFirst=Xa,Bi.lt=fa,Bi.lte=da,Bi.max=function(t){return t&&t.length?mn(t,sl,An):i},Bi.maxBy=function(t,e){return t&&t.length?mn(t,hs(e,2),An):i},Bi.mean=function(t){return Ue(t,sl)},Bi.meanBy=function(t,e){return Ue(t,hs(e,2))},Bi.min=function(t){return t&&t.length?mn(t,sl,Vn):i},Bi.minBy=function(t,e){return t&&t.length?mn(t,hs(e,2),Vn):i},Bi.stubArray=bl,Bi.stubFalse=_l,Bi.stubObject=function(){return{}},Bi.stubString=function(){return""},Bi.stubTrue=function(){return!0},Bi.multiply=Ml,Bi.nth=function(t,e){return t&&t.length?$n(t,ma(e)):i},Bi.noConflict=function(){return pe._===this&&(pe._=Bt),this},Bi.noop=cl,Bi.now=Do,Bi.pad=function(t,e,i){t=va(t);var n=(e=ma(e))?di(t):0;if(!e||n>=e)return t;var r=(e-n)/2;return Ur(ge(r),i)+t+Ur(de(r),i)},Bi.padEnd=function(t,e,i){t=va(t);var n=(e=ma(e))?di(t):0;return e&&n<e?t+Ur(e-n,i):t},Bi.padStart=function(t,e,i){t=va(t);var n=(e=ma(e))?di(t):0;return e&&n<e?Ur(e-n,i)+t:t},Bi.parseInt=function(t,e,i){return i||null==e?e=0:e&&(e=+e),yi(va(t).replace(st,""),e||0)},Bi.random=function(t,e,n){if(n&&"boolean"!=typeof n&&vs(t,e,n)&&(e=n=i),n===i&&("boolean"==typeof e?(n=e,e=i):"boolean"==typeof t&&(n=t,t=i)),t===i&&e===i?(t=0,e=1):(t=ga(t),e===i?(e=t,t=0):e=ga(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var s=wi();return xi(t+s*(e-t+ce("1e-"+((s+"").length-1))),e)}return Kn(t,e)},Bi.reduce=function(t,e,i){var n=Yo(t)?ze:Xe,r=arguments.length<3;return n(t,hs(e,4),i,r,dn)},Bi.reduceRight=function(t,e,i){var n=Yo(t)?Fe:Xe,r=arguments.length<3;return n(t,hs(e,4),i,r,pn)},Bi.repeat=function(t,e,n){return e=(n?vs(t,e,n):e===i)?1:ma(e),Zn(va(t),e)},Bi.replace=function(){var t=arguments,e=va(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Bi.result=function(t,e,n){var r=-1,s=(e=vr(e,t)).length;for(s||(s=1,t=i);++r<s;){var o=null==t?i:t[js(e[r])];o===i&&(r=s,o=n),t=Qo(o)?o.call(t):o}return t},Bi.round=Sl,Bi.runInContext=t,Bi.sample=function(t){return(Yo(t)?Gi:Jn)(t)},Bi.size=function(t){if(null==t)return 0;if(Xo(t))return ha(t)?di(t):t.length;var e=gs(t);return e==M||e==O?t.size:Fn(t).length},Bi.snakeCase=Ka,Bi.some=function(t,e,n){var r=Yo(t)?je:sr;return n&&vs(t,e,n)&&(e=i),r(t,hs(e,3))},Bi.sortedIndex=function(t,e){return or(t,e)},Bi.sortedIndexBy=function(t,e,i){return ar(t,e,hs(i,2))},Bi.sortedIndexOf=function(t,e){var i=null==t?0:t.length;if(i){var n=or(t,e);if(n<i&&No(t[n],e))return n}return-1},Bi.sortedLastIndex=function(t,e){return or(t,e,!0)},Bi.sortedLastIndexBy=function(t,e,i){return ar(t,e,hs(i,2),!0)},Bi.sortedLastIndexOf=function(t,e){if(null==t?0:t.length){var i=or(t,e,!0)-1;if(No(t[i],e))return i}return-1},Bi.startCase=Za,Bi.startsWith=function(t,e,i){return t=va(t),i=null==i?0:ln(ma(i),0,t.length),e=cr(e),t.slice(i,i+e.length)==e},Bi.subtract=Pl,Bi.sum=function(t){return t&&t.length?Ke(t,sl):0},Bi.sumBy=function(t,e){return t&&t.length?Ke(t,hs(e,2)):0},Bi.template=function(t,e,n){var r=Bi.templateSettings;n&&vs(t,e,n)&&(e=i),t=va(t),e=ka({},e,r,Qr);var s,o,a=ka({},e.imports,r.imports,Qr),l=La(a),h=Qe(a,l),c=0,u=e.interpolate||yt,f="__p += '",d=At((e.escape||yt).source+"|"+u.source+"|"+(u===Q?dt:yt).source+"|"+(e.evaluate||yt).source+"|$","g"),p="//# sourceURL="+(It.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++oe+"]")+"\n";t.replace(d,(function(e,i,n,r,a,l){return n||(n=r),f+=t.slice(c,l).replace(wt,oi),i&&(s=!0,f+="' +\n__e("+i+") +\n'"),a&&(o=!0,f+="';\n"+a+";\n__p += '"),n&&(f+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),c=l+e.length,e})),f+="';\n";var g=It.call(e,"variable")&&e.variable;if(g){if(ut.test(g))throw new kt("Invalid `variable` option passed into `_.template`")}else f="with (obj) {\n"+f+"\n}\n";f=(o?f.replace($,""):f).replace(U,"$1").replace(Y,"$1;"),f="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(s?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var m=tl((function(){return Mt(l,p+"return "+f).apply(i,h)}));if(m.source=f,Jo(m))throw m;return m},Bi.times=function(t,e){if((t=ma(t))<1||t>d)return[];var i=g,n=xi(t,g);e=hs(e),t-=g;for(var r=Ze(n,e);++i<t;)e(i);return r},Bi.toFinite=ga,Bi.toInteger=ma,Bi.toLength=ba,Bi.toLower=function(t){return va(t).toLowerCase()},Bi.toNumber=_a,Bi.toSafeInteger=function(t){return t?ln(ma(t),-9007199254740991,d):0===t?t:0},Bi.toString=va,Bi.toUpper=function(t){return va(t).toUpperCase()},Bi.trim=function(t,e,n){if((t=va(t))&&(n||e===i))return Ge(t);if(!t||!(e=cr(e)))return t;var r=pi(t),s=pi(e);return wr(r,ei(r,s),ii(r,s)+1).join("")},Bi.trimEnd=function(t,e,n){if((t=va(t))&&(n||e===i))return t.slice(0,gi(t)+1);if(!t||!(e=cr(e)))return t;var r=pi(t);return wr(r,0,ii(r,pi(e))+1).join("")},Bi.trimStart=function(t,e,n){if((t=va(t))&&(n||e===i))return t.replace(st,"");if(!t||!(e=cr(e)))return t;var r=pi(t);return wr(r,ei(r,pi(e))).join("")},Bi.truncate=function(t,e){var n=30,r="...";if(ia(e)){var s="separator"in e?e.separator:s;n="length"in e?ma(e.length):n,r="omission"in e?cr(e.omission):r}var o=(t=va(t)).length;if(ai(t)){var a=pi(t);o=a.length}if(n>=o)return t;var l=n-di(r);if(l<1)return r;var h=a?wr(a,0,l).join(""):t.slice(0,l);if(s===i)return h+r;if(a&&(l+=h.length-l),aa(s)){if(t.slice(l).search(s)){var c,u=h;for(s.global||(s=At(s.source,va(pt.exec(s))+"g")),s.lastIndex=0;c=s.exec(u);)var f=c.index;h=h.slice(0,f===i?l:f)}}else if(t.indexOf(cr(s),l)!=l){var d=h.lastIndexOf(s);d>-1&&(h=h.slice(0,d))}return h+r},Bi.unescape=function(t){return(t=va(t))&&K.test(t)?t.replace(q,mi):t},Bi.uniqueId=function(t){var e=++zt;return va(t)+e},Bi.upperCase=Ga,Bi.upperFirst=Ja,Bi.each=vo,Bi.eachRight=yo,Bi.first=qs,hl(Bi,(kl={},yn(Bi,(function(t,e){It.call(Bi.prototype,e)||(kl[e]=t)})),kl),{chain:!1}),Bi.VERSION="4.17.21",De(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Bi[t].placeholder=Bi})),De(["drop","take"],(function(t,e){$i.prototype[t]=function(n){n=n===i?1:_i(ma(n),0);var r=this.__filtered__&&!e?new $i(this):this.clone();return r.__filtered__?r.__takeCount__=xi(n,r.__takeCount__):r.__views__.push({size:xi(n,g),type:t+(r.__dir__<0?"Right":"")}),r},$i.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),De(["filter","map","takeWhile"],(function(t,e){var i=e+1,n=1==i||3==i;$i.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:hs(t,3),type:i}),e.__filtered__=e.__filtered__||n,e}})),De(["head","last"],(function(t,e){var i="take"+(e?"Right":"");$i.prototype[t]=function(){return this[i](1).value()[0]}})),De(["initial","tail"],(function(t,e){var i="drop"+(e?"":"Right");$i.prototype[t]=function(){return this.__filtered__?new $i(this):this[i](1)}})),$i.prototype.compact=function(){return this.filter(sl)},$i.prototype.find=function(t){return this.filter(t).head()},$i.prototype.findLast=function(t){return this.reverse().find(t)},$i.prototype.invokeMap=Gn((function(t,e){return"function"==typeof t?new $i(this):this.map((function(i){return Tn(i,t,e)}))})),$i.prototype.reject=function(t){return this.filter(Fo(hs(t)))},$i.prototype.slice=function(t,e){t=ma(t);var n=this;return n.__filtered__&&(t>0||e<0)?new $i(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==i&&(n=(e=ma(e))<0?n.dropRight(-e):n.take(e-t)),n)},$i.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},$i.prototype.toArray=function(){return this.take(g)},yn($i.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),s=Bi[r?"take"+("last"==e?"Right":""):e],o=r||/^find/.test(e);s&&(Bi.prototype[e]=function(){var e=this.__wrapped__,a=r?[1]:arguments,l=e instanceof $i,h=a[0],c=l||Yo(e),u=function(t){var e=s.apply(Bi,Ie([t],a));return r&&f?e[0]:e};c&&n&&"function"==typeof h&&1!=h.length&&(l=c=!1);var f=this.__chain__,d=!!this.__actions__.length,p=o&&!f,g=l&&!d;if(!o&&c){e=g?e:new $i(this);var m=t.apply(e,a);return m.__actions__.push({func:go,args:[u],thisArg:i}),new Hi(m,f)}return p&&g?t.apply(this,a):(m=this.thru(u),p?r?m.value()[0]:m.value():m)})})),De(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Ct[t],i=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);Bi.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var r=this.value();return e.apply(Yo(r)?r:[],t)}return this[i]((function(i){return e.apply(Yo(i)?i:[],t)}))}})),yn($i.prototype,(function(t,e){var i=Bi[e];if(i){var n=i.name+"";It.call(Ti,n)||(Ti[n]=[]),Ti[n].push({name:e,func:i})}})),Ti[Wr(i,2).name]=[{name:"wrapper",func:i}],$i.prototype.clone=function(){var t=new $i(this.__wrapped__);return t.__actions__=Cr(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Cr(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Cr(this.__views__),t},$i.prototype.reverse=function(){if(this.__filtered__){var t=new $i(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},$i.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,i=Yo(t),n=e<0,r=i?t.length:0,s=function(t,e,i){var n=-1,r=i.length;for(;++n<r;){var s=i[n],o=s.size;switch(s.type){case"drop":t+=o;break;case"dropRight":e-=o;break;case"take":e=xi(e,t+o);break;case"takeRight":t=_i(t,e-o)}}return{start:t,end:e}}(0,r,this.__views__),o=s.start,a=s.end,l=a-o,h=n?a:o-1,c=this.__iteratees__,u=c.length,f=0,d=xi(l,this.__takeCount__);if(!i||!n&&r==l&&d==l)return gr(t,this.__actions__);var p=[];t:for(;l--&&f<d;){for(var g=-1,m=t[h+=e];++g<u;){var b=c[g],_=b.iteratee,x=b.type,v=_(m);if(2==x)m=v;else if(!v){if(1==x)continue t;break t}}p[f++]=m}return p},Bi.prototype.at=mo,Bi.prototype.chain=function(){return po(this)},Bi.prototype.commit=function(){return new Hi(this.value(),this.__chain__)},Bi.prototype.next=function(){this.__values__===i&&(this.__values__=pa(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?i:this.__values__[this.__index__++]}},Bi.prototype.plant=function(t){for(var e,n=this;n instanceof Ni;){var r=Bs(n);r.__index__=0,r.__values__=i,e?s.__wrapped__=r:e=r;var s=r;n=n.__wrapped__}return s.__wrapped__=t,e},Bi.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof $i){var e=t;return this.__actions__.length&&(e=new $i(this)),(e=e.reverse()).__actions__.push({func:go,args:[eo],thisArg:i}),new Hi(e,this.__chain__)}return this.thru(eo)},Bi.prototype.toJSON=Bi.prototype.valueOf=Bi.prototype.value=function(){return gr(this.__wrapped__,this.__actions__)},Bi.prototype.first=Bi.prototype.head,Gt&&(Bi.prototype[Gt]=function(){return this}),Bi}();me?((me.exports=bi)._=bi,ge._=bi):pe._=bi}).call(n)}(g,g.exports);const b=(t,e,i)=>Math.max(Math.min(t,i),e);function _(t){return b(m(2.55*t),0,255)}function x(t){return b(m(255*t),0,255)}function v(t){return b(m(t/2.55)/100,0,1)}function y(t){return b(m(100*t),0,100)}const w={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},k=[..."0123456789ABCDEF"],M=t=>k[15&t],S=t=>k[(240&t)>>4]+k[15&t],P=t=>(240&t)>>4==(15&t);function A(t){var e=(t=>P(t.r)&&P(t.g)&&P(t.b)&&P(t.a))(t)?M:S;return t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0}const D=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function O(t,e,i){const n=e*Math.min(i,1-i),r=(e,r=(e+t/30)%12)=>i-n*Math.max(Math.min(r-3,9-r,1),-1);return[r(0),r(8),r(4)]}function C(t,e,i){const n=(n,r=(n+t/60)%6)=>i-i*e*Math.max(Math.min(r,4-r,1),0);return[n(5),n(3),n(1)]}function T(t,e,i){const n=O(t,1,.5);let r;for(e+i>1&&(r=1/(e+i),e*=r,i*=r),r=0;r<3;r++)n[r]*=1-e-i,n[r]+=e;return n}function E(t){const e=t.r/255,i=t.g/255,n=t.b/255,r=Math.max(e,i,n),s=Math.min(e,i,n),o=(r+s)/2;let a,l,h;return r!==s&&(h=r-s,l=o>.5?h/(2-r-s):h/(r+s),a=function(t,e,i,n,r){return t===r?(e-i)/n+(e<i?6:0):e===r?(i-t)/n+2:(t-e)/n+4}(e,i,n,h,r),a=60*a+.5),[0|a,l||0,o]}function L(t,e,i,n){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,n)).map(x)}function R(t,e,i){return L(O,t,e,i)}function I(t){return(t%360+360)%360}function z(t){const e=D.exec(t);let i,n=255;if(!e)return;e[5]!==i&&(n=e[6]?_(+e[5]):x(+e[5]));const r=I(+e[2]),s=+e[3]/100,o=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return L(T,t,e,i)}(r,s,o):"hsv"===e[1]?function(t,e,i){return L(C,t,e,i)}(r,s,o):R(r,s,o),{r:i[0],g:i[1],b:i[2],a:n}}const F={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"},j={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"};let V;function B(t){V||(V=function(){const t={},e=Object.keys(j),i=Object.keys(F);let n,r,s,o,a;for(n=0;n<e.length;n++){for(o=a=e[n],r=0;r<i.length;r++)s=i[r],a=a.replace(s,F[s]);s=parseInt(j[o],16),t[a]=[s>>16&255,s>>8&255,255&s]}return t}(),V.transparent=[0,0,0,0]);const e=V[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}const W=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const N=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,H=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function $(t,e,i){if(t){let n=E(t);n[e]=Math.max(0,Math.min(n[e]+n[e]*i,0===e?360:1)),n=R(n),t.r=n[0],t.g=n[1],t.b=n[2]}}function U(t,e){return t?Object.assign(e||{},t):t}function Y(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=x(t[3]))):(e=U(t,{r:0,g:0,b:0,a:1})).a=x(e.a),e}function q(t){return"r"===t.charAt(0)?function(t){const e=W.exec(t);let i,n,r,s=255;if(e){if(e[7]!==i){const t=+e[7];s=e[8]?_(t):b(255*t,0,255)}return i=+e[1],n=+e[3],r=+e[5],i=255&(e[2]?_(i):b(i,0,255)),n=255&(e[4]?_(n):b(n,0,255)),r=255&(e[6]?_(r):b(r,0,255)),{r:i,g:n,b:r,a:s}}}(t):z(t)}class X{constructor(t){if(t instanceof X)return t;const e=typeof t;let i;var n,r,s;"object"===e?i=Y(t):"string"===e&&(s=(n=t).length,"#"===n[0]&&(4===s||5===s?r={r:255&17*w[n[1]],g:255&17*w[n[2]],b:255&17*w[n[3]],a:5===s?17*w[n[4]]:255}:7!==s&&9!==s||(r={r:w[n[1]]<<4|w[n[2]],g:w[n[3]]<<4|w[n[4]],b:w[n[5]]<<4|w[n[6]],a:9===s?w[n[7]]<<4|w[n[8]]:255})),i=r||B(t)||q(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=U(this._rgb);return t&&(t.a=v(t.a)),t}set rgb(t){this._rgb=Y(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${v(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?A(this._rgb):void 0}hslString(){return this._valid?function(t){if(!t)return;const e=E(t),i=e[0],n=y(e[1]),r=y(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${r}%, ${v(t.a)})`:`hsl(${i}, ${n}%, ${r}%)`}(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,n=t.rgb;let r;const s=e===r?.5:e,o=2*s-1,a=i.a-n.a,l=((o*a==-1?o:(o+a)/(1+o*a))+1)/2;r=1-l,i.r=255&l*i.r+r*n.r+.5,i.g=255&l*i.g+r*n.g+.5,i.b=255&l*i.b+r*n.b+.5,i.a=s*i.a+(1-s)*n.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){const n=H(v(t.r)),r=H(v(t.g)),s=H(v(t.b));return{r:x(N(n+i*(H(v(e.r))-n))),g:x(N(r+i*(H(v(e.g))-r))),b:x(N(s+i*(H(v(e.b))-s))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new X(this.rgb)}alpha(t){return this._rgb.a=x(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=m(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.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 $(this._rgb,2,t),this}darken(t){return $(this._rgb,2,-t),this}saturate(t){return $(this._rgb,1,t),this}desaturate(t){return $(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=E(t);i[0]=I(i[0]+e),i=R(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}
/*!
* Chart.js v4.1.2
* https://www.chartjs.org
* (c) 2023 Chart.js Contributors
* Released under the MIT License
*/function K(){}const Z=(()=>{let t=0;return()=>t++})();function G(t){return null==t}function J(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function Q(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function tt(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function et(t,e){return tt(t)?t:e}function it(t,e){return void 0===t?e:t}const nt=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function rt(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function st(t,e,i,n){let r,s,o;if(J(t))if(s=t.length,n)for(r=s-1;r>=0;r--)e.call(i,t[r],r);else for(r=0;r<s;r++)e.call(i,t[r],r);else if(Q(t))for(o=Object.keys(t),s=o.length,r=0;r<s;r++)e.call(i,t[o[r]],o[r])}function ot(t,e){let i,n,r,s;if(!t||!e||t.length!==e.length)return!1;for(i=0,n=t.length;i<n;++i)if(r=t[i],s=e[i],r.datasetIndex!==s.datasetIndex||r.index!==s.index)return!1;return!0}function at(t){if(J(t))return t.map(at);if(Q(t)){const e=Object.create(null),i=Object.keys(t),n=i.length;let r=0;for(;r<n;++r)e[i[r]]=at(t[i[r]]);return e}return t}function lt(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function ht(t,e,i,n){if(!lt(t))return;const r=e[t],s=i[t];Q(r)&&Q(s)?ct(r,s,n):e[t]=at(s)}function ct(t,e,i){const n=J(e)?e:[e],r=n.length;if(!Q(t))return t;const s=(i=i||{}).merger||ht;let o;for(let a=0;a<r;++a){if(o=n[a],!Q(o))continue;const e=Object.keys(o);for(let n=0,r=e.length;n<r;++n)s(e[n],t,o,i)}return t}function ut(t,e){return ct(t,e,{merger:ft})}function ft(t,e,i){if(!lt(t))return;const n=e[t],r=i[t];Q(n)&&Q(r)?ut(n,r):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=at(r))}const dt={"":t=>t,x:t=>t.x,y:t=>t.y};function pt(t,e){const i=dt[e]||(dt[e]=function(t){const e=function(t){const e=t.split("."),i=[];let n="";for(const r of e)n+=r,n.endsWith("\\")?n=n.slice(0,-1)+".":(i.push(n),n="");return i}(t);return t=>{for(const i of e){if(""===i)break;t=t&&t[i]}return t}}(e));return i(t)}function gt(t){return t.charAt(0).toUpperCase()+t.slice(1)}const mt=t=>void 0!==t,bt=t=>"function"==typeof t,_t=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0};const xt=Math.PI,vt=2*xt,yt=vt+xt,wt=Number.POSITIVE_INFINITY,kt=xt/180,Mt=xt/2,St=xt/4,Pt=2*xt/3,At=Math.log10,Dt=Math.sign;function Ot(t,e,i){return Math.abs(t-e)<i}function Ct(t){const e=Math.round(t);t=Ot(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(At(t))),n=t/i;return(n<=1?1:n<=2?2:n<=5?5:10)*i}function Tt(t){return!isNaN(parseFloat(t))&&isFinite(t)}function Et(t,e,i){let n,r,s;for(n=0,r=t.length;n<r;n++)s=t[n][i],isNaN(s)||(e.min=Math.min(e.min,s),e.max=Math.max(e.max,s))}function Lt(t){return t*(xt/180)}function Rt(t){return t*(180/xt)}function It(t){if(!tt(t))return;let e=1,i=0;for(;Math.round(t*e)/e!==t;)e*=10,i++;return i}function zt(t,e){const i=e.x-t.x,n=e.y-t.y,r=Math.sqrt(i*i+n*n);let s=Math.atan2(n,i);return s<-.5*xt&&(s+=vt),{angle:s,distance:r}}function Ft(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function jt(t,e){return(t-e+yt)%vt-xt}function Vt(t){return(t%vt+vt)%vt}function Bt(t,e,i,n){const r=Vt(t),s=Vt(e),o=Vt(i),a=Vt(s-r),l=Vt(o-r),h=Vt(r-s),c=Vt(r-o);return r===s||r===o||n&&s===o||a>l&&h<c}function Wt(t,e,i){return Math.max(e,Math.min(i,t))}function Nt(t,e,i,n=1e-6){return t>=Math.min(e,i)-n&&t<=Math.max(e,i)+n}function Ht(t,e,i){i=i||(i=>t[i]<e);let n,r=t.length-1,s=0;for(;r-s>1;)n=s+r>>1,i(n)?s=n:r=n;return{lo:s,hi:r}}const $t=(t,e,i,n)=>Ht(t,i,n?n=>{const r=t[n][e];return r<i||r===i&&t[n+1][e]===i}:n=>t[n][e]<i),Ut=(t,e,i)=>Ht(t,i,(n=>t[n][e]>=i));const Yt=["push","pop","shift","splice","unshift"];function qt(t,e){const i=t._chartjs;if(!i)return;const n=i.listeners,r=n.indexOf(e);-1!==r&&n.splice(r,1),n.length>0||(Yt.forEach((e=>{delete t[e]})),delete t._chartjs)}function Xt(t){const e=new Set;let i,n;for(i=0,n=t.length;i<n;++i)e.add(t[i]);return e.size===n?t:Array.from(e)}const Kt="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function Zt(t,e){let i=[],n=!1;return function(...r){i=r,n||(n=!0,Kt.call(window,(()=>{n=!1,t.apply(e,i)})))}}const Gt=t=>"start"===t?"left":"end"===t?"right":"center",Jt=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function Qt(t,e,i){const n=e.length;let r=0,s=n;if(t._sorted){const{iScale:o,_parsed:a}=t,l=o.axis,{min:h,max:c,minDefined:u,maxDefined:f}=o.getUserBounds();u&&(r=Wt(Math.min($t(a,o.axis,h).lo,i?n:$t(e,l,o.getPixelForValue(h)).lo),0,n-1)),s=f?Wt(Math.max($t(a,o.axis,c,!0).hi+1,i?0:$t(e,l,o.getPixelForValue(c),!0).hi+1),r,n)-r:n-r}return{start:r,count:s}}function te(t){const{xScale:e,yScale:i,_scaleRanges:n}=t,r={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=r,!0;const s=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,r),s}const ee=t=>0===t||1===t,ie=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*vt/i),ne=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*vt/i)+1,re={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*Mt),easeOutSine:t=>Math.sin(t*Mt),easeInOutSine:t=>-.5*(Math.cos(xt*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>ee(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>ee(t)?t:ie(t,.075,.3),easeOutElastic:t=>ee(t)?t:ne(t,.075,.3),easeInOutElastic(t){const e=.1125;return ee(t)?t:t<.5?.5*ie(2*t,e,.45):.5+.5*ne(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-re.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*re.easeInBounce(2*t):.5*re.easeOutBounce(2*t-1)+.5};function se(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function oe(t){return se(t)?t:new X(t)}function ae(t){return se(t)?t:new X(t).saturate(.5).darken(.1).hexString()}const le=["x","y","borderWidth","radius","tension"],he=["color","borderColor","backgroundColor"];const ce=new Map;function ue(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let n=ce.get(i);return n||(n=new Intl.NumberFormat(t,e),ce.set(i,n)),n}(e,i).format(t)}const fe={values:t=>J(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const n=this.chart.options.locale;let r,s=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(r="scientific"),s=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t));return i}(t,i)}const o=At(Math.abs(s)),a=Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:r,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),ue(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";const n=i[e].significand||t/Math.pow(10,Math.floor(At(t)));return[1,2,3,5,10,15].includes(n)||e>.8*i.length?fe.numeric.call(this,t,e,i):""}};var de={formatters:fe};const pe=Object.create(null),ge=Object.create(null);function me(t,e){if(!e)return t;const i=e.split(".");for(let n=0,r=i.length;n<r;++n){const e=i[n];t=t[e]||(t[e]=Object.create(null))}return t}function be(t,e,i){return"string"==typeof e?ct(me(t,e),i):ct(me(t,""),e)}class _e{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.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=(t,e)=>ae(e.backgroundColor),this.hoverBorderColor=(t,e)=>ae(e.borderColor),this.hoverColor=(t,e)=>ae(e.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(e)}set(t,e){return be(this,t,e)}get(t){return me(this,t)}describe(t,e){return be(ge,t,e)}override(t,e){return be(pe,t,e)}route(t,e,i,n){const r=me(this,t),s=me(this,i),o="_"+e;Object.defineProperties(r,{[o]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[o],e=s[n];return Q(t)?Object.assign({},e,t):it(t,e)},set(t){this[o]=t}}})}apply(t){t.forEach((t=>t(this)))}}var xe=new _e({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:he},numbers:{type:"number",properties:le}}),t.describe("animations",{_fallback:"animation"}),t.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=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.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:de.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function ve(t,e,i,n,r){let s=e[r];return s||(s=e[r]=t.measureText(r).width,i.push(r)),s>n&&(n=s),n}function ye(t,e,i,n){let r=(n=n||{}).data=n.data||{},s=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(r=n.data={},s=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let o=0;const a=i.length;let l,h,c,u,f;for(l=0;l<a;l++)if(u=i[l],null!=u&&!0!==J(u))o=ve(t,r,s,o,u);else if(J(u))for(h=0,c=u.length;h<c;h++)f=u[h],null==f||J(f)||(o=ve(t,r,s,o,f));t.restore();const d=s.length/2;if(d>i.length){for(l=0;l<d;l++)delete r[s[l]];s.splice(0,d)}return o}function we(t,e,i){const n=t.currentDevicePixelRatio,r=0!==i?Math.max(i/2,.5):0;return Math.round((e-r)*n)/n+r}function ke(t,e){(e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function Me(t,e,i,n){Se(t,e,i,n,null)}function Se(t,e,i,n,r){let s,o,a,l,h,c,u,f;const d=e.pointStyle,p=e.rotation,g=e.radius;let m=(p||0)*kt;if(d&&"object"==typeof d&&(s=d.toString(),"[object HTMLImageElement]"===s||"[object HTMLCanvasElement]"===s))return t.save(),t.translate(i,n),t.rotate(m),t.drawImage(d,-d.width/2,-d.height/2,d.width,d.height),void t.restore();if(!(isNaN(g)||g<=0)){switch(t.beginPath(),d){default:r?t.ellipse(i,n,r/2,g,0,0,vt):t.arc(i,n,g,0,vt),t.closePath();break;case"triangle":c=r?r/2:g,t.moveTo(i+Math.sin(m)*c,n-Math.cos(m)*g),m+=Pt,t.lineTo(i+Math.sin(m)*c,n-Math.cos(m)*g),m+=Pt,t.lineTo(i+Math.sin(m)*c,n-Math.cos(m)*g),t.closePath();break;case"rectRounded":h=.516*g,l=g-h,o=Math.cos(m+St)*l,u=Math.cos(m+St)*(r?r/2-h:l),a=Math.sin(m+St)*l,f=Math.sin(m+St)*(r?r/2-h:l),t.arc(i-u,n-a,h,m-xt,m-Mt),t.arc(i+f,n-o,h,m-Mt,m),t.arc(i+u,n+a,h,m,m+Mt),t.arc(i-f,n+o,h,m+Mt,m+xt),t.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,c=r?r/2:l,t.rect(i-c,n-l,2*c,2*l);break}m+=St;case"rectRot":u=Math.cos(m)*(r?r/2:g),o=Math.cos(m)*g,a=Math.sin(m)*g,f=Math.sin(m)*(r?r/2:g),t.moveTo(i-u,n-a),t.lineTo(i+f,n-o),t.lineTo(i+u,n+a),t.lineTo(i-f,n+o),t.closePath();break;case"crossRot":m+=St;case"cross":u=Math.cos(m)*(r?r/2:g),o=Math.cos(m)*g,a=Math.sin(m)*g,f=Math.sin(m)*(r?r/2:g),t.moveTo(i-u,n-a),t.lineTo(i+u,n+a),t.moveTo(i+f,n-o),t.lineTo(i-f,n+o);break;case"star":u=Math.cos(m)*(r?r/2:g),o=Math.cos(m)*g,a=Math.sin(m)*g,f=Math.sin(m)*(r?r/2:g),t.moveTo(i-u,n-a),t.lineTo(i+u,n+a),t.moveTo(i+f,n-o),t.lineTo(i-f,n+o),m+=St,u=Math.cos(m)*(r?r/2:g),o=Math.cos(m)*g,a=Math.sin(m)*g,f=Math.sin(m)*(r?r/2:g),t.moveTo(i-u,n-a),t.lineTo(i+u,n+a),t.moveTo(i+f,n-o),t.lineTo(i-f,n+o);break;case"line":o=r?r/2:Math.cos(m)*g,a=Math.sin(m)*g,t.moveTo(i-o,n-a),t.lineTo(i+o,n+a);break;case"dash":t.moveTo(i,n),t.lineTo(i+Math.cos(m)*(r?r/2:g),n+Math.sin(m)*g);break;case!1:t.closePath()}t.fill(),e.borderWidth>0&&t.stroke()}}function Pe(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}function Ae(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function De(t){t.restore()}function Oe(t,e,i,n,r){if(!e)return t.lineTo(i.x,i.y);if("middle"===r){const n=(e.x+i.x)/2;t.lineTo(n,e.y),t.lineTo(n,i.y)}else"after"===r!=!!n?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}function Ce(t,e,i,n){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(n?e.cp1x:e.cp2x,n?e.cp1y:e.cp2y,n?i.cp2x:i.cp1x,n?i.cp2y:i.cp1y,i.x,i.y)}function Te(t,e,i,n,r,s={}){const o=J(e)?e:[e],a=s.strokeWidth>0&&""!==s.strokeColor;let l,h;for(t.save(),t.font=r.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]);G(e.rotation)||t.rotate(e.rotation);e.color&&(t.fillStyle=e.color);e.textAlign&&(t.textAlign=e.textAlign);e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,s),l=0;l<o.length;++l)h=o[l],s.backdrop&&Le(t,s.backdrop),a&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),G(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(h,i,n,s.maxWidth)),t.fillText(h,i,n,s.maxWidth),Ee(t,i,n,h,s),n+=r.lineHeight;t.restore()}function Ee(t,e,i,n,r){if(r.strikethrough||r.underline){const s=t.measureText(n),o=e-s.actualBoundingBoxLeft,a=e+s.actualBoundingBoxRight,l=i-s.actualBoundingBoxAscent,h=i+s.actualBoundingBoxDescent,c=r.strikethrough?(l+h)/2:h;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=r.decorationWidth||2,t.moveTo(o,c),t.lineTo(a,c),t.stroke()}}function Le(t,e){const i=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=i}function Re(t,e){const{x:i,y:n,w:r,h:s,radius:o}=e;t.arc(i+o.topLeft,n+o.topLeft,o.topLeft,-Mt,xt,!0),t.lineTo(i,n+s-o.bottomLeft),t.arc(i+o.bottomLeft,n+s-o.bottomLeft,o.bottomLeft,xt,Mt,!0),t.lineTo(i+r-o.bottomRight,n+s),t.arc(i+r-o.bottomRight,n+s-o.bottomRight,o.bottomRight,Mt,0,!0),t.lineTo(i+r,n+o.topRight),t.arc(i+r-o.topRight,n+o.topRight,o.topRight,0,-Mt,!0),t.lineTo(i+o.topLeft,n)}const Ie=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,ze=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Fe(t,e){const i=(""+t).match(Ie);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}function je(t,e){const i={},n=Q(e),r=n?Object.keys(e):e,s=Q(t)?n?i=>it(t[i],t[e[i]]):e=>t[e]:()=>t;for(const o of r)i[o]=+s(o)||0;return i}function Ve(t){return je(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Be(t){return je(t,["topLeft","topRight","bottomLeft","bottomRight"])}function We(t){const e=Ve(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Ne(t,e){t=t||{},e=e||xe.font;let i=it(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let n=it(t.style,e.style);n&&!(""+n).match(ze)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const r={family:it(t.family,e.family),lineHeight:Fe(it(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:it(t.weight,e.weight),string:""};return r.string=function(t){return!t||G(t.size)||G(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(r),r}function He(t,e,i,n){let r,s,o,a=!0;for(r=0,s=t.length;r<s;++r)if(o=t[r],void 0!==o&&(void 0!==e&&"function"==typeof o&&(o=o(e),a=!1),void 0!==i&&J(o)&&(o=o[i%o.length],a=!1),void 0!==o))return n&&!a&&(n.cacheable=!1),o}function $e(t,e){return Object.assign(Object.create(t),e)}function Ue(t,e=[""],i=t,n,r=(()=>t[0])){mt(n)||(n=ii("_fallback",t));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:n,_getTarget:r,override:r=>Ue([r,...t],e,i,n)};return new Proxy(s,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,n)=>Ze(i,n,(()=>function(t,e,i,n){let r;for(const s of e)if(r=ii(Xe(s,t),i),mt(r))return Ke(t,r)?ti(i,n,t,r):r}(n,e,t,i))),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>ni(t).includes(e),ownKeys:t=>ni(t),set(t,e,i){const n=t._storage||(t._storage=r());return t[e]=n[e]=i,delete t._keys,!0}})}function Ye(t,e,i,n){const r={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:qe(t,n),setContext:e=>Ye(t,e,i,n),override:r=>Ye(t.override(r),e,i,n)};return new Proxy(r,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>Ze(t,e,(()=>function(t,e,i){const{_proxy:n,_context:r,_subProxy:s,_descriptors:o}=t;let a=n[e];bt(a)&&o.isScriptable(e)&&(a=function(t,e,i,n){const{_proxy:r,_context:s,_subProxy:o,_stack:a}=i;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t),e=e(s,o||n),a.delete(t),Ke(t,e)&&(e=ti(r._scopes,r,t,e));return e}(e,a,t,i));J(a)&&a.length&&(a=function(t,e,i,n){const{_proxy:r,_context:s,_subProxy:o,_descriptors:a}=i;if(mt(s.index)&&n(t))e=e[s.index%e.length];else if(Q(e[0])){const i=e,n=r._scopes.filter((t=>t!==i));e=[];for(const l of i){const i=ti(n,r,t,l);e.push(Ye(i,s,o&&o[t],a))}}return e}(e,a,t,o.isIndexable));Ke(e,a)&&(a=Ye(a,r,s&&s[e],o));return a}(t,e,i))),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,n)=>(t[i]=n,delete e[i],!0)})}function qe(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:r=e.allKeys}=t;return{allKeys:r,scriptable:i,indexable:n,isScriptable:bt(i)?i:()=>i,isIndexable:bt(n)?n:()=>n}}const Xe=(t,e)=>t?t+gt(e):e,Ke=(t,e)=>Q(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function Ze(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const n=i();return t[e]=n,n}function Ge(t,e,i){return bt(t)?t(e,i):t}const Je=(t,e)=>!0===t?e:"string"==typeof t?pt(e,t):void 0;function Qe(t,e,i,n,r){for(const s of e){const e=Je(i,s);if(e){t.add(e);const s=Ge(e._fallback,i,r);if(mt(s)&&s!==i&&s!==n)return s}else if(!1===e&&mt(n)&&i!==n)return null}return!1}function ti(t,e,i,n){const r=e._rootScopes,s=Ge(e._fallback,i,n),o=[...t,...r],a=new Set;a.add(n);let l=ei(a,o,i,s||i,n);return null!==l&&((!mt(s)||s===i||(l=ei(a,o,s,l,n),null!==l))&&Ue(Array.from(a),[""],r,s,(()=>function(t,e,i){const n=t._getTarget();e in n||(n[e]={});const r=n[e];if(J(r)&&Q(i))return i;return r||{}}(e,i,n))))}function ei(t,e,i,n,r){for(;i;)i=Qe(t,e,i,n,r);return i}function ii(t,e){for(const i of e){if(!i)continue;const e=i[t];if(mt(e))return e}}function ni(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter((t=>!t.startsWith("_"))))e.add(t);return Array.from(e)}(t._scopes)),e}function ri(t,e,i,n){const{iScale:r}=t,{key:s="r"}=this._parsing,o=new Array(n);let a,l,h,c;for(a=0,l=n;a<l;++a)h=a+i,c=e[h],o[a]={r:r.parse(pt(c,s),h)};return o}const si=Number.EPSILON||1e-14,oi=(t,e)=>e<t.length&&!t[e].skip&&t[e],ai=t=>"x"===t?"y":"x";function li(t,e,i,n){const r=t.skip?e:t,s=e,o=i.skip?e:i,a=Ft(s,r),l=Ft(o,s);let h=a/(a+l),c=l/(a+l);h=isNaN(h)?0:h,c=isNaN(c)?0:c;const u=n*h,f=n*c;return{previous:{x:s.x-u*(o.x-r.x),y:s.y-u*(o.y-r.y)},next:{x:s.x+f*(o.x-r.x),y:s.y+f*(o.y-r.y)}}}function hi(t,e="x"){const i=ai(e),n=t.length,r=Array(n).fill(0),s=Array(n);let o,a,l,h=oi(t,0);for(o=0;o<n;++o)if(a=l,l=h,h=oi(t,o+1),l){if(h){const t=h[e]-l[e];r[o]=0!==t?(h[i]-l[i])/t:0}s[o]=a?h?Dt(r[o-1])!==Dt(r[o])?0:(r[o-1]+r[o])/2:r[o-1]:r[o]}!function(t,e,i){const n=t.length;let r,s,o,a,l,h=oi(t,0);for(let c=0;c<n-1;++c)l=h,h=oi(t,c+1),l&&h&&(Ot(e[c],0,si)?i[c]=i[c+1]=0:(r=i[c]/e[c],s=i[c+1]/e[c],a=Math.pow(r,2)+Math.pow(s,2),a<=9||(o=3/Math.sqrt(a),i[c]=r*o*e[c],i[c+1]=s*o*e[c])))}(t,r,s),function(t,e,i="x"){const n=ai(i),r=t.length;let s,o,a,l=oi(t,0);for(let h=0;h<r;++h){if(o=a,a=l,l=oi(t,h+1),!a)continue;const r=a[i],c=a[n];o&&(s=(r-o[i])/3,a[`cp1${i}`]=r-s,a[`cp1${n}`]=c-s*e[h]),l&&(s=(l[i]-r)/3,a[`cp2${i}`]=r+s,a[`cp2${n}`]=c+s*e[h])}}(t,s,e)}function ci(t,e,i){return Math.max(Math.min(t,i),e)}function ui(t,e,i,n,r){let s,o,a,l;if(e.spanGaps&&(t=t.filter((t=>!t.skip))),"monotone"===e.cubicInterpolationMode)hi(t,r);else{let i=n?t[t.length-1]:t[0];for(s=0,o=t.length;s<o;++s)a=t[s],l=li(i,a,t[Math.min(s+1,o-(n?0:1))%o],e.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,i=a}e.capBezierPoints&&function(t,e){let i,n,r,s,o,a=Pe(t[0],e);for(i=0,n=t.length;i<n;++i)o=s,s=a,a=i<n-1&&Pe(t[i+1],e),s&&(r=t[i],o&&(r.cp1x=ci(r.cp1x,e.left,e.right),r.cp1y=ci(r.cp1y,e.top,e.bottom)),a&&(r.cp2x=ci(r.cp2x,e.left,e.right),r.cp2y=ci(r.cp2y,e.top,e.bottom)))}(t,i)}function fi(){return"undefined"!=typeof window&&"undefined"!=typeof document}function di(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function pi(t,e,i){let n;return"string"==typeof t?(n=parseInt(t,10),-1!==t.indexOf("%")&&(n=n/100*e.parentNode[i])):n=t,n}const gi=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);const mi=["top","right","bottom","left"];function bi(t,e,i){const n={};i=i?"-"+i:"";for(let r=0;r<4;r++){const s=mi[r];n[s]=parseFloat(t[e+"-"+s+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function _i(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:n}=e,r=gi(i),s="border-box"===r.boxSizing,o=bi(r,"padding"),a=bi(r,"border","width"),{x:l,y:h,box:c}=function(t,e){const i=t.touches,n=i&&i.length?i[0]:t,{offsetX:r,offsetY:s}=n;let o,a,l=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(r,s,t.target))o=r,a=s;else{const t=e.getBoundingClientRect();o=n.clientX-t.left,a=n.clientY-t.top,l=!0}return{x:o,y:a,box:l}}(t,i),u=o.left+(c&&a.left),f=o.top+(c&&a.top);let{width:d,height:p}=e;return s&&(d-=o.width+a.width,p-=o.height+a.height),{x:Math.round((l-u)/d*i.width/n),y:Math.round((h-f)/p*i.height/n)}}const xi=t=>Math.round(10*t)/10;function vi(t,e,i,n){const r=gi(t),s=bi(r,"margin"),o=pi(r.maxWidth,t,"clientWidth")||wt,a=pi(r.maxHeight,t,"clientHeight")||wt,l=function(t,e,i){let n,r;if(void 0===e||void 0===i){const s=di(t);if(s){const t=s.getBoundingClientRect(),o=gi(s),a=bi(o,"border","width"),l=bi(o,"padding");e=t.width-l.width-a.width,i=t.height-l.height-a.height,n=pi(o.maxWidth,s,"clientWidth"),r=pi(o.maxHeight,s,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||wt,maxHeight:r||wt}}(t,e,i);let{width:h,height:c}=l;if("content-box"===r.boxSizing){const t=bi(r,"border","width"),e=bi(r,"padding");h-=e.width+t.width,c-=e.height+t.height}h=Math.max(0,h-s.width),c=Math.max(0,n?h/n:c-s.height),h=xi(Math.min(h,o,l.maxWidth)),c=xi(Math.min(c,a,l.maxHeight)),h&&!c&&(c=xi(h/2));return(void 0!==e||void 0!==i)&&n&&l.height&&c>l.height&&(c=l.height,h=xi(Math.floor(c*n))),{width:h,height:c}}function yi(t,e,i){const n=e||1,r=Math.floor(t.height*n),s=Math.floor(t.width*n);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const o=t.canvas;return o.style&&(i||!o.style.height&&!o.style.width)&&(o.style.height=`${t.height}px`,o.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==n||o.height!==r||o.width!==s)&&(t.currentDevicePixelRatio=n,o.height=r,o.width=s,t.ctx.setTransform(n,0,0,n,0,0),!0)}const wi=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){}return t}();function ki(t,e){const i=function(t,e){return gi(t).getPropertyValue(e)}(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Mi(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function Si(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function Pi(t,e,i,n){const r={x:t.cp2x,y:t.cp2y},s={x:e.cp1x,y:e.cp1y},o=Mi(t,r,i),a=Mi(r,s,i),l=Mi(s,e,i),h=Mi(o,a,i),c=Mi(a,l,i);return Mi(h,c,i)}function Ai(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function Di(t,e){let i,n;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}function Oi(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Ci(t){return"angle"===t?{between:Bt,compare:jt,normalize:Vt}:{between:Nt,compare:(t,e)=>t-e,normalize:t=>t}}function Ti({start:t,end:e,count:i,loop:n,style:r}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i==0,style:r}}function Ei(t,e,i){if(!i)return[t];const{property:n,start:r,end:s}=i,o=e.length,{compare:a,between:l,normalize:h}=Ci(n),{start:c,end:u,loop:f,style:d}=function(t,e,i){const{property:n,start:r,end:s}=i,{between:o,normalize:a}=Ci(n),l=e.length;let h,c,{start:u,end:f,loop:d}=t;if(d){for(u+=l,f+=l,h=0,c=l;h<c&&o(a(e[u%l][n]),r,s);++h)u--,f--;u%=l,f%=l}return f<u&&(f+=l),{start:u,end:f,loop:d,style:t.style}}(t,e,i),p=[];let g,m,b,_=!1,x=null;const v=()=>_||l(r,b,g)&&0!==a(r,b),y=()=>!_||0===a(s,g)||l(s,b,g);for(let w=c,k=c;w<=u;++w)m=e[w%o],m.skip||(g=h(m[n]),g!==b&&(_=l(g,r,s),null===x&&v()&&(x=0===a(g,r)?w:k),null!==x&&y()&&(p.push(Ti({start:x,end:w,loop:f,count:o,style:d})),x=null),k=w,b=g));return null!==x&&p.push(Ti({start:x,end:u,loop:f,count:o,style:d})),p}function Li(t,e){const i=[],n=t.segments;for(let r=0;r<n.length;r++){const s=Ei(n[r],t.points,e);s.length&&i.push(...s)}return i}function Ri(t,e,i,n){return n&&n.setContext&&i?function(t,e,i,n){const r=t._chart.getContext(),s=Ii(t.options),{_datasetIndex:o,options:{spanGaps:a}}=t,l=i.length,h=[];let c=s,u=e[0].start,f=u;function d(t,e,n,r){const s=a?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=s;for(;i[e%l].skip;)e+=s;t%l!=e%l&&(h.push({start:t%l,end:e%l,loop:n,style:r}),c=r,u=e%l)}}for(const p of e){u=a?u:p.start;let t,e=i[u%l];for(f=u+1;f<=p.end;f++){const s=i[f%l];t=Ii(n.setContext($e(r,{type:"segment",p0:e,p1:s,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:o}))),zi(t,c)&&d(u,f-1,p.loop,c),e=s,c=t}u<f-1&&d(u,f-1,p.loop,c)}return h}(t,e,i,n):e}function Ii(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function zi(t,e){return e&&JSON.stringify(t)!==JSON.stringify(e)}
/*!
* Chart.js v4.1.2
* https://www.chartjs.org
* (c) 2023 Chart.js Contributors
* Released under the MIT License
*/class Fi{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,n){const r=e.listeners[n],s=e.duration;r.forEach((n=>n({chart:t,initial:e.initial,numSteps:s,currentStep:Math.min(i-e.start,s)})))}_refresh(){this._request||(this._running=!0,this._request=Kt.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let e=0;this._charts.forEach(((i,n)=>{if(!i.running||!i.items.length)return;const r=i.items;let s,o=r.length-1,a=!1;for(;o>=0;--o)s=r[o],s._active?(s._total>i.duration&&(i.duration=s._total),s.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(n.draw(),this._notify(n,i,t,"progress")),r.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=r.length})),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce(((t,e)=>Math.max(t,e._duration)),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var ji=new Fi;const Vi="transparent",Bi={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const n=oe(t||Vi),r=n.valid&&oe(e||Vi);return r&&r.valid?r.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class Wi{constructor(t,e,i,n){const r=e[i];n=He([t.to,n,r,t.from]);const s=He([t.from,r,n]);this._active=!0,this._fn=t.fn||Bi[t.type||typeof s],this._easing=re[t.easing]||re.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=s,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],r=i-this._start,s=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=He([t.to,e,n,t.from]),this._from=He([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,r=this._from,s=this._loop,o=this._to;let a;if(this._active=r!==o&&(s||e<i),!this._active)return this._target[n]=o,void this._notify(!0);e<0?this._target[n]=r:(a=e/i%2,a=s&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[n]=this._fn(r,o,a))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,i)=>{t.push({res:e,rej:i})}))}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let n=0;n<i.length;n++)i[n][e]()}}class Ni{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!Q(t))return;const e=Object.keys(xe.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach((n=>{const r=t[n];if(!Q(r))return;const s={};for(const t of e)s[t]=r[t];(J(r.properties)&&r.properties||[n]).forEach((t=>{t!==n&&i.has(t)||i.set(t,s)}))}))}_animateOptions(t,e){const i=e.options,n=function(t,e){if(!e)return;let i=t.options;if(!i)return void(t.options=e);i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}}));return i}(t,i);if(!n)return[];const r=this._createAnimations(n,i);return i.$shared&&function(t,e){const i=[],n=Object.keys(e);for(let r=0;r<n.length;r++){const e=t[n[r]];e&&e.active()&&i.push(e.wait())}return Promise.all(i)}(t.options.$animations,i).then((()=>{t.options=i}),(()=>{})),r}_createAnimations(t,e){const i=this._properties,n=[],r=t.$animations||(t.$animations={}),s=Object.keys(e),o=Date.now();let a;for(a=s.length-1;a>=0;--a){const l=s[a];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}const h=e[l];let c=r[l];const u=i.get(l);if(c){if(u&&c.active()){c.update(u,h,o);continue}c.cancel()}u&&u.duration?(r[l]=c=new Wi(u,t,l,h),n.push(c)):t[l]=h}return n}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(ji.add(this._chart,i),!0):void 0}}function Hi(t,e){const i=t&&t.options||{},n=i.reverse,r=void 0===i.min?e:0,s=void 0===i.max?e:0;return{start:n?s:r,end:n?r:s}}function $i(t,e){const i=[],n=t._getSortedDatasetMetas(e);let r,s;for(r=0,s=n.length;r<s;++r)i.push(n[r].index);return i}function Ui(t,e,i,n={}){const r=t.keys,s="single"===n.mode;let o,a,l,h;if(null!==e){for(o=0,a=r.length;o<a;++o){if(l=+r[o],l===i){if(n.all)continue;break}h=t.values[l],tt(h)&&(s||0===e||Dt(e)===Dt(h))&&(e+=h)}return e}}function Yi(t,e){const i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function qi(t,e,i){const n=t[e]||(t[e]={});return n[i]||(n[i]={})}function Xi(t,e,i,n){for(const r of e.getMatchingVisibleMetas(n).reverse()){const e=t[r.index];if(i&&e>0||!i&&e<0)return r.index}return null}function Ki(t,e){const{chart:i,_cachedMeta:n}=t,r=i._stacks||(i._stacks={}),{iScale:s,vScale:o,index:a}=n,l=s.axis,h=o.axis,c=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(s,o,n),u=e.length;let f;for(let d=0;d<u;++d){const t=e[d],{[l]:i,[h]:s}=t;f=(t._stacks||(t._stacks={}))[h]=qi(r,c,i),f[a]=s,f._top=Xi(f,o,!0,n.type),f._bottom=Xi(f,o,!1,n.type);(f._visualValues||(f._visualValues={}))[a]=s}}function Zi(t,e){const i=t.scales;return Object.keys(i).filter((t=>i[t].axis===e)).shift()}function Gi(t,e){const i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[n]||void 0===e[n][i])return;delete e[n][i],void 0!==e[n]._visualValues&&void 0!==e[n]._visualValues[i]&&delete e[n]._visualValues[i]}}}const Ji=t=>"reset"===t||"none"===t,Qi=(t,e)=>e?t:Object.assign({},t);class tn{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,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=Yi(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&&Gi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,r=e.xAxisID=it(i.xAxisID,Zi(t,"x")),s=e.yAxisID=it(i.yAxisID,Zi(t,"y")),o=e.rAxisID=it(i.rAxisID,Zi(t,"r")),a=e.indexAxis,l=e.iAxisID=n(a,r,s,o),h=e.vAxisID=n(a,s,r,o);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(s),e.rScale=this.getScaleForId(o),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(h)}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 e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&qt(this._data,this),t._stacked&&Gi(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(Q(e))this._data=function(t){const e=Object.keys(t),i=new Array(e.length);let n,r,s;for(n=0,r=e.length;n<r;++n)s=e[n],i[n]={x:s,y:t[s]};return i}(e);else if(i!==e){if(i){qt(i,this);const t=this._cachedMeta;Gi(t),t._parsed=[]}e&&Object.isExtensible(e)&&(r=this,(n=e)._chartjs?n._chartjs.listeners.push(r):(Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[r]}}),Yt.forEach((t=>{const e="_onData"+gt(t),i=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...t){const r=i.apply(this,t);return n._chartjs.listeners.forEach((i=>{"function"==typeof i[e]&&i[e](...t)})),r}})})))),this._syncList=[],this._data=e}var n,r}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const r=e._stacked;e._stacked=Yi(e.vScale,e),e.stack!==i.stack&&(n=!0,Gi(e),e.stack=i.stack),this._resyncElements(t),(n||r!==e._stacked)&&Ki(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:r,_stacked:s}=i,o=r.axis;let a,l,h,c=0===t&&e===n.length||i._sorted,u=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=n,i._sorted=!0,h=n;else{h=J(n[t])?this.parseArrayData(i,n,t,e):Q(n[t])?this.parseObjectData(i,n,t,e):this.parsePrimitiveData(i,n,t,e);const r=()=>null===l[o]||u&&l[o]<u[o];for(a=0;a<e;++a)i._parsed[a+t]=l=h[a],c&&(r()&&(c=!1),u=l);i._sorted=c}s&&Ki(this,h)}parsePrimitiveData(t,e,i,n){const{iScale:r,vScale:s}=t,o=r.axis,a=s.axis,l=r.getLabels(),h=r===s,c=new Array(n);let u,f,d;for(u=0,f=n;u<f;++u)d=u+i,c[u]={[o]:h||r.parse(l[d],d),[a]:s.parse(e[d],d)};return c}parseArrayData(t,e,i,n){const{xScale:r,yScale:s}=t,o=new Array(n);let a,l,h,c;for(a=0,l=n;a<l;++a)h=a+i,c=e[h],o[a]={x:r.parse(c[0],h),y:s.parse(c[1],h)};return o}parseObjectData(t,e,i,n){const{xScale:r,yScale:s}=t,{xAxisKey:o="x",yAxisKey:a="y"}=this._parsing,l=new Array(n);let h,c,u,f;for(h=0,c=n;h<c;++h)u=h+i,f=e[u],l[h]={x:r.parse(pt(f,o),u),y:s.parse(pt(f,a),u)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const n=this.chart,r=this._cachedMeta,s=e[t.axis];return Ui({keys:$i(n,!0),values:e._stacks[t.axis]._visualValues},s,r.index,{mode:i})}updateRangeFromParsed(t,e,i,n){const r=i[e.axis];let s=null===r?NaN:r;const o=n&&i._stacks[e.axis];n&&o&&(n.values=o,s=Ui(n,r,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,e){const i=this._cachedMeta,n=i._parsed,r=i._sorted&&t===i.iScale,s=n.length,o=this._getOtherScale(t),a=((t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:$i(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:c}=function(t){const{min:e,max:i,minDefined:n,maxDefined:r}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:r?i:Number.POSITIVE_INFINITY}}(o);let u,f;function d(){f=n[u];const e=f[o.axis];return!tt(f[t.axis])||h>e||c<e}for(u=0;u<s&&(d()||(this.updateRangeFromParsed(l,t,f,a),!r));++u);if(r)for(u=s-1;u>=0;--u)if(!d()){this.updateRangeFromParsed(l,t,f,a);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,r,s;for(n=0,r=e.length;n<r;++n)s=e[n][t.axis],tt(s)&&i.push(s);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,n=e.vScale,r=this.getParsed(t);return{label:i?""+i.getLabelForValue(r[i.axis]):"",value:n?""+n.getLabelForValue(r[n.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=function(t){let e,i,n,r;return Q(t)?(e=t.top,i=t.right,n=t.bottom,r=t.left):e=i=n=r=t,{top:e,right:i,bottom:n,left:r,disabled:!1===t}}(it(this.options.clip,function(t,e,i){if(!1===i)return!1;const n=Hi(t,i),r=Hi(e,i);return{top:r.end,right:n.end,bottom:r.start,left:n.start}}(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,n=i.data||[],r=e.chartArea,s=[],o=this._drawStart||0,a=this._drawCount||n.length-o,l=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(t,r,o,a),h=o;h<o+a;++h){const e=n[h];e.hidden||(e.active&&l?s.push(e):e.draw(t,r))}for(h=0;h<s.length;++h)s[h].draw(t,r)}getStyle(t,e){const i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const n=this.getDataset();let r;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];r=e.$context||(e.$context=function(t,e,i){return $e(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}(this.getContext(),t,e)),r.parsed=this.getParsed(t),r.raw=n.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=function(t,e){return $e(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),r.dataset=n,r.index=r.datasetIndex=this.index;return r.active=!!e,r.mode=i,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const n="active"===e,r=this._cachedDataOpts,s=t+"-"+e,o=r[s],a=this.enableOptionSharing&&mt(i);if(o)return Qi(o,a);const l=this.chart.config,h=l.datasetElementScopeKeys(this._type,t),c=n?[`${t}Hover`,"hover",t,""]:[t,""],u=l.getOptionScopes(this.getDataset(),h),f=Object.keys(xe.elements[t]),d=l.resolveNamedOptions(u,f,(()=>this.getContext(i,n,e)),c);return d.$shared&&(d.$shared=a,r[s]=Object.freeze(Qi(d,a))),d}_resolveAnimations(t,e,i){const n=this.chart,r=this._cachedDataOpts,s=`animation-${e}`,o=r[s];if(o)return o;let a;if(!1!==n.options.animation){const n=this.chart.config,r=n.datasetAnimationScopeKeys(this._type,e),s=n.getOptionScopes(this.getDataset(),r);a=n.createResolver(s,this.getContext(t,i,e))}const l=new Ni(n,a&&a.animations);return a&&a._cacheable&&(r[s]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Ji(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,r=this.getSharedOptions(i),s=this.includeOptions(e,r)||r!==n;return this.updateSharedOptions(r,e,i),{sharedOptions:r,includeOptions:s}}updateElement(t,e,i,n){Ji(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!Ji(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const r=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,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 e=this._data,i=this._cachedMeta.data;for(const[o,a,l]of this._syncList)this[o](a,l);this._syncList=[];const n=i.length,r=e.length,s=Math.min(r,n);s&&this.parse(0,s),r>n?this._insertElements(n,r-n,t):r<n&&this._removeElements(r,n-r)}_insertElements(t,e,i=!0){const n=this._cachedMeta,r=n.data,s=t+e;let o;const a=t=>{for(t.length+=e,o=t.length-1;o>=s;o--)t[o]=t[o-e]};for(a(r),o=t;o<s;++o)r[o]=new this.dataElementType;this._parsing&&a(n._parsed),this.parse(t,e),i&&this.updateElements(r,t,e,"reset")}updateElements(t,e,i,n){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const n=i._parsed.splice(t,e);i._stacked&&Gi(i,n)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,n]=t;this[e](i,n)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function en(t){const e=t.iScale,i=function(t,e){if(!t._cache.$bar){const i=t.getMatchingVisibleMetas(e);let n=[];for(let e=0,r=i.length;e<r;e++)n=n.concat(i[e].controller.getAllParsedValues(t));t._cache.$bar=Xt(n.sort(((t,e)=>t-e)))}return t._cache.$bar}(e,t.type);let n,r,s,o,a=e._length;const l=()=>{32767!==s&&-32768!==s&&(mt(o)&&(a=Math.min(a,Math.abs(s-o)||a)),o=s)};for(n=0,r=i.length;n<r;++n)s=e.getPixelForValue(i[n]),l();for(o=void 0,n=0,r=e.ticks.length;n<r;++n)s=e.getPixelForTick(n),l();return a}function nn(t,e,i,n){return J(t)?function(t,e,i,n){const r=i.parse(t[0],n),s=i.parse(t[1],n),o=Math.min(r,s),a=Math.max(r,s);let l=o,h=a;Math.abs(o)>Math.abs(a)&&(l=a,h=o),e[i.axis]=h,e._custom={barStart:l,barEnd:h,start:r,end:s,min:o,max:a}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function rn(t,e,i,n){const r=t.iScale,s=t.vScale,o=r.getLabels(),a=r===s,l=[];let h,c,u,f;for(h=i,c=i+n;h<c;++h)f=e[h],u={},u[r.axis]=a||r.parse(o[h],h),l.push(nn(f,u,s,h));return l}function sn(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function on(t,e,i,n){let r=e.borderSkipped;const s={};if(!r)return void(t.borderSkipped=s);if(!0===r)return void(t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:o,end:a,reverse:l,top:h,bottom:c}=function(t){let e,i,n,r,s;return t.horizontal?(e=t.base>t.x,i="left",n="right"):(e=t.base<t.y,i="bottom",n="top"),e?(r="end",s="start"):(r="start",s="end"),{start:i,end:n,reverse:e,top:r,bottom:s}}(t);"middle"===r&&i&&(t.enableBorderRadius=!0,(i._top||0)===n?r=h:(i._bottom||0)===n?r=c:(s[an(c,o,a,l)]=!0,r=h)),s[an(r,o,a,l)]=!0,t.borderSkipped=s}function an(t,e,i,n){var r,s,o;return n?(o=i,t=ln(t=(r=t)===(s=e)?o:r===o?s:r,i,e)):t=ln(t,e,i),t}function ln(t,e,i){return"start"===t?e:"end"===t?i:t}function hn(t,{inflateAmount:e},i){t.inflateAmount="auto"===e?1===i?.33:0:e}t(tn,"defaults",{}),t(tn,"datasetElementType",null),t(tn,"dataElementType",null);class cn extends tn{parsePrimitiveData(t,e,i,n){return rn(t,e,i,n)}parseArrayData(t,e,i,n){return rn(t,e,i,n)}parseObjectData(t,e,i,n){const{iScale:r,vScale:s}=t,{xAxisKey:o="x",yAxisKey:a="y"}=this._parsing,l="x"===r.axis?o:a,h="x"===s.axis?o:a,c=[];let u,f,d,p;for(u=i,f=i+n;u<f;++u)p=e[u],d={},d[r.axis]=r.parse(pt(p,l),u),c.push(nn(pt(p,h),d,s,u));return c}updateRangeFromParsed(t,e,i,n){super.updateRangeFromParsed(t,e,i,n);const r=i._custom;r&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:n}=e,r=this.getParsed(t),s=r._custom,o=sn(s)?"["+s.start+", "+s.end+"]":""+n.getLabelForValue(r[n.axis]);return{label:""+i.getLabelForValue(r[i.axis]),value:o}}initialize(){this.enableOptionSharing=!0,super.initialize();this._cachedMeta.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,n){const r="reset"===n,{index:s,_cachedMeta:{vScale:o}}=this,a=o.getBasePixel(),l=o.isHorizontal(),h=this._getRuler(),{sharedOptions:c,includeOptions:u}=this._getSharedOptions(e,n);for(let f=e;f<e+i;f++){const e=this.getParsed(f),i=r||G(e[o.axis])?{base:a,head:a}:this._calculateBarValuePixels(f),d=this._calculateBarIndexPixels(f,h),p=(e._stacks||{})[o.axis],g={horizontal:l,base:i.base,enableBorderRadius:!p||sn(e._custom)||s===p._top||s===p._bottom,x:l?i.head:d.center,y:l?d.center:i.head,height:l?d.size:Math.abs(i.size),width:l?Math.abs(i.size):d.size};u&&(g.options=c||this.resolveDataElementOptions(f,t[f].active?"active":n));const m=g.options||t[f].options;on(g,m,p,s),hn(g,m,h.ratio),this.updateElement(t[f],f,g,n)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,n=i.getMatchingVisibleMetas(this._type).filter((t=>t.controller.options.grouped)),r=i.options.stacked,s=[],o=t=>{const i=t.controller.getParsed(e),n=i&&i[t.vScale.axis];if(G(n)||isNaN(n))return!0};for(const a of n)if((void 0===e||!o(a))&&((!1===r||-1===s.indexOf(a.stack)||void 0===r&&void 0===a.stack)&&s.push(a.stack),a.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const n=this._getStacks(t,i),r=void 0!==e?n.indexOf(e):-1;return-1===r?n.length-1:r}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,n=[];let r,s;for(r=0,s=e.data.length;r<s;++r)n.push(i.getPixelForValue(this.getParsed(r)[i.axis],r));const o=t.barThickness;return{min:o||en(e),pixels:n,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:o?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:n},options:{base:r,minBarLength:s}}=this,o=r||0,a=this.getParsed(t),l=a._custom,h=sn(l);let c,u,f=a[e.axis],d=0,p=i?this.applyStack(e,a,i):f;p!==f&&(d=p-f,p=f),h&&(f=l.barStart,p=l.barEnd-l.barStart,0!==f&&Dt(f)!==Dt(l.barEnd)&&(d=0),d+=f);const g=G(r)||h?d:r;let m=e.getPixelForValue(g);if(c=this.chart.getDataVisibility(t)?e.getPixelForValue(d+p):m,u=c-m,Math.abs(u)<s){u=function(t,e,i){return 0!==t?Dt(t):(e.isHorizontal()?1:-1)*(e.min>=i?1:-1)}(u,e,o)*s,f===o&&(m-=u/2);const t=e.getPixelForDecimal(0),r=e.getPixelForDecimal(1),l=Math.min(t,r),d=Math.max(t,r);m=Math.max(Math.min(m,d),l),c=m+u,i&&!h&&(a._stacks[e.axis]._visualValues[n]=e.getValueForPixel(c)-e.getValueForPixel(m))}if(m===e.getPixelForValue(o)){const t=Dt(u)*e.getLineWidthForValue(o)/2;m+=t,u-=t}return{size:u,base:m,head:c,center:c+u/2}}_calculateBarIndexPixels(t,e){const i=e.scale,n=this.options,r=n.skipNull,s=it(n.maxBarThickness,1/0);let o,a;if(e.grouped){const i=r?this._getStackCount(t):e.stackCount,l="flex"===n.barThickness?function(t,e,i,n){const r=e.pixels,s=r[t];let o=t>0?r[t-1]:null,a=t<r.length-1?r[t+1]:null;const l=i.categoryPercentage;null===o&&(o=s-(null===a?e.end-e.start:a-s)),null===a&&(a=s+s-o);const h=s-(s-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/n,ratio:i.barPercentage,start:h}}(t,e,n,i):function(t,e,i,n){const r=i.barThickness;let s,o;return G(r)?(s=e.min*i.categoryPercentage,o=i.barPercentage):(s=r*n,o=1),{chunk:s/n,ratio:o,start:e.pixels[t]-s/2}}(t,e,n,i),h=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0);o=l.start+l.chunk*h+l.chunk/2,a=Math.min(s,l.chunk*l.ratio)}else o=i.getPixelForValue(this.getParsed(t)[i.axis],t),a=Math.min(s,e.min*e.ratio);return{base:o-a/2,head:o+a/2,center:o,size:a}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,n=i.length;let r=0;for(;r<n;++r)null!==this.getParsed(r)[e.axis]&&i[r].draw(this._ctx)}}t(cn,"id","bar"),t(cn,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),t(cn,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class un extends tn{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,n){const r=super.parsePrimitiveData(t,e,i,n);for(let s=0;s<r.length;s++)r[s]._custom=this.resolveDataElementOptions(s+i).radius;return r}parseArrayData(t,e,i,n){const r=super.parseArrayData(t,e,i,n);for(let s=0;s<r.length;s++){const t=e[i+s];r[s]._custom=it(t[2],this.resolveDataElementOptions(s+i).radius)}return r}parseObjectData(t,e,i,n){const r=super.parseObjectData(t,e,i,n);for(let s=0;s<r.length;s++){const t=e[i+s];r[s]._custom=it(t&&t.r&&+t.r,this.resolveDataElementOptions(s+i).radius)}return r}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:n,yScale:r}=e,s=this.getParsed(t),o=n.getLabelForValue(s.x),a=r.getLabelForValue(s.y),l=s._custom;return{label:i[t]||"",value:"("+o+", "+a+(l?", "+l:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){const r="reset"===n,{iScale:s,vScale:o}=this._cachedMeta,{sharedOptions:a,includeOptions:l}=this._getSharedOptions(e,n),h=s.axis,c=o.axis;for(let u=e;u<e+i;u++){const e=t[u],i=!r&&this.getParsed(u),f={},d=f[h]=r?s.getPixelForDecimal(.5):s.getPixelForValue(i[h]),p=f[c]=r?o.getBasePixel():o.getPixelForValue(i[c]);f.skip=isNaN(d)||isNaN(p),l&&(f.options=a||this.resolveDataElementOptions(u,e.active?"active":n),r&&(f.options.radius=0)),this.updateElement(e,u,f,n)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let n=super.resolveDataElementOptions(t,e);n.$shared&&(n=Object.assign({},n,{$shared:!1}));const r=n.radius;return"active"!==e&&(n.radius=0),n.radius+=it(i&&i._custom,r),n}}t(un,"id","bubble"),t(un,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),t(un,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});class fn extends tn{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=i;else{let r,s,o=t=>+i[t];if(Q(i[t])){const{key:t="value"}=this._parsing;o=e=>+pt(i[e],t)}for(r=t,s=t+e;r<s;++r)n._parsed[r]=o(r)}}_getRotation(){return Lt(this.options.rotation-90)}_getCircumference(){return Lt(this.options.circumference)}_getRotationExtents(){let t=vt,e=-vt;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const n=this.chart.getDatasetMeta(i).controller,r=n._getRotation(),s=n._getCircumference();t=Math.min(t,r),e=Math.max(e,r+s)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,n=this._cachedMeta,r=n.data,s=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,o=Math.max((Math.min(i.width,i.height)-s)/2,0),a=Math.min((l=this.options.cutout,h=o,"string"==typeof l&&l.endsWith("%")?parseFloat(l)/100:+l/h),1);var l,h;const c=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:d,ratioY:p,offsetX:g,offsetY:m}=function(t,e,i){let n=1,r=1,s=0,o=0;if(e<vt){const a=t,l=a+e,h=Math.cos(a),c=Math.sin(a),u=Math.cos(l),f=Math.sin(l),d=(t,e,n)=>Bt(t,a,l,!0)?1:Math.max(e,e*i,n,n*i),p=(t,e,n)=>Bt(t,a,l,!0)?-1:Math.min(e,e*i,n,n*i),g=d(0,h,u),m=d(Mt,c,f),b=p(xt,h,u),_=p(xt+Mt,c,f);n=(g-b)/2,r=(m-_)/2,s=-(g+b)/2,o=-(m+_)/2}return{ratioX:n,ratioY:r,offsetX:s,offsetY:o}}(f,u,a),b=(i.width-s)/d,_=(i.height-s)/p,x=Math.max(Math.min(b,_)/2,0),v=nt(this.options.radius,x),y=(v-Math.max(v*a,0))/this._getVisibleDatasetWeightTotal();this.offsetX=g*v,this.offsetY=m*v,n.total=this.calculateTotal(),this.outerRadius=v-y*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-y*c,0),this.updateElements(r,0,r.length,t)}_circumference(t,e){const i=this.options,n=this._cachedMeta,r=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===n._parsed[t]||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*r/vt)}updateElements(t,e,i,n){const r="reset"===n,s=this.chart,o=s.chartArea,a=s.options.animation,l=(o.left+o.right)/2,h=(o.top+o.bottom)/2,c=r&&a.animateScale,u=c?0:this.innerRadius,f=c?0:this.outerRadius,{sharedOptions:d,includeOptions:p}=this._getSharedOptions(e,n);let g,m=this._getRotation();for(g=0;g<e;++g)m+=this._circumference(g,r);for(g=e;g<e+i;++g){const e=this._circumference(g,r),i=t[g],s={x:l+this.offsetX,y:h+this.offsetY,startAngle:m,endAngle:m+e,circumference:e,outerRadius:f,innerRadius:u};p&&(s.options=d||this.resolveDataElementOptions(g,i.active?"active":n)),m+=e,this.updateElement(i,g,s,n)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i,n=0;for(i=0;i<e.length;i++){const r=t._parsed[i];null===r||isNaN(r)||!this.chart.getDataVisibility(i)||e[i].hidden||(n+=Math.abs(r))}return n}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?vt*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],r=ue(e._parsed[t],i.options.locale);return{label:n[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const i=this.chart;let n,r,s,o,a;if(!t)for(n=0,r=i.data.datasets.length;n<r;++n)if(i.isDatasetVisible(n)){s=i.getDatasetMeta(n),t=s.data,o=s.controller;break}if(!t)return 0;for(n=0,r=t.length;n<r;++n)a=o.resolveDataElementOptions(n),"inner"!==a.borderAlign&&(e=Math.max(e,a.borderWidth||0,a.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,n=t.length;i<n;++i){const t=this.resolveDataElementOptions(i);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(it(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}t(fn,"id","doughnut"),t(fn,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),t(fn,"descriptors",{_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t}),t(fn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:n}}=t.legend.options;return e.labels.map(((e,r)=>{const s=t.getDatasetMeta(0).controller.getStyle(r);return{text:e,fillStyle:s.backgroundColor,strokeStyle:s.borderColor,fontColor:n,lineWidth:s.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(r),index:r}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class dn extends tn{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:n=[],_dataset:r}=e,s=this.chart._animationsDisabled;let{start:o,count:a}=Qt(e,n,s);this._drawStart=o,this._drawCount=a,te(e)&&(o=0,a=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=n;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!s,options:l},t),this.updateElements(n,o,a,t)}updateElements(t,e,i,n){const r="reset"===n,{iScale:s,vScale:o,_stacked:a,_dataset:l}=this._cachedMeta,{sharedOptions:h,includeOptions:c}=this._getSharedOptions(e,n),u=s.axis,f=o.axis,{spanGaps:d,segment:p}=this.options,g=Tt(d)?d:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||r||"none"===n,b=e+i,_=t.length;let x=e>0&&this.getParsed(e-1);for(let v=0;v<_;++v){const i=t[v],d=m?i:{};if(v<e||v>=b){d.skip=!0;continue}const _=this.getParsed(v),y=G(_[f]),w=d[u]=s.getPixelForValue(_[u],v),k=d[f]=r||y?o.getBasePixel():o.getPixelForValue(a?this.applyStack(o,_,a):_[f],v);d.skip=isNaN(w)||isNaN(k)||y,d.stop=v>0&&Math.abs(_[u]-x[u])>g,p&&(d.parsed=_,d.raw=l.data[v]),c&&(d.options=h||this.resolveDataElementOptions(v,i.active?"active":n)),m||this.updateElement(i,v,d,n),x=_}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const r=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,r,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}t(dn,"id","line"),t(dn,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),t(dn,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class pn extends tn{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],r=ue(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:r}}parseObjectData(t,e,i,n){return ri.bind(this)(t,e,i,n)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach(((t,i)=>{const n=this.getParsed(i).r;!isNaN(n)&&this.chart.getDataVisibility(i)&&(n<e.min&&(e.min=n),n>e.max&&(e.max=n))})),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(n/2,0),s=(r-Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=r-s*this.index,this.innerRadius=this.outerRadius-s}updateElements(t,e,i,n){const r="reset"===n,s=this.chart,o=s.options.animation,a=this._cachedMeta.rScale,l=a.xCenter,h=a.yCenter,c=a.getIndexAngle(0)-.5*xt;let u,f=c;const d=360/this.countVisibleElements();for(u=0;u<e;++u)f+=this._computeAngle(u,n,d);for(u=e;u<e+i;u++){const e=t[u];let i=f,p=f+this._computeAngle(u,n,d),g=s.getDataVisibility(u)?a.getDistanceFromCenterForValue(this.getParsed(u).r):0;f=p,r&&(o.animateScale&&(g=0),o.animateRotate&&(i=p=c));const m={x:l,y:h,innerRadius:0,outerRadius:g,startAngle:i,endAngle:p,options:this.resolveDataElementOptions(u,e.active?"active":n)};this.updateElement(e,u,m,n)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach(((t,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++})),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?Lt(this.resolveDataElementOptions(t,e).angle||i):0}}t(pn,"id","polarArea"),t(pn,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),t(pn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:n}}=t.legend.options;return e.labels.map(((e,r)=>{const s=t.getDatasetMeta(0).controller.getStyle(r);return{text:e,fillStyle:s.backgroundColor,strokeStyle:s.borderColor,fontColor:n,lineWidth:s.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(r),index:r}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class gn extends fn{}t(gn,"id","pie"),t(gn,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class mn extends tn{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,n){return ri.bind(this)(t,e,i,n)}update(t){const e=this._cachedMeta,i=e.dataset,n=e.data||[],r=e.iScale.getLabels();if(i.points=n,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const s={_loop:!0,_fullLoop:r.length===n.length,options:e};this.updateElement(i,void 0,s,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){const r=this._cachedMeta.rScale,s="reset"===n;for(let o=e;o<e+i;o++){const e=t[o],i=this.resolveDataElementOptions(o,e.active?"active":n),a=r.getPointPositionForValue(o,this.getParsed(o).r),l=s?r.xCenter:a.x,h=s?r.yCenter:a.y,c={x:l,y:h,angle:a.angle,skip:isNaN(l)||isNaN(h),options:i};this.updateElement(e,o,c,n)}}}t(mn,"id","radar"),t(mn,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),t(mn,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class bn extends tn{getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:n,yScale:r}=e,s=this.getParsed(t),o=n.getLabelForValue(s.x),a=r.getLabelForValue(s.y);return{label:i[t]||"",value:"("+o+", "+a+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,n=this.chart._animationsDisabled;let{start:r,count:s}=Qt(e,i,n);if(this._drawStart=r,this._drawCount=s,te(e)&&(r=0,s=i.length),this.options.showLine){const{dataset:r,_dataset:s}=e;r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!s._decimated,r.points=i;const o=this.resolveDatasetElementOptions(t);o.segment=this.options.segment,this.updateElement(r,void 0,{animated:!n,options:o},t)}this.updateElements(i,r,s,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,n){const r="reset"===n,{iScale:s,vScale:o,_stacked:a,_dataset:l}=this._cachedMeta,h=this.resolveDataElementOptions(e,n),c=this.getSharedOptions(h),u=this.includeOptions(n,c),f=s.axis,d=o.axis,{spanGaps:p,segment:g}=this.options,m=Tt(p)?p:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||r||"none"===n;let _=e>0&&this.getParsed(e-1);for(let x=e;x<e+i;++x){const e=t[x],i=this.getParsed(x),h=b?e:{},p=G(i[d]),v=h[f]=s.getPixelForValue(i[f],x),y=h[d]=r||p?o.getBasePixel():o.getPixelForValue(a?this.applyStack(o,i,a):i[d],x);h.skip=isNaN(v)||isNaN(y)||p,h.stop=x>0&&Math.abs(i[f]-_[f])>m,g&&(h.parsed=i,h.raw=l.data[x]),u&&(h.options=c||this.resolveDataElementOptions(x,e.active?"active":n)),b||this.updateElement(e,x,h,n),_=i}this.updateSharedOptions(c,n,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}const i=t.dataset,n=i.options&&i.options.borderWidth||0;if(!e.length)return n;const r=e[0].size(this.resolveDataElementOptions(0)),s=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(n,r,s)/2}}t(bn,"id","scatter"),t(bn,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),t(bn,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var _n=Object.freeze({__proto__:null,BarController:cn,BubbleController:un,DoughnutController:fn,LineController:dn,PolarAreaController:pn,PieController:gn,RadarController:mn,ScatterController:bn});function xn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class vn{static override(t){Object.assign(vn.prototype,t)}constructor(t){this.options=t||{}}init(){}formats(){return xn()}parse(){return xn()}format(){return xn()}add(){return xn()}diff(){return xn()}startOf(){return xn()}endOf(){return xn()}}var yn=vn;function wn(t,e,i,n){const{controller:r,data:s,_sorted:o}=t,a=r._cachedMeta.iScale;if(a&&e===a.axis&&"r"!==e&&o&&s.length){const t=a._reversePixels?Ut:$t;if(!n)return t(s,e,i);if(r._sharedOptions){const n=s[0],r="function"==typeof n.getRange&&n.getRange(e);if(r){const n=t(s,e,i-r),o=t(s,e,i+r);return{lo:n.lo,hi:o.hi}}}}return{lo:0,hi:s.length-1}}function kn(t,e,i,n,r){const s=t.getSortedVisibleDatasetMetas(),o=i[e];for(let a=0,l=s.length;a<l;++a){const{index:t,data:i}=s[a],{lo:l,hi:h}=wn(s[a],e,o,r);for(let e=l;e<=h;++e){const r=i[e];r.skip||n(r,t,e)}}}function Mn(t,e,i,n,r){const s=[];if(!r&&!t.isPointInArea(e))return s;return kn(t,i,e,(function(i,o,a){(r||Pe(i,t.chartArea,0))&&i.inRange(e.x,e.y,n)&&s.push({element:i,datasetIndex:o,index:a})}),!0),s}function Sn(t,e,i,n,r,s){let o=[];const a=function(t){const e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,n){const r=e?Math.abs(t.x-n.x):0,s=i?Math.abs(t.y-n.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(s,2))}}(i);let l=Number.POSITIVE_INFINITY;return kn(t,i,e,(function(i,h,c){const u=i.inRange(e.x,e.y,r);if(n&&!u)return;const f=i.getCenterPoint(r);if(!(!!s||t.isPointInArea(f))&&!u)return;const d=a(e,f);d<l?(o=[{element:i,datasetIndex:h,index:c}],l=d):d===l&&o.push({element:i,datasetIndex:h,index:c})})),o}function Pn(t,e,i,n,r,s){return s||t.isPointInArea(e)?"r"!==i||n?Sn(t,e,i,n,r,s):function(t,e,i,n){let r=[];return kn(t,i,e,(function(t,i,s){const{startAngle:o,endAngle:a}=t.getProps(["startAngle","endAngle"],n),{angle:l}=zt(t,{x:e.x,y:e.y});Bt(l,o,a)&&r.push({element:t,datasetIndex:i,index:s})})),r}(t,e,i,r):[]}function An(t,e,i,n,r){const s=[],o="x"===i?"inXRange":"inYRange";let a=!1;return kn(t,i,e,((t,n,l)=>{t[o](e[i],r)&&(s.push({element:t,datasetIndex:n,index:l}),a=a||t.inRange(e.x,e.y,r))})),n&&!a?[]:s}var Dn={evaluateInteractionItems:kn,modes:{index(t,e,i,n){const r=_i(e,t),s=i.axis||"x",o=i.includeInvisible||!1,a=i.intersect?Mn(t,r,s,n,o):Pn(t,r,s,!1,n,o),l=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=a[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})})),l):[]},dataset(t,e,i,n){const r=_i(e,t),s=i.axis||"xy",o=i.includeInvisible||!1;let a=i.intersect?Mn(t,r,s,n,o):Pn(t,r,s,!1,n,o);if(a.length>0){const e=a[0].datasetIndex,i=t.getDatasetMeta(e).data;a=[];for(let t=0;t<i.length;++t)a.push({element:i[t],datasetIndex:e,index:t})}return a},point:(t,e,i,n)=>Mn(t,_i(e,t),i.axis||"xy",n,i.includeInvisible||!1),nearest(t,e,i,n){const r=_i(e,t),s=i.axis||"xy",o=i.includeInvisible||!1;return Pn(t,r,s,i.intersect,n,o)},x:(t,e,i,n)=>An(t,_i(e,t),"x",i.intersect,n),y:(t,e,i,n)=>An(t,_i(e,t),"y",i.intersect,n)}};const On=["left","top","right","bottom"];function Cn(t,e){return t.filter((t=>t.pos===e))}function Tn(t,e){return t.filter((t=>-1===On.indexOf(t.pos)&&t.box.axis===e))}function En(t,e){return t.sort(((t,i)=>{const n=e?i:t,r=e?t:i;return n.weight===r.weight?n.index-r.index:n.weight-r.weight}))}function Ln(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:n,stackWeight:r}=i;if(!t||!On.includes(n))continue;const s=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=r}return e}(t),{vBoxMaxWidth:n,hBoxMaxHeight:r}=e;let s,o,a;for(s=0,o=t.length;s<o;++s){a=t[s];const{fullSize:o}=a.box,l=i[a.stack],h=l&&a.stackWeight/l.weight;a.horizontal?(a.width=h?h*n:o&&e.availableWidth,a.height=r):(a.width=n,a.height=h?h*r:o&&e.availableHeight)}return i}function Rn(t,e,i,n){return Math.max(t[i],e[i])+Math.max(t[n],e[n])}function In(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function zn(t,e,i,n){const{pos:r,box:s}=i,o=t.maxPadding;if(!Q(r)){i.size&&(t[r]-=i.size);const e=n[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?s.height:s.width),i.size=e.size/e.count,t[r]+=i.size}s.getPadding&&In(o,s.getPadding());const a=Math.max(0,e.outerWidth-Rn(o,t,"left","right")),l=Math.max(0,e.outerHeight-Rn(o,t,"top","bottom")),h=a!==t.w,c=l!==t.h;return t.w=a,t.h=l,i.horizontal?{same:h,other:c}:{same:c,other:h}}function Fn(t,e){const i=e.maxPadding;function n(t){const n={left:0,top:0,right:0,bottom:0};return t.forEach((t=>{n[t]=Math.max(e[t],i[t])})),n}return n(t?["left","right"]:["top","bottom"])}function jn(t,e,i,n){const r=[];let s,o,a,l,h,c;for(s=0,o=t.length,h=0;s<o;++s){a=t[s],l=a.box,l.update(a.width||e.w,a.height||e.h,Fn(a.horizontal,e));const{same:o,other:u}=zn(e,i,a,n);h|=o&&r.length,c=c||u,l.fullSize||r.push(a)}return h&&jn(r,e,i,n)||c}function Vn(t,e,i,n,r){t.top=i,t.left=e,t.right=e+n,t.bottom=i+r,t.width=n,t.height=r}function Bn(t,e,i,n){const r=i.padding;let{x:s,y:o}=e;for(const a of t){const t=a.box,l=n[a.stack]||{count:1,placed:0,weight:1},h=a.stackWeight/l.weight||1;if(a.horizontal){const n=e.w*h,s=l.size||t.height;mt(l.start)&&(o=l.start),t.fullSize?Vn(t,r.left,o,i.outerWidth-r.right-r.left,s):Vn(t,e.left+l.placed,o,n,s),l.start=o,l.placed+=n,o=t.bottom}else{const n=e.h*h,o=l.size||t.width;mt(l.start)&&(s=l.start),t.fullSize?Vn(t,s,r.top,o,i.outerHeight-r.bottom-r.top):Vn(t,s,e.top+l.placed,o,n),l.start=s,l.placed+=n,s=t.right}}e.x=s,e.y=o}var Wn={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){const i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,n){if(!t)return;const r=We(t.options.layout.padding),s=Math.max(e-r.width,0),o=Math.max(i-r.height,0),a=function(t){const e=function(t){const e=[];let i,n,r,s,o,a;for(i=0,n=(t||[]).length;i<n;++i)r=t[i],({position:s,options:{stack:o,stackWeight:a=1}}=r),e.push({index:i,box:r,pos:s,horizontal:r.isHorizontal(),weight:r.weight,stack:o&&s+o,stackWeight:a});return e}(t),i=En(e.filter((t=>t.box.fullSize)),!0),n=En(Cn(e,"left"),!0),r=En(Cn(e,"right")),s=En(Cn(e,"top"),!0),o=En(Cn(e,"bottom")),a=Tn(e,"x"),l=Tn(e,"y");return{fullSize:i,leftAndTop:n.concat(s),rightAndBottom:r.concat(l).concat(o).concat(a),chartArea:Cn(e,"chartArea"),vertical:n.concat(r).concat(l),horizontal:s.concat(o).concat(a)}}(t.boxes),l=a.vertical,h=a.horizontal;st(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}));const c=l.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,u=Object.freeze({outerWidth:e,outerHeight:i,padding:r,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/c,hBoxMaxHeight:o/2}),f=Object.assign({},r);In(f,We(n));const d=Object.assign({maxPadding:f,w:s,h:o,x:r.left,y:r.top},r),p=Ln(l.concat(h),u);jn(a.fullSize,d,u,p),jn(l,d,u,p),jn(h,d,u,p)&&jn(l,d,u,p),function(t){const e=t.maxPadding;function i(i){const n=Math.max(e[i]-t[i],0);return t[i]+=n,n}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(d),Bn(a.leftAndTop,d,u,p),d.x+=d.w,d.y+=d.h,Bn(a.rightAndBottom,d,u,p),t.chartArea={left:d.left,top:d.top,right:d.left+d.w,bottom:d.top+d.h,height:d.h,width:d.w},st(a.chartArea,(e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(d.w,d.h,{left:0,top:0,right:0,bottom:0})}))}};class Nn{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class Hn extends Nn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const $n="$chartjs",Un={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Yn=t=>null===t||""===t;const qn=!!wi&&{passive:!0};function Xn(t,e,i){t.canvas.removeEventListener(e,i,qn)}function Kn(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function Zn(t,e,i){const n=t.canvas,r=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||Kn(i.addedNodes,n),e=e&&!Kn(i.removedNodes,n);e&&i()}));return r.observe(document,{childList:!0,subtree:!0}),r}function Gn(t,e,i){const n=t.canvas,r=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||Kn(i.removedNodes,n),e=e&&!Kn(i.addedNodes,n);e&&i()}));return r.observe(document,{childList:!0,subtree:!0}),r}const Jn=new Map;let Qn=0;function tr(){const t=window.devicePixelRatio;t!==Qn&&(Qn=t,Jn.forEach(((e,i)=>{i.currentDevicePixelRatio!==t&&e()})))}function er(t,e,i){const n=t.canvas,r=n&&di(n);if(!r)return;const s=Zt(((t,e)=>{const n=r.clientWidth;i(t,e),n<r.clientWidth&&i()}),window),o=new ResizeObserver((t=>{const e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||s(i,n)}));return o.observe(r),function(t,e){Jn.size||window.addEventListener("resize",tr),Jn.set(t,e)}(t,s),o}function ir(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){Jn.delete(t),Jn.size||window.removeEventListener("resize",tr)}(t)}function nr(t,e,i){const n=t.canvas,r=Zt((e=>{null!==t.ctx&&i(function(t,e){const i=Un[t.type]||t.type,{x:n,y:r}=_i(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==r?r:null}}(e,t))}),t);return function(t,e,i){t.addEventListener(e,i,qn)}(n,e,r),r}class rr extends Nn{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,n=t.getAttribute("height"),r=t.getAttribute("width");if(t[$n]={initial:{height:n,width:r,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",Yn(r)){const e=ki(t,"width");void 0!==e&&(t.width=e)}if(Yn(n))if(""===t.style.height)t.height=t.width/(e||2);else{const e=ki(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[$n])return!1;const i=e[$n].initial;["height","width"].forEach((t=>{const n=i[t];G(n)?e.removeAttribute(t):e.setAttribute(t,n)}));const n=i.style||{};return Object.keys(n).forEach((t=>{e.style[t]=n[t]})),e.width=e.width,delete e[$n],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),r={attach:Zn,detach:Gn,resize:er}[e]||nr;n[e]=r(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];if(!n)return;({attach:ir,detach:ir,resize:ir}[e]||Xn)(t,e,n),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return vi(t,e,i,n)}isAttached(t){const e=di(t);return!(!e||!e.isConnected)}}class sr{constructor(){t(this,"active",!1)}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Tt(this.x)&&Tt(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach((t=>{n[t]=i[t]&&i[t].active()?i[t]._to:this[t]})),n}}function or(t,e){const i=t.options.ticks,n=function(t){const e=t.options.offset,i=t._tickSize(),n=t._length/i+(e?0:1),r=t._maxLength/i;return Math.floor(Math.min(n,r))}(t),r=Math.min(i.maxTicksLimit||n,n),s=i.major.enabled?function(t){const e=[];let i,n;for(i=0,n=t.length;i<n;i++)t[i].major&&e.push(i);return e}(e):[],o=s.length,a=s[0],l=s[o-1],h=[];if(o>r)return function(t,e,i,n){let r,s=0,o=i[0];for(n=Math.ceil(n),r=0;r<t.length;r++)r===o&&(e.push(t[r]),s++,o=i[s*n])}(e,h,s,o/r),h;const c=function(t,e,i){const n=function(t){const e=t.length;let i,n;if(e<2)return!1;for(n=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==n)return!1;return n}(t),r=e.length/i;if(!n)return Math.max(r,1);const s=function(t){const e=[],i=Math.sqrt(t);let n;for(n=1;n<i;n++)t%n==0&&(e.push(n),e.push(t/n));return i===(0|i)&&e.push(i),e.sort(((t,e)=>t-e)).pop(),e}(n);for(let o=0,a=s.length-1;o<a;o++){const t=s[o];if(t>r)return t}return Math.max(r,1)}(s,e,r);if(o>0){let t,i;const n=o>1?Math.round((l-a)/(o-1)):null;for(ar(e,h,c,G(n)?0:a-n,a),t=0,i=o-1;t<i;t++)ar(e,h,c,s[t],s[t+1]);return ar(e,h,c,l,G(n)?e.length:l+n),h}return ar(e,h,c),h}function ar(t,e,i,n,r){const s=it(n,0),o=Math.min(it(r,t.length),t.length);let a,l,h,c=0;for(i=Math.ceil(i),r&&(a=r-n,i=a/Math.floor(a/i)),h=s;h<0;)c++,h=Math.round(s+c*i);for(l=Math.max(s,0);l<o;l++)l===h&&(e.push(t[l]),c++,h=Math.round(s+c*i))}t(sr,"defaults",{}),t(sr,"defaultRoutes",void 0);const lr=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function hr(t,e){const i=[],n=t.length/e,r=t.length;let s=0;for(;s<r;s+=n)i.push(t[Math.floor(s)]);return i}function cr(t,e,i){const n=t.ticks.length,r=Math.min(e,n-1),s=t._startPixel,o=t._endPixel,a=1e-6;let l,h=t.getPixelForTick(r);if(!(i&&(l=1===n?Math.max(h-s,o-h):0===e?(t.getPixelForTick(1)-h)/2:(h-t.getPixelForTick(r-1))/2,h+=r<e?l:-l,h<s-a||h>o+a)))return h}function ur(t){return t.drawTicks?t.tickLength:0}function fr(t,e){if(!t.display)return 0;const i=Ne(t.font,e),n=We(t.padding);return(J(t.text)?t.text.length:1)*i.lineHeight+n.height}function dr(t,e,i){let n=Gt(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class pr extends sr{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=et(t,Number.POSITIVE_INFINITY),e=et(e,Number.NEGATIVE_INFINITY),i=et(i,Number.POSITIVE_INFINITY),n=et(n,Number.NEGATIVE_INFINITY),{min:et(t,i),max:et(e,n),minDefined:tt(t),maxDefined:tt(e)}}getMinMax(t){let e,{min:i,max:n,minDefined:r,maxDefined:s}=this.getUserBounds();if(r&&s)return{min:i,max:n};const o=this.getMatchingVisibleMetas();for(let a=0,l=o.length;a<l;++a)e=o[a].controller.getMinMax(this,t),r||(i=Math.min(i,e.min)),s||(n=Math.max(n,e.max));return i=s&&i>n?n:i,n=r&&i>n?i:n,{min:et(i,et(n,i)),max:et(n,et(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){rt(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:r,ticks:s}=this.options,o=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,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=function(t,e,i){const{min:n,max:r}=t,s=nt(e,(r-n)/2),o=(t,e)=>i&&0===t?0:t+e;return{min:o(n,-Math.abs(s)),max:o(r,s)}}(this,r,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=o<this.ticks.length;this._convertTicksToLabels(a?hr(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||"auto"===s.source)&&(this.ticks=or(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),a&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,i=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,i=!i),this._startPixel=t,this._endPixel=e,this._reversePixels=i,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){rt(this.options.afterUpdate,[this])}beforeSetDimensions(){rt(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){rt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),rt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){rt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,n,r;for(i=0,n=t.length;i<n;i++)r=t[i],r.label=rt(e.callback,[r.value,i,t],this)}afterTickToLabelConversion(){rt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){rt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=this.ticks.length,n=e.minRotation||0,r=e.maxRotation;let s,o,a,l=n;if(!this._isVisible()||!e.display||n>=r||i<=1||!this.isHorizontal())return void(this.labelRotation=n);const h=this._getLabelSizes(),c=h.widest.width,u=h.highest.height,f=Wt(this.chart.width-c,0,this.maxWidth);s=t.offset?this.maxWidth/i:f/(i-1),c+6>s&&(s=f/(i-(t.offset?.5:1)),o=this.maxHeight-ur(t.grid)-e.padding-fr(t.title,this.chart.options.font),a=Math.sqrt(c*c+u*u),l=Rt(Math.min(Math.asin(Wt((h.highest.height+6)/s,-1,1)),Math.asin(Wt(o/a,-1,1))-Math.asin(Wt(u/a,-1,1)))),l=Math.max(n,Math.min(r,l))),this.labelRotation=l}afterCalculateLabelRotation(){rt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){rt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:r}}=this,s=this._isVisible(),o=this.isHorizontal();if(s){const s=fr(n,e.options.font);if(o?(t.width=this.maxWidth,t.height=ur(r)+s):(t.height=this.maxHeight,t.width=ur(r)+s),i.display&&this.ticks.length){const{first:e,last:n,widest:r,highest:s}=this._getLabelSizes(),a=2*i.padding,l=Lt(this.labelRotation),h=Math.cos(l),c=Math.sin(l);if(o){const e=i.mirror?0:c*r.width+h*s.height;t.height=Math.min(this.maxHeight,t.height+e+a)}else{const e=i.mirror?0:h*r.width+c*s.height;t.width=Math.min(this.maxWidth,t.width+e+a)}this._calculatePadding(e,n,c,h)}}this._handleMargins(),o?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){const{ticks:{align:r,padding:s},position:o}=this.options,a=0!==this.labelRotation,l="top"!==o&&"x"===this.axis;if(this.isHorizontal()){const o=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,u=0;a?l?(c=n*t.width,u=i*e.height):(c=i*t.height,u=n*e.width):"start"===r?u=e.width:"end"===r?c=t.width:"inner"!==r&&(c=t.width/2,u=e.width/2),this.paddingLeft=Math.max((c-o+s)*this.width/(this.width-o),0),this.paddingRight=Math.max((u-h+s)*this.width/(this.width-h),0)}else{let i=e.height/2,n=t.height/2;"start"===r?(i=0,n=t.height):"end"===r&&(i=e.height,n=0),this.paddingTop=i+s,this.paddingBottom=n+s}}_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(){rt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e<i;e++)G(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=hr(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length)}return t}_computeLabelSizes(t,e){const{ctx:i,_longestTextCache:n}=this,r=[],s=[];let o,a,l,h,c,u,f,d,p,g,m,b=0,_=0;for(o=0;o<e;++o){if(h=t[o].label,c=this._resolveTickFontOptions(o),i.font=u=c.string,f=n[u]=n[u]||{data:{},gc:[]},d=c.lineHeight,p=g=0,G(h)||J(h)){if(J(h))for(a=0,l=h.length;a<l;++a)m=h[a],G(m)||J(m)||(p=ve(i,f.data,f.gc,p,m),g+=d)}else p=ve(i,f.data,f.gc,p,h),g=d;r.push(p),s.push(g),b=Math.max(p,b),_=Math.max(g,_)}!function(t,e){st(t,(t=>{const i=t.gc,n=i.length/2;let r;if(n>e){for(r=0;r<n;++r)delete t.data[i[r]];i.splice(0,n)}}))}(n,e);const x=r.indexOf(b),v=s.indexOf(_),y=t=>({width:r[t]||0,height:s[t]||0});return{first:y(0),last:y(e-1),widest:y(x),highest:y(v),widths:r,heights:s}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Wt(this._alignToPixels?we(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=function(t,e,i){return $e(t,{tick:i,index:e,type:"tick"})}(this.getContext(),t,i))}return this.$context||(this.$context=$e(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){const t=this.options.ticks,e=Lt(this.labelRotation),i=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),r=this._getLabelSizes(),s=t.autoSkipPadding||0,o=r?r.widest.width+s:0,a=r?r.highest.height+s:0;return this.isHorizontal()?a*i>o*n?o/i:a/n:a*n<o*i?a/i:o/n}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:r,position:s,border:o}=n,a=r.offset,l=this.isHorizontal(),h=this.ticks.length+(a?1:0),c=ur(r),u=[],f=o.setContext(this.getContext()),d=f.display?f.width:0,p=d/2,g=function(t){return we(i,t,d)};let m,b,_,x,v,y,w,k,M,S,P,A;if("top"===s)m=g(this.bottom),y=this.bottom-c,k=m-p,S=g(t.top)+p,A=t.bottom;else if("bottom"===s)m=g(this.top),S=t.top,A=g(t.bottom)-p,y=m+p,k=this.top+c;else if("left"===s)m=g(this.right),v=this.right-c,w=m-p,M=g(t.left)+p,P=t.right;else if("right"===s)m=g(this.left),M=t.left,P=g(t.right)-p,v=m+p,w=this.left+c;else if("x"===e){if("center"===s)m=g((t.top+t.bottom)/2+.5);else if(Q(s)){const t=Object.keys(s)[0],e=s[t];m=g(this.chart.scales[t].getPixelForValue(e))}S=t.top,A=t.bottom,y=m+p,k=y+c}else if("y"===e){if("center"===s)m=g((t.left+t.right)/2);else if(Q(s)){const t=Object.keys(s)[0],e=s[t];m=g(this.chart.scales[t].getPixelForValue(e))}v=m-p,w=v-c,M=t.left,P=t.right}const D=it(n.ticks.maxTicksLimit,h),O=Math.max(1,Math.ceil(h/D));for(b=0;b<h;b+=O){const t=this.getContext(b),e=r.setContext(t),n=o.setContext(t),s=e.lineWidth,h=e.color,c=n.dash||[],f=n.dashOffset,d=e.tickWidth,p=e.tickColor,g=e.tickBorderDash||[],m=e.tickBorderDashOffset;_=cr(this,b,a),void 0!==_&&(x=we(i,_,s),l?v=w=M=P=x:y=k=S=A=x,u.push({tx1:v,ty1:y,tx2:w,ty2:k,x1:M,y1:S,x2:P,y2:A,width:s,color:h,borderDash:c,borderDashOffset:f,tickWidth:d,tickColor:p,tickBorderDash:g,tickBorderDashOffset:m}))}return this._ticksLength=h,this._borderValue=m,u}_computeLabelItems(t){const e=this.axis,i=this.options,{position:n,ticks:r}=i,s=this.isHorizontal(),o=this.ticks,{align:a,crossAlign:l,padding:h,mirror:c}=r,u=ur(i.grid),f=u+h,d=c?-h:f,p=-Lt(this.labelRotation),g=[];let m,b,_,x,v,y,w,k,M,S,P,A,D="middle";if("top"===n)y=this.bottom-d,w=this._getXAxisLabelAlignment();else if("bottom"===n)y=this.top+d,w=this._getXAxisLabelAlignment();else if("left"===n){const t=this._getYAxisLabelAlignment(u);w=t.textAlign,v=t.x}else if("right"===n){const t=this._getYAxisLabelAlignment(u);w=t.textAlign,v=t.x}else if("x"===e){if("center"===n)y=(t.top+t.bottom)/2+f;else if(Q(n)){const t=Object.keys(n)[0],e=n[t];y=this.chart.scales[t].getPixelForValue(e)+f}w=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===n)v=(t.left+t.right)/2-f;else if(Q(n)){const t=Object.keys(n)[0],e=n[t];v=this.chart.scales[t].getPixelForValue(e)}w=this._getYAxisLabelAlignment(u).textAlign}"y"===e&&("start"===a?D="top":"end"===a&&(D="bottom"));const O=this._getLabelSizes();for(m=0,b=o.length;m<b;++m){_=o[m],x=_.label;const t=r.setContext(this.getContext(m));k=this.getPixelForTick(m)+r.labelOffset,M=this._resolveTickFontOptions(m),S=M.lineHeight,P=J(x)?x.length:1;const e=P/2,i=t.color,a=t.textStrokeColor,h=t.textStrokeWidth;let u,f=w;if(s?(v=k,"inner"===w&&(f=m===b-1?this.options.reverse?"left":"right":0===m?this.options.reverse?"right":"left":"center"),A="top"===n?"near"===l||0!==p?-P*S+S/2:"center"===l?-O.highest.height/2-e*S+S:-O.highest.height+S/2:"near"===l||0!==p?S/2:"center"===l?O.highest.height/2-e*S:O.highest.height-P*S,c&&(A*=-1),0===p||t.showLabelBackdrop||(v+=S/2*Math.sin(p))):(y=k,A=(1-P)*S/2),t.showLabelBackdrop){const e=We(t.backdropPadding),i=O.heights[m],n=O.widths[m];let r=A-e.top,s=0-e.left;switch(D){case"middle":r-=i/2;break;case"bottom":r-=i}switch(w){case"center":s-=n/2;break;case"right":s-=n}u={left:s,top:r,width:n+e.width,height:i+e.height,color:t.backdropColor}}g.push({label:x,font:M,textOffset:A,options:{rotation:p,color:i,strokeColor:a,strokeWidth:h,textAlign:f,textBaseline:D,translation:[v,y],backdrop:u}})}return g}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Lt(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:n,padding:r}}=this.options,s=t+r,o=this._getLabelSizes().widest.width;let a,l;return"left"===e?n?(l=this.right+r,"near"===i?a="left":"center"===i?(a="center",l+=o/2):(a="right",l+=o)):(l=this.right-s,"near"===i?a="right":"center"===i?(a="center",l-=o/2):(a="left",l=this.left)):"right"===e?n?(l=this.left+r,"near"===i?a="right":"center"===i?(a="center",l-=o/2):(a="left",l-=o)):(l=this.left+s,"near"===i?a="left":"center"===i?(a="center",l+=o/2):(a="right",l=this.right)):a="right",{textAlign:a,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:n,width:r,height:s}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,n,r,s),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex((e=>e.value===t));if(i>=0){return e.setContext(this.getContext(i)).lineWidth}return 0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,s;const o=(t,e,n)=>{n.width&&n.color&&(i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.setLineDash(n.borderDash||[]),i.lineDashOffset=n.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(r=0,s=n.length;r<s;++r){const t=n[r];e.drawOnChartArea&&o({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.drawTicks&&o({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:n}}=this,r=i.setContext(this.getContext()),s=i.display?r.width:0;if(!s)return;const o=n.setContext(this.getContext(0)).lineWidth,a=this._borderValue;let l,h,c,u;this.isHorizontal()?(l=we(t,this.left,s)-s/2,h=we(t,this.right,o)+o/2,c=u=a):(c=we(t,this.top,s)-s/2,u=we(t,this.bottom,o)+o/2,l=h=a),e.save(),e.lineWidth=r.width,e.strokeStyle=r.color,e.beginPath(),e.moveTo(l,c),e.lineTo(h,u),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const e=this.ctx,i=this._computeLabelArea();i&&Ae(e,i);const n=this.getLabelItems(t);for(const r of n){const t=r.options,i=r.font;Te(e,r.label,0,r.textOffset,i,t)}i&&De(e)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:n}}=this;if(!i.display)return;const r=Ne(i.font),s=We(i.padding),o=i.align;let a=r.lineHeight/2;"bottom"===e||"center"===e||Q(e)?(a+=s.bottom,J(i.text)&&(a+=r.lineHeight*(i.text.length-1))):a+=s.top;const{titleX:l,titleY:h,maxWidth:c,rotation:u}=function(t,e,i,n){const{top:r,left:s,bottom:o,right:a,chart:l}=t,{chartArea:h,scales:c}=l;let u,f,d,p=0;const g=o-r,m=a-s;if(t.isHorizontal()){if(f=Jt(n,s,a),Q(i)){const t=Object.keys(i)[0],n=i[t];d=c[t].getPixelForValue(n)+g-e}else d="center"===i?(h.bottom+h.top)/2+g-e:lr(t,i,e);u=a-s}else{if(Q(i)){const t=Object.keys(i)[0],n=i[t];f=c[t].getPixelForValue(n)-m+e}else f="center"===i?(h.left+h.right)/2-m+e:lr(t,i,e);d=Jt(n,o,r),p="left"===i?-Mt:Mt}return{titleX:f,titleY:d,maxWidth:u,rotation:p}}(this,a,e,o);Te(t,i.text,0,0,r,{color:i.color,maxWidth:c,rotation:u,textAlign:dr(o,e,n),textBaseline:"middle",translation:[l,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=it(t.grid&&t.grid.z,-1),n=it(t.border&&t.border.z,0);return this._isVisible()&&this.draw===pr.prototype.draw?[{z:i,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let r,s;for(r=0,s=e.length;r<s;++r){const s=e[r];s[i]!==this.id||t&&s.type!==t||n.push(s)}return n}_resolveTickFontOptions(t){return Ne(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class gr{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;(function(t){return"id"in t&&"defaults"in t})(e)&&(i=this.register(e));const n=this.items,r=t.id,s=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in n||(n[r]=t,function(t,e,i){const n=ct(Object.create(null),[i?xe.get(i):{},xe.get(e),t.defaults]);xe.set(e,n),t.defaultRoutes&&function(t,e){Object.keys(e).forEach((i=>{const n=i.split("."),r=n.pop(),s=[t].concat(n).join("."),o=e[i].split("."),a=o.pop(),l=o.join(".");xe.route(s,r,l,a)}))}(e,t.defaultRoutes);t.descriptors&&xe.describe(e,t.descriptors)}(t,s,i),this.override&&xe.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in xe[n]&&(delete xe[n][i],this.override&&delete pe[i])}}class mr{constructor(){this.controllers=new gr(tn,"datasets",!0),this.elements=new gr(sr,"elements"),this.plugins=new gr(Object,"plugins"),this.scales=new gr(pr,"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,e,i){[...e].forEach((e=>{const n=i||this._getRegistryForType(e);i||n.isForType(e)||n===this.plugins&&e.id?this._exec(t,n,e):st(e,(e=>{const n=i||this._getRegistryForType(e);this._exec(t,n,e)}))}))}_exec(t,e,i){const n=gt(t);rt(i["before"+n],[],i),e[t](i),rt(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const n=e.get(t);if(void 0===n)throw new Error('"'+t+'" is not a registered '+i+".");return n}}var br=new mr;class _r{constructor(){this._init=[]}notify(t,e,i,n){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const r=n?this._descriptors(t).filter(n):this._descriptors(t),s=this._notify(r,t,e,i);return"afterDestroy"===e&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),s}_notify(t,e,i,n){n=n||{};for(const r of t){const t=r.plugin;if(!1===rt(t[i],[e,n,r.options],t)&&n.cancelable)return!1}return!0}invalidate(){G(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,n=it(i.options&&i.options.plugins,{}),r=function(t){const e={},i=[],n=Object.keys(br.plugins.items);for(let s=0;s<n.length;s++)i.push(br.getPlugin(n[s]));const r=t.plugins||[];for(let s=0;s<r.length;s++){const t=r[s];-1===i.indexOf(t)&&(i.push(t),e[t.id]=!0)}return{plugins:i,localIds:e}}(i);return!1!==n||e?function(t,{plugins:e,localIds:i},n,r){const s=[],o=t.getContext();for(const a of e){const e=a.id,l=xr(n[e],r);null!==l&&s.push({plugin:a,options:vr(t.config,{plugin:a,local:i[e]},l,o)})}return s}(t,r,n,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,n=(t,e)=>t.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function xr(t,e){return e||!1!==t?!0===t?{}:t:null}function vr(t,{plugin:e,local:i},n,r){const s=t.pluginScopeKeys(e),o=t.getOptionScopes(n,s);return i&&e.defaults&&o.push(e.defaults),t.createResolver(o,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function yr(t,e){const i=xe.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function wr(t,e){if("x"===t||"y"===t||"r"===t)return t;var i;if(t=e.axis||("top"===(i=e.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.length>1&&wr(t[0].toLowerCase(),e))return t;throw new Error(`Cannot determine type of '${name}' axis. Please provide 'axis' or 'position' option.`)}function kr(t){const e=t.options||(t.options={});e.plugins=it(e.plugins,{}),e.scales=function(t,e){const i=pe[t.type]||{scales:{}},n=e.scales||{},r=yr(t.type,e),s=Object.create(null);return Object.keys(n).forEach((t=>{const e=n[t];if(!Q(e))return console.error(`Invalid scale configuration for scale: ${t}`);if(e._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);const o=wr(t,e),a=function(t,e){return t===e?"_index_":"_value_"}(o,r),l=i.scales||{};s[t]=ut(Object.create(null),[{axis:o},e,l[o],l[a]])})),t.data.datasets.forEach((i=>{const r=i.type||t.type,o=i.indexAxis||yr(r,e),a=(pe[r]||{}).scales||{};Object.keys(a).forEach((t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,o),r=i[e+"AxisID"]||e;s[r]=s[r]||Object.create(null),ut(s[r],[{axis:e},n[r],a[t]])}))})),Object.keys(s).forEach((t=>{const e=s[t];ut(e,[xe.scales[e.type],xe.scale])})),s}(t,e)}function Mr(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Sr=new Map,Pr=new Set;function Ar(t,e){let i=Sr.get(t);return i||(i=e(),Sr.set(t,i),Pr.add(i)),i}const Dr=(t,e,i)=>{const n=pt(e,i);void 0!==n&&t.add(n)};class Or{constructor(t){this._config=function(t){return(t=t||{}).data=Mr(t.data),kr(t),t}(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=Mr(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(),kr(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Ar(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return Ar(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return Ar(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return Ar(`${this.type}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return n&&!e||(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:r}=this,s=this._cachedScopes(t,i),o=s.get(e);if(o)return o;const a=new Set;e.forEach((e=>{t&&(a.add(t),e.forEach((e=>Dr(a,t,e)))),e.forEach((t=>Dr(a,n,t))),e.forEach((t=>Dr(a,pe[r]||{},t))),e.forEach((t=>Dr(a,xe,t))),e.forEach((t=>Dr(a,ge,t)))}));const l=Array.from(a);return 0===l.length&&l.push(Object.create(null)),Pr.has(e)&&s.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,pe[e]||{},xe.datasets[e]||{},{type:e},xe,ge]}resolveNamedOptions(t,e,i,n=[""]){const r={$shared:!0},{resolver:s,subPrefixes:o}=Cr(this._resolverCache,t,n);let a=s;if(function(t,e){const{isScriptable:i,isIndexable:n}=qe(t);for(const r of e){const e=i(r),s=n(r),o=(s||e)&&t[r];if(e&&(bt(o)||Tr(o))||s&&J(o))return!0}return!1}(s,e)){r.$shared=!1;a=Ye(s,i=bt(i)?i():i,this.createResolver(t,i,o))}for(const l of e)r[l]=a[l];return r}createResolver(t,e,i=[""],n){const{resolver:r}=Cr(this._resolverCache,t,i);return Q(e)?Ye(r,e,void 0,n):r}}function Cr(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));const r=i.join();let s=n.get(r);if(!s){s={resolver:Ue(e,i),subPrefixes:i.filter((t=>!t.toLowerCase().includes("hover")))},n.set(r,s)}return s}const Tr=t=>Q(t)&&Object.getOwnPropertyNames(t).reduce(((e,i)=>e||bt(t[i])),!1);const Er=["top","bottom","left","right","chartArea"];function Lr(t,e){return"top"===t||"bottom"===t||-1===Er.indexOf(t)&&"x"===e}function Rr(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function Ir(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),rt(i&&i.onComplete,[t],e)}function zr(t){const e=t.chart,i=e.options.animation;rt(i&&i.onProgress,[t],e)}function Fr(t){return fi()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const jr={},Vr=t=>{const e=Fr(t);return Object.values(jr).filter((t=>t.canvas===e)).pop()};function Br(t,e,i){const n=Object.keys(t);for(const r of n){const n=+r;if(n>=e){const s=t[r];delete t[r],(i>0||n>e)&&(t[n+i]=s)}}}class Wr{static register(...t){br.add(...t),Nr()}static unregister(...t){br.remove(...t),Nr()}constructor(t,e){const i=this.config=new Or(e),n=Fr(t),r=Vr(n);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const s=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!fi()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Hn:rr}(n)),this.platform.updateConfig(i);const o=this.platform.acquireContext(n,s.aspectRatio),a=o&&o.canvas,l=a&&a.height,h=a&&a.width;this.id=Z(),this.ctx=o,this.canvas=a,this.width=h,this.height=l,this._options=s,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 _r,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...n){return e?(clearTimeout(i),i=setTimeout(t,e,n)):t.apply(this,n),e}}((t=>this.update(t)),s.resizeDelay||0),this._dataChanges=[],jr[this.id]=this,o&&a?(ji.listen(this,"complete",Ir),ji.listen(this,"progress",zr),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:r}=this;return G(t)?e&&r?r:n?i/n: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 br}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():yi(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ke(this.canvas,this.ctx),this}stop(){return ji.stop(this),this}resize(t,e){ji.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(n,t,e,r),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,yi(this,o,!0)&&(this.notifyPlugins("resize",{size:s}),rt(i.onResize,[this,s],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){st(this.options.scales||{},((t,e)=>{t.id=e}))}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce(((t,e)=>(t[e]=!1,t)),{});let r=[];e&&(r=r.concat(Object.keys(e).map((t=>{const i=e[t],n=wr(t,i),r="r"===n,s="x"===n;return{options:i,dposition:r?"chartArea":s?"bottom":"left",dtype:r?"radialLinear":s?"category":"linear"}})))),st(r,(e=>{const r=e.options,s=r.id,o=wr(s,r),a=it(r.type,e.dtype);void 0!==r.position&&Lr(r.position,o)===Lr(e.dposition)||(r.position=e.dposition),n[s]=!0;let l=null;if(s in i&&i[s].type===a)l=i[s];else{l=new(br.getScale(a))({id:s,type:a,ctx:this.ctx,chart:this}),i[l.id]=l}l.init(r,t)})),st(n,((t,e)=>{t||delete i[e]})),st(i,(t=>{Wn.configure(this,t,t.options),Wn.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort(((t,e)=>t.index-e.index)),i>e){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Rr("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach(((t,i)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(i)}))}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i<n;i++){const n=e[i];let r=this.getDatasetMeta(i);const s=n.type||this.config.type;if(r.type&&r.type!==s&&(this._destroyDatasetMeta(i),r=this.getDatasetMeta(i)),r.type=s,r.indexAxis=n.indexAxis||yr(s,this.options),r.order=n.order||0,r.index=i,r.label=""+n.label,r.visible=this.isDatasetVisible(i),r.controller)r.controller.updateIndex(i),r.controller.linkScales();else{const e=br.getController(s),{datasetElementType:n,dataElementType:o}=xe.datasets[s];Object.assign(e,{dataElementType:br.getElement(o),datasetElementType:n&&br.getElement(n)}),r.controller=new e(this,i),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){st(this.data.datasets,((t,e)=>{this.getDatasetMeta(e).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let l=0,h=this.data.datasets.length;l<h;l++){const{controller:t}=this.getDatasetMeta(l),e=!n&&-1===r.indexOf(t);t.buildOrUpdateElements(e),s=Math.max(+t.getMaxOverflow(),s)}s=this._minPadding=i.layout.autoPadding?s:0,this._updateLayout(s),n||st(r,(t=>{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Rr("z","_idx"));const{_active:o,_lastEvent:a}=this;a?this._eventHandler(a,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){st(this.scales,(t=>{Wn.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);_t(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:r}of e){Br(t,n,"_removeElements"===i?-r:r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter((t=>t[0]===e)).map(((t,e)=>e+","+t.splice(1).join(",")))),n=i(0);for(let r=1;r<e;r++)if(!_t(n,i(r)))return;return Array.from(n).map((t=>t.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;Wn.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],st(this.boxes,(t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,e)=>{t._idx=e})),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,bt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),n={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",n)&&(i.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(ji.has(this)?this.attached&&!ji.running(this)&&ji.start(this):(this.draw(),Ir({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resize(t,e),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let n,r;for(n=0,r=e.length;n<r;++n){const r=e[n];t&&!r.visible||i.push(r)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,n=!i.disabled,r=function(t){const{xScale:e,yScale:i}=t;if(e&&i)return{left:e.left,right:e.right,top:i.top,bottom:i.bottom}}(t)||this.chartArea,s={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",s)&&(n&&Ae(e,{left:!1===i.left?0:r.left-i.left,right:!1===i.right?this.width:r.right+i.right,top:!1===i.top?0:r.top-i.top,bottom:!1===i.bottom?this.height:r.bottom+i.bottom}),t.controller.draw(),n&&De(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return Pe(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){const r=Dn.modes[e];return"function"==typeof r?r(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter((t=>t&&t._dataset===e)).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=$e(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",r=this.getDatasetMeta(t),s=r.controller._resolveAnimations(void 0,n);mt(e)?(r.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),s.update(r,{visible:i}),this.update((e=>e.datasetIndex===t?n:void 0)))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),ji.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),ke(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete jr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};st(this.options.events,(t=>i(t,n)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(i,n)=>{t[i]&&(e.removeEventListener(this,i,n),delete t[i])},r=(t,e)=>{this.canvas&&this.resize(t,e)};let s;const o=()=>{n("attach",o),this.attached=!0,this.resize(),i("resize",r),i("detach",s)};s=()=>{this.attached=!1,n("resize",r),this._stop(),this._resize(0,0),i("attach",o)},e.isAttached(this.canvas)?o():s()}unbindEvents(){st(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._listeners={},st(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let r,s,o,a;for("dataset"===e&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+n+"DatasetHoverStyle"]()),o=0,a=t.length;o<a;++o){s=t[o];const e=s&&this.getDatasetMeta(s.datasetIndex).controller;e&&e[n+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map((({datasetIndex:t,index:e})=>{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}));!ot(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter((e=>e.plugin.id===t)).length}_updateHoverStyles(t,e,i){const n=this.options.hover,r=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),s=r(e,t),o=i?t:r(t,e);s.length&&this.updateHoverStyle(s,n.mode,!1),o.length&&n.mode&&this.updateHoverStyle(o,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,n))return;const r=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(r||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:r}=this,s=e,o=this._getActiveElements(t,n,i,s),a=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,i,n){return i&&"mouseout"!==t.type?n?e:t:null}(t,this._lastEvent,i,a);i&&(this._lastEvent=null,rt(r.onHover,[t,o,this],this),a&&rt(r.onClick,[t,o,this],this));const h=!ot(o,n);return(h||e)&&(this._active=o,this._updateHoverStyles(o,n,e)),this._lastEvent=l,h}_getActiveElements(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,n)}}function Nr(){return st(Wr.instances,(t=>t._plugins.invalidate()))}function Hr(t,e,i,n){const r=je(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const s=(i-e)/2,o=Math.min(s,n*e/2),a=t=>{const e=(i-Math.min(s,t))*n/2;return Wt(t,0,Math.min(s,e))};return{outerStart:a(r.outerStart),outerEnd:a(r.outerEnd),innerStart:Wt(r.innerStart,0,o),innerEnd:Wt(r.innerEnd,0,o)}}function $r(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function Ur(t,e,i,n,r,s){const{x:o,y:a,startAngle:l,pixelMargin:h,innerRadius:c}=e,u=Math.max(e.outerRadius+n+i-h,0),f=c>0?c+n+i+h:0;let d=0;const p=r-l;if(n){const t=((c>0?c-n:0)+(u>0?u-n:0))/2;d=(p-(0!==t?p*t/(t+n):p))/2}const g=(p-Math.max(.001,p*u-i/xt)/u)/2,m=l+g+d,b=r-g-d,{outerStart:_,outerEnd:x,innerStart:v,innerEnd:y}=Hr(e,f,u,b-m),w=u-_,k=u-x,M=m+_/w,S=b-x/k,P=f+v,A=f+y,D=m+v/P,O=b-y/A;if(t.beginPath(),s){const e=(M+S)/2;if(t.arc(o,a,u,M,e),t.arc(o,a,u,e,S),x>0){const e=$r(k,S,o,a);t.arc(e.x,e.y,x,S,b+Mt)}const i=$r(A,b,o,a);if(t.lineTo(i.x,i.y),y>0){const e=$r(A,O,o,a);t.arc(e.x,e.y,y,b+Mt,O+Math.PI)}const n=(b-y/f+(m+v/f))/2;if(t.arc(o,a,f,b-y/f,n,!0),t.arc(o,a,f,n,m+v/f,!0),v>0){const e=$r(P,D,o,a);t.arc(e.x,e.y,v,D+Math.PI,m-Mt)}const r=$r(w,m,o,a);if(t.lineTo(r.x,r.y),_>0){const e=$r(w,M,o,a);t.arc(e.x,e.y,_,m-Mt,M)}}else{t.moveTo(o,a);const e=Math.cos(M)*u+o,i=Math.sin(M)*u+a;t.lineTo(e,i);const n=Math.cos(S)*u+o,r=Math.sin(S)*u+a;t.lineTo(n,r)}t.closePath()}function Yr(t,e,i,n,r){const{fullCircles:s,startAngle:o,circumference:a,options:l}=e,{borderWidth:h,borderJoinStyle:c}=l,u="inner"===l.borderAlign;if(!h)return;u?(t.lineWidth=2*h,t.lineJoin=c||"round"):(t.lineWidth=h,t.lineJoin=c||"bevel");let f=e.endAngle;if(s){Ur(t,e,i,n,f,r);for(let e=0;e<s;++e)t.stroke();isNaN(a)||(f=o+(a%vt||vt))}u&&function(t,e,i){const{startAngle:n,pixelMargin:r,x:s,y:o,outerRadius:a,innerRadius:l}=e;let h=r/a;t.beginPath(),t.arc(s,o,a,n-h,i+h),l>r?(h=r/l,t.arc(s,o,l,i+h,n-h,!0)):t.arc(s,o,r,i+Mt,n-Mt),t.closePath(),t.clip()}(t,e,f),s||(Ur(t,e,i,n,f,r),t.stroke())}t(Wr,"defaults",xe),t(Wr,"instances",jr),t(Wr,"overrides",pe),t(Wr,"registry",br),t(Wr,"version","4.1.2"),t(Wr,"getChart",Vr),e("C",Wr);class qr extends sr{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.getProps(["x","y"],i),{angle:r,distance:s}=zt(n,{x:t,y:e}),{startAngle:o,endAngle:a,innerRadius:l,outerRadius:h,circumference:c}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),u=this.options.spacing/2,f=it(c,a-o)>=vt||Bt(r,o,a),d=Nt(s,l+u,h+u);return f&&d}getCenterPoint(t){const{x:e,y:i,startAngle:n,endAngle:r,innerRadius:s,outerRadius:o}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:a,spacing:l}=this.options,h=(n+r)/2,c=(s+o+l+a)/2;return{x:e+Math.cos(h)*c,y:i+Math.sin(h)*c}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,n=(e.offset||0)/4,r=(e.spacing||0)/2,s=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>vt?Math.floor(i/vt):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();const o=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(o)*n,Math.sin(o)*n);const a=n*(1-Math.sin(Math.min(xt,i||0)));t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,function(t,e,i,n,r){const{fullCircles:s,startAngle:o,circumference:a}=e;let l=e.endAngle;if(s){Ur(t,e,i,n,l,r);for(let e=0;e<s;++e)t.fill();isNaN(a)||(l=o+(a%vt||vt))}Ur(t,e,i,n,l,r),t.fill()}(t,this,a,r,s),Yr(t,this,a,r,s),t.restore()}}function Xr(t,e,i=e){t.lineCap=it(i.borderCapStyle,e.borderCapStyle),t.setLineDash(it(i.borderDash,e.borderDash)),t.lineDashOffset=it(i.borderDashOffset,e.borderDashOffset),t.lineJoin=it(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=it(i.borderWidth,e.borderWidth),t.strokeStyle=it(i.borderColor,e.borderColor)}function Kr(t,e,i){t.lineTo(i.x,i.y)}function Zr(t,e,i={}){const n=t.length,{start:r=0,end:s=n-1}=i,{start:o,end:a}=e,l=Math.max(r,o),h=Math.min(s,a),c=r<o&&s<o||r>a&&s>a;return{count:n,start:l,loop:e.loop,ilen:h<l&&!c?n+h-l:h-l}}function Gr(t,e,i,n){const{points:r,options:s}=e,{count:o,start:a,loop:l,ilen:h}=Zr(r,i,n),c=function(t){return t.stepped?Oe:t.tension||"monotone"===t.cubicInterpolationMode?Ce:Kr}(s);let u,f,d,{move:p=!0,reverse:g}=n||{};for(u=0;u<=h;++u)f=r[(a+(g?h-u:u))%o],f.skip||(p?(t.moveTo(f.x,f.y),p=!1):c(t,d,f,g,s.stepped),d=f);return l&&(f=r[(a+(g?h:0))%o],c(t,d,f,g,s.stepped)),!!l}function Jr(t,e,i,n){const r=e.points,{count:s,start:o,ilen:a}=Zr(r,i,n),{move:l=!0,reverse:h}=n||{};let c,u,f,d,p,g,m=0,b=0;const _=t=>(o+(h?a-t:t))%s,x=()=>{d!==p&&(t.lineTo(m,p),t.lineTo(m,d),t.lineTo(m,g))};for(l&&(u=r[_(0)],t.moveTo(u.x,u.y)),c=0;c<=a;++c){if(u=r[_(c)],u.skip)continue;const e=u.x,i=u.y,n=0|e;n===f?(i<d?d=i:i>p&&(p=i),m=(b*m+e)/++b):(x(),t.lineTo(e,i),f=n,b=0,d=p=i),g=i}x()}function Qr(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i)?Jr:Gr}t(qr,"id","arc"),t(qr,"defaults",{borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),t(qr,"defaultRoutes",{backgroundColor:"backgroundColor"});const ts="function"==typeof Path2D;function es(t,e,i,n){ts&&!e.options.segment?function(t,e,i,n){let r=e._path;r||(r=e._path=new Path2D,e.path(r,i,n)&&r.closePath()),Xr(t,e.options),t.stroke(r)}(t,e,i,n):function(t,e,i,n){const{segments:r,options:s}=e,o=Qr(e);for(const a of r)Xr(t,s,a.style),t.beginPath(),o(t,e,a,{start:i,end:i+n-1})&&t.closePath(),t.stroke()}(t,e,i,n)}class is extends sr{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;ui(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const i=t.points,n=t.options.spanGaps,r=i.length;if(!r)return[];const s=!!t._loop,{start:o,end:a}=function(t,e,i,n){let r=0,s=e-1;if(i&&!n)for(;r<e&&!t[r].skip;)r++;for(;r<e&&t[r].skip;)r++;for(r%=e,i&&(s+=r);s>r&&t[s%e].skip;)s--;return s%=e,{start:r,end:s}}(i,r,s,n);return Ri(t,!0===n?[{start:o,end:a,loop:s}]:function(t,e,i,n){const r=t.length,s=[];let o,a=e,l=t[e];for(o=e+1;o<=i;++o){const i=t[o%r];i.skip||i.stop?l.skip||(n=!1,s.push({start:e%r,end:(o-1)%r,loop:n}),e=a=i.stop?o:null):(a=o,l.skip&&(e=o)),l=i}return null!==a&&s.push({start:e%r,end:a%r,loop:n}),s}(i,o,a<o?a+r:a,!!t._fullLoop&&0===o&&a===r-1),i,e)}(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,n=t[e],r=this.points,s=Li(this,{property:e,start:n,end:n});if(!s.length)return;const o=[],a=function(t){return t.stepped?Si:t.tension||"monotone"===t.cubicInterpolationMode?Pi:Mi}(i);let l,h;for(l=0,h=s.length;l<h;++l){const{start:h,end:c}=s[l],u=r[h],f=r[c];if(u===f){o.push(u);continue}const d=a(u,f,Math.abs((n-u[e])/(f[e]-u[e])),i.stepped);d[e]=t[e],o.push(d)}return 1===o.length?o[0]:o}pathSegment(t,e,i){return Qr(this)(t,this,e,i)}path(t,e,i){const n=this.segments,r=Qr(this);let s=this._loop;e=e||0,i=i||this.points.length-e;for(const o of n)s&=r(t,this,o,{start:e,end:e+i-1});return!!s}draw(t,e,i,n){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),es(t,this,i,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function ns(t,e,i,n){const r=t.options,{[i]:s}=t.getProps([i],n);return Math.abs(e-s)<r.radius+r.hitRadius}t(is,"id","line"),t(is,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),t(is,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),t(is,"descriptors",{_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t});class rs extends sr{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.options,{x:r,y:s}=this.getProps(["x","y"],i);return Math.pow(t-r,2)+Math.pow(e-s,2)<Math.pow(n.hitRadius+n.radius,2)}inXRange(t,e){return ns(this,t,"x",e)}inYRange(t,e){return ns(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){let e=(t=t||this.options||{}).radius||0;e=Math.max(e,e&&t.hoverRadius||0);return 2*(e+(e&&t.borderWidth||0))}draw(t,e){const i=this.options;this.skip||i.radius<.1||!Pe(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Me(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function ss(t,e){const{x:i,y:n,base:r,width:s,height:o}=t.getProps(["x","y","base","width","height"],e);let a,l,h,c,u;return t.horizontal?(u=o/2,a=Math.min(i,r),l=Math.max(i,r),h=n-u,c=n+u):(u=s/2,a=i-u,l=i+u,h=Math.min(n,r),c=Math.max(n,r)),{left:a,top:h,right:l,bottom:c}}function os(t,e,i,n){return t?0:Wt(e,i,n)}function as(t){const e=ss(t),i=e.right-e.left,n=e.bottom-e.top,r=function(t,e,i){const n=t.options.borderWidth,r=t.borderSkipped,s=Ve(n);return{t:os(r.top,s.top,0,i),r:os(r.right,s.right,0,e),b:os(r.bottom,s.bottom,0,i),l:os(r.left,s.left,0,e)}}(t,i/2,n/2),s=function(t,e,i){const{enableBorderRadius:n}=t.getProps(["enableBorderRadius"]),r=t.options.borderRadius,s=Be(r),o=Math.min(e,i),a=t.borderSkipped,l=n||Q(r);return{topLeft:os(!l||a.top||a.left,s.topLeft,0,o),topRight:os(!l||a.top||a.right,s.topRight,0,o),bottomLeft:os(!l||a.bottom||a.left,s.bottomLeft,0,o),bottomRight:os(!l||a.bottom||a.right,s.bottomRight,0,o)}}(t,i/2,n/2);return{outer:{x:e.left,y:e.top,w:i,h:n,radius:s},inner:{x:e.left+r.l,y:e.top+r.t,w:i-r.l-r.r,h:n-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 ls(t,e,i,n){const r=null===e,s=null===i,o=t&&!(r&&s)&&ss(t,n);return o&&(r||Nt(e,o.left,o.right))&&(s||Nt(i,o.top,o.bottom))}function hs(t,e){t.rect(e.x,e.y,e.w,e.h)}function cs(t,e,i={}){const n=t.x!==i.x?-e:0,r=t.y!==i.y?-e:0,s=(t.x+t.w!==i.x+i.w?e:0)-n,o=(t.y+t.h!==i.y+i.h?e:0)-r;return{x:t.x+n,y:t.y+r,w:t.w+s,h:t.h+o,radius:t.radius}}t(rs,"id","point"),t(rs,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),t(rs,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});class us extends sr{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:e,options:{borderColor:i,backgroundColor:n}}=this,{inner:r,outer:s}=as(this),o=(a=s.radius).topLeft||a.topRight||a.bottomLeft||a.bottomRight?Re:hs;var a;t.save(),s.w===r.w&&s.h===r.h||(t.beginPath(),o(t,cs(s,e,r)),t.clip(),o(t,cs(r,-e,s)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),o(t,cs(r,e)),t.fillStyle=n,t.fill(),t.restore()}inRange(t,e,i){return ls(this,t,e,i)}inXRange(t,e){return ls(this,t,null,e)}inYRange(t,e){return ls(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:n,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(e+n)/2:e,y:r?i:(i+n)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}t(us,"id","bar"),t(us,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),t(us,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var fs=Object.freeze({__proto__:null,ArcElement:qr,LineElement:is,PointElement:rs,BarElement:us});const ds=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],ps=ds.map((t=>t.replace("rgb(","rgba(").replace(")",", 0.5)")));function gs(t){return ds[t%ds.length]}function ms(t){return ps[t%ps.length]}function bs(t){let e=0;return(i,n)=>{const r=t.getDatasetMeta(n).controller;r instanceof fn?e=function(t,e){return t.backgroundColor=t.data.map((()=>gs(e++))),e}(i,e):r instanceof pn?e=function(t,e){return t.backgroundColor=t.data.map((()=>ms(e++))),e}(i,e):r&&(e=function(t,e){return t.borderColor=gs(e),t.backgroundColor=ms(e),++e}(i,e))}}function _s(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}var xs={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,i){if(!i.enabled)return;const{options:{elements:n},data:{datasets:r}}=t.config;if(!i.forceOverride&&(_s(r)||n&&_s(n)))return;const s=bs(t);r.forEach(s)}};function vs(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{value:e})}}function ys(t){t.data.datasets.forEach((t=>{vs(t)}))}var ws={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled)return void ys(t);const n=t.width;t.data.datasets.forEach(((e,r)=>{const{_data:s,indexAxis:o}=e,a=t.getDatasetMeta(r),l=s||e.data;if("y"===He([o,t.options.indexAxis]))return;if(!a.controller.supportsDecimation)return;const h=t.scales[a.xAxisID];if("linear"!==h.type&&"time"!==h.type)return;if(t.options.parsing)return;let{start:c,count:u}=function(t,e){const i=e.length;let n,r=0;const{iScale:s}=t,{min:o,max:a,minDefined:l,maxDefined:h}=s.getUserBounds();return l&&(r=Wt($t(e,s.axis,o).lo,0,i-1)),n=h?Wt($t(e,s.axis,a).hi+1,r,i)-r:i-r,{start:r,count:n}}(a,l);if(u<=(i.threshold||4*n))return void vs(e);let f;switch(G(s)&&(e._data=l,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":f=function(t,e,i,n,r){const s=r.samples||n;if(s>=i)return t.slice(e,e+i);const o=[],a=(i-2)/(s-2);let l=0;const h=e+i-1;let c,u,f,d,p,g=e;for(o[l++]=t[g],c=0;c<s-2;c++){let n,r=0,s=0;const h=Math.floor((c+1)*a)+1+e,m=Math.min(Math.floor((c+2)*a)+1,i)+e,b=m-h;for(n=h;n<m;n++)r+=t[n].x,s+=t[n].y;r/=b,s/=b;const _=Math.floor(c*a)+1+e,x=Math.min(Math.floor((c+1)*a)+1,i)+e,{x:v,y:y}=t[g];for(f=d=-1,n=_;n<x;n++)d=.5*Math.abs((v-r)*(t[n].y-y)-(v-t[n].x)*(s-y)),d>f&&(f=d,u=t[n],p=n);o[l++]=u,g=p}return o[l++]=t[h],o}(l,c,u,n,i);break;case"min-max":f=function(t,e,i,n){let r,s,o,a,l,h,c,u,f,d,p=0,g=0;const m=[],b=e+i-1,_=t[e].x,x=t[b].x-_;for(r=e;r<e+i;++r){s=t[r],o=(s.x-_)/x*n,a=s.y;const e=0|o;if(e===l)a<f?(f=a,h=r):a>d&&(d=a,c=r),p=(g*p+s.x)/++g;else{const i=r-1;if(!G(h)&&!G(c)){const e=Math.min(h,c),n=Math.max(h,c);e!==u&&e!==i&&m.push({...t[e],x:p}),n!==u&&n!==i&&m.push({...t[n],x:p})}r>0&&i!==u&&m.push(t[i]),m.push(s),l=e,g=0,f=d=a,h=c=u=r}}return m}(l,c,u,n);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=f}))},destroy(t){ys(t)}};function ks(t,e,i,n){if(n)return;let r=e[t],s=i[t];return"angle"===t&&(r=Vt(r),s=Vt(s)),{property:t,start:r,end:s}}function Ms(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function Ss(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function Ps(t,e){let i=[],n=!1;return J(t)?(n=!0,i=t):i=function(t,e){const{x:i=null,y:n=null}=t||{},r=e.points,s=[];return e.segments.forEach((({start:t,end:e})=>{e=Ms(t,e,r);const o=r[t],a=r[e];null!==n?(s.push({x:o.x,y:n}),s.push({x:a.x,y:n})):null!==i&&(s.push({x:i,y:o.y}),s.push({x:i,y:a.y}))})),s}(t,e),i.length?new is({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function As(t){return t&&!1!==t.fill}function Ds(t,e,i){let n=t[e].fill;const r=[e];let s;if(!i)return n;for(;!1!==n&&-1===r.indexOf(n);){if(!tt(n))return n;if(s=t[n],!s)return!1;if(s.visible)return n;r.push(n),n=s.fill}return!1}function Os(t,e,i){const n=function(t){const e=t.options,i=e.fill;let n=it(i&&i.target,i);void 0===n&&(n=!!e.backgroundColor);if(!1===n||null===n)return!1;if(!0===n)return"origin";return n}(t);if(Q(n))return!isNaN(n.value)&&n;let r=parseFloat(n);return tt(r)&&Math.floor(r)===r?function(t,e,i,n){"-"!==t&&"+"!==t||(i=e+i);if(i===e||i<0||i>=n)return!1;return i}(n[0],e,r,i):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function Cs(t,e,i){const n=[];for(let r=0;r<i.length;r++){const s=i[r],{first:o,last:a,point:l}=Ts(s,e,"x");if(!(!l||o&&a))if(o)n.unshift(l);else if(t.push(l),!a)break}t.push(...n)}function Ts(t,e,i){const n=t.interpolate(e,i);if(!n)return{};const r=n[i],s=t.segments,o=t.points;let a=!1,l=!1;for(let h=0;h<s.length;h++){const t=s[h],e=o[t.start][i],n=o[t.end][i];if(Nt(r,e,n)){a=r===e,l=r===n;break}}return{first:a,last:l,point:n}}class Es{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:n,y:r,radius:s}=this;return e=e||{start:0,end:vt},t.arc(n,r,s,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:n}=this,r=t.angle;return{x:e+Math.cos(r)*n,y:i+Math.sin(r)*n,angle:r}}}function Ls(t){const{chart:e,fill:i,line:n}=t;if(tt(i))return function(t,e){const i=t.getDatasetMeta(e),n=i&&t.isDatasetVisible(e);return n?i.dataset:null}(e,i);if("stack"===i)return function(t){const{scale:e,index:i,line:n}=t,r=[],s=n.segments,o=n.points,a=function(t,e){const i=[],n=t.getMatchingVisibleMetas("line");for(let r=0;r<n.length;r++){const t=n[r];if(t.index===e)break;t.hidden||i.unshift(t.dataset)}return i}(e,i);a.push(Ps({x:null,y:e.bottom},n));for(let l=0;l<s.length;l++){const t=s[l];for(let e=t.start;e<=t.end;e++)Cs(r,o[e],a)}return new is({points:r,options:{}})}(t);if("shape"===i)return!0;const r=function(t){const e=t.scale||{};if(e.getPointPositionForValue)return function(t){const{scale:e,fill:i}=t,n=e.options,r=e.getLabels().length,s=n.reverse?e.max:e.min,o=function(t,e,i){let n;return n="start"===t?i:"end"===t?e.options.reverse?e.min:e.max:Q(t)?t.value:e.getBaseValue(),n}(i,e,s),a=[];if(n.grid.circular){const t=e.getPointPositionForValue(0,s);return new Es({x:t.x,y:t.y,radius:e.getDistanceFromCenterForValue(o)})}for(let l=0;l<r;++l)a.push(e.getPointPositionForValue(l,o));return a}(t);return function(t){const{scale:e={},fill:i}=t,n=function(t,e){let i=null;return"start"===t?i=e.bottom:"end"===t?i=e.top:Q(t)?i=e.getPixelForValue(t.value):e.getBasePixel&&(i=e.getBasePixel()),i}(i,e);if(tt(n)){const t=e.isHorizontal();return{x:t?n:null,y:t?null:n}}return null}(t)}(t);return r instanceof Es?r:Ps(r,n)}function Rs(t,e,i){const n=Ls(e),{line:r,scale:s,axis:o}=e,a=r.options,l=a.fill,h=a.backgroundColor,{above:c=h,below:u=h}=l||{};n&&r.points.length&&(Ae(t,i),function(t,e){const{line:i,target:n,above:r,below:s,area:o,scale:a}=e,l=i._loop?"angle":e.axis;t.save(),"x"===l&&s!==r&&(Is(t,n,o.top),zs(t,{line:i,target:n,color:r,scale:a,property:l}),t.restore(),t.save(),Is(t,n,o.bottom));zs(t,{line:i,target:n,color:s,scale:a,property:l}),t.restore()}(t,{line:r,target:n,above:c,below:u,area:i,scale:s,axis:o}),De(t))}function Is(t,e,i){const{segments:n,points:r}=e;let s=!0,o=!1;t.beginPath();for(const a of n){const{start:n,end:l}=a,h=r[n],c=r[Ms(n,l,r)];s?(t.moveTo(h.x,h.y),s=!1):(t.lineTo(h.x,i),t.lineTo(h.x,h.y)),o=!!e.pathSegment(t,a,{move:o}),o?t.closePath():t.lineTo(c.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function zs(t,e){const{line:i,target:n,property:r,color:s,scale:o}=e,a=function(t,e,i){const n=t.segments,r=t.points,s=e.points,o=[];for(const a of n){let{start:t,end:n}=a;n=Ms(t,n,r);const l=ks(i,r[t],r[n],a.loop);if(!e.segments){o.push({source:a,target:l,start:r[t],end:r[n]});continue}const h=Li(e,l);for(const e of h){const t=ks(i,s[e.start],s[e.end],e.loop),n=Ei(a,r,t);for(const r of n)o.push({source:r,target:e,start:{[i]:Ss(l,t,"start",Math.max)},end:{[i]:Ss(l,t,"end",Math.min)}})}}return o}(i,n,r);for(const{source:l,target:h,start:c,end:u}of a){const{style:{backgroundColor:e=s}={}}=l,a=!0!==n;t.save(),t.fillStyle=e,Fs(t,o,a&&ks(r,c,u)),t.beginPath();const f=!!i.pathSegment(t,l);let d;if(a){f?t.closePath():js(t,n,u,r);const e=!!n.pathSegment(t,h,{move:f,reverse:!0});d=f&&e,d||js(t,n,c,r)}t.closePath(),t.fill(d?"evenodd":"nonzero"),t.restore()}}function Fs(t,e,i){const{top:n,bottom:r}=e.chart.chartArea,{property:s,start:o,end:a}=i||{};"x"===s&&(t.beginPath(),t.rect(o,n,a-o,r-n),t.clip())}function js(t,e,i,n){const r=e.interpolate(i,n);r&&t.lineTo(r.x,r.y)}var Vs={id:"filler",afterDatasetsUpdate(t,e,i){const n=(t.data.datasets||[]).length,r=[];let s,o,a,l;for(o=0;o<n;++o)s=t.getDatasetMeta(o),a=s.dataset,l=null,a&&a.options&&a instanceof is&&(l={visible:t.isDatasetVisible(o),index:o,fill:Os(a,o,n),chart:t,axis:s.controller.options.indexAxis,scale:s.vScale,line:a}),s.$filler=l,r.push(l);for(o=0;o<n;++o)l=r[o],l&&!1!==l.fill&&(l.fill=Ds(r,o,i.propagate))},beforeDraw(t,e,i){const n="beforeDraw"===i.drawTime,r=t.getSortedVisibleDatasetMetas(),s=t.chartArea;for(let o=r.length-1;o>=0;--o){const e=r[o].$filler;e&&(e.line.updateControlPoints(s,e.axis),n&&e.fill&&Rs(t.ctx,e,s))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const n=t.getSortedVisibleDatasetMetas();for(let r=n.length-1;r>=0;--r){const e=n[r].$filler;As(e)&&Rs(t.ctx,e,t.chartArea)}},beforeDatasetDraw(t,e,i){const n=e.meta.$filler;As(n)&&"beforeDatasetDraw"===i.drawTime&&Rs(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Bs=(t,e)=>{let{boxHeight:i=e,boxWidth:n=e}=t;return t.usePointStyle&&(i=Math.min(i,e),n=t.pointStyleWidth||Math.min(n,e)),{boxWidth:n,boxHeight:i,itemHeight:Math.max(e,i)}};class Ws extends sr{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,e,i){this.maxWidth=t,this.maxHeight=e,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 e=rt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter((e=>t.filter(e,this.chart.data)))),t.sort&&(e=e.sort(((e,i)=>t.sort(e,i,this.chart.data)))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,n=Ne(i.font),r=n.size,s=this._computeTitleHeight(),{boxWidth:o,itemHeight:a}=Bs(i,r);let l,h;e.font=n.string,this.isHorizontal()?(l=this.maxWidth,h=this._fitRows(s,r,o,a)+10):(h=this.maxHeight,l=this._fitCols(s,n,o,a)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,n){const{ctx:r,maxWidth:s,options:{labels:{padding:o}}}=this,a=this.legendHitBoxes=[],l=this.lineWidths=[0],h=n+o;let c=t;r.textAlign="left",r.textBaseline="middle";let u=-1,f=-h;return this.legendItems.forEach(((t,d)=>{const p=i+e/2+r.measureText(t.text).width;(0===d||l[l.length-1]+p+2*o>s)&&(c+=h,l[l.length-(d>0?0:1)]=0,f+=h,u++),a[d]={left:0,top:f,row:u,width:p,height:n},l[l.length-1]+=p+o})),c}_fitCols(t,e,i,n){const{ctx:r,maxHeight:s,options:{labels:{padding:o}}}=this,a=this.legendHitBoxes=[],l=this.columnSizes=[],h=s-t;let c=o,u=0,f=0,d=0,p=0;return this.legendItems.forEach(((t,s)=>{const{itemWidth:g,itemHeight:m}=function(t,e,i,n,r){const s=function(t,e,i,n){let r=t.text;r&&"string"!=typeof r&&(r=r.reduce(((t,e)=>t.length>e.length?t:e)));return e+i.size/2+n.measureText(r).width}(n,t,e,i),o=function(t,e,i){let n=t;"string"!=typeof e.text&&(n=Ns(e,i));return n}(r,n,e.lineHeight);return{itemWidth:s,itemHeight:o}}(i,e,r,t,n);s>0&&f+m+2*o>h&&(c+=u+o,l.push({width:u,height:f}),d+=u+o,p++,u=f=0),a[s]={left:d,top:f,col:p,width:g,height:m},u=Math.max(u,g),f+=m+o})),c+=u,l.push({width:u,height:f}),c}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:n},rtl:r}}=this,s=Ai(r,this.left,this.width);if(this.isHorizontal()){let r=0,o=Jt(i,this.left+n,this.right-this.lineWidths[r]);for(const a of e)r!==a.row&&(r=a.row,o=Jt(i,this.left+n,this.right-this.lineWidths[r])),a.top+=this.top+t+n,a.left=s.leftForLtr(s.x(o),a.width),o+=a.width+n}else{let r=0,o=Jt(i,this.top+t+n,this.bottom-this.columnSizes[r].height);for(const a of e)a.col!==r&&(r=a.col,o=Jt(i,this.top+t+n,this.bottom-this.columnSizes[r].height)),a.top=o,a.left+=this.left+n,a.left=s.leftForLtr(s.x(a.left),a.width),o+=a.height+n}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;Ae(t,this),this._draw(),De(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:n}=this,{align:r,labels:s}=t,o=xe.color,a=Ai(t.rtl,this.left,this.width),l=Ne(s.font),{padding:h}=s,c=l.size,u=c/2;let f;this.drawTitle(),n.textAlign=a.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=l.string;const{boxWidth:d,boxHeight:p,itemHeight:g}=Bs(s,c),m=this.isHorizontal(),b=this._computeTitleHeight();f=m?{x:Jt(r,this.left+h,this.right-i[0]),y:this.top+h+b,line:0}:{x:this.left+h,y:Jt(r,this.top+b+h,this.bottom-e[0].height),line:0},Di(this.ctx,t.textDirection);const _=g+h;this.legendItems.forEach(((x,v)=>{n.strokeStyle=x.fontColor,n.fillStyle=x.fontColor;const y=n.measureText(x.text).width,w=a.textAlign(x.textAlign||(x.textAlign=s.textAlign)),k=d+u+y;let M=f.x,S=f.y;a.setWidth(this.width),m?v>0&&M+k+h>this.right&&(S=f.y+=_,f.line++,M=f.x=Jt(r,this.left+h,this.right-i[f.line])):v>0&&S+_>this.bottom&&(M=f.x=M+e[f.line].width+h,f.line++,S=f.y=Jt(r,this.top+b+h,this.bottom-e[f.line].height));if(function(t,e,i){if(isNaN(d)||d<=0||isNaN(p)||p<0)return;n.save();const r=it(i.lineWidth,1);if(n.fillStyle=it(i.fillStyle,o),n.lineCap=it(i.lineCap,"butt"),n.lineDashOffset=it(i.lineDashOffset,0),n.lineJoin=it(i.lineJoin,"miter"),n.lineWidth=r,n.strokeStyle=it(i.strokeStyle,o),n.setLineDash(it(i.lineDash,[])),s.usePointStyle){const o={radius:p*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:r},l=a.xPlus(t,d/2);Se(n,o,l,e+u,s.pointStyleWidth&&d)}else{const s=e+Math.max((c-p)/2,0),o=a.leftForLtr(t,d),l=Be(i.borderRadius);n.beginPath(),Object.values(l).some((t=>0!==t))?Re(n,{x:o,y:s,w:d,h:p,radius:l}):n.rect(o,s,d,p),n.fill(),0!==r&&n.stroke()}n.restore()}(a.x(M),S,x),M=((t,e,i,n)=>t===(n?"left":"right")?i:"center"===t?(e+i)/2:e)(w,M+d+u,m?M+k:this.right,t.rtl),function(t,e,i){Te(n,i.text,t,e+g/2,l,{strikethrough:i.hidden,textAlign:a.textAlign(i.textAlign)})}(a.x(M),S,x),m)f.x+=k+h;else if("string"!=typeof x.text){const t=l.lineHeight;f.y+=Ns(x,t)}else f.y+=_})),Oi(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=Ne(e.font),n=We(e.padding);if(!e.display)return;const r=Ai(t.rtl,this.left,this.width),s=this.ctx,o=e.position,a=i.size/2,l=n.top+a;let h,c=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+l,c=Jt(t.align,c,this.right-u);else{const e=this.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);h=l+Jt(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const f=Jt(o,c,c+u);s.textAlign=r.textAlign(Gt(o)),s.textBaseline="middle",s.strokeStyle=e.color,s.fillStyle=e.color,s.font=i.string,Te(s,e.text,f,h,i)}_computeTitleHeight(){const t=this.options.title,e=Ne(t.font),i=We(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,n,r;if(Nt(t,this.left,this.right)&&Nt(e,this.top,this.bottom))for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(n=r[i],Nt(t,n.left,n.left+n.width)&&Nt(e,n.top,n.top+n.height))return this.legendItems[i];return null}handleEvent(t){const e=this.options;if(!function(t,e){if(("mousemove"===t||"mouseout"===t)&&(e.onHover||e.onLeave))return!0;if(e.onClick&&("click"===t||"mouseup"===t))return!0;return!1}(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){const n=this._hoveredItem,r=((t,e)=>null!==t&&null!==e&&t.datasetIndex===e.datasetIndex&&t.index===e.index)(n,i);n&&!r&&rt(e.onLeave,[t,n,this],this),this._hoveredItem=i,i&&!r&&rt(e.onHover,[t,i,this],this)}else i&&rt(e.onClick,[t,i,this],this)}}function Ns(t,e){return e*(t.text?t.text.length+.5:0)}var Hs={id:"legend",_element:Ws,start(t,e,i){const n=t.legend=new Ws({ctx:t.ctx,options:i,chart:t});Wn.configure(t,n,i),Wn.addBox(t,n)},stop(t){Wn.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){const n=t.legend;Wn.configure(t,n,i),n.options=i},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){const n=e.datasetIndex,r=i.chart;r.isDatasetVisible(n)?(r.hide(n),e.hidden=!0):(r.show(n),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:n,textAlign:r,color:s,useBorderRadius:o,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const l=t.controller.getStyle(i?0:void 0),h=We(l.borderWidth);return{text:e[t.index].label,fillStyle:l.backgroundColor,fontColor:s,hidden:!t.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:l.borderColor,pointStyle:n||l.pointStyle,rotation:l.rotation,textAlign:r||l.textAlign,borderRadius:o&&(a||l.borderRadius),datasetIndex:t.index}}),this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class $s extends sr{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,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const n=J(i.text)?i.text.length:1;this._padding=We(i.padding);const r=n*Ne(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:n,right:r,options:s}=this,o=s.align;let a,l,h,c=0;return this.isHorizontal()?(l=Jt(o,i,r),h=e+t,a=r-i):("left"===s.position?(l=i+t,h=Jt(o,n,e),c=-.5*xt):(l=r-t,h=Jt(o,e,n),c=.5*xt),a=n-e),{titleX:l,titleY:h,maxWidth:a,rotation:c}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=Ne(e.font),n=i.lineHeight/2+this._padding.top,{titleX:r,titleY:s,maxWidth:o,rotation:a}=this._drawArgs(n);Te(t,e.text,0,0,i,{color:e.color,maxWidth:o,rotation:a,textAlign:Gt(e.align),textBaseline:"middle",translation:[r,s]})}}var Us={id:"title",_element:$s,start(t,e,i){!function(t,e){const i=new $s({ctx:t.ctx,options:e,chart:t});Wn.configure(t,i,e),Wn.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){const e=t.titleBlock;Wn.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const n=t.titleBlock;Wn.configure(t,n,i),n.options=i},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 Ys=new WeakMap;var qs={id:"subtitle",start(t,e,i){const n=new $s({ctx:t.ctx,options:i,chart:t});Wn.configure(t,n,i),Wn.addBox(t,n),Ys.set(t,n)},stop(t){Wn.removeBox(t,Ys.get(t)),Ys.delete(t)},beforeUpdate(t,e,i){const n=Ys.get(t);Wn.configure(t,n,i),n.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Xs={average(t){if(!t.length)return!1;let e,i,n=0,r=0,s=0;for(e=0,i=t.length;e<i;++e){const i=t[e].element;if(i&&i.hasValue()){const t=i.tooltipPosition();n+=t.x,r+=t.y,++s}}return{x:n/s,y:r/s}},nearest(t,e){if(!t.length)return!1;let i,n,r,s=e.x,o=e.y,a=Number.POSITIVE_INFINITY;for(i=0,n=t.length;i<n;++i){const n=t[i].element;if(n&&n.hasValue()){const t=Ft(e,n.getCenterPoint());t<a&&(a=t,r=n)}}if(r){const t=r.tooltipPosition();s=t.x,o=t.y}return{x:s,y:o}}};function Ks(t,e){return e&&(J(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Zs(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function Gs(t,e){const{element:i,datasetIndex:n,index:r}=e,s=t.getDatasetMeta(n).controller,{label:o,value:a}=s.getLabelAndValue(r);return{chart:t,label:o,parsed:s.getParsed(r),raw:t.data.datasets[n].data[r],formattedValue:a,dataset:s.getDataset(),dataIndex:r,datasetIndex:n,element:i}}function Js(t,e){const i=t.chart.ctx,{body:n,footer:r,title:s}=t,{boxWidth:o,boxHeight:a}=e,l=Ne(e.bodyFont),h=Ne(e.titleFont),c=Ne(e.footerFont),u=s.length,f=r.length,d=n.length,p=We(e.padding);let g=p.height,m=0,b=n.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);if(b+=t.beforeBody.length+t.afterBody.length,u&&(g+=u*h.lineHeight+(u-1)*e.titleSpacing+e.titleMarginBottom),b){g+=d*(e.displayColors?Math.max(a,l.lineHeight):l.lineHeight)+(b-d)*l.lineHeight+(b-1)*e.bodySpacing}f&&(g+=e.footerMarginTop+f*c.lineHeight+(f-1)*e.footerSpacing);let _=0;const x=function(t){m=Math.max(m,i.measureText(t).width+_)};return i.save(),i.font=h.string,st(t.title,x),i.font=l.string,st(t.beforeBody.concat(t.afterBody),x),_=e.displayColors?o+2+e.boxPadding:0,st(n,(t=>{st(t.before,x),st(t.lines,x),st(t.after,x)})),_=0,i.font=c.string,st(t.footer,x),i.restore(),m+=p.width,{width:m,height:g}}function Qs(t,e,i,n){const{x:r,width:s}=i,{width:o,chartArea:{left:a,right:l}}=t;let h="center";return"center"===n?h=r<=(a+l)/2?"left":"right":r<=s/2?h="left":r>=o-s/2&&(h="right"),function(t,e,i,n){const{x:r,width:s}=n,o=i.caretSize+i.caretPadding;return"left"===t&&r+s+o>e.width||"right"===t&&r-s-o<0||void 0}(h,t,e,i)&&(h="center"),h}function to(t,e,i){const n=i.yAlign||e.yAlign||function(t,e){const{y:i,height:n}=e;return i<n/2?"top":i>t.height-n/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||Qs(t,e,i,n),yAlign:n}}function eo(t,e,i,n){const{caretSize:r,caretPadding:s,cornerRadius:o}=t,{xAlign:a,yAlign:l}=i,h=r+s,{topLeft:c,topRight:u,bottomLeft:f,bottomRight:d}=Be(o);let p=function(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,a);const g=function(t,e,i){let{y:n,height:r}=t;return"top"===e?n+=i:n-="bottom"===e?r+i:r/2,n}(e,l,h);return"center"===l?"left"===a?p+=h:"right"===a&&(p-=h):"left"===a?p-=Math.max(c,f)+r:"right"===a&&(p+=Math.max(u,d)+r),{x:Wt(p,0,n.width-e.width),y:Wt(g,0,n.height-e.height)}}function io(t,e,i){const n=We(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function no(t){return Ks([],Zs(t))}function ro(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const so={beforeTitle:K,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex<n)return i[e.dataIndex]}return""},afterTitle:K,beforeBody:K,beforeLabel:K,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const i=t.formattedValue;return G(i)||(e+=i),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:K,afterBody:K,beforeFooter:K,footer:K,afterFooter:K};function oo(t,e,i,n){const r=t[e].call(i,n);return void 0===r?so[e].call(i,n):r}class ao extends sr{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 e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,r=new Ni(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=(t=this.chart.getContext(),e=this,i=this._tooltipItems,$e(t,{tooltip:e,tooltipItems:i,type:"tooltip"})));var t,e,i}getTitle(t,e){const{callbacks:i}=e,n=oo(i,"beforeTitle",this,t),r=oo(i,"title",this,t),s=oo(i,"afterTitle",this,t);let o=[];return o=Ks(o,Zs(n)),o=Ks(o,Zs(r)),o=Ks(o,Zs(s)),o}getBeforeBody(t,e){return no(oo(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,n=[];return st(t,(t=>{const e={before:[],lines:[],after:[]},r=ro(i,t);Ks(e.before,Zs(oo(r,"beforeLabel",this,t))),Ks(e.lines,oo(r,"label",this,t)),Ks(e.after,Zs(oo(r,"afterLabel",this,t))),n.push(e)})),n}getAfterBody(t,e){return no(oo(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,n=oo(i,"beforeFooter",this,t),r=oo(i,"footer",this,t),s=oo(i,"afterFooter",this,t);let o=[];return o=Ks(o,Zs(n)),o=Ks(o,Zs(r)),o=Ks(o,Zs(s)),o}_createItems(t){const e=this._active,i=this.chart.data,n=[],r=[],s=[];let o,a,l=[];for(o=0,a=e.length;o<a;++o)l.push(Gs(this.chart,e[o]));return t.filter&&(l=l.filter(((e,n,r)=>t.filter(e,n,r,i)))),t.itemSort&&(l=l.sort(((e,n)=>t.itemSort(e,n,i)))),st(l,(e=>{const i=ro(t.callbacks,e);n.push(oo(i,"labelColor",this,e)),r.push(oo(i,"labelPointStyle",this,e)),s.push(oo(i,"labelTextColor",this,e))})),this.labelColors=n,this.labelPointStyles=r,this.labelTextColors=s,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let r,s=[];if(n.length){const t=Xs[i.position].call(this,n,this._eventPosition);s=this._createItems(i),this.title=this.getTitle(s,i),this.beforeBody=this.getBeforeBody(s,i),this.body=this.getBody(s,i),this.afterBody=this.getAfterBody(s,i),this.footer=this.getFooter(s,i);const e=this._size=Js(this,i),o=Object.assign({},t,e),a=to(this.chart,i,o),l=eo(i,o,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,r={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(r={opacity:0});this._tooltipItems=s,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const r=this.getCaretPosition(t,i,n);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:r}=this,{caretSize:s,cornerRadius:o}=i,{topLeft:a,topRight:l,bottomLeft:h,bottomRight:c}=Be(o),{x:u,y:f}=t,{width:d,height:p}=e;let g,m,b,_,x,v;return"center"===r?(x=f+p/2,"left"===n?(g=u,m=g-s,_=x+s,v=x-s):(g=u+d,m=g+s,_=x-s,v=x+s),b=g):(m="left"===n?u+Math.max(a,h)+s:"right"===n?u+d-Math.max(l,c)-s:this.caretX,"top"===r?(_=f,x=_-s,g=m-s,b=m+s):(_=f+p,x=_+s,g=m+s,b=m-s),v=_),{x1:g,x2:m,x3:b,y1:_,y2:x,y3:v}}drawTitle(t,e,i){const n=this.title,r=n.length;let s,o,a;if(r){const l=Ai(i.rtl,this.x,this.width);for(t.x=io(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",s=Ne(i.titleFont),o=i.titleSpacing,e.fillStyle=i.titleColor,e.font=s.string,a=0;a<r;++a)e.fillText(n[a],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+o,a+1===r&&(t.y+=i.titleMarginBottom-o)}}_drawColorBox(t,e,i,n,r){const s=this.labelColors[i],o=this.labelPointStyles[i],{boxHeight:a,boxWidth:l,boxPadding:h}=r,c=Ne(r.bodyFont),u=io(this,"left",r),f=n.x(u),d=a<c.lineHeight?(c.lineHeight-a)/2:0,p=e.y+d;if(r.usePointStyle){const e={radius:Math.min(l,a)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},i=n.leftForLtr(f,l)+l/2,h=p+a/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Me(t,e,i,h),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,Me(t,e,i,h)}else{t.lineWidth=Q(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,t.strokeStyle=s.borderColor,t.setLineDash(s.borderDash||[]),t.lineDashOffset=s.borderDashOffset||0;const e=n.leftForLtr(f,l-h),i=n.leftForLtr(n.xPlus(f,1),l-h-2),o=Be(s.borderRadius);Object.values(o).some((t=>0!==t))?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Re(t,{x:e,y:p,w:l,h:a,radius:o}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),Re(t,{x:i,y:p+1,w:l-2,h:a-2,radius:o}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(e,p,l,a),t.strokeRect(e,p,l,a),t.fillStyle=s.backgroundColor,t.fillRect(i,p+1,l-2,a-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:r,bodyAlign:s,displayColors:o,boxHeight:a,boxWidth:l,boxPadding:h}=i,c=Ne(i.bodyFont);let u=c.lineHeight,f=0;const d=Ai(i.rtl,this.x,this.width),p=function(i){e.fillText(i,d.x(t.x+f),t.y+u/2),t.y+=u+r},g=d.textAlign(s);let m,b,_,x,v,y,w;for(e.textAlign=s,e.textBaseline="middle",e.font=c.string,t.x=io(this,g,i),e.fillStyle=i.bodyColor,st(this.beforeBody,p),f=o&&"right"!==g?"center"===s?l/2+h:l+2+h:0,x=0,y=n.length;x<y;++x){for(m=n[x],b=this.labelTextColors[x],e.fillStyle=b,st(m.before,p),_=m.lines,o&&_.length&&(this._drawColorBox(e,t,x,d,i),u=Math.max(c.lineHeight,a)),v=0,w=_.length;v<w;++v)p(_[v]),u=c.lineHeight;st(m.after,p)}f=0,u=c.lineHeight,st(this.afterBody,p),t.y-=r}drawFooter(t,e,i){const n=this.footer,r=n.length;let s,o;if(r){const a=Ai(i.rtl,this.x,this.width);for(t.x=io(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=a.textAlign(i.footerAlign),e.textBaseline="middle",s=Ne(i.footerFont),e.fillStyle=i.footerColor,e.font=s.string,o=0;o<r;++o)e.fillText(n[o],a.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+i.footerSpacing}}drawBackground(t,e,i,n){const{xAlign:r,yAlign:s}=this,{x:o,y:a}=t,{width:l,height:h}=i,{topLeft:c,topRight:u,bottomLeft:f,bottomRight:d}=Be(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(o+c,a),"top"===s&&this.drawCaret(t,e,i,n),e.lineTo(o+l-u,a),e.quadraticCurveTo(o+l,a,o+l,a+u),"center"===s&&"right"===r&&this.drawCaret(t,e,i,n),e.lineTo(o+l,a+h-d),e.quadraticCurveTo(o+l,a+h,o+l-d,a+h),"bottom"===s&&this.drawCaret(t,e,i,n),e.lineTo(o+f,a+h),e.quadraticCurveTo(o,a+h,o,a+h-f),"center"===s&&"left"===r&&this.drawCaret(t,e,i,n),e.lineTo(o,a+c),e.quadraticCurveTo(o,a,o+c,a),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,r=i&&i.y;if(n||r){const i=Xs[t.position].call(this,this._active,this._eventPosition);if(!i)return;const s=this._size=Js(this,t),o=Object.assign({},i,this._size),a=to(e,t,o),l=eo(t,o,a,e);n._to===l.x&&r._to===l.y||(this.xAlign=a.xAlign,this.yAlign=a.yAlign,this.width=s.width,this.height=s.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const s=We(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,n,e),Di(t,e.textDirection),r.y+=s.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),Oi(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map((({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}})),r=!ot(i,n),s=this._positionChanged(n,e);(r||s)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,r=this._active||[],s=this._getActiveElements(t,r,e,i),o=this._positionChanged(s,t),a=e||!ot(s,r)||o;return a&&(this._active=s,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),a}_getActiveElements(t,e,i,n){const r=this.options;if("mouseout"===t.type)return[];if(!n)return e;const s=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&s.reverse(),s}_positionChanged(t,e){const{caretX:i,caretY:n,options:r}=this,s=Xs[r.position].call(this,t,e);return!1!==s&&(i!==s.x||n!==s.y)}}t(ao,"positioners",Xs);var lo={id:"tooltip",_element:ao,positioners:Xs,afterInit(t,e,i){i&&(t.tooltip=new ao({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.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:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.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:so},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},ho=Object.freeze({__proto__:null,Colors:xs,Decimation:ws,Filler:Vs,Legend:Hs,SubTitle:qs,Title:Us,Tooltip:lo});function co(t,e,i,n){const r=t.indexOf(e);if(-1===r)return((t,e,i,n)=>("string"==typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,n);return r!==t.lastIndexOf(e)?i:r}function uo(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class fo extends pr{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:n}of e)t[i]===n&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(G(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:Wt(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:co(i,t,it(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let r=this.getLabels();r=0===t&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let s=t;s<=e;s++)n.push({value:s});return n}getLabelForValue(t){return uo.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function po(t,e){const i=[],{bounds:n,step:r,min:s,max:o,precision:a,count:l,maxTicks:h,maxDigits:c,includeBounds:u}=t,f=r||1,d=h-1,{min:p,max:g}=e,m=!G(s),b=!G(o),_=!G(l),x=(g-p)/(c+1);let v,y,w,k,M=Ct((g-p)/d/f)*f;if(M<1e-14&&!m&&!b)return[{value:p},{value:g}];k=Math.ceil(g/M)-Math.floor(p/M),k>d&&(M=Ct(k*M/d/f)*f),G(a)||(v=Math.pow(10,a),M=Math.ceil(M*v)/v),"ticks"===n?(y=Math.floor(p/M)*M,w=Math.ceil(g/M)*M):(y=p,w=g),m&&b&&r&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((o-s)/r,M/1e3)?(k=Math.round(Math.min((o-s)/M,h)),M=(o-s)/k,y=s,w=o):_?(y=m?s:y,w=b?o:w,k=l-1,M=(w-y)/k):(k=(w-y)/M,k=Ot(k,Math.round(k),M/1e3)?Math.round(k):Math.ceil(k));const S=Math.max(It(M),It(y));v=Math.pow(10,G(a)?S:a),y=Math.round(y*v)/v,w=Math.round(w*v)/v;let P=0;for(m&&(u&&y!==s?(i.push({value:s}),y<s&&P++,Ot(Math.round((y+P*M)*v)/v,s,go(s,x,t))&&P++):y<s&&P++);P<k;++P)i.push({value:Math.round((y+P*M)*v)/v});return b&&u&&w!==o?i.length&&Ot(i[i.length-1].value,o,go(o,x,t))?i[i.length-1].value=o:i.push({value:o}):b&&w!==o||i.push({value:w}),i}function go(t,e,{horizontal:i,minRotation:n}){const r=Lt(n),s=(i?Math.sin(r):Math.cos(r))||.001,o=.75*e*(""+t).length;return Math.min(e/s,o)}t(fo,"id","category"),t(fo,"defaults",{ticks:{callback:uo}});class mo extends pr{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,e){return G(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:r}=this;const s=t=>n=e?n:t,o=t=>r=i?r:t;if(t){const t=Dt(n),e=Dt(r);t<0&&e<0?o(0):t>0&&e>0&&s(0)}if(n===r){let e=0===r?1:Math.abs(.05*r);o(r+e),t||s(n-e)}this.min=n,this.max=r}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:n}=t;return n?(e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n=po({maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&Et(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return ue(t,this.chart.options.locale,this.options.ticks.format)}}class bo extends mo{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=tt(t)?t:0,this.max=tt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Lt(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/n))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}t(bo,"id","linear"),t(bo,"defaults",{ticks:{callback:de.formatters.numeric}});const _o=t=>Math.floor(At(t)),xo=(t,e)=>Math.pow(10,_o(t)+e);function vo(t){return 1===t/Math.pow(10,_o(t))}function yo(t,e,i){const n=Math.pow(10,i),r=Math.floor(t/n);return Math.ceil(e/n)-r}function wo(t,{min:e,max:i}){e=et(t.min,e);const n=[],r=_o(e);let s=function(t,e){let i=_o(e-t);for(;yo(t,e,i)>10;)i++;for(;yo(t,e,i)<10;)i--;return Math.min(i,_o(t))}(e,i),o=s<0?Math.pow(10,Math.abs(s)):1;const a=Math.pow(10,s),l=r>s?Math.pow(10,r):0,h=Math.round((e-l)*o)/o,c=Math.floor((e-l)/a/10)*a*10;let u=Math.floor((h-c)/Math.pow(10,s)),f=et(t.min,Math.round((l+c+u*Math.pow(10,s))*o)/o);for(;f<i;)n.push({value:f,major:vo(f),significand:u}),u>=10?u=u<15?15:20:u++,u>=20&&(s++,u=2,o=s>=0?1:o),f=Math.round((l+c+u*Math.pow(10,s))*o)/o;const d=et(t.max,f);return n.push({value:d,major:vo(d),significand:u}),n}class ko extends pr{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=mo.prototype.parse.apply(this,[t,e]);if(0!==i)return tt(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=tt(t)?Math.max(0,t):null,this.max=tt(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!tt(this._userMin)&&(this.min=t===xo(this.min,0)?xo(this.min,-1):xo(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,n=this.max;const r=e=>i=t?i:e,s=t=>n=e?n:t;i===n&&(i<=0?(r(1),s(10)):(r(xo(i,-1)),s(xo(n,1)))),i<=0&&r(xo(n,-1)),n<=0&&s(xo(i,1)),this.min=i,this.max=n}buildTicks(){const t=this.options,e=wo({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&Et(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":ue(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=At(t),this._valueRange=At(this.max)-At(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(At(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function Mo(t){const e=t.ticks;if(e.display&&t.display){const t=We(e.backdropPadding);return it(e.font&&e.font.size,xe.font.size)+t.height}return 0}function So(t,e,i,n,r){return t===n||t===r?{start:e-i/2,end:e+i/2}:t<n||t>r?{start:e-i,end:e}:{start:e,end:e+i}}function Po(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),n=[],r=[],s=t._pointLabels.length,o=t.options.pointLabels,a=o.centerPointLabels?xt/s:0;for(let u=0;u<s;u++){const s=o.setContext(t.getPointLabelContext(u));r[u]=s.padding;const f=t.getPointPosition(u,t.drawingArea+r[u],a),d=Ne(s.font),p=(l=t.ctx,h=d,c=J(c=t._pointLabels[u])?c:[c],{w:ye(l,h.string,c),h:c.length*h.lineHeight});n[u]=p;const g=Vt(t.getIndexAngle(u)+a),m=Math.round(Rt(g));Ao(i,e,g,So(m,f.x,p.w,0,180),So(m,f.y,p.h,90,270))}var l,h,c;t.setCenterPoint(e.l-i.l,i.r-e.r,e.t-i.t,i.b-e.b),t._pointLabelItems=function(t,e,i){const n=[],r=t._pointLabels.length,s=t.options,o=Mo(s)/2,a=t.drawingArea,l=s.pointLabels.centerPointLabels?xt/r:0;for(let h=0;h<r;h++){const r=t.getPointPosition(h,a+o+i[h],l),s=Math.round(Rt(Vt(r.angle+Mt))),c=e[h],u=Co(r.y,c.h,s),f=Do(s),d=Oo(r.x,c.w,f);n.push({x:r.x,y:u,textAlign:f,left:d,top:u,right:d+c.w,bottom:u+c.h})}return n}(t,n,r)}function Ao(t,e,i,n,r){const s=Math.abs(Math.sin(i)),o=Math.abs(Math.cos(i));let a=0,l=0;n.start<e.l?(a=(e.l-n.start)/s,t.l=Math.min(t.l,e.l-a)):n.end>e.r&&(a=(n.end-e.r)/s,t.r=Math.max(t.r,e.r+a)),r.start<e.t?(l=(e.t-r.start)/o,t.t=Math.min(t.t,e.t-l)):r.end>e.b&&(l=(r.end-e.b)/o,t.b=Math.max(t.b,e.b+l))}function Do(t){return 0===t||180===t?"center":t<180?"left":"right"}function Oo(t,e,i){return"right"===i?t-=e:"center"===i&&(t-=e/2),t}function Co(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}function To(t,e,i,n){const{ctx:r}=t;if(i)r.arc(t.xCenter,t.yCenter,e,0,vt);else{let i=t.getPointPosition(0,e);r.moveTo(i.x,i.y);for(let s=1;s<n;s++)i=t.getPointPosition(s,e),r.lineTo(i.x,i.y)}}t(ko,"id","logarithmic"),t(ko,"defaults",{ticks:{callback:de.formatters.logarithmic,major:{enabled:!0}}});class Eo extends mo{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=We(Mo(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=tt(t)&&!isNaN(t)?t:0,this.max=tt(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Mo(this.options))}generateTickLabels(t){mo.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map(((t,e)=>{const i=rt(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""})).filter(((t,e)=>this.chart.getDataVisibility(e)))}fit(){const t=this.options;t.display&&t.pointLabels.display?Po(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,n))}getIndexAngle(t){return Vt(t*(vt/(this._pointLabels.length||1))+Lt(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(G(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(G(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return function(t,e,i){return $e(t,{label:i,index:e,type:"pointLabel"})}(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const n=this.getIndexAngle(t)-Mt+i;return{x:Math.cos(n)*e+this.xCenter,y:Math.sin(n)*e+this.yCenter,angle:n}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:n,bottom:r}=this._pointLabelItems[t];return{left:e,top:i,right:n,bottom:r}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),To(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:n,border:r}=e,s=this._pointLabels.length;let o,a,l;if(e.pointLabels.display&&function(t,e){const{ctx:i,options:{pointLabels:n}}=t;for(let r=e-1;r>=0;r--){const e=n.setContext(t.getPointLabelContext(r)),s=Ne(e.font),{x:o,y:a,textAlign:l,left:h,top:c,right:u,bottom:f}=t._pointLabelItems[r],{backdropColor:d}=e;if(!G(d)){const t=Be(e.borderRadius),n=We(e.backdropPadding);i.fillStyle=d;const r=h-n.left,s=c-n.top,o=u-h+n.width,a=f-c+n.height;Object.values(t).some((t=>0!==t))?(i.beginPath(),Re(i,{x:r,y:s,w:o,h:a,radius:t}),i.fill()):i.fillRect(r,s,o,a)}Te(i,t._pointLabels[r],o,a+s.lineHeight/2,s,{color:e.color,textAlign:l,textBaseline:"middle"})}}(this,s),n.display&&this.ticks.forEach(((t,e)=>{if(0!==e){a=this.getDistanceFromCenterForValue(t.value);const i=this.getContext(e),o=n.setContext(i),l=r.setContext(i);!function(t,e,i,n,r){const s=t.ctx,o=e.circular,{color:a,lineWidth:l}=e;!o&&!n||!a||!l||i<0||(s.save(),s.strokeStyle=a,s.lineWidth=l,s.setLineDash(r.dash),s.lineDashOffset=r.dashOffset,s.beginPath(),To(t,i,o,n),s.closePath(),s.stroke(),s.restore())}(this,o,a,s,l)}})),i.display){for(t.save(),o=s-1;o>=0;o--){const n=i.setContext(this.getPointLabelContext(o)),{color:r,lineWidth:s}=n;s&&r&&(t.lineWidth=s,t.strokeStyle=r,t.setLineDash(n.borderDash),t.lineDashOffset=n.borderDashOffset,a=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),l=this.getPointPosition(o,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const n=this.getIndexAngle(0);let r,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach(((n,o)=>{if(0===o&&!e.reverse)return;const a=i.setContext(this.getContext(o)),l=Ne(a.font);if(r=this.getDistanceFromCenterForValue(this.ticks[o].value),a.showLabelBackdrop){t.font=l.string,s=t.measureText(n.label).width,t.fillStyle=a.backdropColor;const e=We(a.backdropPadding);t.fillRect(-s/2-e.left,-r-l.size/2-e.top,s+e.width,l.size+e.height)}Te(t,n.label,0,-r,l,{color:a.color})})),t.restore()}drawTitle(){}}t(Eo,"id","radialLinear"),t(Eo,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:de.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}}),t(Eo,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),t(Eo,"descriptors",{angleLines:{_fallback:"grid"}});const Lo={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}},Ro=Object.keys(Lo);function Io(t,e){return t-e}function zo(t,e){if(G(e))return null;const i=t._adapter,{parser:n,round:r,isoWeekday:s}=t._parseOpts;let o=e;return"function"==typeof n&&(o=n(o)),tt(o)||(o="string"==typeof n?i.parse(o,n):i.parse(o)),null===o?null:(r&&(o="week"!==r||!Tt(s)&&!0!==s?i.startOf(o,r):i.startOf(o,"isoWeek",s)),+o)}function Fo(t,e,i,n){const r=Ro.length;for(let s=Ro.indexOf(t);s<r-1;++s){const t=Lo[Ro[s]],r=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((i-e)/(r*t.size))<=n)return Ro[s]}return Ro[r-1]}function jo(t,e,i){if(i){if(i.length){const{lo:n,hi:r}=Ht(i,e);t[i[n]>=e?i[n]:i[r]]=!0}}else t[e]=!0}function Vo(t,e,i){const n=[],r={},s=e.length;let o,a;for(o=0;o<s;++o)a=e[o],r[a]=o,n.push({value:a,major:!1});return 0!==s&&i?function(t,e,i,n){const r=t._adapter,s=+r.startOf(e[0].value,n),o=e[e.length-1].value;let a,l;for(a=s;a<=o;a=+r.add(a,1,n))l=i[a],l>=0&&(e[l].major=!0);return e}(t,n,r,i):n}class Bo extends pr{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),n=this._adapter=new yn(t.adapters.date);n.init(e),ut(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:zo(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:n,max:r,minDefined:s,maxDefined:o}=this.getUserBounds();function a(t){s||isNaN(t.min)||(n=Math.min(n,t.min)),o||isNaN(t.max)||(r=Math.max(r,t.max))}s&&o||(a(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||a(this.getMinMax(!1))),n=tt(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),r=tt(r)&&!isNaN(r)?r:+e.endOf(Date.now(),i)+1,this.min=Math.min(n,r-1),this.max=Math.max(n+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,n="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const r=this.min,s=function(t,e,i){let n=0,r=t.length;for(;n<r&&t[n]<e;)n++;for(;r>n&&t[r-1]>i;)r--;return n>0||r<t.length?t.slice(n,r):t}(n,r,this.max);return this._unit=e.unit||(i.autoSkip?Fo(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):function(t,e,i,n,r){for(let s=Ro.length-1;s>=Ro.indexOf(i);s--){const i=Ro[s];if(Lo[i].common&&t._adapter.diff(r,n,i)>=e-1)return i}return Ro[i?Ro.indexOf(i):0]}(this,s.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=Ro.indexOf(t)+1,i=Ro.length;e<i;++e)if(Lo[Ro[e]].common)return Ro[e]}(this._unit):void 0,this.initOffsets(n),t.reverse&&s.reverse(),Vo(this,s,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map((t=>+t.value)))}initOffsets(t=[]){let e,i,n=0,r=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),n=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),r=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;n=Wt(n,0,s),r=Wt(r,0,s),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,e=this.min,i=this.max,n=this.options,r=n.time,s=r.unit||Fo(r.minUnit,e,i,this._getLabelCapacity(e)),o=it(n.ticks.stepSize,1),a="week"===s&&r.isoWeekday,l=Tt(a)||!0===a,h={};let c,u,f=e;if(l&&(f=+t.startOf(f,"isoWeek",a)),f=+t.startOf(f,l?"day":s),t.diff(i,e,s)>1e5*o)throw new Error(e+" and "+i+" are too far apart with stepSize of "+o+" "+s);const d="data"===n.ticks.source&&this.getDataTimestamps();for(c=f,u=0;c<i;c=+t.add(c,o,s),u++)jo(h,c,d);return c!==i&&"ticks"!==n.bounds&&1!==u||jo(h,c,d),Object.keys(h).sort(((t,e)=>t-e)).map((t=>+t))}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,n){const r=this.options,s=r.ticks.callback;if(s)return rt(s,[t,e,i],this);const o=r.time.displayFormats,a=this._unit,l=this._majorUnit,h=a&&o[a],c=l&&o[l],u=i[e],f=l&&c&&u&&u.major;return this._adapter.format(t,n||(f?c:h))}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e<i;++e)n=t[e],n.label=this._tickFormatFunction(n.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,n=Lt(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(n),s=Math.sin(n),o=this._resolveTickFontOptions(0).size;return{w:i*r+o*s,h:i*s+o*r}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,n=i[e.unit]||i.millisecond,r=this._tickFormatFunction(t,0,Vo(this,[t],this._majorUnit),n),s=this._getLabelSize(r),o=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return o>0?o:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t<e;++t)i=i.concat(n[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(i)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const n=this.getLabels();for(e=0,i=n.length;e<i;++e)t.push(zo(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Xt(t.sort(Io))}}function Wo(t,e,i){let n,r,s,o,a=0,l=t.length-1;i?(e>=t[a].pos&&e<=t[l].pos&&({lo:a,hi:l}=$t(t,"pos",e)),({pos:n,time:s}=t[a]),({pos:r,time:o}=t[l])):(e>=t[a].time&&e<=t[l].time&&({lo:a,hi:l}=$t(t,"time",e)),({time:n,pos:s}=t[a]),({time:r,pos:o}=t[l]));const h=r-n;return h?s+(o-s)*(e-n)/h:s}t(Bo,"id","time"),t(Bo,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});class No extends Bo{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Wo(e,this.min),this._tableRange=Wo(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],r=[];let s,o,a,l,h;for(s=0,o=t.length;s<o;++s)l=t[s],l>=e&&l<=i&&n.push(l);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(s=0,o=n.length;s<o;++s)h=n[s+1],a=n[s-1],l=n[s],Math.round((h+a)/2)!==l&&r.push({time:l,pos:s/(o-1)});return r}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Wo(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Wo(this._table,i*this._tableRange+this._minPos,!0)}}t(No,"id","timeseries"),t(No,"defaults",Bo.defaults);e("r",[_n,fs,ho,Object.freeze({__proto__:null,CategoryScale:fo,LinearScale:bo,LogarithmicScale:ko,RadialLinearScale:Eo,TimeScale:Bo,TimeSeriesScale:No})])}}}))}();