HumanBreak/assets/common-legacy.a38bdb29.js
2023-02-15 05:21:55 +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,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;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:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}System.register(["./antdv-legacy.e3a2a19a.js"],(function(e,n){"use strict";var i;return{setters:[t=>{i=t.c}],execute:function(){e({B:function(t,e=1,n=[0,0],i=0,r=(t=>1),s=!1){return o=>{const a=e*o*Math.PI*2+i*Math.PI/180,l=Math.cos(a),h=Math.sin(a),c=t*r(r(s?1-o:o));return[c*l+n[0],c*h+n[1]]}},O:function(...t){const e=[0].concat(t);e.push(1);const n=e.length,i=Array(n).fill(0).map(((t,e)=>((t,e)=>Math.round(c(e)/(c(t)*c(e-t))))(e,n-1)));return t=>((...t)=>t.reduce(((t,e)=>t+e),0))(...i.map(((i,r)=>i*e[r]*(1-t)**(n-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 n=Object.defineProperty,r=(t,e,i)=>(((t,e,i)=>{e in t?n(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i})(t,"symbol"!=typeof e?e+"":e,i),i);let s=[];const o=t=>{for(const n of s)if("running"===n.status)try{for(const e of n.funcs)e(t-n.startTime)}catch(e){n.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))}}e("I",a);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 n=0;await new Promise((e=>{const i=()=>{n++,n===t&&(this.unlisten("end",i),e(`${t} animated.`))};this.listen("end",i)}))}async w(t){if(!1===this.applying[t])throw new ReferenceError(`The ${t} animate is not animating.`);await new Promise((e=>{const n=()=>{!1===this.applying[t]&&(this.unlisten("end",n),e(`${t} animated.`))};this.listen("end",n)}))}listen(t,e){var n;null!=(n=this.listener)[t]||(n[t]=[]),this.listener[t].push(e)}unlisten(t,e){const n=this.listener[t].findIndex((t=>t===e));if(-1===n)throw new ReferenceError("You are trying to remove a nonexistent listener.");this.listener[t].splice(n,1)}hook(...t){const e=Object.entries(this.listener).filter((e=>t.includes(e[0])));for(const[n,i]of e)for(const t of i)t(this,n)}}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:n,shakeTiming:i}=this,r=Date.now();this.hook("start","shakestart");const s=()=>{const o=Date.now()-r;o>n&&(this.ticker.remove(s),this.applying.shake=!1,this.sx=0,this.sy=0,this.hook("end","shakeend"));const a=i(o/n);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:n,timing:i}=this,r=Date.now(),[s,o]=[this.x,this.y],[a,l]=(()=>{if("absolute"===n)return t(1);{const[e,n]=t(1);return[s+e,o+n]}})();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(i(l));"absolute"===n?(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,n=!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 i=this.value[t],r=Date.now(),{timing:s,relation:o,easeTime:a}=this,l="absolute"===o?e-i:e;this.hook("start");const h=()=>{const e=Date.now()-r;if(e>a)return void this.end(!1,t);const n=s(e/a);this.value[t]=i+n*l};return this.ticker.add(h,n),this.animateFn.custom[t]=h,this.targetValue.custom[t]=l+i,this}applyMulti(t=!1){!0===this.applying["@@bind"]&&this.end(!1,"@@bind"),this.applying["@@bind"]=!0;const e=this.bindInfo,n=e.map((t=>this.value[t])),i=Date.now(),{multiTiming:r,relation:s,easeTime:o}=this,a=r(1);if(a.length!==n.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()-i;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]:n[e]+a[e]}))};return this.ticker.add(l,t),this.animateFn.custom["@@bind"]=l,this.targetValue.system["@@bind"]=a,this}applySys(t,e,n){"move"!==n&&!0===this.applying[n]&&this.end(!0,n),this.applying[n]=!0;const i=this[t],r=Date.now(),s=this.timing,o=this.relation,a=this.easeTime,l="absolute"===o?e-i:e;this.hook("start",`${n}start`);const h=()=>{const e=Date.now()-r;if(e>a)return void this.end(!0,n);const o=s(e/a);this[t]=i+l*o,"oy"!==t&&this.hook(n)};this.ticker.add(h,!0),"ox"===t?this.animateFn.system.move[0]=h:"oy"===t?this.animateFn.system.move[1]=h:this.animateFn.system[n]=h,"move"===n?("ox"===t&&(this.targetValue.system.move[0]=l+i),"oy"===t&&(this.targetValue.system.move[1]=l+i)):"shake"!==n&&(this.targetValue.system[n]=l+i)}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,n)=>(this.transition(e,n),!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 n=Date.now(),i=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()-n;e>=i&&this.end(t);const o=e/i;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,n=(t=>1-e(1-t)))=>"in"===t?e:"out"===t?n:"in-out"===t?t=>t<.5?e(2*t)/2:.5+n(2*(t-.5))/2:t=>t<.5?n(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 n,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]",M="[object GeneratorFunction]",k="[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*$/,nt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,it=/[\\^$.*+?()[\]{}|]/g,rt=RegExp(it.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,Mt="\\ud800-\\udfff",kt="\\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="["+Mt+"]",Et="["+Ot+"]",Lt="["+kt+"]",Rt="\\d+",It="["+St+"]",zt="["+Pt+"]",Ft="[^"+Mt+Ot+Rt+St+Pt+At+"]",jt="\\ud83c[\\udffb-\\udfff]",Vt="[^"+Mt+"]",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"),ne=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"),ie=RegExp("["+Ht+Mt+kt+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[k]=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[k]=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 i&&i&&i.Object===Object&&i,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,Me=xe&&xe.isRegExp,ke=xe&&xe.isSet,Se=xe&&xe.isTypedArray;function Pe(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Ae(t,e,n,i){for(var r=-1,s=null==t?0:t.length;++r<s;){var o=t[r];e(i,o,n(o),t)}return i}function De(t,e){for(var n=-1,i=null==t?0:t.length;++n<i&&!1!==e(t[n],n,t););return t}function Oe(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function Ce(t,e){for(var n=-1,i=null==t?0:t.length;++n<i;)if(!e(t[n],n,t))return!1;return!0}function Te(t,e){for(var n=-1,i=null==t?0:t.length,r=0,s=[];++n<i;){var o=t[n];e(o,n,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,n){for(var i=-1,r=null==t?0:t.length;++i<r;)if(n(e,t[i]))return!0;return!1}function Re(t,e){for(var n=-1,i=null==t?0:t.length,r=Array(i);++n<i;)r[n]=e(t[n],n,t);return r}function Ie(t,e){for(var n=-1,i=e.length,r=t.length;++n<i;)t[r+n]=e[n];return t}function ze(t,e,n,i){var r=-1,s=null==t?0:t.length;for(i&&s&&(n=t[++r]);++r<s;)n=e(n,t[r],r,t);return n}function Fe(t,e,n,i){var r=null==t?0:t.length;for(i&&r&&(n=t[--r]);r--;)n=e(n,t[r],r,t);return n}function je(t,e){for(var n=-1,i=null==t?0:t.length;++n<i;)if(e(t[n],n,t))return!0;return!1}var Ve=Ye("length");function Be(t,e,n){var i;return n(t,(function(t,n,r){if(e(t,n,r))return i=n,!1})),i}function We(t,e,n,i){for(var r=t.length,s=n+(i?1:-1);i?s--:++s<r;)if(e(t[s],s,t))return s;return-1}function Ne(t,e,n){return e==e?function(t,e,n){var i=n-1,r=t.length;for(;++i<r;)if(t[i]===e)return i;return-1}(t,e,n):We(t,$e,n)}function He(t,e,n,i){for(var r=n-1,s=t.length;++r<s;)if(i(t[r],e))return r;return-1}function $e(t){return t!=t}function Ue(t,e){var n=null==t?0:t.length;return n?Ke(t,e)/n:p}function Ye(t){return function(e){return null==e?n:e[t]}}function qe(t){return function(e){return null==t?n:t[e]}}function Xe(t,e,n,i,r){return r(t,(function(t,r,s){n=i?(i=!1,t):e(n,t,r,s)})),n}function Ke(t,e){for(var i,r=-1,s=t.length;++r<s;){var o=e(t[r]);o!==n&&(i=i===n?o:i+o)}return i}function Ze(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}function Ge(t){return t?t.slice(0,mn(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 tn(t,e){return t.has(e)}function en(t,e){for(var n=-1,i=t.length;++n<i&&Ne(e,t[n],0)>-1;);return n}function nn(t,e){for(var n=t.length;n--&&Ne(e,t[n],0)>-1;);return n}function rn(t,e){for(var n=t.length,i=0;n--;)t[n]===e&&++i;return i}var sn=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"}),on=qe({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function an(t){return"\\"+he[t]}function ln(t){return ie.test(t)}function hn(t){var e=-1,n=Array(t.size);return t.forEach((function(t,i){n[++e]=[i,t]})),n}function cn(t,e){return function(n){return t(e(n))}}function un(t,e){for(var n=-1,i=t.length,r=0,s=[];++n<i;){var a=t[n];a!==e&&a!==o||(t[n]=o,s[r++]=n)}return s}function fn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function dn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function pn(t){return ln(t)?function(t){var e=ee.lastIndex=0;for(;ee.test(t);)++e;return e}(t):Ve(t)}function gn(t){return ln(t)?function(t){return t.match(ee)||[]}(t):function(t){return t.split("")}(t)}function mn(t){for(var e=t.length;e--&&ot.test(t.charAt(e)););return e}var bn=qe({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var _n=function t(e){var i=(e=null==e?pe:_n.defaults(pe.Object(),e,_n.pick(pe,se))).Array,ot=e.Date,Mt=e.Error,kt=e.Function,St=e.Math,Pt=e.Object,At=e.RegExp,Dt=e.String,Ot=e.TypeError,Ct=i.prototype,Tt=kt.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(it,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Nt=be?e.Buffer:n,Ht=e.Symbol,$t=e.Uint8Array,Ut=Nt?Nt.allocUnsafe:n,Yt=cn(Pt.getPrototypeOf,Pt),qt=Pt.create,Xt=Et.propertyIsEnumerable,Kt=Ct.splice,Zt=Ht?Ht.isConcatSpreadable:n,Gt=Ht?Ht.iterator:n,Jt=Ht?Ht.toStringTag:n,ee=function(){try{var t=fs(Pt,"defineProperty");return t({},"",{}),t}catch(e){}}(),ie=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:n,xe=e.isFinite,Ve=Ct.join,qe=cn(Pt.keys,Pt),xn=St.max,vn=St.min,yn=ot.now,wn=e.parseInt,Mn=St.random,kn=Ct.reverse,Sn=fs(e,"DataView"),Pn=fs(e,"Map"),An=fs(e,"Promise"),Dn=fs(e,"Set"),On=fs(e,"WeakMap"),Cn=fs(Pt,"create"),Tn=On&&new On,En={},Ln=Vs(Sn),Rn=Vs(Pn),In=Vs(An),zn=Vs(Dn),Fn=Vs(On),jn=Ht?Ht.prototype:n,Vn=jn?jn.valueOf:n,Bn=jn?jn.toString:n;function Wn(t){if(ia(t)&&!Yo(t)&&!(t instanceof Un)){if(t instanceof $n)return t;if(It.call(t,"__wrapped__"))return Bs(t)}return new $n(t)}var Nn=function(){function t(){}return function(e){if(!na(e))return{};if(qt)return qt(e);t.prototype=e;var i=new t;return t.prototype=n,i}}();function Hn(){}function $n(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=n}function Un(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g,this.__views__=[]}function Yn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function qn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function Xn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function Kn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Xn;++e<n;)this.add(t[e])}function Zn(t){var e=this.__data__=new qn(t);this.size=e.size}function Gn(t,e){var n=Yo(t),i=!n&&Uo(t),r=!n&&!i&&Zo(t),s=!n&&!i&&!r&&ua(t),o=n||i||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 Jn(t){var e=t.length;return e?t[Ki(0,e-1)]:n}function Qn(t,e){return zs(Cr(t),li(e,0,t.length))}function ti(t){return zs(Cr(t))}function ei(t,e,i){(i!==n&&!No(t[e],i)||i===n&&!(e in t))&&oi(t,e,i)}function ni(t,e,i){var r=t[e];It.call(t,e)&&No(r,i)&&(i!==n||e in t)||oi(t,e,i)}function ii(t,e){for(var n=t.length;n--;)if(No(t[n][0],e))return n;return-1}function ri(t,e,n,i){return di(t,(function(t,r,s){e(i,t,n(t),s)})),i}function si(t,e){return t&&Tr(e,La(e),t)}function oi(t,e,n){"__proto__"==e&&ee?ee(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function ai(t,e){for(var r=-1,s=e.length,o=i(s),a=null==t;++r<s;)o[r]=a?n:Da(t,e[r]);return o}function li(t,e,i){return t==t&&(i!==n&&(t=t<=i?t:i),e!==n&&(t=t>=e?t:e)),t}function hi(t,e,i,r,s,o){var a,l=1&e,h=2&e,c=4&e;if(i&&(a=s?i(t,r,s,o):i(t)),a!==n)return a;if(!na(t))return t;var u=Yo(t);if(u){if(a=function(t){var e=t.length,n=new t.constructor(e);e&&"string"==typeof t[0]&&It.call(t,"index")&&(n.index=t.index,n.input=t.input);return n}(t),!l)return Cr(t,a)}else{var f=gs(t),d=f==w||f==M;if(Zo(t))return kr(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,si(a,t))}else{if(!le[f])return s?t:{};a=function(t,e,n){var i=t.constructor;switch(e){case L:return Sr(t);case x:case v:return new i(+t);case R:return function(t,e){var n=e?Sr(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case I:case z:case F:case j:case V:case B:case W:case N:case H:return Pr(t,n);case k:return new i;case S:case C:return new i(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 i;case T:return r=t,Vn?Pt(Vn.call(r)):{}}var r}(t,f,l)}}o||(o=new Zn);var p=o.get(t);if(p)return p;o.set(t,a),la(t)?t.forEach((function(n){a.add(hi(n,e,i,n,t,o))})):ra(t)&&t.forEach((function(n,r){a.set(r,hi(n,e,i,r,t,o))}));var g=u?n:(c?h?ss:rs:h?Ra:La)(t);return De(g||t,(function(n,r){g&&(n=t[r=n]),ni(a,r,hi(n,e,i,r,t,o))})),a}function ci(t,e,i){var r=i.length;if(null==t)return!r;for(t=Pt(t);r--;){var s=i[r],o=e[s],a=t[s];if(a===n&&!(s in t)||!o(a))return!1}return!0}function ui(t,e,i){if("function"!=typeof t)throw new Ot(r);return Es((function(){t.apply(n,i)}),e)}function fi(t,e,n,i){var r=-1,s=Ee,o=!0,a=t.length,l=[],h=e.length;if(!a)return l;n&&(e=Re(e,Je(n))),i?(s=Le,o=!1):e.length>=200&&(s=tn,o=!1,e=new Kn(e));t:for(;++r<a;){var c=t[r],u=null==n?c:n(c);if(c=i||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,i)||l.push(c)}return l}Wn.templateSettings={escape:G,evaluate:J,interpolate:Q,variable:"",imports:{_:Wn}},Wn.prototype=Hn.prototype,Wn.prototype.constructor=Wn,$n.prototype=Nn(Hn.prototype),$n.prototype.constructor=$n,Un.prototype=Nn(Hn.prototype),Un.prototype.constructor=Un,Yn.prototype.clear=function(){this.__data__=Cn?Cn(null):{},this.size=0},Yn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Yn.prototype.get=function(t){var e=this.__data__;if(Cn){var i=e[t];return i===s?n:i}return It.call(e,t)?e[t]:n},Yn.prototype.has=function(t){var e=this.__data__;return Cn?e[t]!==n:It.call(e,t)},Yn.prototype.set=function(t,e){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=Cn&&e===n?s:e,this},qn.prototype.clear=function(){this.__data__=[],this.size=0},qn.prototype.delete=function(t){var e=this.__data__,n=ii(e,t);return!(n<0)&&(n==e.length-1?e.pop():Kt.call(e,n,1),--this.size,!0)},qn.prototype.get=function(t){var e=this.__data__,i=ii(e,t);return i<0?n:e[i][1]},qn.prototype.has=function(t){return ii(this.__data__,t)>-1},qn.prototype.set=function(t,e){var n=this.__data__,i=ii(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this},Xn.prototype.clear=function(){this.size=0,this.__data__={hash:new Yn,map:new(Pn||qn),string:new Yn}},Xn.prototype.delete=function(t){var e=cs(this,t).delete(t);return this.size-=e?1:0,e},Xn.prototype.get=function(t){return cs(this,t).get(t)},Xn.prototype.has=function(t){return cs(this,t).has(t)},Xn.prototype.set=function(t,e){var n=cs(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this},Kn.prototype.add=Kn.prototype.push=function(t){return this.__data__.set(t,s),this},Kn.prototype.has=function(t){return this.__data__.has(t)},Zn.prototype.clear=function(){this.__data__=new qn,this.size=0},Zn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Zn.prototype.get=function(t){return this.__data__.get(t)},Zn.prototype.has=function(t){return this.__data__.has(t)},Zn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof qn){var i=n.__data__;if(!Pn||i.length<199)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new Xn(i)}return n.set(t,e),this.size=n.size,this};var di=Rr(yi),pi=Rr(wi,!0);function gi(t,e){var n=!0;return di(t,(function(t,i,r){return n=!!e(t,i,r)})),n}function mi(t,e,i){for(var r=-1,s=t.length;++r<s;){var o=t[r],a=e(o);if(null!=a&&(l===n?a==a&&!ca(a):i(a,l)))var l=a,h=o}return h}function bi(t,e){var n=[];return di(t,(function(t,i,r){e(t,i,r)&&n.push(t)})),n}function _i(t,e,n,i,r){var s=-1,o=t.length;for(n||(n=_s),r||(r=[]);++s<o;){var a=t[s];e>0&&n(a)?e>1?_i(a,e-1,n,i,r):Ie(r,a):i||(r[r.length]=a)}return r}var xi=Ir(),vi=Ir(!0);function yi(t,e){return t&&xi(t,e,La)}function wi(t,e){return t&&vi(t,e,La)}function Mi(t,e){return Te(e,(function(e){return Qo(t[e])}))}function ki(t,e){for(var i=0,r=(e=vr(e,t)).length;null!=t&&i<r;)t=t[js(e[i++])];return i&&i==r?t:n}function Si(t,e,n){var i=e(t);return Yo(t)?i:Ie(i,n(t))}function Pi(t){return null==t?t===n?"[object Undefined]":"[object Null]":Jt&&Jt in Pt(t)?function(t){var e=It.call(t,Jt),i=t[Jt];try{t[Jt]=n;var r=!0}catch(o){}var s=jt.call(t);r&&(e?t[Jt]=i:delete t[Jt]);return s}(t):function(t){return jt.call(t)}(t)}function Ai(t,e){return t>e}function Di(t,e){return null!=t&&It.call(t,e)}function Oi(t,e){return null!=t&&e in Pt(t)}function Ci(t,e,r){for(var s=r?Le:Ee,o=t[0].length,a=t.length,l=a,h=i(a),c=1/0,u=[];l--;){var f=t[l];l&&e&&(f=Re(f,Je(e))),c=vn(f.length,c),h[l]=!r&&(e||o>=120&&f.length>=120)?new Kn(l&&f):n}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?tn(p,m):s(u,m,r))){for(l=a;--l;){var b=h[l];if(!(b?tn(b,m):s(t[l],m,r)))continue t}p&&p.push(m),u.push(g)}}return u}function Ti(t,e,i){var r=null==(t=Ds(t,e=vr(e,t)))?t:t[js(Gs(e))];return null==r?n:Pe(r,t,i)}function Ei(t){return ia(t)&&Pi(t)==b}function Li(t,e,i,r,s){return t===e||(null==t||null==e||!ia(t)&&!ia(e)?t!=t&&e!=e:function(t,e,i,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 Zn),a||ua(t)?ns(t,e,i,r,s,o):function(t,e,n,i,r,s,o){switch(n){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 k:var a=hn;case O:var l=1&i;if(a||(a=fn),t.size!=e.size&&!l)return!1;var h=o.get(t);if(h)return h==e;i|=2,o.set(t,e);var c=ns(a(t),a(e),i,r,s,o);return o.delete(t),c;case T:if(Vn)return Vn.call(t)==Vn.call(e)}return!1}(t,e,h,i,r,s,o);if(!(1&i)){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 Zn),s(m,w,i,r,o)}}if(!d)return!1;return o||(o=new Zn),function(t,e,i,r,s,o){var a=1&i,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===n?_===x||s(_,x,i,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,i,r,s,o)}(t,e,i,r,Li,s))}function Ri(t,e,i,r){var s=i.length,o=s,a=!r;if(null==t)return!o;for(t=Pt(t);s--;){var l=i[s];if(a&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++s<o;){var h=(l=i[s])[0],c=t[h],u=l[1];if(a&&l[2]){if(c===n&&!(h in t))return!1}else{var f=new Zn;if(r)var d=r(c,u,h,t,e,f);if(!(d===n?Li(u,c,3,r,f):d))return!1}}return!0}function Ii(t){return!(!na(t)||(e=t,Ft&&Ft in e))&&(Qo(t)?Wt:bt).test(Vs(t));var e}function zi(t){return"function"==typeof t?t:null==t?sl:"object"==typeof t?Yo(t)?Ni(t[0],t[1]):Wi(t):pl(t)}function Fi(t){if(!ks(t))return qe(t);var e=[];for(var n in Pt(t))It.call(t,n)&&"constructor"!=n&&e.push(n);return e}function ji(t){if(!na(t))return function(t){var e=[];if(null!=t)for(var n in Pt(t))e.push(n);return e}(t);var e=ks(t),n=[];for(var i in t)("constructor"!=i||!e&&It.call(t,i))&&n.push(i);return n}function Vi(t,e){return t<e}function Bi(t,e){var n=-1,r=Xo(t)?i(t.length):[];return di(t,(function(t,i,s){r[++n]=e(t,i,s)})),r}function Wi(t){var e=us(t);return 1==e.length&&e[0][2]?Ps(e[0][0],e[0][1]):function(n){return n===t||Ri(n,t,e)}}function Ni(t,e){return ys(t)&&Ss(e)?Ps(js(t),e):function(i){var r=Da(i,t);return r===n&&r===e?Oa(i,t):Li(e,r,3)}}function Hi(t,e,i,r,s){t!==e&&xi(e,(function(o,a){if(s||(s=new Zn),na(o))!function(t,e,i,r,s,o,a){var l=Cs(t,i),h=Cs(e,i),c=a.get(h);if(c)return void ei(t,i,c);var u=o?o(l,h,i+"",t,e,a):n,f=u===n;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=kr(h,!0)):g?(f=!1,u=Pr(h,!0)):u=[]:oa(h)||Uo(h)?(u=l,Uo(l)?u=xa(l):na(l)&&!Qo(l)||(u=bs(h))):f=!1}f&&(a.set(h,u),s(u,h,r,o,a),a.delete(h));ei(t,i,u)}(t,e,a,i,Hi,r,s);else{var l=r?r(Cs(t,a),o,a+"",t,e,s):n;l===n&&(l=o),ei(t,a,l)}}),Ra)}function $i(t,e){var i=t.length;if(i)return xs(e+=e<0?i:0,i)?t[e]:n}function Ui(t,e,n){e=e.length?Re(e,(function(t){return Yo(t)?function(e){return ki(e,1===t.length?t[0]:t)}:t})):[sl];var i=-1;e=Re(e,Je(hs()));var r=Bi(t,(function(t,n,r){var s=Re(e,(function(e){return e(t)}));return{criteria:s,index:++i,value:t}}));return function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(r,(function(t,e){return function(t,e,n){var i=-1,r=t.criteria,s=e.criteria,o=r.length,a=n.length;for(;++i<o;){var l=Ar(r[i],s[i]);if(l)return i>=a?l:l*("desc"==n[i]?-1:1)}return t.index-e.index}(t,e,n)}))}function Yi(t,e,n){for(var i=-1,r=e.length,s={};++i<r;){var o=e[i],a=ki(t,o);n(a,o)&&tr(s,vr(o,t),a)}return s}function qi(t,e,n,i){var r=i?He:Ne,s=-1,o=e.length,a=t;for(t===e&&(e=Cr(e)),n&&(a=Re(t,Je(n)));++s<o;)for(var l=0,h=e[s],c=n?n(h):h;(l=r(a,c,l,i))>-1;)a!==t&&Kt.call(a,l,1),Kt.call(t,l,1);return t}function Xi(t,e){for(var n=t?e.length:0,i=n-1;n--;){var r=e[n];if(n==i||r!==s){var s=r;xs(r)?Kt.call(t,r,1):fr(t,r)}}return t}function Ki(t,e){return t+ge(Mn()*(e-t+1))}function Zi(t,e){var n="";if(!t||e<1||e>d)return n;do{e%2&&(n+=t),(e=ge(e/2))&&(t+=t)}while(e);return n}function Gi(t,e){return Ls(As(t,e,sl),t+"")}function Ji(t){return Jn(Na(t))}function Qi(t,e){var n=Na(t);return zs(n,li(e,0,n.length))}function tr(t,e,i,r){if(!na(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=i;if("__proto__"===h||"constructor"===h||"prototype"===h)return t;if(s!=a){var u=l[h];(c=r?r(u,h,l):n)===n&&(c=na(u)?u:xs(e[s+1])?[]:{})}ni(l,h,c),l=l[h]}return t}var er=Tn?function(t,e){return Tn.set(t,e),t}:sl,nr=ee?function(t,e){return ee(t,"toString",{configurable:!0,enumerable:!1,value:nl(e),writable:!0})}:sl;function ir(t){return zs(Na(t))}function rr(t,e,n){var r=-1,s=t.length;e<0&&(e=-e>s?0:s+e),(n=n>s?s:n)<0&&(n+=s),s=e>n?0:n-e>>>0,e>>>=0;for(var o=i(s);++r<s;)o[r]=t[r+e];return o}function sr(t,e){var n;return di(t,(function(t,i,r){return!(n=e(t,i,r))})),!!n}function or(t,e,n){var i=0,r=null==t?i:t.length;if("number"==typeof e&&e==e&&r<=2147483647){for(;i<r;){var s=i+r>>>1,o=t[s];null!==o&&!ca(o)&&(n?o<=e:o<e)?i=s+1:r=s}return r}return ar(t,e,sl,n)}function ar(t,e,i,r){var s=0,o=null==t?0:t.length;if(0===o)return 0;for(var a=(e=i(e))!=e,l=null===e,h=ca(e),c=e===n;s<o;){var u=ge((s+o)/2),f=i(t[u]),d=f!==n,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 vn(o,4294967294)}function lr(t,e){for(var n=-1,i=t.length,r=0,s=[];++n<i;){var o=t[n],a=e?e(o):o;if(!n||!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 Bn?Bn.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ur(t,e,n){var i=-1,r=Ee,s=t.length,o=!0,a=[],l=a;if(n)o=!1,r=Le;else if(s>=200){var h=e?null:Zr(t);if(h)return fn(h);o=!1,r=tn,l=new Kn}else l=e?[]:a;t:for(;++i<s;){var c=t[i],u=e?e(c):c;if(c=n||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,n)||(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,n,i){return tr(t,e,n(ki(t,e)),i)}function pr(t,e,n,i){for(var r=t.length,s=i?r:-1;(i?s--:++s<r)&&e(t[s],s,t););return n?rr(t,i?0:s,i?s+1:r):rr(t,i?s+1:0,i?r:s)}function gr(t,e){var n=t;return n instanceof Un&&(n=n.value()),ze(e,(function(t,e){return e.func.apply(e.thisArg,Ie([t],e.args))}),n)}function mr(t,e,n){var r=t.length;if(r<2)return r?ur(t[0]):[];for(var s=-1,o=i(r);++s<r;)for(var a=t[s],l=-1;++l<r;)l!=s&&(o[s]=fi(o[s]||a,t[l],e,n));return ur(_i(o,1),e,n)}function br(t,e,i){for(var r=-1,s=t.length,o=e.length,a={};++r<s;){var l=r<o?e[r]:n;i(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=Gi;function wr(t,e,i){var r=t.length;return i=i===n?r:i,!e&&i>=r?t:rr(t,e,i)}var Mr=ie||function(t){return pe.clearTimeout(t)};function kr(t,e){if(e)return t.slice();var n=t.length,i=Ut?Ut(n):new t.constructor(n);return t.copy(i),i}function Sr(t){var e=new t.constructor(t.byteLength);return new $t(e).set(new $t(t)),e}function Pr(t,e){var n=e?Sr(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Ar(t,e){if(t!==e){var i=t!==n,r=null===t,s=t==t,o=ca(t),a=e!==n,l=null===e,h=e==e,c=ca(e);if(!l&&!c&&!o&&t>e||o&&a&&h&&!l&&!c||r&&a&&h||!i&&h||!s)return 1;if(!r&&!o&&!c&&t<e||c&&i&&s&&!r&&!o||l&&i&&s||!a&&s||!h)return-1}return 0}function Dr(t,e,n,r){for(var s=-1,o=t.length,a=n.length,l=-1,h=e.length,c=xn(o-a,0),u=i(h+c),f=!r;++l<h;)u[l]=e[l];for(;++s<a;)(f||s<o)&&(u[n[s]]=t[s]);for(;c--;)u[l++]=t[s++];return u}function Or(t,e,n,r){for(var s=-1,o=t.length,a=-1,l=n.length,h=-1,c=e.length,u=xn(o-l,0),f=i(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+n[a]]=t[s++]);return f}function Cr(t,e){var n=-1,r=t.length;for(e||(e=i(r));++n<r;)e[n]=t[n];return e}function Tr(t,e,i,r){var s=!i;i||(i={});for(var o=-1,a=e.length;++o<a;){var l=e[o],h=r?r(i[l],t[l],l,i,t):n;h===n&&(h=t[l]),s?oi(i,l,h):ni(i,l,h)}return i}function Er(t,e){return function(n,i){var r=Yo(n)?Ae:ri,s=e?e():{};return r(n,t,hs(i,2),s)}}function Lr(t){return Gi((function(e,i){var r=-1,s=i.length,o=s>1?i[s-1]:n,a=s>2?i[2]:n;for(o=t.length>3&&"function"==typeof o?(s--,o):n,a&&vs(i[0],i[1],a)&&(o=s<3?n:o,s=1),e=Pt(e);++r<s;){var l=i[r];l&&t(e,l,r,o)}return e}))}function Rr(t,e){return function(n,i){if(null==n)return n;if(!Xo(n))return t(n,i);for(var r=n.length,s=e?r:-1,o=Pt(n);(e?s--:++s<r)&&!1!==i(o[s],s,o););return n}}function Ir(t){return function(e,n,i){for(var r=-1,s=Pt(e),o=i(e),a=o.length;a--;){var l=o[t?a:++r];if(!1===n(s[l],l,s))break}return e}}function zr(t){return function(e){var i=ln(e=va(e))?gn(e):n,r=i?i[0]:e.charAt(0),s=i?wr(i,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 n=Nn(t.prototype),i=t.apply(n,e);return na(i)?i:n}}function Vr(t){return function(e,i,r){var s=Pt(e);if(!Xo(e)){var o=hs(i,3);e=La(e),i=function(t){return o(s[t],t,s)}}var a=t(e,i,r);return a>-1?s[o?e[a]:a]:n}}function Br(t){return is((function(e){var i=e.length,s=i,o=$n.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 $n([],!0)}for(s=l?s:i;++s<i;){var h=as(a=e[s]),c="wrapper"==h?os(a):n;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,n=t[0];if(l&&1==t.length&&Yo(n))return l.plant(n).value();for(var r=0,s=i?e[r].apply(this,t):n;++r<i;)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?n:jr(t);return function n(){for(var c=arguments.length,x=i(c),v=c;v--;)x[v]=arguments[v];if(m)var y=ls(n),w=rn(x,y);if(s&&(x=Dr(x,s,o,m)),a&&(x=Or(x,a,l,m)),c-=w,m&&c<f){var M=un(x,y);return Xr(t,e,Wr,n.placeholder,r,x,M,h,u,f-c)}var k=p?r:this,S=g?k[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 n&&(S=_||jr(S)),S.apply(k,x)}}function Nr(t,e){return function(n,i){return function(t,e,n,i){return yi(t,(function(t,r,s){e(i,n(t),r,s)})),i}(n,t,e(i),{})}}function Hr(t,e){return function(i,r){var s;if(i===n&&r===n)return e;if(i!==n&&(s=i),r!==n){if(s===n)return r;"string"==typeof i||"string"==typeof r?(i=cr(i),r=cr(r)):(i=hr(i),r=hr(r)),s=t(i,r)}return s}}function $r(t){return is((function(e){return e=Re(e,Je(hs())),Gi((function(n){var i=this;return t(e,(function(t){return Pe(t,i,n)}))}))}))}function Ur(t,e){var i=(e=e===n?" ":cr(e)).length;if(i<2)return i?Zi(e,t):e;var r=Zi(e,de(t/pn(e)));return ln(e)?wr(gn(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=n),e=ga(e),r===n?(r=e,e=0):r=ga(r),function(t,e,n,r){for(var s=-1,o=xn(de((e-t)/(n||1)),0),a=i(o);o--;)a[r?o:++s]=t,t+=n;return a}(e,r,s=s===n?e<r?1:-1:ga(s),t)}}function qr(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=_a(e),n=_a(n)),t(e,n)}}function Xr(t,e,i,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:n,d?a:n,d?n:o,d?n:a,c,u,f],g=i.apply(n,p);return ws(t)&&Ts(g,p),g.placeholder=r,Rs(g,t,e)}function Kr(t){var e=St[t];return function(t,n){if(t=_a(t),(n=null==n?0:vn(ma(n),292))&&xe(t)){var i=(va(t)+"e").split("e");return+((i=(va(e(i[0]+"e"+(+i[1]+n)))+"e").split("e"))[0]+"e"+(+i[1]-n))}return e(t)}}var Zr=Dn&&1/fn(new Dn([,-0]))[1]==f?function(t){return new Dn(t)}:cl;function Gr(t){return function(e){var n=gs(e);return n==k?hn(e):n==O?dn(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=n),g=g===n?g:xn(ma(g),0),m=m===n?m:ma(m),_-=d?d.length:0,e&h){var x=f,v=d;f=d=n}var y=b?n:os(t),w=[t,e,s,f,d,x,v,p,g,m];if(y&&function(t,e){var n=t[1],i=e[1],r=n|i,s=r<131,a=i==c&&8==n||i==c&&n==u&&t[7].length<=e[8]||384==i&&e[7].length<=e[8]&&8==n;if(!s&&!a)return t;1&i&&(t[2]=e[2],r|=1&n?0:4);var l=e[3];if(l){var h=t[3];t[3]=h?Dr(h,l,e[4]):l,t[4]=h?un(t[3],o):e[4]}(l=e[5])&&(h=t[5],t[5]=h?Or(h,l,e[6]):l,t[6]=h?un(t[5],o):e[6]);(l=e[7])&&(t[7]=l);i&c&&(t[8]=null==t[8]?e[8]:vn(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]===n?b?0:t.length:xn(w[9]-_,0))&&24&e&&(e&=-25),e&&1!=e)M=8==e||e==a?function(t,e,r){var s=jr(t);return function o(){for(var a=arguments.length,l=i(a),h=a,c=ls(o);h--;)l[h]=arguments[h];var u=a<3&&l[0]!==c&&l[a-1]!==c?[]:un(l,c);return(a-=u.length)<r?Xr(t,e,Wr,o.placeholder,n,l,u,n,n,r-a):Pe(this&&this!==pe&&this instanceof o?s:t,this,l)}}(t,e,m):e!=l&&33!=e||d.length?Wr.apply(n,w):function(t,e,n,r){var s=1&e,o=jr(t);return function e(){for(var a=-1,l=arguments.length,h=-1,c=r.length,u=i(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?n:this,u)}}(t,e,s,f);else var M=function(t,e,n){var i=1&e,r=jr(t);return function e(){return(this&&this!==pe&&this instanceof e?r:t).apply(i?n:this,arguments)}}(t,e,s);return Rs((y?er:Ts)(M,w),t,e)}function Qr(t,e,i,r){return t===n||No(t,Et[i])&&!It.call(r,i)?e:t}function ts(t,e,i,r,s,o){return na(t)&&na(e)&&(o.set(e,t),Hi(t,e,n,ts,o),o.delete(e)),t}function es(t){return oa(t)?n:t}function ns(t,e,i,r,s,o){var a=1&i,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&i?new Kn:n;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!==n){if(b)continue;d=!1;break}if(p){if(!je(e,(function(t,e){if(!tn(p,e)&&(g===t||s(g,t,i,r,o)))return p.push(e)}))){d=!1;break}}else if(g!==m&&!s(g,m,i,r,o)){d=!1;break}}return o.delete(t),o.delete(e),d}function is(t){return Ls(As(t,n,Ys),t+"")}function rs(t){return Si(t,La,ds)}function ss(t){return Si(t,Ra,ps)}var os=Tn?function(t){return Tn.get(t)}:cl;function as(t){for(var e=t.name+"",n=En[e],i=It.call(En,e)?n.length:0;i--;){var r=n[i],s=r.func;if(null==s||s==t)return r.name}return e}function ls(t){return(It.call(Wn,"placeholder")?Wn:t).placeholder}function hs(){var t=Wn.iteratee||ol;return t=t===ol?zi:t,arguments.length?t(arguments[0],arguments[1]):t}function cs(t,e){var n,i,r=t.__data__;return("string"==(i=typeof(n=e))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==n:null===n)?r["string"==typeof e?"string":"hash"]:r.map}function us(t){for(var e=La(t),n=e.length;n--;){var i=e[n],r=t[i];e[n]=[i,r,Ss(r)]}return e}function fs(t,e){var i=function(t,e){return null==t?n:t[e]}(t,e);return Ii(i)?i:n}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=Pi;function ms(t,e,n){for(var i=-1,r=(e=vr(e,t)).length,s=!1;++i<r;){var o=js(e[i]);if(!(s=null!=t&&n(t,o)))break;t=t[o]}return s||++i!=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||ks(t)?{}:Nn(Yt(t))}function _s(t){return Yo(t)||Uo(t)||!!(Zt&&t&&t[Zt])}function xs(t,e){var n=typeof t;return!!(e=null==e?d:e)&&("number"==n||"symbol"!=n&&xt.test(t))&&t>-1&&t%1==0&&t<e}function vs(t,e,n){if(!na(n))return!1;var i=typeof e;return!!("number"==i?Xo(n)&&xs(e,n.length):"string"==i&&e in n)&&No(n[e],t)}function ys(t,e){if(Yo(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!ca(t))||(et.test(t)||!tt.test(t)||null!=e&&t in Pt(e))}function ws(t){var e=as(t),n=Wn[e];if("function"!=typeof n||!(e in Un.prototype))return!1;if(t===n)return!0;var i=os(n);return!!i&&t===i[0]}(Sn&&gs(new Sn(new ArrayBuffer(1)))!=R||Pn&&gs(new Pn)!=k||An&&gs(An.resolve())!=A||Dn&&gs(new Dn)!=O||On&&gs(new On)!=E)&&(gs=function(t){var e=Pi(t),i=e==P?t.constructor:n,r=i?Vs(i):"";if(r)switch(r){case Ln:return R;case Rn:return k;case In:return A;case zn:return O;case Fn:return E}return e});var Ms=Lt?Qo:_l;function ks(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Et)}function Ss(t){return t==t&&!na(t)}function Ps(t,e){return function(i){return null!=i&&(i[t]===e&&(e!==n||t in Pt(i)))}}function As(t,e,r){return e=xn(e===n?t.length-1:e,0),function(){for(var n=arguments,s=-1,o=xn(n.length-e,0),a=i(o);++s<o;)a[s]=n[e+s];s=-1;for(var l=i(e+1);++s<e;)l[s]=n[s];return l[e]=r(a),Pe(t,this,l)}}function Ds(t,e){return e.length<2?t:ki(t,rr(e,0,-1))}function Os(t,e){for(var i=t.length,r=vn(e.length,i),s=Cr(t);r--;){var o=e[r];t[r]=xs(o,i)?s[o]:n}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(nr);function Rs(t,e,n){var i=e+"";return Ls(t,function(t,e){var n=e.length;if(!n)return t;var i=n-1;return e[i]=(n>1?"& ":"")+e[i],e=e.join(n>2?", ":" "),t.replace(at,"{\n/* [wrapped with "+e+"] */\n")}(i,function(t,e){return De(m,(function(n){var i="_."+n[0];e&n[1]&&!Ee(t,i)&&t.push(i)})),t.sort()}(function(t){var e=t.match(lt);return e?e[1].split(ht):[]}(i),n)))}function Is(t){var e=0,i=0;return function(){var r=yn(),s=16-(r-i);if(i=r,s>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(n,arguments)}}function zs(t,e){var i=-1,r=t.length,s=r-1;for(e=e===n?r:e;++i<e;){var o=Ki(i,s),a=t[o];t[o]=t[i],t[i]=a}return t.length=e,t}var Fs=function(t){var e=zo(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(nt,(function(t,n,i,r){e.push(i?r.replace(ft,"$1"):n||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 Un)return t.clone();var e=new $n(t.__wrapped__,t.__chain__);return e.__actions__=Cr(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Ws=Gi((function(t,e){return Ko(t)?fi(t,_i(e,1,Ko,!0)):[]})),Ns=Gi((function(t,e){var i=Gs(e);return Ko(i)&&(i=n),Ko(t)?fi(t,_i(e,1,Ko,!0),hs(i,2)):[]})),Hs=Gi((function(t,e){var i=Gs(e);return Ko(i)&&(i=n),Ko(t)?fi(t,_i(e,1,Ko,!0),n,i):[]}));function $s(t,e,n){var i=null==t?0:t.length;if(!i)return-1;var r=null==n?0:ma(n);return r<0&&(r=xn(i+r,0)),We(t,hs(e,3),r)}function Us(t,e,i){var r=null==t?0:t.length;if(!r)return-1;var s=r-1;return i!==n&&(s=ma(i),s=i<0?xn(r+s,0):vn(s,r-1)),We(t,hs(e,3),s,!0)}function Ys(t){return(null==t?0:t.length)?_i(t,1):[]}function qs(t){return t&&t.length?t[0]:n}var Xs=Gi((function(t){var e=Re(t,_r);return e.length&&e[0]===t[0]?Ci(e):[]})),Ks=Gi((function(t){var e=Gs(t),i=Re(t,_r);return e===Gs(i)?e=n:i.pop(),i.length&&i[0]===t[0]?Ci(i,hs(e,2)):[]})),Zs=Gi((function(t){var e=Gs(t),i=Re(t,_r);return(e="function"==typeof e?e:n)&&i.pop(),i.length&&i[0]===t[0]?Ci(i,n,e):[]}));function Gs(t){var e=null==t?0:t.length;return e?t[e-1]:n}var Js=Gi(Qs);function Qs(t,e){return t&&t.length&&e&&e.length?qi(t,e):t}var to=is((function(t,e){var n=null==t?0:t.length,i=ai(t,e);return Xi(t,Re(e,(function(t){return xs(t,n)?+t:t})).sort(Ar)),i}));function eo(t){return null==t?t:kn.call(t)}var no=Gi((function(t){return ur(_i(t,1,Ko,!0))})),io=Gi((function(t){var e=Gs(t);return Ko(e)&&(e=n),ur(_i(t,1,Ko,!0),hs(e,2))})),ro=Gi((function(t){var e=Gs(t);return e="function"==typeof e?e:n,ur(_i(t,1,Ko,!0),n,e)}));function so(t){if(!t||!t.length)return[];var e=0;return t=Te(t,(function(t){if(Ko(t))return e=xn(t.length,e),!0})),Ze(e,(function(e){return Re(t,Ye(e))}))}function oo(t,e){if(!t||!t.length)return[];var i=so(t);return null==e?i:Re(i,(function(t){return Pe(e,n,t)}))}var ao=Gi((function(t,e){return Ko(t)?fi(t,e):[]})),lo=Gi((function(t){return mr(Te(t,Ko))})),ho=Gi((function(t){var e=Gs(t);return Ko(e)&&(e=n),mr(Te(t,Ko),hs(e,2))})),co=Gi((function(t){var e=Gs(t);return e="function"==typeof e?e:n,mr(Te(t,Ko),n,e)})),uo=Gi(so);var fo=Gi((function(t){var e=t.length,i=e>1?t[e-1]:n;return i="function"==typeof i?(t.pop(),i):n,oo(t,i)}));function po(t){var e=Wn(t);return e.__chain__=!0,e}function go(t,e){return e(t)}var mo=is((function(t){var e=t.length,i=e?t[0]:0,r=this.__wrapped__,s=function(e){return ai(e,t)};return!(e>1||this.__actions__.length)&&r instanceof Un&&xs(i)?((r=r.slice(i,+i+(e?1:0))).__actions__.push({func:go,args:[s],thisArg:n}),new $n(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(n),t}))):this.thru(s)}));var bo=Er((function(t,e,n){It.call(t,n)?++t[n]:oi(t,n,1)}));var _o=Vr($s),xo=Vr(Us);function vo(t,e){return(Yo(t)?De:di)(t,hs(e,3))}function yo(t,e){return(Yo(t)?Oe:pi)(t,hs(e,3))}var wo=Er((function(t,e,n){It.call(t,n)?t[n].push(e):oi(t,n,[e])}));var Mo=Gi((function(t,e,n){var r=-1,s="function"==typeof e,o=Xo(t)?i(t.length):[];return di(t,(function(t){o[++r]=s?Pe(e,t,n):Ti(t,e,n)})),o})),ko=Er((function(t,e,n){oi(t,n,e)}));function So(t,e){return(Yo(t)?Re:Bi)(t,hs(e,3))}var Po=Er((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));var Ao=Gi((function(t,e){if(null==t)return[];var n=e.length;return n>1&&vs(t,e[0],e[1])?e=[]:n>2&&vs(e[0],e[1],e[2])&&(e=[e[0]]),Ui(t,_i(e,1),[])})),Do=he||function(){return pe.Date.now()};function Oo(t,e,i){return e=i?n:e,e=t&&null==e?t.length:e,Jr(t,c,n,n,n,n,e)}function Co(t,e){var i;if("function"!=typeof e)throw new Ot(r);return t=ma(t),function(){return--t>0&&(i=e.apply(this,arguments)),t<=1&&(e=n),i}}var To=Gi((function(t,e,n){var i=1;if(n.length){var r=un(n,ls(To));i|=l}return Jr(t,i,e,n,r)})),Eo=Gi((function(t,e,n){var i=3;if(n.length){var r=un(n,ls(Eo));i|=l}return Jr(e,i,t,n,r)}));function Lo(t,e,i){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 i=s,r=o;return s=o=n,u=e,l=t.apply(r,i)}function m(t){return u=t,h=Es(_,e),f?g(t):l}function b(t){var i=t-c;return c===n||i>=e||i<0||d&&t-u>=a}function _(){var t=Do();if(b(t))return x(t);h=Es(_,function(t){var n=e-(t-c);return d?vn(n,a-(t-u)):n}(t))}function x(t){return h=n,p&&s?g(t):(s=o=n,l)}function v(){var t=Do(),i=b(t);if(s=arguments,o=this,c=t,i){if(h===n)return m(c);if(d)return Mr(h),h=Es(_,e),g(c)}return h===n&&(h=Es(_,e)),l}return e=_a(e)||0,na(i)&&(f=!!i.leading,a=(d="maxWait"in i)?xn(_a(i.maxWait)||0,e):a,p="trailing"in i?!!i.trailing:p),v.cancel=function(){h!==n&&Mr(h),u=0,s=c=o=h=n},v.flush=function(){return h===n?l:x(Do())},v}var Ro=Gi((function(t,e){return ui(t,1,e)})),Io=Gi((function(t,e,n){return ui(t,_a(e)||0,n)}));function zo(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new Ot(r);var n=function(){var i=arguments,r=e?e.apply(this,i):i[0],s=n.cache;if(s.has(r))return s.get(r);var o=t.apply(this,i);return n.cache=s.set(r,o)||s,o};return n.cache=new(zo.Cache||Xn),n}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=Xn;var jo=yr((function(t,e){var n=(e=1==e.length&&Yo(e[0])?Re(e[0],Je(hs())):Re(_i(e,1),Je(hs()))).length;return Gi((function(i){for(var r=-1,s=vn(i.length,n);++r<s;)i[r]=e[r].call(this,i[r]);return Pe(t,this,i)}))})),Vo=Gi((function(t,e){var i=un(e,ls(Vo));return Jr(t,l,n,e,i)})),Bo=Gi((function(t,e){var i=un(e,ls(Bo));return Jr(t,h,n,e,i)})),Wo=is((function(t,e){return Jr(t,u,n,n,n,e)}));function No(t,e){return t===e||t!=t&&e!=e}var Ho=qr(Ai),$o=qr((function(t,e){return t>=e})),Uo=Ei(function(){return arguments}())?Ei:function(t){return ia(t)&&It.call(t,"callee")&&!Xt.call(t,"callee")},Yo=i.isArray,qo=ve?Je(ve):function(t){return ia(t)&&Pi(t)==L};function Xo(t){return null!=t&&ea(t.length)&&!Qo(t)}function Ko(t){return ia(t)&&Xo(t)}var Zo=_e||_l,Go=ye?Je(ye):function(t){return ia(t)&&Pi(t)==v};function Jo(t){if(!ia(t))return!1;var e=Pi(t);return e==y||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!oa(t)}function Qo(t){if(!na(t))return!1;var e=Pi(t);return e==w||e==M||"[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 na(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ia(t){return null!=t&&"object"==typeof t}var ra=we?Je(we):function(t){return ia(t)&&gs(t)==k};function sa(t){return"number"==typeof t||ia(t)&&Pi(t)==S}function oa(t){if(!ia(t)||Pi(t)!=P)return!1;var e=Yt(t);if(null===e)return!0;var n=It.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Rt.call(n)==Vt}var aa=Me?Je(Me):function(t){return ia(t)&&Pi(t)==D};var la=ke?Je(ke):function(t){return ia(t)&&gs(t)==O};function ha(t){return"string"==typeof t||!Yo(t)&&ia(t)&&Pi(t)==C}function ca(t){return"symbol"==typeof t||ia(t)&&Pi(t)==T}var ua=Se?Je(Se):function(t){return ia(t)&&ea(t.length)&&!!ae[Pi(t)]};var fa=qr(Vi),da=qr((function(t,e){return t<=e}));function pa(t){if(!t)return[];if(Xo(t))return ha(t)?gn(t):Cr(t);if(Gt&&t[Gt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Gt]());var e=gs(t);return(e==k?hn:e==O?fn: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),n=e%1;return e==e?n?e-n:e:0}function ba(t){return t?li(ma(t),0,g):0}function _a(t){if("number"==typeof t)return t;if(ca(t))return p;if(na(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=na(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ge(t);var n=mt.test(t);return n||_t.test(t)?ue(t.slice(2),n?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(ks(e)||Xo(e))Tr(e,La(e),t);else for(var n in e)It.call(e,n)&&ni(t,n,e[n])})),wa=Lr((function(t,e){Tr(e,Ra(e),t)})),Ma=Lr((function(t,e,n,i){Tr(e,Ra(e),t,i)})),ka=Lr((function(t,e,n,i){Tr(e,La(e),t,i)})),Sa=is(ai);var Pa=Gi((function(t,e){t=Pt(t);var i=-1,r=e.length,s=r>2?e[2]:n;for(s&&vs(e[0],e[1],s)&&(r=1);++i<r;)for(var o=e[i],a=Ra(o),l=-1,h=a.length;++l<h;){var c=a[l],u=t[c];(u===n||No(u,Et[c])&&!It.call(t,c))&&(t[c]=o[c])}return t})),Aa=Gi((function(t){return t.push(n,ts),Pe(za,n,t)}));function Da(t,e,i){var r=null==t?n:ki(t,e);return r===n?i:r}function Oa(t,e){return null!=t&&ms(t,e,Oi)}var Ca=Nr((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=jt.call(e)),t[e]=n}),nl(sl)),Ta=Nr((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=jt.call(e)),It.call(t,e)?t[e].push(n):t[e]=[n]}),hs),Ea=Gi(Ti);function La(t){return Xo(t)?Gn(t):Fi(t)}function Ra(t){return Xo(t)?Gn(t,!0):ji(t)}var Ia=Lr((function(t,e,n){Hi(t,e,n)})),za=Lr((function(t,e,n,i){Hi(t,e,n,i)})),Fa=is((function(t,e){var n={};if(null==t)return n;var i=!1;e=Re(e,(function(e){return e=vr(e,t),i||(i=e.length>1),e})),Tr(t,ss(t),n),i&&(n=hi(n,7,es));for(var r=e.length;r--;)fr(n,e[r]);return n}));var ja=is((function(t,e){return null==t?{}:function(t,e){return Yi(t,e,(function(e,n){return Oa(t,n)}))}(t,e)}));function Va(t,e){if(null==t)return{};var n=Re(ss(t),(function(t){return[t]}));return e=hs(e),Yi(t,n,(function(t,n){return e(t,n[0])}))}var Ba=Gr(La),Wa=Gr(Ra);function Na(t){return null==t?[]:Qe(t,La(t))}var Ha=Fr((function(t,e,n){return e=e.toLowerCase(),t+(n?$a(e):e)}));function $a(t){return Ja(va(t).toLowerCase())}function Ua(t){return(t=va(t))&&t.replace(vt,sn).replace(te,"")}var Ya=Fr((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),qa=Fr((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Xa=zr("toLowerCase");var Ka=Fr((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));var Za=Fr((function(t,e,n){return t+(n?" ":"")+Ja(e)}));var Ga=Fr((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Ja=zr("toUpperCase");function Qa(t,e,i){return t=va(t),(e=i?n:e)===n?function(t){return re.test(t)}(t)?function(t){return t.match(ne)||[]}(t):function(t){return t.match(ct)||[]}(t):t.match(e)||[]}var tl=Gi((function(t,e){try{return Pe(t,n,e)}catch(i){return Jo(i)?i:new Mt(i)}})),el=is((function(t,e){return De(e,(function(e){e=js(e),oi(t,e,To(t[e],t))})),t}));function nl(t){return function(){return t}}var il=Br(),rl=Br(!0);function sl(t){return t}function ol(t){return zi("function"==typeof t?t:hi(t,1))}var al=Gi((function(t,e){return function(n){return Ti(n,t,e)}})),ll=Gi((function(t,e){return function(n){return Ti(t,n,e)}}));function hl(t,e,n){var i=La(e),r=Mi(e,i);null!=n||na(e)&&(r.length||!i.length)||(n=e,e=t,t=this,r=Mi(e,La(e)));var s=!(na(n)&&"chain"in n&&!n.chain),o=Qo(t);return De(r,(function(n){var i=e[n];t[n]=i,o&&(t.prototype[n]=function(){var e=this.__chain__;if(s||e){var n=t(this.__wrapped__),r=n.__actions__=Cr(this.__actions__);return r.push({func:i,args:arguments,thisArg:t}),n.__chain__=e,n}return i.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 ki(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 Ml,kl=Hr((function(t,e){return t*e}),1),Sl=Kr("round"),Pl=Hr((function(t,e){return t-e}),0);return Wn.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)}},Wn.ary=Oo,Wn.assign=ya,Wn.assignIn=wa,Wn.assignInWith=Ma,Wn.assignWith=ka,Wn.at=Sa,Wn.before=Co,Wn.bind=To,Wn.bindAll=el,Wn.bindKey=Eo,Wn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Yo(t)?t:[t]},Wn.chain=po,Wn.chunk=function(t,e,r){e=(r?vs(t,e,r):e===n)?1:xn(ma(e),0);var s=null==t?0:t.length;if(!s||e<1)return[];for(var o=0,a=0,l=i(de(s/e));o<s;)l[a++]=rr(t,o,o+=e);return l},Wn.compact=function(t){for(var e=-1,n=null==t?0:t.length,i=0,r=[];++e<n;){var s=t[e];s&&(r[i++]=s)}return r},Wn.concat=function(){var t=arguments.length;if(!t)return[];for(var e=i(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return Ie(Yo(n)?Cr(n):[n],_i(e,1))},Wn.cond=function(t){var e=null==t?0:t.length,n=hs();return t=e?Re(t,(function(t){if("function"!=typeof t[1])throw new Ot(r);return[n(t[0]),t[1]]})):[],Gi((function(n){for(var i=-1;++i<e;){var r=t[i];if(Pe(r[0],this,n))return Pe(r[1],this,n)}}))},Wn.conforms=function(t){return function(t){var e=La(t);return function(n){return ci(n,t,e)}}(hi(t,1))},Wn.constant=nl,Wn.countBy=bo,Wn.create=function(t,e){var n=Nn(t);return null==e?n:si(n,e)},Wn.curry=function t(e,i,r){var s=Jr(e,8,n,n,n,n,n,i=r?n:i);return s.placeholder=t.placeholder,s},Wn.curryRight=function t(e,i,r){var s=Jr(e,a,n,n,n,n,n,i=r?n:i);return s.placeholder=t.placeholder,s},Wn.debounce=Lo,Wn.defaults=Pa,Wn.defaultsDeep=Aa,Wn.defer=Ro,Wn.delay=Io,Wn.difference=Ws,Wn.differenceBy=Ns,Wn.differenceWith=Hs,Wn.drop=function(t,e,i){var r=null==t?0:t.length;return r?rr(t,(e=i||e===n?1:ma(e))<0?0:e,r):[]},Wn.dropRight=function(t,e,i){var r=null==t?0:t.length;return r?rr(t,0,(e=r-(e=i||e===n?1:ma(e)))<0?0:e):[]},Wn.dropRightWhile=function(t,e){return t&&t.length?pr(t,hs(e,3),!0,!0):[]},Wn.dropWhile=function(t,e){return t&&t.length?pr(t,hs(e,3),!0):[]},Wn.fill=function(t,e,i,r){var s=null==t?0:t.length;return s?(i&&"number"!=typeof i&&vs(t,e,i)&&(i=0,r=s),function(t,e,i,r){var s=t.length;for((i=ma(i))<0&&(i=-i>s?0:s+i),(r=r===n||r>s?s:ma(r))<0&&(r+=s),r=i>r?0:ba(r);i<r;)t[i++]=e;return t}(t,e,i,r)):[]},Wn.filter=function(t,e){return(Yo(t)?Te:bi)(t,hs(e,3))},Wn.flatMap=function(t,e){return _i(So(t,e),1)},Wn.flatMapDeep=function(t,e){return _i(So(t,e),f)},Wn.flatMapDepth=function(t,e,i){return i=i===n?1:ma(i),_i(So(t,e),i)},Wn.flatten=Ys,Wn.flattenDeep=function(t){return(null==t?0:t.length)?_i(t,f):[]},Wn.flattenDepth=function(t,e){return(null==t?0:t.length)?_i(t,e=e===n?1:ma(e)):[]},Wn.flip=function(t){return Jr(t,512)},Wn.flow=il,Wn.flowRight=rl,Wn.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,i={};++e<n;){var r=t[e];i[r[0]]=r[1]}return i},Wn.functions=function(t){return null==t?[]:Mi(t,La(t))},Wn.functionsIn=function(t){return null==t?[]:Mi(t,Ra(t))},Wn.groupBy=wo,Wn.initial=function(t){return(null==t?0:t.length)?rr(t,0,-1):[]},Wn.intersection=Xs,Wn.intersectionBy=Ks,Wn.intersectionWith=Zs,Wn.invert=Ca,Wn.invertBy=Ta,Wn.invokeMap=Mo,Wn.iteratee=ol,Wn.keyBy=ko,Wn.keys=La,Wn.keysIn=Ra,Wn.map=So,Wn.mapKeys=function(t,e){var n={};return e=hs(e,3),yi(t,(function(t,i,r){oi(n,e(t,i,r),t)})),n},Wn.mapValues=function(t,e){var n={};return e=hs(e,3),yi(t,(function(t,i,r){oi(n,i,e(t,i,r))})),n},Wn.matches=function(t){return Wi(hi(t,1))},Wn.matchesProperty=function(t,e){return Ni(t,hi(e,1))},Wn.memoize=zo,Wn.merge=Ia,Wn.mergeWith=za,Wn.method=al,Wn.methodOf=ll,Wn.mixin=hl,Wn.negate=Fo,Wn.nthArg=function(t){return t=ma(t),Gi((function(e){return $i(e,t)}))},Wn.omit=Fa,Wn.omitBy=function(t,e){return Va(t,Fo(hs(e)))},Wn.once=function(t){return Co(2,t)},Wn.orderBy=function(t,e,i,r){return null==t?[]:(Yo(e)||(e=null==e?[]:[e]),Yo(i=r?n:i)||(i=null==i?[]:[i]),Ui(t,e,i))},Wn.over=ul,Wn.overArgs=jo,Wn.overEvery=fl,Wn.overSome=dl,Wn.partial=Vo,Wn.partialRight=Bo,Wn.partition=Po,Wn.pick=ja,Wn.pickBy=Va,Wn.property=pl,Wn.propertyOf=function(t){return function(e){return null==t?n:ki(t,e)}},Wn.pull=Js,Wn.pullAll=Qs,Wn.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?qi(t,e,hs(n,2)):t},Wn.pullAllWith=function(t,e,i){return t&&t.length&&e&&e.length?qi(t,e,n,i):t},Wn.pullAt=to,Wn.range=gl,Wn.rangeRight=ml,Wn.rearg=Wo,Wn.reject=function(t,e){return(Yo(t)?Te:bi)(t,Fo(hs(e,3)))},Wn.remove=function(t,e){var n=[];if(!t||!t.length)return n;var i=-1,r=[],s=t.length;for(e=hs(e,3);++i<s;){var o=t[i];e(o,i,t)&&(n.push(o),r.push(i))}return Xi(t,r),n},Wn.rest=function(t,e){if("function"!=typeof t)throw new Ot(r);return Gi(t,e=e===n?e:ma(e))},Wn.reverse=eo,Wn.sampleSize=function(t,e,i){return e=(i?vs(t,e,i):e===n)?1:ma(e),(Yo(t)?Qn:Qi)(t,e)},Wn.set=function(t,e,n){return null==t?t:tr(t,e,n)},Wn.setWith=function(t,e,i,r){return r="function"==typeof r?r:n,null==t?t:tr(t,e,i,r)},Wn.shuffle=function(t){return(Yo(t)?ti:ir)(t)},Wn.slice=function(t,e,i){var r=null==t?0:t.length;return r?(i&&"number"!=typeof i&&vs(t,e,i)?(e=0,i=r):(e=null==e?0:ma(e),i=i===n?r:ma(i)),rr(t,e,i)):[]},Wn.sortBy=Ao,Wn.sortedUniq=function(t){return t&&t.length?lr(t):[]},Wn.sortedUniqBy=function(t,e){return t&&t.length?lr(t,hs(e,2)):[]},Wn.split=function(t,e,i){return i&&"number"!=typeof i&&vs(t,e,i)&&(e=i=n),(i=i===n?g:i>>>0)?(t=va(t))&&("string"==typeof e||null!=e&&!aa(e))&&!(e=cr(e))&&ln(t)?wr(gn(t),0,i):t.split(e,i):[]},Wn.spread=function(t,e){if("function"!=typeof t)throw new Ot(r);return e=null==e?0:xn(ma(e),0),Gi((function(n){var i=n[e],r=wr(n,0,e);return i&&Ie(r,i),Pe(t,this,r)}))},Wn.tail=function(t){var e=null==t?0:t.length;return e?rr(t,1,e):[]},Wn.take=function(t,e,i){return t&&t.length?rr(t,0,(e=i||e===n?1:ma(e))<0?0:e):[]},Wn.takeRight=function(t,e,i){var r=null==t?0:t.length;return r?rr(t,(e=r-(e=i||e===n?1:ma(e)))<0?0:e,r):[]},Wn.takeRightWhile=function(t,e){return t&&t.length?pr(t,hs(e,3),!1,!0):[]},Wn.takeWhile=function(t,e){return t&&t.length?pr(t,hs(e,3)):[]},Wn.tap=function(t,e){return e(t),t},Wn.throttle=function(t,e,n){var i=!0,s=!0;if("function"!=typeof t)throw new Ot(r);return na(n)&&(i="leading"in n?!!n.leading:i,s="trailing"in n?!!n.trailing:s),Lo(t,e,{leading:i,maxWait:e,trailing:s})},Wn.thru=go,Wn.toArray=pa,Wn.toPairs=Ba,Wn.toPairsIn=Wa,Wn.toPath=function(t){return Yo(t)?Re(t,js):ca(t)?[t]:Cr(Fs(va(t)))},Wn.toPlainObject=xa,Wn.transform=function(t,e,n){var i=Yo(t),r=i||Zo(t)||ua(t);if(e=hs(e,4),null==n){var s=t&&t.constructor;n=r?i?new s:[]:na(t)&&Qo(s)?Nn(Yt(t)):{}}return(r?De:yi)(t,(function(t,i,r){return e(n,t,i,r)})),n},Wn.unary=function(t){return Oo(t,1)},Wn.union=no,Wn.unionBy=io,Wn.unionWith=ro,Wn.uniq=function(t){return t&&t.length?ur(t):[]},Wn.uniqBy=function(t,e){return t&&t.length?ur(t,hs(e,2)):[]},Wn.uniqWith=function(t,e){return e="function"==typeof e?e:n,t&&t.length?ur(t,n,e):[]},Wn.unset=function(t,e){return null==t||fr(t,e)},Wn.unzip=so,Wn.unzipWith=oo,Wn.update=function(t,e,n){return null==t?t:dr(t,e,xr(n))},Wn.updateWith=function(t,e,i,r){return r="function"==typeof r?r:n,null==t?t:dr(t,e,xr(i),r)},Wn.values=Na,Wn.valuesIn=function(t){return null==t?[]:Qe(t,Ra(t))},Wn.without=ao,Wn.words=Qa,Wn.wrap=function(t,e){return Vo(xr(e),t)},Wn.xor=lo,Wn.xorBy=ho,Wn.xorWith=co,Wn.zip=uo,Wn.zipObject=function(t,e){return br(t||[],e||[],ni)},Wn.zipObjectDeep=function(t,e){return br(t||[],e||[],tr)},Wn.zipWith=fo,Wn.entries=Ba,Wn.entriesIn=Wa,Wn.extend=wa,Wn.extendWith=Ma,hl(Wn,Wn),Wn.add=xl,Wn.attempt=tl,Wn.camelCase=Ha,Wn.capitalize=$a,Wn.ceil=vl,Wn.clamp=function(t,e,i){return i===n&&(i=e,e=n),i!==n&&(i=(i=_a(i))==i?i:0),e!==n&&(e=(e=_a(e))==e?e:0),li(_a(t),e,i)},Wn.clone=function(t){return hi(t,4)},Wn.cloneDeep=function(t){return hi(t,5)},Wn.cloneDeepWith=function(t,e){return hi(t,5,e="function"==typeof e?e:n)},Wn.cloneWith=function(t,e){return hi(t,4,e="function"==typeof e?e:n)},Wn.conformsTo=function(t,e){return null==e||ci(t,e,La(e))},Wn.deburr=Ua,Wn.defaultTo=function(t,e){return null==t||t!=t?e:t},Wn.divide=yl,Wn.endsWith=function(t,e,i){t=va(t),e=cr(e);var r=t.length,s=i=i===n?r:li(ma(i),0,r);return(i-=e.length)>=0&&t.slice(i,s)==e},Wn.eq=No,Wn.escape=function(t){return(t=va(t))&&Z.test(t)?t.replace(X,on):t},Wn.escapeRegExp=function(t){return(t=va(t))&&rt.test(t)?t.replace(it,"\\$&"):t},Wn.every=function(t,e,i){var r=Yo(t)?Ce:gi;return i&&vs(t,e,i)&&(e=n),r(t,hs(e,3))},Wn.find=_o,Wn.findIndex=$s,Wn.findKey=function(t,e){return Be(t,hs(e,3),yi)},Wn.findLast=xo,Wn.findLastIndex=Us,Wn.findLastKey=function(t,e){return Be(t,hs(e,3),wi)},Wn.floor=wl,Wn.forEach=vo,Wn.forEachRight=yo,Wn.forIn=function(t,e){return null==t?t:xi(t,hs(e,3),Ra)},Wn.forInRight=function(t,e){return null==t?t:vi(t,hs(e,3),Ra)},Wn.forOwn=function(t,e){return t&&yi(t,hs(e,3))},Wn.forOwnRight=function(t,e){return t&&wi(t,hs(e,3))},Wn.get=Da,Wn.gt=Ho,Wn.gte=$o,Wn.has=function(t,e){return null!=t&&ms(t,e,Di)},Wn.hasIn=Oa,Wn.head=qs,Wn.identity=sl,Wn.includes=function(t,e,n,i){t=Xo(t)?t:Na(t),n=n&&!i?ma(n):0;var r=t.length;return n<0&&(n=xn(r+n,0)),ha(t)?n<=r&&t.indexOf(e,n)>-1:!!r&&Ne(t,e,n)>-1},Wn.indexOf=function(t,e,n){var i=null==t?0:t.length;if(!i)return-1;var r=null==n?0:ma(n);return r<0&&(r=xn(i+r,0)),Ne(t,e,r)},Wn.inRange=function(t,e,i){return e=ga(e),i===n?(i=e,e=0):i=ga(i),function(t,e,n){return t>=vn(e,n)&&t<xn(e,n)}(t=_a(t),e,i)},Wn.invoke=Ea,Wn.isArguments=Uo,Wn.isArray=Yo,Wn.isArrayBuffer=qo,Wn.isArrayLike=Xo,Wn.isArrayLikeObject=Ko,Wn.isBoolean=function(t){return!0===t||!1===t||ia(t)&&Pi(t)==x},Wn.isBuffer=Zo,Wn.isDate=Go,Wn.isElement=function(t){return ia(t)&&1===t.nodeType&&!oa(t)},Wn.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==k||e==O)return!t.size;if(ks(t))return!Fi(t).length;for(var n in t)if(It.call(t,n))return!1;return!0},Wn.isEqual=function(t,e){return Li(t,e)},Wn.isEqualWith=function(t,e,i){var r=(i="function"==typeof i?i:n)?i(t,e):n;return r===n?Li(t,e,n,i):!!r},Wn.isError=Jo,Wn.isFinite=function(t){return"number"==typeof t&&xe(t)},Wn.isFunction=Qo,Wn.isInteger=ta,Wn.isLength=ea,Wn.isMap=ra,Wn.isMatch=function(t,e){return t===e||Ri(t,e,us(e))},Wn.isMatchWith=function(t,e,i){return i="function"==typeof i?i:n,Ri(t,e,us(e),i)},Wn.isNaN=function(t){return sa(t)&&t!=+t},Wn.isNative=function(t){if(Ms(t))throw new Mt("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Ii(t)},Wn.isNil=function(t){return null==t},Wn.isNull=function(t){return null===t},Wn.isNumber=sa,Wn.isObject=na,Wn.isObjectLike=ia,Wn.isPlainObject=oa,Wn.isRegExp=aa,Wn.isSafeInteger=function(t){return ta(t)&&t>=-9007199254740991&&t<=d},Wn.isSet=la,Wn.isString=ha,Wn.isSymbol=ca,Wn.isTypedArray=ua,Wn.isUndefined=function(t){return t===n},Wn.isWeakMap=function(t){return ia(t)&&gs(t)==E},Wn.isWeakSet=function(t){return ia(t)&&"[object WeakSet]"==Pi(t)},Wn.join=function(t,e){return null==t?"":Ve.call(t,e)},Wn.kebabCase=Ya,Wn.last=Gs,Wn.lastIndexOf=function(t,e,i){var r=null==t?0:t.length;if(!r)return-1;var s=r;return i!==n&&(s=(s=ma(i))<0?xn(r+s,0):vn(s,r-1)),e==e?function(t,e,n){for(var i=n+1;i--;)if(t[i]===e)return i;return i}(t,e,s):We(t,$e,s,!0)},Wn.lowerCase=qa,Wn.lowerFirst=Xa,Wn.lt=fa,Wn.lte=da,Wn.max=function(t){return t&&t.length?mi(t,sl,Ai):n},Wn.maxBy=function(t,e){return t&&t.length?mi(t,hs(e,2),Ai):n},Wn.mean=function(t){return Ue(t,sl)},Wn.meanBy=function(t,e){return Ue(t,hs(e,2))},Wn.min=function(t){return t&&t.length?mi(t,sl,Vi):n},Wn.minBy=function(t,e){return t&&t.length?mi(t,hs(e,2),Vi):n},Wn.stubArray=bl,Wn.stubFalse=_l,Wn.stubObject=function(){return{}},Wn.stubString=function(){return""},Wn.stubTrue=function(){return!0},Wn.multiply=kl,Wn.nth=function(t,e){return t&&t.length?$i(t,ma(e)):n},Wn.noConflict=function(){return pe._===this&&(pe._=Bt),this},Wn.noop=cl,Wn.now=Do,Wn.pad=function(t,e,n){t=va(t);var i=(e=ma(e))?pn(t):0;if(!e||i>=e)return t;var r=(e-i)/2;return Ur(ge(r),n)+t+Ur(de(r),n)},Wn.padEnd=function(t,e,n){t=va(t);var i=(e=ma(e))?pn(t):0;return e&&i<e?t+Ur(e-i,n):t},Wn.padStart=function(t,e,n){t=va(t);var i=(e=ma(e))?pn(t):0;return e&&i<e?Ur(e-i,n)+t:t},Wn.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),wn(va(t).replace(st,""),e||0)},Wn.random=function(t,e,i){if(i&&"boolean"!=typeof i&&vs(t,e,i)&&(e=i=n),i===n&&("boolean"==typeof e?(i=e,e=n):"boolean"==typeof t&&(i=t,t=n)),t===n&&e===n?(t=0,e=1):(t=ga(t),e===n?(e=t,t=0):e=ga(e)),t>e){var r=t;t=e,e=r}if(i||t%1||e%1){var s=Mn();return vn(t+s*(e-t+ce("1e-"+((s+"").length-1))),e)}return Ki(t,e)},Wn.reduce=function(t,e,n){var i=Yo(t)?ze:Xe,r=arguments.length<3;return i(t,hs(e,4),n,r,di)},Wn.reduceRight=function(t,e,n){var i=Yo(t)?Fe:Xe,r=arguments.length<3;return i(t,hs(e,4),n,r,pi)},Wn.repeat=function(t,e,i){return e=(i?vs(t,e,i):e===n)?1:ma(e),Zi(va(t),e)},Wn.replace=function(){var t=arguments,e=va(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Wn.result=function(t,e,i){var r=-1,s=(e=vr(e,t)).length;for(s||(s=1,t=n);++r<s;){var o=null==t?n:t[js(e[r])];o===n&&(r=s,o=i),t=Qo(o)?o.call(t):o}return t},Wn.round=Sl,Wn.runInContext=t,Wn.sample=function(t){return(Yo(t)?Jn:Ji)(t)},Wn.size=function(t){if(null==t)return 0;if(Xo(t))return ha(t)?pn(t):t.length;var e=gs(t);return e==k||e==O?t.size:Fi(t).length},Wn.snakeCase=Ka,Wn.some=function(t,e,i){var r=Yo(t)?je:sr;return i&&vs(t,e,i)&&(e=n),r(t,hs(e,3))},Wn.sortedIndex=function(t,e){return or(t,e)},Wn.sortedIndexBy=function(t,e,n){return ar(t,e,hs(n,2))},Wn.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var i=or(t,e);if(i<n&&No(t[i],e))return i}return-1},Wn.sortedLastIndex=function(t,e){return or(t,e,!0)},Wn.sortedLastIndexBy=function(t,e,n){return ar(t,e,hs(n,2),!0)},Wn.sortedLastIndexOf=function(t,e){if(null==t?0:t.length){var n=or(t,e,!0)-1;if(No(t[n],e))return n}return-1},Wn.startCase=Za,Wn.startsWith=function(t,e,n){return t=va(t),n=null==n?0:li(ma(n),0,t.length),e=cr(e),t.slice(n,n+e.length)==e},Wn.subtract=Pl,Wn.sum=function(t){return t&&t.length?Ke(t,sl):0},Wn.sumBy=function(t,e){return t&&t.length?Ke(t,hs(e,2)):0},Wn.template=function(t,e,i){var r=Wn.templateSettings;i&&vs(t,e,i)&&(e=n),t=va(t),e=Ma({},e,r,Qr);var s,o,a=Ma({},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,n,i,r,a,l){return i||(i=r),f+=t.slice(c,l).replace(wt,an),n&&(s=!0,f+="' +\n__e("+n+") +\n'"),a&&(o=!0,f+="';\n"+a+";\n__p += '"),i&&(f+="' +\n((__t = ("+i+")) == 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 Mt("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 kt(l,p+"return "+f).apply(n,h)}));if(m.source=f,Jo(m))throw m;return m},Wn.times=function(t,e){if((t=ma(t))<1||t>d)return[];var n=g,i=vn(t,g);e=hs(e),t-=g;for(var r=Ze(i,e);++n<t;)e(n);return r},Wn.toFinite=ga,Wn.toInteger=ma,Wn.toLength=ba,Wn.toLower=function(t){return va(t).toLowerCase()},Wn.toNumber=_a,Wn.toSafeInteger=function(t){return t?li(ma(t),-9007199254740991,d):0===t?t:0},Wn.toString=va,Wn.toUpper=function(t){return va(t).toUpperCase()},Wn.trim=function(t,e,i){if((t=va(t))&&(i||e===n))return Ge(t);if(!t||!(e=cr(e)))return t;var r=gn(t),s=gn(e);return wr(r,en(r,s),nn(r,s)+1).join("")},Wn.trimEnd=function(t,e,i){if((t=va(t))&&(i||e===n))return t.slice(0,mn(t)+1);if(!t||!(e=cr(e)))return t;var r=gn(t);return wr(r,0,nn(r,gn(e))+1).join("")},Wn.trimStart=function(t,e,i){if((t=va(t))&&(i||e===n))return t.replace(st,"");if(!t||!(e=cr(e)))return t;var r=gn(t);return wr(r,en(r,gn(e))).join("")},Wn.truncate=function(t,e){var i=30,r="...";if(na(e)){var s="separator"in e?e.separator:s;i="length"in e?ma(e.length):i,r="omission"in e?cr(e.omission):r}var o=(t=va(t)).length;if(ln(t)){var a=gn(t);o=a.length}if(i>=o)return t;var l=i-pn(r);if(l<1)return r;var h=a?wr(a,0,l).join(""):t.slice(0,l);if(s===n)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===n?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},Wn.unescape=function(t){return(t=va(t))&&K.test(t)?t.replace(q,bn):t},Wn.uniqueId=function(t){var e=++zt;return va(t)+e},Wn.upperCase=Ga,Wn.upperFirst=Ja,Wn.each=vo,Wn.eachRight=yo,Wn.first=qs,hl(Wn,(Ml={},yi(Wn,(function(t,e){It.call(Wn.prototype,e)||(Ml[e]=t)})),Ml),{chain:!1}),Wn.VERSION="4.17.21",De(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Wn[t].placeholder=Wn})),De(["drop","take"],(function(t,e){Un.prototype[t]=function(i){i=i===n?1:xn(ma(i),0);var r=this.__filtered__&&!e?new Un(this):this.clone();return r.__filtered__?r.__takeCount__=vn(i,r.__takeCount__):r.__views__.push({size:vn(i,g),type:t+(r.__dir__<0?"Right":"")}),r},Un.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),De(["filter","map","takeWhile"],(function(t,e){var n=e+1,i=1==n||3==n;Un.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:hs(t,3),type:n}),e.__filtered__=e.__filtered__||i,e}})),De(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Un.prototype[t]=function(){return this[n](1).value()[0]}})),De(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Un.prototype[t]=function(){return this.__filtered__?new Un(this):this[n](1)}})),Un.prototype.compact=function(){return this.filter(sl)},Un.prototype.find=function(t){return this.filter(t).head()},Un.prototype.findLast=function(t){return this.reverse().find(t)},Un.prototype.invokeMap=Gi((function(t,e){return"function"==typeof t?new Un(this):this.map((function(n){return Ti(n,t,e)}))})),Un.prototype.reject=function(t){return this.filter(Fo(hs(t)))},Un.prototype.slice=function(t,e){t=ma(t);var i=this;return i.__filtered__&&(t>0||e<0)?new Un(i):(t<0?i=i.takeRight(-t):t&&(i=i.drop(t)),e!==n&&(i=(e=ma(e))<0?i.dropRight(-e):i.take(e-t)),i)},Un.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Un.prototype.toArray=function(){return this.take(g)},yi(Un.prototype,(function(t,e){var i=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),s=Wn[r?"take"+("last"==e?"Right":""):e],o=r||/^find/.test(e);s&&(Wn.prototype[e]=function(){var e=this.__wrapped__,a=r?[1]:arguments,l=e instanceof Un,h=a[0],c=l||Yo(e),u=function(t){var e=s.apply(Wn,Ie([t],a));return r&&f?e[0]:e};c&&i&&"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 Un(this);var m=t.apply(e,a);return m.__actions__.push({func:go,args:[u],thisArg:n}),new $n(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],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",i=/^(?:pop|shift)$/.test(t);Wn.prototype[t]=function(){var t=arguments;if(i&&!this.__chain__){var r=this.value();return e.apply(Yo(r)?r:[],t)}return this[n]((function(n){return e.apply(Yo(n)?n:[],t)}))}})),yi(Un.prototype,(function(t,e){var n=Wn[e];if(n){var i=n.name+"";It.call(En,i)||(En[i]=[]),En[i].push({name:e,func:n})}})),En[Wr(n,2).name]=[{name:"wrapper",func:n}],Un.prototype.clone=function(){var t=new Un(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},Un.prototype.reverse=function(){if(this.__filtered__){var t=new Un(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Un.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Yo(t),i=e<0,r=n?t.length:0,s=function(t,e,n){var i=-1,r=n.length;for(;++i<r;){var s=n[i],o=s.size;switch(s.type){case"drop":t+=o;break;case"dropRight":e-=o;break;case"take":e=vn(e,t+o);break;case"takeRight":t=xn(t,e-o)}}return{start:t,end:e}}(0,r,this.__views__),o=s.start,a=s.end,l=a-o,h=i?a:o-1,c=this.__iteratees__,u=c.length,f=0,d=vn(l,this.__takeCount__);if(!n||!i&&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},Wn.prototype.at=mo,Wn.prototype.chain=function(){return po(this)},Wn.prototype.commit=function(){return new $n(this.value(),this.__chain__)},Wn.prototype.next=function(){this.__values__===n&&(this.__values__=pa(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?n:this.__values__[this.__index__++]}},Wn.prototype.plant=function(t){for(var e,i=this;i instanceof Hn;){var r=Bs(i);r.__index__=0,r.__values__=n,e?s.__wrapped__=r:e=r;var s=r;i=i.__wrapped__}return s.__wrapped__=t,e},Wn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Un){var e=t;return this.__actions__.length&&(e=new Un(this)),(e=e.reverse()).__actions__.push({func:go,args:[eo],thisArg:n}),new $n(e,this.__chain__)}return this.thru(eo)},Wn.prototype.toJSON=Wn.prototype.valueOf=Wn.prototype.value=function(){return gr(this.__wrapped__,this.__actions__)},Wn.prototype.first=Wn.prototype.head,Gt&&(Wn.prototype[Gt]=function(){return this}),Wn}();me?((me.exports=_n)._=_n,ge._=_n):pe._=_n}).call(i)}(g,g.exports);const b=(t,e,n)=>Math.max(Math.min(t,n),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},M=[..."0123456789ABCDEF"],k=t=>M[15&t],S=t=>M[(240&t)>>4]+M[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)?k: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,n){const i=e*Math.min(n,1-n),r=(e,r=(e+t/30)%12)=>n-i*Math.max(Math.min(r-3,9-r,1),-1);return[r(0),r(8),r(4)]}function C(t,e,n){const i=(i,r=(i+t/60)%6)=>n-n*e*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function T(t,e,n){const i=O(t,1,.5);let r;for(e+n>1&&(r=1/(e+n),e*=r,n*=r),r=0;r<3;r++)i[r]*=1-e-n,i[r]+=e;return i}function E(t){const e=t.r/255,n=t.g/255,i=t.b/255,r=Math.max(e,n,i),s=Math.min(e,n,i),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,n,i,r){return t===r?(e-n)/i+(e<n?6:0):e===r?(n-t)/i+2:(t-e)/i+4}(e,n,i,h,r),a=60*a+.5),[0|a,l||0,o]}function L(t,e,n,i){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,i)).map(x)}function R(t,e,n){return L(O,t,e,n)}function I(t){return(t%360+360)%360}function z(t){const e=D.exec(t);let n,i=255;if(!e)return;e[5]!==n&&(i=e[6]?_(+e[5]):x(+e[5]));const r=I(+e[2]),s=+e[3]/100,o=+e[4]/100;return n="hwb"===e[1]?function(t,e,n){return L(T,t,e,n)}(r,s,o):"hsv"===e[1]?function(t,e,n){return L(C,t,e,n)}(r,s,o):R(r,s,o),{r:n[0],g:n[1],b:n[2],a:i}}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),n=Object.keys(F);let i,r,s,o,a;for(i=0;i<e.length;i++){for(o=a=e[i],r=0;r<n.length;r++)s=n[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,n){if(t){let i=E(t);i[e]=Math.max(0,Math.min(i[e]+i[e]*n,0===e?360:1)),i=R(i),t.r=i[0],t.g=i[1],t.b=i[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 n,i,r,s=255;if(e){if(e[7]!==n){const t=+e[7];s=e[8]?_(t):b(255*t,0,255)}return n=+e[1],i=+e[3],r=+e[5],n=255&(e[2]?_(n):b(n,0,255)),i=255&(e[4]?_(i):b(i,0,255)),r=255&(e[6]?_(r):b(r,0,255)),{r:n,g:i,b:r,a:s}}}(t):z(t)}class X{constructor(t){if(t instanceof X)return t;const e=typeof t;let n;var i,r,s;"object"===e?n=Y(t):"string"===e&&(s=(i=t).length,"#"===i[0]&&(4===s||5===s?r={r:255&17*w[i[1]],g:255&17*w[i[2]],b:255&17*w[i[3]],a:5===s?17*w[i[4]]:255}:7!==s&&9!==s||(r={r:w[i[1]]<<4|w[i[2]],g:w[i[3]]<<4|w[i[4]],b:w[i[5]]<<4|w[i[6]],a:9===s?w[i[7]]<<4|w[i[8]]:255})),n=r||B(t)||q(t)),this._rgb=n,this._valid=!!n}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),n=e[0],i=y(e[1]),r=y(e[2]);return t.a<255?`hsla(${n}, ${i}%, ${r}%, ${v(t.a)})`:`hsl(${n}, ${i}%, ${r}%)`}(this._rgb):void 0}mix(t,e){if(t){const n=this.rgb,i=t.rgb;let r;const s=e===r?.5:e,o=2*s-1,a=n.a-i.a,l=((o*a==-1?o:(o+a)/(1+o*a))+1)/2;r=1-l,n.r=255&l*n.r+r*i.r+.5,n.g=255&l*n.g+r*i.g+.5,n.b=255&l*n.b+r*i.b+.5,n.a=s*n.a+(1-s)*i.a,this.rgb=n}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,n){const i=H(v(t.r)),r=H(v(t.g)),s=H(v(t.b));return{r:x(N(i+n*(H(v(e.r))-i))),g:x(N(r+n*(H(v(e.g))-r))),b:x(N(s+n*(H(v(e.b))-s))),a:t.a+n*(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 n=E(t);n[0]=I(n[0]+e),n=R(n),t.r=n[0],t.g=n[1],t.b=n[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 nt(t,e){return void 0===t?e:t}const it=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function rt(t,e,n){if(t&&"function"==typeof t.call)return t.apply(n,e)}function st(t,e,n,i){let r,s,o;if(J(t))if(s=t.length,i)for(r=s-1;r>=0;r--)e.call(n,t[r],r);else for(r=0;r<s;r++)e.call(n,t[r],r);else if(Q(t))for(o=Object.keys(t),s=o.length,r=0;r<s;r++)e.call(n,t[o[r]],o[r])}function ot(t,e){let n,i,r,s;if(!t||!e||t.length!==e.length)return!1;for(n=0,i=t.length;n<i;++n)if(r=t[n],s=e[n],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),n=Object.keys(t),i=n.length;let r=0;for(;r<i;++r)e[n[r]]=at(t[n[r]]);return e}return t}function lt(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function ht(t,e,n,i){if(!lt(t))return;const r=e[t],s=n[t];Q(r)&&Q(s)?ct(r,s,i):e[t]=at(s)}function ct(t,e,n){const i=J(e)?e:[e],r=i.length;if(!Q(t))return t;const s=(n=n||{}).merger||ht;let o;for(let a=0;a<r;++a){if(o=i[a],!Q(o))continue;const e=Object.keys(o);for(let i=0,r=e.length;i<r;++i)s(e[i],t,o,n)}return t}function ut(t,e){return ct(t,e,{merger:ft})}function ft(t,e,n){if(!lt(t))return;const i=e[t],r=n[t];Q(i)&&Q(r)?ut(i,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 n=dt[e]||(dt[e]=function(t){const e=function(t){const e=t.split("."),n=[];let i="";for(const r of e)i+=r,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}(t);return t=>{for(const n of e){if(""===n)break;t=t&&t[n]}return t}}(e));return n(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 n of t)if(!e.has(n))return!1;return!0};const xt=Math.PI,vt=2*xt,yt=vt+xt,wt=Number.POSITIVE_INFINITY,Mt=xt/180,kt=xt/2,St=xt/4,Pt=2*xt/3,At=Math.log10,Dt=Math.sign;function Ot(t,e,n){return Math.abs(t-e)<n}function Ct(t){const e=Math.round(t);t=Ot(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(At(t))),i=t/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function Tt(t){return!isNaN(parseFloat(t))&&isFinite(t)}function Et(t,e,n){let i,r,s;for(i=0,r=t.length;i<r;i++)s=t[i][n],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,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function zt(t,e){const n=e.x-t.x,i=e.y-t.y,r=Math.sqrt(n*n+i*i);let s=Math.atan2(i,n);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,n,i){const r=Vt(t),s=Vt(e),o=Vt(n),a=Vt(s-r),l=Vt(o-r),h=Vt(r-s),c=Vt(r-o);return r===s||r===o||i&&s===o||a>l&&h<c}function Wt(t,e,n){return Math.max(e,Math.min(n,t))}function Nt(t,e,n,i=1e-6){return t>=Math.min(e,n)-i&&t<=Math.max(e,n)+i}function Ht(t,e,n){n=n||(n=>t[n]<e);let i,r=t.length-1,s=0;for(;r-s>1;)i=s+r>>1,n(i)?s=i:r=i;return{lo:s,hi:r}}const $t=(t,e,n,i)=>Ht(t,n,i?i=>{const r=t[i][e];return r<n||r===n&&t[i+1][e]===n}:i=>t[i][e]<n),Ut=(t,e,n)=>Ht(t,n,(i=>t[i][e]>=n));const Yt=["push","pop","shift","splice","unshift"];function qt(t,e){const n=t._chartjs;if(!n)return;const i=n.listeners,r=i.indexOf(e);-1!==r&&i.splice(r,1),i.length>0||(Yt.forEach((e=>{delete t[e]})),delete t._chartjs)}function Xt(t){const e=new Set;let n,i;for(n=0,i=t.length;n<i;++n)e.add(t[n]);return e.size===i?t:Array.from(e)}const Kt="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function Zt(t,e){let n=[],i=!1;return function(...r){n=r,i||(i=!0,Kt.call(window,(()=>{i=!1,t.apply(e,n)})))}}const Gt=t=>"start"===t?"left":"end"===t?"right":"center",Jt=(t,e,n)=>"start"===t?e:"end"===t?n:(e+n)/2;function Qt(t,e,n){const i=e.length;let r=0,s=i;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,n?i:$t(e,l,o.getPixelForValue(h)).lo),0,i-1)),s=f?Wt(Math.max($t(a,o.axis,c,!0).hi+1,n?0:$t(e,l,o.getPixelForValue(c),!0).hi+1),r,i)-r:i-r}return{start:r,count:s}}function te(t){const{xScale:e,yScale:n,_scaleRanges:i}=t,r={xmin:e.min,xmax:e.max,ymin:n.min,ymax:n.max};if(!i)return t._scaleRanges=r,!0;const s=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,r),s}const ee=t=>0===t||1===t,ne=(t,e,n)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*vt/n),ie=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*vt/n)+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*kt),easeOutSine:t=>Math.sin(t*kt),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:ne(t,.075,.3),easeOutElastic:t=>ee(t)?t:ie(t,.075,.3),easeInOutElastic(t){const e=.1125;return ee(t)?t:t<.5?.5*ne(2*t,e,.45):.5+.5*ie(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,n=2.75;return t<1/n?e*t*t:t<2/n?e*(t-=1.5/n)*t+.75:t<2.5/n?e*(t-=2.25/n)*t+.9375:e*(t-=2.625/n)*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,n){return function(t,e){e=e||{};const n=t+JSON.stringify(e);let i=ce.get(n);return i||(i=new Intl.NumberFormat(t,e),ce.set(n,i)),i}(e,n).format(t)}const fe={values:t=>J(t)?t:""+t,numeric(t,e,n){if(0===t)return"0";const i=this.chart.options.locale;let r,s=t;if(n.length>1){const e=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(e<1e-4||e>1e15)&&(r="scientific"),s=function(t,e){let n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;Math.abs(n)>=1&&t!==Math.floor(t)&&(n=t-Math.floor(t));return n}(t,n)}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,i,l)},logarithmic(t,e,n){if(0===t)return"0";const i=n[e].significand||t/Math.pow(10,Math.floor(At(t)));return[1,2,3,5,10,15].includes(i)||e>.8*n.length?fe.numeric.call(this,t,e,n):""}};var de={formatters:fe};const pe=Object.create(null),ge=Object.create(null);function me(t,e){if(!e)return t;const n=e.split(".");for(let i=0,r=n.length;i<r;++i){const e=n[i];t=t[e]||(t[e]=Object.create(null))}return t}function be(t,e,n){return"string"==typeof e?ct(me(t,e),n):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,n,i){const r=me(this,t),s=me(this,n),o="_"+e;Object.defineProperties(r,{[o]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[o],e=s[i];return Q(t)?Object.assign({},e,t):nt(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,n,i,r){let s=e[r];return s||(s=e[r]=t.measureText(r).width,n.push(r)),s>i&&(i=s),i}function ye(t,e,n,i){let r=(i=i||{}).data=i.data||{},s=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(r=i.data={},s=i.garbageCollect=[],i.font=e),t.save(),t.font=e;let o=0;const a=n.length;let l,h,c,u,f;for(l=0;l<a;l++)if(u=n[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>n.length){for(l=0;l<d;l++)delete r[s[l]];s.splice(0,d)}return o}function we(t,e,n){const i=t.currentDevicePixelRatio,r=0!==n?Math.max(n/2,.5):0;return Math.round((e-r)*i)/i+r}function Me(t,e){(e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function ke(t,e,n,i){Se(t,e,n,i,null)}function Se(t,e,n,i,r){let s,o,a,l,h,c,u,f;const d=e.pointStyle,p=e.rotation,g=e.radius;let m=(p||0)*Mt;if(d&&"object"==typeof d&&(s=d.toString(),"[object HTMLImageElement]"===s||"[object HTMLCanvasElement]"===s))return t.save(),t.translate(n,i),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(n,i,r/2,g,0,0,vt):t.arc(n,i,g,0,vt),t.closePath();break;case"triangle":c=r?r/2:g,t.moveTo(n+Math.sin(m)*c,i-Math.cos(m)*g),m+=Pt,t.lineTo(n+Math.sin(m)*c,i-Math.cos(m)*g),m+=Pt,t.lineTo(n+Math.sin(m)*c,i-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(n-u,i-a,h,m-xt,m-kt),t.arc(n+f,i-o,h,m-kt,m),t.arc(n+u,i+a,h,m,m+kt),t.arc(n-f,i+o,h,m+kt,m+xt),t.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,c=r?r/2:l,t.rect(n-c,i-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(n-u,i-a),t.lineTo(n+f,i-o),t.lineTo(n+u,i+a),t.lineTo(n-f,i+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(n-u,i-a),t.lineTo(n+u,i+a),t.moveTo(n+f,i-o),t.lineTo(n-f,i+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(n-u,i-a),t.lineTo(n+u,i+a),t.moveTo(n+f,i-o),t.lineTo(n-f,i+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(n-u,i-a),t.lineTo(n+u,i+a),t.moveTo(n+f,i-o),t.lineTo(n-f,i+o);break;case"line":o=r?r/2:Math.cos(m)*g,a=Math.sin(m)*g,t.moveTo(n-o,i-a),t.lineTo(n+o,i+a);break;case"dash":t.moveTo(n,i),t.lineTo(n+Math.cos(m)*(r?r/2:g),i+Math.sin(m)*g);break;case!1:t.closePath()}t.fill(),e.borderWidth>0&&t.stroke()}}function Pe(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.x<e.right+n&&t.y>e.top-n&&t.y<e.bottom+n}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,n,i,r){if(!e)return t.lineTo(n.x,n.y);if("middle"===r){const i=(e.x+n.x)/2;t.lineTo(i,e.y),t.lineTo(i,n.y)}else"after"===r!=!!i?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y);t.lineTo(n.x,n.y)}function Ce(t,e,n,i){if(!e)return t.lineTo(n.x,n.y);t.bezierCurveTo(i?e.cp1x:e.cp2x,i?e.cp1y:e.cp2y,i?n.cp2x:n.cp1x,i?n.cp2y:n.cp1y,n.x,n.y)}function Te(t,e,n,i,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,n,i,s.maxWidth)),t.fillText(h,n,i,s.maxWidth),Ee(t,n,i,h,s),i+=r.lineHeight;t.restore()}function Ee(t,e,n,i,r){if(r.strikethrough||r.underline){const s=t.measureText(i),o=e-s.actualBoundingBoxLeft,a=e+s.actualBoundingBoxRight,l=n-s.actualBoundingBoxAscent,h=n+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 n=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=n}function Re(t,e){const{x:n,y:i,w:r,h:s,radius:o}=e;t.arc(n+o.topLeft,i+o.topLeft,o.topLeft,-kt,xt,!0),t.lineTo(n,i+s-o.bottomLeft),t.arc(n+o.bottomLeft,i+s-o.bottomLeft,o.bottomLeft,xt,kt,!0),t.lineTo(n+r-o.bottomRight,i+s),t.arc(n+r-o.bottomRight,i+s-o.bottomRight,o.bottomRight,kt,0,!0),t.lineTo(n+r,i+o.topRight),t.arc(n+r-o.topRight,i+o.topRight,o.topRight,0,-kt,!0),t.lineTo(n+o.topLeft,i)}const Ie=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,ze=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Fe(t,e){const n=(""+t).match(Ie);if(!n||"normal"===n[1])return 1.2*e;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100}return e*t}function je(t,e){const n={},i=Q(e),r=i?Object.keys(e):e,s=Q(t)?i?n=>nt(t[n],t[e[n]]):e=>t[e]:()=>t;for(const o of r)n[o]=+s(o)||0;return n}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 n=nt(t.size,e.size);"string"==typeof n&&(n=parseInt(n,10));let i=nt(t.style,e.style);i&&!(""+i).match(ze)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:nt(t.family,e.family),lineHeight:Fe(nt(t.lineHeight,e.lineHeight),n),size:n,style:i,weight:nt(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,n,i){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!==n&&J(o)&&(o=o[n%o.length],a=!1),void 0!==o))return i&&!a&&(i.cacheable=!1),o}function $e(t,e){return Object.assign(Object.create(t),e)}function Ue(t,e=[""],n=t,i,r=(()=>t[0])){mt(i)||(i=nn("_fallback",t));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:n,_fallback:i,_getTarget:r,override:r=>Ue([r,...t],e,n,i)};return new Proxy(s,{deleteProperty:(e,n)=>(delete e[n],delete e._keys,delete t[0][n],!0),get:(n,i)=>Ze(n,i,(()=>function(t,e,n,i){let r;for(const s of e)if(r=nn(Xe(s,t),n),mt(r))return Ke(t,r)?tn(n,i,t,r):r}(i,e,t,n))),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>rn(t).includes(e),ownKeys:t=>rn(t),set(t,e,n){const i=t._storage||(t._storage=r());return t[e]=i[e]=n,delete t._keys,!0}})}function Ye(t,e,n,i){const r={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:qe(t,i),setContext:e=>Ye(t,e,n,i),override:r=>Ye(t.override(r),e,n,i)};return new Proxy(r,{deleteProperty:(e,n)=>(delete e[n],delete t[n],!0),get:(t,e,n)=>Ze(t,e,(()=>function(t,e,n){const{_proxy:i,_context:r,_subProxy:s,_descriptors:o}=t;let a=i[e];bt(a)&&o.isScriptable(e)&&(a=function(t,e,n,i){const{_proxy:r,_context:s,_subProxy:o,_stack:a}=n;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t),e=e(s,o||i),a.delete(t),Ke(t,e)&&(e=tn(r._scopes,r,t,e));return e}(e,a,t,n));J(a)&&a.length&&(a=function(t,e,n,i){const{_proxy:r,_context:s,_subProxy:o,_descriptors:a}=n;if(mt(s.index)&&i(t))e=e[s.index%e.length];else if(Q(e[0])){const n=e,i=r._scopes.filter((t=>t!==n));e=[];for(const l of n){const n=tn(i,r,t,l);e.push(Ye(n,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,n))),getOwnPropertyDescriptor:(e,n)=>e._descriptors.allKeys?Reflect.has(t,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,n),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,n)=>Reflect.has(t,n),ownKeys:()=>Reflect.ownKeys(t),set:(e,n,i)=>(t[n]=i,delete e[n],!0)})}function qe(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:i=e.indexable,_allKeys:r=e.allKeys}=t;return{allKeys:r,scriptable:n,indexable:i,isScriptable:bt(n)?n:()=>n,isIndexable:bt(i)?i:()=>i}}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,n){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const i=n();return t[e]=i,i}function Ge(t,e,n){return bt(t)?t(e,n):t}const Je=(t,e)=>!0===t?e:"string"==typeof t?pt(e,t):void 0;function Qe(t,e,n,i,r){for(const s of e){const e=Je(n,s);if(e){t.add(e);const s=Ge(e._fallback,n,r);if(mt(s)&&s!==n&&s!==i)return s}else if(!1===e&&mt(i)&&n!==i)return null}return!1}function tn(t,e,n,i){const r=e._rootScopes,s=Ge(e._fallback,n,i),o=[...t,...r],a=new Set;a.add(i);let l=en(a,o,n,s||n,i);return null!==l&&((!mt(s)||s===n||(l=en(a,o,s,l,i),null!==l))&&Ue(Array.from(a),[""],r,s,(()=>function(t,e,n){const i=t._getTarget();e in i||(i[e]={});const r=i[e];if(J(r)&&Q(n))return n;return r||{}}(e,n,i))))}function en(t,e,n,i,r){for(;n;)n=Qe(t,e,n,i,r);return n}function nn(t,e){for(const n of e){if(!n)continue;const e=n[t];if(mt(e))return e}}function rn(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const n of t)for(const t of Object.keys(n).filter((t=>!t.startsWith("_"))))e.add(t);return Array.from(e)}(t._scopes)),e}function sn(t,e,n,i){const{iScale:r}=t,{key:s="r"}=this._parsing,o=new Array(i);let a,l,h,c;for(a=0,l=i;a<l;++a)h=a+n,c=e[h],o[a]={r:r.parse(pt(c,s),h)};return o}const on=Number.EPSILON||1e-14,an=(t,e)=>e<t.length&&!t[e].skip&&t[e],ln=t=>"x"===t?"y":"x";function hn(t,e,n,i){const r=t.skip?e:t,s=e,o=n.skip?e:n,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=i*h,f=i*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 cn(t,e="x"){const n=ln(e),i=t.length,r=Array(i).fill(0),s=Array(i);let o,a,l,h=an(t,0);for(o=0;o<i;++o)if(a=l,l=h,h=an(t,o+1),l){if(h){const t=h[e]-l[e];r[o]=0!==t?(h[n]-l[n])/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,n){const i=t.length;let r,s,o,a,l,h=an(t,0);for(let c=0;c<i-1;++c)l=h,h=an(t,c+1),l&&h&&(Ot(e[c],0,on)?n[c]=n[c+1]=0:(r=n[c]/e[c],s=n[c+1]/e[c],a=Math.pow(r,2)+Math.pow(s,2),a<=9||(o=3/Math.sqrt(a),n[c]=r*o*e[c],n[c+1]=s*o*e[c])))}(t,r,s),function(t,e,n="x"){const i=ln(n),r=t.length;let s,o,a,l=an(t,0);for(let h=0;h<r;++h){if(o=a,a=l,l=an(t,h+1),!a)continue;const r=a[n],c=a[i];o&&(s=(r-o[n])/3,a[`cp1${n}`]=r-s,a[`cp1${i}`]=c-s*e[h]),l&&(s=(l[n]-r)/3,a[`cp2${n}`]=r+s,a[`cp2${i}`]=c+s*e[h])}}(t,s,e)}function un(t,e,n){return Math.max(Math.min(t,n),e)}function fn(t,e,n,i,r){let s,o,a,l;if(e.spanGaps&&(t=t.filter((t=>!t.skip))),"monotone"===e.cubicInterpolationMode)cn(t,r);else{let n=i?t[t.length-1]:t[0];for(s=0,o=t.length;s<o;++s)a=t[s],l=hn(n,a,t[Math.min(s+1,o-(i?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,n=a}e.capBezierPoints&&function(t,e){let n,i,r,s,o,a=Pe(t[0],e);for(n=0,i=t.length;n<i;++n)o=s,s=a,a=n<i-1&&Pe(t[n+1],e),s&&(r=t[n],o&&(r.cp1x=un(r.cp1x,e.left,e.right),r.cp1y=un(r.cp1y,e.top,e.bottom)),a&&(r.cp2x=un(r.cp2x,e.left,e.right),r.cp2y=un(r.cp2y,e.top,e.bottom)))}(t,n)}function dn(){return"undefined"!=typeof window&&"undefined"!=typeof document}function pn(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function gn(t,e,n){let i;return"string"==typeof t?(i=parseInt(t,10),-1!==t.indexOf("%")&&(i=i/100*e.parentNode[n])):i=t,i}const mn=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);const bn=["top","right","bottom","left"];function _n(t,e,n){const i={};n=n?"-"+n:"";for(let r=0;r<4;r++){const s=bn[r];i[s]=parseFloat(t[e+"-"+s+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}function xn(t,e){if("native"in t)return t;const{canvas:n,currentDevicePixelRatio:i}=e,r=mn(n),s="border-box"===r.boxSizing,o=_n(r,"padding"),a=_n(r,"border","width"),{x:l,y:h,box:c}=function(t,e){const n=t.touches,i=n&&n.length?n[0]:t,{offsetX:r,offsetY:s}=i;let o,a,l=!1;if(((t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot))(r,s,t.target))o=r,a=s;else{const t=e.getBoundingClientRect();o=i.clientX-t.left,a=i.clientY-t.top,l=!0}return{x:o,y:a,box:l}}(t,n),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*n.width/i),y:Math.round((h-f)/p*n.height/i)}}const vn=t=>Math.round(10*t)/10;function yn(t,e,n,i){const r=mn(t),s=_n(r,"margin"),o=gn(r.maxWidth,t,"clientWidth")||wt,a=gn(r.maxHeight,t,"clientHeight")||wt,l=function(t,e,n){let i,r;if(void 0===e||void 0===n){const s=pn(t);if(s){const t=s.getBoundingClientRect(),o=mn(s),a=_n(o,"border","width"),l=_n(o,"padding");e=t.width-l.width-a.width,n=t.height-l.height-a.height,i=gn(o.maxWidth,s,"clientWidth"),r=gn(o.maxHeight,s,"clientHeight")}else e=t.clientWidth,n=t.clientHeight}return{width:e,height:n,maxWidth:i||wt,maxHeight:r||wt}}(t,e,n);let{width:h,height:c}=l;if("content-box"===r.boxSizing){const t=_n(r,"border","width"),e=_n(r,"padding");h-=e.width+t.width,c-=e.height+t.height}h=Math.max(0,h-s.width),c=Math.max(0,i?h/i:c-s.height),h=vn(Math.min(h,o,l.maxWidth)),c=vn(Math.min(c,a,l.maxHeight)),h&&!c&&(c=vn(h/2));return(void 0!==e||void 0!==n)&&i&&l.height&&c>l.height&&(c=l.height,h=vn(Math.floor(c*i))),{width:h,height:c}}function wn(t,e,n){const i=e||1,r=Math.floor(t.height*i),s=Math.floor(t.width*i);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const o=t.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${t.height}px`,o.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==i||o.height!==r||o.width!==s)&&(t.currentDevicePixelRatio=i,o.height=r,o.width=s,t.ctx.setTransform(i,0,0,i,0,0),!0)}const Mn=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 kn(t,e){const n=function(t,e){return mn(t).getPropertyValue(e)}(t,e),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Sn(t,e,n,i){return{x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}}function Pn(t,e,n,i){return{x:t.x+n*(e.x-t.x),y:"middle"===i?n<.5?t.y:e.y:"after"===i?n<1?t.y:e.y:n>0?e.y:t.y}}function An(t,e,n,i){const r={x:t.cp2x,y:t.cp2y},s={x:e.cp1x,y:e.cp1y},o=Sn(t,r,n),a=Sn(r,s,n),l=Sn(s,e,n),h=Sn(o,a,n),c=Sn(a,l,n);return Sn(h,c,n)}function Dn(t,e,n){return t?function(t,e){return{x:n=>t+t+e-n,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,n):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function On(t,e){let n,i;"ltr"!==e&&"rtl"!==e||(n=t.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=i)}function Cn(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Tn(t){return"angle"===t?{between:Bt,compare:jt,normalize:Vt}:{between:Nt,compare:(t,e)=>t-e,normalize:t=>t}}function En({start:t,end:e,count:n,loop:i,style:r}){return{start:t%n,end:e%n,loop:i&&(e-t+1)%n==0,style:r}}function Ln(t,e,n){if(!n)return[t];const{property:i,start:r,end:s}=n,o=e.length,{compare:a,between:l,normalize:h}=Tn(i),{start:c,end:u,loop:f,style:d}=function(t,e,n){const{property:i,start:r,end:s}=n,{between:o,normalize:a}=Tn(i),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][i]),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,n),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,M=c;w<=u;++w)m=e[w%o],m.skip||(g=h(m[i]),g!==b&&(_=l(g,r,s),null===x&&v()&&(x=0===a(g,r)?w:M),null!==x&&y()&&(p.push(En({start:x,end:w,loop:f,count:o,style:d})),x=null),M=w,b=g));return null!==x&&p.push(En({start:x,end:u,loop:f,count:o,style:d})),p}function Rn(t,e){const n=[],i=t.segments;for(let r=0;r<i.length;r++){const s=Ln(i[r],t.points,e);s.length&&n.push(...s)}return n}function In(t,e,n,i){return i&&i.setContext&&n?function(t,e,n,i){const r=t._chart.getContext(),s=zn(t.options),{_datasetIndex:o,options:{spanGaps:a}}=t,l=n.length,h=[];let c=s,u=e[0].start,f=u;function d(t,e,i,r){const s=a?-1:1;if(t!==e){for(t+=l;n[t%l].skip;)t-=s;for(;n[e%l].skip;)e+=s;t%l!=e%l&&(h.push({start:t%l,end:e%l,loop:i,style:r}),c=r,u=e%l)}}for(const p of e){u=a?u:p.start;let t,e=n[u%l];for(f=u+1;f<=p.end;f++){const s=n[f%l];t=zn(i.setContext($e(r,{type:"segment",p0:e,p1:s,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:o}))),Fn(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,n,i):e}function zn(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function Fn(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 jn{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,n,i){const r=e.listeners[i],s=e.duration;r.forEach((i=>i({chart:t,initial:e.initial,numSteps:s,currentStep:Math.min(n-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(((n,i)=>{if(!n.running||!n.items.length)return;const r=n.items;let s,o=r.length-1,a=!1;for(;o>=0;--o)s=r[o],s._active?(s._total>n.duration&&(n.duration=s._total),s.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(i.draw(),this._notify(i,n,t,"progress")),r.length||(n.running=!1,this._notify(i,n,t,"complete"),n.initial=!1),e+=r.length})),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}listen(t,e,n){this._getAnims(t).listeners[e].push(n)}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 n=e.items;let i=n.length-1;for(;i>=0;--i)n[i].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Vn=new jn;const Bn="transparent",Wn={boolean:(t,e,n)=>n>.5?e:t,color(t,e,n){const i=oe(t||Bn),r=i.valid&&oe(e||Bn);return r&&r.valid?r.mix(i,n).hexString():e},number:(t,e,n)=>t+(e-t)*n};class Nn{constructor(t,e,n,i){const r=e[n];i=He([t.to,i,r,t.from]);const s=He([t.from,r,i]);this._active=!0,this._fn=t.fn||Wn[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=n,this._from=s,this._to=i,this._promises=void 0}active(){return this._active}update(t,e,n){if(this._active){this._notify(!1);const i=this._target[this._prop],r=n-this._start,s=this._duration-r;this._start=n,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=He([t.to,e,i,t.from]),this._from=He([t.from,i,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,n=this._duration,i=this._prop,r=this._from,s=this._loop,o=this._to;let a;if(this._active=r!==o&&(s||e<n),!this._active)return this._target[i]=o,void this._notify(!0);e<0?this._target[i]=r:(a=e/n%2,a=s&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[i]=this._fn(r,o,a))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,n)=>{t.push({res:e,rej:n})}))}_notify(t){const e=t?"res":"rej",n=this._promises||[];for(let i=0;i<n.length;i++)n[i][e]()}}class Hn{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),n=this._properties;Object.getOwnPropertyNames(t).forEach((i=>{const r=t[i];if(!Q(r))return;const s={};for(const t of e)s[t]=r[t];(J(r.properties)&&r.properties||[i]).forEach((t=>{t!==i&&n.has(t)||n.set(t,s)}))}))}_animateOptions(t,e){const n=e.options,i=function(t,e){if(!e)return;let n=t.options;if(!n)return void(t.options=e);n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}}));return n}(t,n);if(!i)return[];const r=this._createAnimations(i,n);return n.$shared&&function(t,e){const n=[],i=Object.keys(e);for(let r=0;r<i.length;r++){const e=t[i[r]];e&&e.active()&&n.push(e.wait())}return Promise.all(n)}(t.options.$animations,n).then((()=>{t.options=n}),(()=>{})),r}_createAnimations(t,e){const n=this._properties,i=[],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){i.push(...this._animateOptions(t,e));continue}const h=e[l];let c=r[l];const u=n.get(l);if(c){if(u&&c.active()){c.update(u,h,o);continue}c.cancel()}u&&u.duration?(r[l]=c=new Nn(u,t,l,h),i.push(c)):t[l]=h}return i}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const n=this._createAnimations(t,e);return n.length?(Vn.add(this._chart,n),!0):void 0}}function $n(t,e){const n=t&&t.options||{},i=n.reverse,r=void 0===n.min?e:0,s=void 0===n.max?e:0;return{start:i?s:r,end:i?r:s}}function Un(t,e){const n=[],i=t._getSortedDatasetMetas(e);let r,s;for(r=0,s=i.length;r<s;++r)n.push(i[r].index);return n}function Yn(t,e,n,i={}){const r=t.keys,s="single"===i.mode;let o,a,l,h;if(null!==e){for(o=0,a=r.length;o<a;++o){if(l=+r[o],l===n){if(i.all)continue;break}h=t.values[l],tt(h)&&(s||0===e||Dt(e)===Dt(h))&&(e+=h)}return e}}function qn(t,e){const n=t&&t.options.stacked;return n||void 0===n&&void 0!==e.stack}function Xn(t,e,n){const i=t[e]||(t[e]={});return i[n]||(i[n]={})}function Kn(t,e,n,i){for(const r of e.getMatchingVisibleMetas(i).reverse()){const e=t[r.index];if(n&&e>0||!n&&e<0)return r.index}return null}function Zn(t,e){const{chart:n,_cachedMeta:i}=t,r=n._stacks||(n._stacks={}),{iScale:s,vScale:o,index:a}=i,l=s.axis,h=o.axis,c=function(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}(s,o,i),u=e.length;let f;for(let d=0;d<u;++d){const t=e[d],{[l]:n,[h]:s}=t;f=(t._stacks||(t._stacks={}))[h]=Xn(r,c,n),f[a]=s,f._top=Kn(f,o,!0,i.type),f._bottom=Kn(f,o,!1,i.type);(f._visualValues||(f._visualValues={}))[a]=s}}function Gn(t,e){const n=t.scales;return Object.keys(n).filter((t=>n[t].axis===e)).shift()}function Jn(t,e){const n=t.controller.index,i=t.vScale&&t.vScale.axis;if(i){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[i]||void 0===e[i][n])return;delete e[i][n],void 0!==e[i]._visualValues&&void 0!==e[i]._visualValues[n]&&delete e[i]._visualValues[n]}}}const Qn=t=>"reset"===t||"none"===t,ti=(t,e)=>e?t:Object.assign({},t);class ei{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=qn(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&&Jn(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,n=this.getDataset(),i=(t,e,n,i)=>"x"===t?e:"r"===t?i:n,r=e.xAxisID=nt(n.xAxisID,Gn(t,"x")),s=e.yAxisID=nt(n.yAxisID,Gn(t,"y")),o=e.rAxisID=nt(n.rAxisID,Gn(t,"r")),a=e.indexAxis,l=e.iAxisID=i(a,r,s,o),h=e.vAxisID=i(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&&Jn(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),n=this._data;if(Q(e))this._data=function(t){const e=Object.keys(t),n=new Array(e.length);let i,r,s;for(i=0,r=e.length;i<r;++i)s=e[i],n[i]={x:s,y:t[s]};return n}(e);else if(n!==e){if(n){qt(n,this);const t=this._cachedMeta;Jn(t),t._parsed=[]}e&&Object.isExtensible(e)&&(r=this,(i=e)._chartjs?i._chartjs.listeners.push(r):(Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[r]}}),Yt.forEach((t=>{const e="_onData"+gt(t),n=i[t];Object.defineProperty(i,t,{configurable:!0,enumerable:!1,value(...t){const r=n.apply(this,t);return i._chartjs.listeners.forEach((n=>{"function"==typeof n[e]&&n[e](...t)})),r}})})))),this._syncList=[],this._data=e}var i,r}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,n=this.getDataset();let i=!1;this._dataCheck();const r=e._stacked;e._stacked=qn(e.vScale,e),e.stack!==n.stack&&(i=!0,Jn(e),e.stack=n.stack),this._resyncElements(t),(i||r!==e._stacked)&&Zn(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:n,_data:i}=this,{iScale:r,_stacked:s}=n,o=r.axis;let a,l,h,c=0===t&&e===i.length||n._sorted,u=t>0&&n._parsed[t-1];if(!1===this._parsing)n._parsed=i,n._sorted=!0,h=i;else{h=J(i[t])?this.parseArrayData(n,i,t,e):Q(i[t])?this.parseObjectData(n,i,t,e):this.parsePrimitiveData(n,i,t,e);const r=()=>null===l[o]||u&&l[o]<u[o];for(a=0;a<e;++a)n._parsed[a+t]=l=h[a],c&&(r()&&(c=!1),u=l);n._sorted=c}s&&Zn(this,h)}parsePrimitiveData(t,e,n,i){const{iScale:r,vScale:s}=t,o=r.axis,a=s.axis,l=r.getLabels(),h=r===s,c=new Array(i);let u,f,d;for(u=0,f=i;u<f;++u)d=u+n,c[u]={[o]:h||r.parse(l[d],d),[a]:s.parse(e[d],d)};return c}parseArrayData(t,e,n,i){const{xScale:r,yScale:s}=t,o=new Array(i);let a,l,h,c;for(a=0,l=i;a<l;++a)h=a+n,c=e[h],o[a]={x:r.parse(c[0],h),y:s.parse(c[1],h)};return o}parseObjectData(t,e,n,i){const{xScale:r,yScale:s}=t,{xAxisKey:o="x",yAxisKey:a="y"}=this._parsing,l=new Array(i);let h,c,u,f;for(h=0,c=i;h<c;++h)u=h+n,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,n){const i=this.chart,r=this._cachedMeta,s=e[t.axis];return Yn({keys:Un(i,!0),values:e._stacks[t.axis]._visualValues},s,r.index,{mode:n})}updateRangeFromParsed(t,e,n,i){const r=n[e.axis];let s=null===r?NaN:r;const o=i&&n._stacks[e.axis];i&&o&&(i.values=o,s=Yn(i,r,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,e){const n=this._cachedMeta,i=n._parsed,r=n._sorted&&t===n.iScale,s=i.length,o=this._getOtherScale(t),a=((t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:Un(n,!0),values:null})(e,n,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:c}=function(t){const{min:e,max:n,minDefined:i,maxDefined:r}=t.getUserBounds();return{min:i?e:Number.NEGATIVE_INFINITY,max:r?n:Number.POSITIVE_INFINITY}}(o);let u,f;function d(){f=i[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,n=[];let i,r,s;for(i=0,r=e.length;i<r;++i)s=e[i][t.axis],tt(s)&&n.push(s);return n}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,n=e.iScale,i=e.vScale,r=this.getParsed(t);return{label:n?""+n.getLabelForValue(r[n.axis]):"",value:i?""+i.getLabelForValue(r[i.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=function(t){let e,n,i,r;return Q(t)?(e=t.top,n=t.right,i=t.bottom,r=t.left):e=n=i=r=t,{top:e,right:n,bottom:i,left:r,disabled:!1===t}}(nt(this.options.clip,function(t,e,n){if(!1===n)return!1;const i=$n(t,n),r=$n(e,n);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,n=this._cachedMeta,i=n.data||[],r=e.chartArea,s=[],o=this._drawStart||0,a=this._drawCount||i.length-o,l=this.options.drawActiveElementsOnTop;let h;for(n.dataset&&n.dataset.draw(t,r,o,a),h=o;h<o+a;++h){const e=i[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 n=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,e,n){const i=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,n){return $e(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}(this.getContext(),t,e)),r.parsed=this.getParsed(t),r.raw=i.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=i,r.index=r.datasetIndex=this.index;return r.active=!!e,r.mode=n,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",n){const i="active"===e,r=this._cachedDataOpts,s=t+"-"+e,o=r[s],a=this.enableOptionSharing&&mt(n);if(o)return ti(o,a);const l=this.chart.config,h=l.datasetElementScopeKeys(this._type,t),c=i?[`${t}Hover`,"hover",t,""]:[t,""],u=l.getOptionScopes(this.getDataset(),h),f=Object.keys(xe.elements[t]),d=l.resolveNamedOptions(u,f,(()=>this.getContext(n,i,e)),c);return d.$shared&&(d.$shared=a,r[s]=Object.freeze(ti(d,a))),d}_resolveAnimations(t,e,n){const i=this.chart,r=this._cachedDataOpts,s=`animation-${e}`,o=r[s];if(o)return o;let a;if(!1!==i.options.animation){const i=this.chart.config,r=i.datasetAnimationScopeKeys(this._type,e),s=i.getOptionScopes(this.getDataset(),r);a=i.createResolver(s,this.getContext(t,n,e))}const l=new Hn(i,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||Qn(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const n=this.resolveDataElementOptions(t,e),i=this._sharedOptions,r=this.getSharedOptions(n),s=this.includeOptions(e,r)||r!==i;return this.updateSharedOptions(r,e,n),{sharedOptions:r,includeOptions:s}}updateElement(t,e,n,i){Qn(i)?Object.assign(t,n):this._resolveAnimations(e,i).update(t,n)}updateSharedOptions(t,e,n){t&&!Qn(e)&&this._resolveAnimations(void 0,e).update(t,n)}_setStyle(t,e,n,i){t.active=i;const r=this.getStyle(e,i);this._resolveAnimations(e,n,i).update(t,{options:!i&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,e,n){this._setStyle(t,n,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,n=this._cachedMeta.data;for(const[o,a,l]of this._syncList)this[o](a,l);this._syncList=[];const i=n.length,r=e.length,s=Math.min(r,i);s&&this.parse(0,s),r>i?this._insertElements(i,r-i,t):r<i&&this._removeElements(r,i-r)}_insertElements(t,e,n=!0){const i=this._cachedMeta,r=i.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(i._parsed),this.parse(t,e),n&&this.updateElements(r,t,e,"reset")}updateElements(t,e,n,i){}_removeElements(t,e){const n=this._cachedMeta;if(this._parsing){const i=n._parsed.splice(t,e);n._stacked&&Jn(n,i)}n.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,n,i]=t;this[e](n,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const n=arguments.length-2;n&&this._sync(["_insertElements",t,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function ni(t){const e=t.iScale,n=function(t,e){if(!t._cache.$bar){const n=t.getMatchingVisibleMetas(e);let i=[];for(let e=0,r=n.length;e<r;e++)i=i.concat(n[e].controller.getAllParsedValues(t));t._cache.$bar=Xt(i.sort(((t,e)=>t-e)))}return t._cache.$bar}(e,t.type);let i,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(i=0,r=n.length;i<r;++i)s=e.getPixelForValue(n[i]),l();for(o=void 0,i=0,r=e.ticks.length;i<r;++i)s=e.getPixelForTick(i),l();return a}function ii(t,e,n,i){return J(t)?function(t,e,n,i){const r=n.parse(t[0],i),s=n.parse(t[1],i),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[n.axis]=h,e._custom={barStart:l,barEnd:h,start:r,end:s,min:o,max:a}}(t,e,n,i):e[n.axis]=n.parse(t,i),e}function ri(t,e,n,i){const r=t.iScale,s=t.vScale,o=r.getLabels(),a=r===s,l=[];let h,c,u,f;for(h=n,c=n+i;h<c;++h)f=e[h],u={},u[r.axis]=a||r.parse(o[h],h),l.push(ii(f,u,s,h));return l}function si(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function oi(t,e,n,i){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,n,i,r,s;return t.horizontal?(e=t.base>t.x,n="left",i="right"):(e=t.base<t.y,n="bottom",i="top"),e?(r="end",s="start"):(r="start",s="end"),{start:n,end:i,reverse:e,top:r,bottom:s}}(t);"middle"===r&&n&&(t.enableBorderRadius=!0,(n._top||0)===i?r=h:(n._bottom||0)===i?r=c:(s[ai(c,o,a,l)]=!0,r=h)),s[ai(r,o,a,l)]=!0,t.borderSkipped=s}function ai(t,e,n,i){var r,s,o;return i?(o=n,t=li(t=(r=t)===(s=e)?o:r===o?s:r,n,e)):t=li(t,e,n),t}function li(t,e,n){return"start"===t?e:"end"===t?n:t}function hi(t,{inflateAmount:e},n){t.inflateAmount="auto"===e?1===n?.33:0:e}t(ei,"defaults",{}),t(ei,"datasetElementType",null),t(ei,"dataElementType",null);class ci extends ei{parsePrimitiveData(t,e,n,i){return ri(t,e,n,i)}parseArrayData(t,e,n,i){return ri(t,e,n,i)}parseObjectData(t,e,n,i){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=n,f=n+i;u<f;++u)p=e[u],d={},d[r.axis]=r.parse(pt(p,l),u),c.push(ii(pt(p,h),d,s,u));return c}updateRangeFromParsed(t,e,n,i){super.updateRangeFromParsed(t,e,n,i);const r=n._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:n,vScale:i}=e,r=this.getParsed(t),s=r._custom,o=si(s)?"["+s.start+", "+s.end+"]":""+i.getLabelForValue(r[i.axis]);return{label:""+n.getLabelForValue(r[n.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,n,i){const r="reset"===i,{index:s,_cachedMeta:{vScale:o}}=this,a=o.getBasePixel(),l=o.isHorizontal(),h=this._getRuler(),{sharedOptions:c,includeOptions:u}=this._getSharedOptions(e,i);for(let f=e;f<e+n;f++){const e=this.getParsed(f),n=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:n.base,enableBorderRadius:!p||si(e._custom)||s===p._top||s===p._bottom,x:l?n.head:d.center,y:l?d.center:n.head,height:l?d.size:Math.abs(n.size),width:l?Math.abs(n.size):d.size};u&&(g.options=c||this.resolveDataElementOptions(f,t[f].active?"active":i));const m=g.options||t[f].options;oi(g,m,p,s),hi(g,m,h.ratio),this.updateElement(t[f],f,g,i)}}_getStacks(t,e){const{iScale:n}=this._cachedMeta,i=n.getMatchingVisibleMetas(this._type).filter((t=>t.controller.options.grouped)),r=n.options.stacked,s=[],o=t=>{const n=t.controller.getParsed(e),i=n&&n[t.vScale.axis];if(G(i)||isNaN(i))return!0};for(const a of i)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,n){const i=this._getStacks(t,n),r=void 0!==e?i.indexOf(e):-1;return-1===r?i.length-1:r}_getRuler(){const t=this.options,e=this._cachedMeta,n=e.iScale,i=[];let r,s;for(r=0,s=e.data.length;r<s;++r)i.push(n.getPixelForValue(this.getParsed(r)[n.axis],r));const o=t.barThickness;return{min:o||ni(e),pixels:i,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:t.grouped,ratio:o?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:n,index:i},options:{base:r,minBarLength:s}}=this,o=r||0,a=this.getParsed(t),l=a._custom,h=si(l);let c,u,f=a[e.axis],d=0,p=n?this.applyStack(e,a,n):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,n){return 0!==t?Dt(t):(e.isHorizontal()?1:-1)*(e.min>=n?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,n&&!h&&(a._stacks[e.axis]._visualValues[i]=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 n=e.scale,i=this.options,r=i.skipNull,s=nt(i.maxBarThickness,1/0);let o,a;if(e.grouped){const n=r?this._getStackCount(t):e.stackCount,l="flex"===i.barThickness?function(t,e,n,i){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=n.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/i,ratio:n.barPercentage,start:h}}(t,e,i,n):function(t,e,n,i){const r=n.barThickness;let s,o;return G(r)?(s=e.min*n.categoryPercentage,o=n.barPercentage):(s=r*i,o=1),{chunk:s/i,ratio:o,start:e.pixels[t]-s/2}}(t,e,i,n),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=n.getPixelForValue(this.getParsed(t)[n.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,n=t.data,i=n.length;let r=0;for(;r<i;++r)null!==this.getParsed(r)[e.axis]&&n[r].draw(this._ctx)}}t(ci,"id","bar"),t(ci,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),t(ci,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class ui extends ei{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,n,i){const r=super.parsePrimitiveData(t,e,n,i);for(let s=0;s<r.length;s++)r[s]._custom=this.resolveDataElementOptions(s+n).radius;return r}parseArrayData(t,e,n,i){const r=super.parseArrayData(t,e,n,i);for(let s=0;s<r.length;s++){const t=e[n+s];r[s]._custom=nt(t[2],this.resolveDataElementOptions(s+n).radius)}return r}parseObjectData(t,e,n,i){const r=super.parseObjectData(t,e,n,i);for(let s=0;s<r.length;s++){const t=e[n+s];r[s]._custom=nt(t&&t.r&&+t.r,this.resolveDataElementOptions(s+n).radius)}return r}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let n=t.length-1;n>=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart.data.labels||[],{xScale:i,yScale:r}=e,s=this.getParsed(t),o=i.getLabelForValue(s.x),a=r.getLabelForValue(s.y),l=s._custom;return{label:n[t]||"",value:"("+o+", "+a+(l?", "+l:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,n,i){const r="reset"===i,{iScale:s,vScale:o}=this._cachedMeta,{sharedOptions:a,includeOptions:l}=this._getSharedOptions(e,i),h=s.axis,c=o.axis;for(let u=e;u<e+n;u++){const e=t[u],n=!r&&this.getParsed(u),f={},d=f[h]=r?s.getPixelForDecimal(.5):s.getPixelForValue(n[h]),p=f[c]=r?o.getBasePixel():o.getPixelForValue(n[c]);f.skip=isNaN(d)||isNaN(p),l&&(f.options=a||this.resolveDataElementOptions(u,e.active?"active":i),r&&(f.options.radius=0)),this.updateElement(e,u,f,i)}}resolveDataElementOptions(t,e){const n=this.getParsed(t);let i=super.resolveDataElementOptions(t,e);i.$shared&&(i=Object.assign({},i,{$shared:!1}));const r=i.radius;return"active"!==e&&(i.radius=0),i.radius+=nt(n&&n._custom,r),i}}t(ui,"id","bubble"),t(ui,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),t(ui,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});class fi extends ei{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 n=this.getDataset().data,i=this._cachedMeta;if(!1===this._parsing)i._parsed=n;else{let r,s,o=t=>+n[t];if(Q(n[t])){const{key:t="value"}=this._parsing;o=e=>+pt(n[e],t)}for(r=t,s=t+e;r<s;++r)i._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 n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){const i=this.chart.getDatasetMeta(n).controller,r=i._getRotation(),s=i._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:n}=e,i=this._cachedMeta,r=i.data,s=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,o=Math.max((Math.min(n.width,n.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,n){let i=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,i)=>Bt(t,a,l,!0)?1:Math.max(e,e*n,i,i*n),p=(t,e,i)=>Bt(t,a,l,!0)?-1:Math.min(e,e*n,i,i*n),g=d(0,h,u),m=d(kt,c,f),b=p(xt,h,u),_=p(xt+kt,c,f);i=(g-b)/2,r=(m-_)/2,s=-(g+b)/2,o=-(m+_)/2}return{ratioX:i,ratioY:r,offsetX:s,offsetY:o}}(f,u,a),b=(n.width-s)/d,_=(n.height-s)/p,x=Math.max(Math.min(b,_)/2,0),v=it(this.options.radius,x),y=(v-Math.max(v*a,0))/this._getVisibleDatasetWeightTotal();this.offsetX=g*v,this.offsetY=m*v,i.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 n=this.options,i=this._cachedMeta,r=this._getCircumference();return e&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||null===i._parsed[t]||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*r/vt)}updateElements(t,e,n,i){const r="reset"===i,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,i);let g,m=this._getRotation();for(g=0;g<e;++g)m+=this._circumference(g,r);for(g=e;g<e+n;++g){const e=this._circumference(g,r),n=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,n.active?"active":i)),m+=e,this.updateElement(n,g,s,i)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let n,i=0;for(n=0;n<e.length;n++){const r=t._parsed[n];null===r||isNaN(r)||!this.chart.getDataVisibility(n)||e[n].hidden||(i+=Math.abs(r))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?vt*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,i=n.data.labels||[],r=ue(e._parsed[t],n.options.locale);return{label:i[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const n=this.chart;let i,r,s,o,a;if(!t)for(i=0,r=n.data.datasets.length;i<r;++i)if(n.isDatasetVisible(i)){s=n.getDatasetMeta(i),t=s.data,o=s.controller;break}if(!t)return 0;for(i=0,r=t.length;i<r;++i)a=o.resolveDataElementOptions(i),"inner"!==a.borderAlign&&(e=Math.max(e,a.borderWidth||0,a.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let n=0,i=t.length;n<i;++n){const t=this.resolveDataElementOptions(n);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(e+=this._getRingWeight(n));return e}_getRingWeight(t){return Math.max(nt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}t(fi,"id","doughnut"),t(fi,"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(fi,"descriptors",{_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t}),t(fi,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n,color:i}}=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:i,lineWidth:s.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(r),index:r}}))}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}}}});class di extends ei{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:n,data:i=[],_dataset:r}=e,s=this.chart._animationsDisabled;let{start:o,count:a}=Qt(e,i,s);this._drawStart=o,this._drawCount=a,te(e)&&(o=0,a=i.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!r._decimated,n.points=i;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(n,void 0,{animated:!s,options:l},t),this.updateElements(i,o,a,t)}updateElements(t,e,n,i){const r="reset"===i,{iScale:s,vScale:o,_stacked:a,_dataset:l}=this._cachedMeta,{sharedOptions:h,includeOptions:c}=this._getSharedOptions(e,i),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"===i,b=e+n,_=t.length;let x=e>0&&this.getParsed(e-1);for(let v=0;v<_;++v){const n=t[v],d=m?n:{};if(v<e||v>=b){d.skip=!0;continue}const _=this.getParsed(v),y=G(_[f]),w=d[u]=s.getPixelForValue(_[u],v),M=d[f]=r||y?o.getBasePixel():o.getPixelForValue(a?this.applyStack(o,_,a):_[f],v);d.skip=isNaN(w)||isNaN(M)||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,n.active?"active":i)),m||this.updateElement(n,v,d,i),x=_}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,n=e.options&&e.options.borderWidth||0,i=t.data||[];if(!i.length)return n;const r=i[0].size(this.resolveDataElementOptions(0)),s=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(n,r,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}t(di,"id","line"),t(di,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),t(di,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class pi extends ei{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,i=n.data.labels||[],r=ue(e._parsed[t].r,n.options.locale);return{label:i[t]||"",value:r}}parseObjectData(t,e,n,i){return sn.bind(this)(t,e,n,i)}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,n)=>{const i=this.getParsed(n).r;!isNaN(i)&&this.chart.getDataVisibility(n)&&(i<e.min&&(e.min=i),i>e.max&&(e.max=i))})),e}_updateRadius(){const t=this.chart,e=t.chartArea,n=t.options,i=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(i/2,0),s=(r-Math.max(n.cutoutPercentage?r/100*n.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=r-s*this.index,this.innerRadius=this.outerRadius-s}updateElements(t,e,n,i){const r="reset"===i,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,i,d);for(u=e;u<e+n;u++){const e=t[u];let n=f,p=f+this._computeAngle(u,i,d),g=s.getDataVisibility(u)?a.getDistanceFromCenterForValue(this.getParsed(u).r):0;f=p,r&&(o.animateScale&&(g=0),o.animateRotate&&(n=p=c));const m={x:l,y:h,innerRadius:0,outerRadius:g,startAngle:n,endAngle:p,options:this.resolveDataElementOptions(u,e.active?"active":i)};this.updateElement(e,u,m,i)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach(((t,n)=>{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&e++})),e}_computeAngle(t,e,n){return this.chart.getDataVisibility(t)?Lt(this.resolveDataElementOptions(t,e).angle||n):0}}t(pi,"id","polarArea"),t(pi,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),t(pi,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n,color:i}}=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:i,lineWidth:s.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(r),index:r}}))}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class gi extends fi{}t(gi,"id","pie"),t(gi,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class mi extends ei{getLabelAndValue(t){const e=this._cachedMeta.vScale,n=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(n[e.axis])}}parseObjectData(t,e,n,i){return sn.bind(this)(t,e,n,i)}update(t){const e=this._cachedMeta,n=e.dataset,i=e.data||[],r=e.iScale.getLabels();if(n.points=i,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const s={_loop:!0,_fullLoop:r.length===i.length,options:e};this.updateElement(n,void 0,s,t)}this.updateElements(i,0,i.length,t)}updateElements(t,e,n,i){const r=this._cachedMeta.rScale,s="reset"===i;for(let o=e;o<e+n;o++){const e=t[o],n=this.resolveDataElementOptions(o,e.active?"active":i),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:n};this.updateElement(e,o,c,i)}}}t(mi,"id","radar"),t(mi,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),t(mi,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class bi extends ei{getLabelAndValue(t){const e=this._cachedMeta,n=this.chart.data.labels||[],{xScale:i,yScale:r}=e,s=this.getParsed(t),o=i.getLabelForValue(s.x),a=r.getLabelForValue(s.y);return{label:n[t]||"",value:"("+o+", "+a+")"}}update(t){const e=this._cachedMeta,{data:n=[]}=e,i=this.chart._animationsDisabled;let{start:r,count:s}=Qt(e,n,i);if(this._drawStart=r,this._drawCount=s,te(e)&&(r=0,s=n.length),this.options.showLine){const{dataset:r,_dataset:s}=e;r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!s._decimated,r.points=n;const o=this.resolveDatasetElementOptions(t);o.segment=this.options.segment,this.updateElement(r,void 0,{animated:!i,options:o},t)}this.updateElements(n,r,s,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,n,i){const r="reset"===i,{iScale:s,vScale:o,_stacked:a,_dataset:l}=this._cachedMeta,h=this.resolveDataElementOptions(e,i),c=this.getSharedOptions(h),u=this.includeOptions(i,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"===i;let _=e>0&&this.getParsed(e-1);for(let x=e;x<e+n;++x){const e=t[x],n=this.getParsed(x),h=b?e:{},p=G(n[d]),v=h[f]=s.getPixelForValue(n[f],x),y=h[d]=r||p?o.getBasePixel():o.getPixelForValue(a?this.applyStack(o,n,a):n[d],x);h.skip=isNaN(v)||isNaN(y)||p,h.stop=x>0&&Math.abs(n[f]-_[f])>m,g&&(h.parsed=n,h.raw=l.data[x]),u&&(h.options=c||this.resolveDataElementOptions(x,e.active?"active":i)),b||this.updateElement(e,x,h,i),_=n}this.updateSharedOptions(c,i,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let n=e.length-1;n>=0;--n)t=Math.max(t,e[n].size(this.resolveDataElementOptions(n))/2);return t>0&&t}const n=t.dataset,i=n.options&&n.options.borderWidth||0;if(!e.length)return i;const r=e[0].size(this.resolveDataElementOptions(0)),s=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(i,r,s)/2}}t(bi,"id","scatter"),t(bi,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),t(bi,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var _i=Object.freeze({__proto__:null,BarController:ci,BubbleController:ui,DoughnutController:fi,LineController:di,PolarAreaController:pi,PieController:gi,RadarController:mi,ScatterController:bi});function xi(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class vi{static override(t){Object.assign(vi.prototype,t)}constructor(t){this.options=t||{}}init(){}formats(){return xi()}parse(){return xi()}format(){return xi()}add(){return xi()}diff(){return xi()}startOf(){return xi()}endOf(){return xi()}}var yi=vi;function wi(t,e,n,i){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(!i)return t(s,e,n);if(r._sharedOptions){const i=s[0],r="function"==typeof i.getRange&&i.getRange(e);if(r){const i=t(s,e,n-r),o=t(s,e,n+r);return{lo:i.lo,hi:o.hi}}}}return{lo:0,hi:s.length-1}}function Mi(t,e,n,i,r){const s=t.getSortedVisibleDatasetMetas(),o=n[e];for(let a=0,l=s.length;a<l;++a){const{index:t,data:n}=s[a],{lo:l,hi:h}=wi(s[a],e,o,r);for(let e=l;e<=h;++e){const r=n[e];r.skip||i(r,t,e)}}}function ki(t,e,n,i,r){const s=[];if(!r&&!t.isPointInArea(e))return s;return Mi(t,n,e,(function(n,o,a){(r||Pe(n,t.chartArea,0))&&n.inRange(e.x,e.y,i)&&s.push({element:n,datasetIndex:o,index:a})}),!0),s}function Si(t,e,n,i,r,s){let o=[];const a=function(t){const e=-1!==t.indexOf("x"),n=-1!==t.indexOf("y");return function(t,i){const r=e?Math.abs(t.x-i.x):0,s=n?Math.abs(t.y-i.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(s,2))}}(n);let l=Number.POSITIVE_INFINITY;return Mi(t,n,e,(function(n,h,c){const u=n.inRange(e.x,e.y,r);if(i&&!u)return;const f=n.getCenterPoint(r);if(!(!!s||t.isPointInArea(f))&&!u)return;const d=a(e,f);d<l?(o=[{element:n,datasetIndex:h,index:c}],l=d):d===l&&o.push({element:n,datasetIndex:h,index:c})})),o}function Pi(t,e,n,i,r,s){return s||t.isPointInArea(e)?"r"!==n||i?Si(t,e,n,i,r,s):function(t,e,n,i){let r=[];return Mi(t,n,e,(function(t,n,s){const{startAngle:o,endAngle:a}=t.getProps(["startAngle","endAngle"],i),{angle:l}=zt(t,{x:e.x,y:e.y});Bt(l,o,a)&&r.push({element:t,datasetIndex:n,index:s})})),r}(t,e,n,r):[]}function Ai(t,e,n,i,r){const s=[],o="x"===n?"inXRange":"inYRange";let a=!1;return Mi(t,n,e,((t,i,l)=>{t[o](e[n],r)&&(s.push({element:t,datasetIndex:i,index:l}),a=a||t.inRange(e.x,e.y,r))})),i&&!a?[]:s}var Di={evaluateInteractionItems:Mi,modes:{index(t,e,n,i){const r=xn(e,t),s=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?ki(t,r,s,i,o):Pi(t,r,s,!1,i,o),l=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=a[0].index,n=t.data[e];n&&!n.skip&&l.push({element:n,datasetIndex:t.index,index:e})})),l):[]},dataset(t,e,n,i){const r=xn(e,t),s=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?ki(t,r,s,i,o):Pi(t,r,s,!1,i,o);if(a.length>0){const e=a[0].datasetIndex,n=t.getDatasetMeta(e).data;a=[];for(let t=0;t<n.length;++t)a.push({element:n[t],datasetIndex:e,index:t})}return a},point:(t,e,n,i)=>ki(t,xn(e,t),n.axis||"xy",i,n.includeInvisible||!1),nearest(t,e,n,i){const r=xn(e,t),s=n.axis||"xy",o=n.includeInvisible||!1;return Pi(t,r,s,n.intersect,i,o)},x:(t,e,n,i)=>Ai(t,xn(e,t),"x",n.intersect,i),y:(t,e,n,i)=>Ai(t,xn(e,t),"y",n.intersect,i)}};const Oi=["left","top","right","bottom"];function Ci(t,e){return t.filter((t=>t.pos===e))}function Ti(t,e){return t.filter((t=>-1===Oi.indexOf(t.pos)&&t.box.axis===e))}function Ei(t,e){return t.sort(((t,n)=>{const i=e?n:t,r=e?t:n;return i.weight===r.weight?i.index-r.index:i.weight-r.weight}))}function Li(t,e){const n=function(t){const e={};for(const n of t){const{stack:t,pos:i,stackWeight:r}=n;if(!t||!Oi.includes(i))continue;const s=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=r}return e}(t),{vBoxMaxWidth:i,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=n[a.stack],h=l&&a.stackWeight/l.weight;a.horizontal?(a.width=h?h*i:o&&e.availableWidth,a.height=r):(a.width=i,a.height=h?h*r:o&&e.availableHeight)}return n}function Ri(t,e,n,i){return Math.max(t[n],e[n])+Math.max(t[i],e[i])}function Ii(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 zi(t,e,n,i){const{pos:r,box:s}=n,o=t.maxPadding;if(!Q(r)){n.size&&(t[r]-=n.size);const e=i[n.stack]||{size:0,count:1};e.size=Math.max(e.size,n.horizontal?s.height:s.width),n.size=e.size/e.count,t[r]+=n.size}s.getPadding&&Ii(o,s.getPadding());const a=Math.max(0,e.outerWidth-Ri(o,t,"left","right")),l=Math.max(0,e.outerHeight-Ri(o,t,"top","bottom")),h=a!==t.w,c=l!==t.h;return t.w=a,t.h=l,n.horizontal?{same:h,other:c}:{same:c,other:h}}function Fi(t,e){const n=e.maxPadding;function i(t){const i={left:0,top:0,right:0,bottom:0};return t.forEach((t=>{i[t]=Math.max(e[t],n[t])})),i}return i(t?["left","right"]:["top","bottom"])}function ji(t,e,n,i){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,Fi(a.horizontal,e));const{same:o,other:u}=zi(e,n,a,i);h|=o&&r.length,c=c||u,l.fullSize||r.push(a)}return h&&ji(r,e,n,i)||c}function Vi(t,e,n,i,r){t.top=n,t.left=e,t.right=e+i,t.bottom=n+r,t.width=i,t.height=r}function Bi(t,e,n,i){const r=n.padding;let{x:s,y:o}=e;for(const a of t){const t=a.box,l=i[a.stack]||{count:1,placed:0,weight:1},h=a.stackWeight/l.weight||1;if(a.horizontal){const i=e.w*h,s=l.size||t.height;mt(l.start)&&(o=l.start),t.fullSize?Vi(t,r.left,o,n.outerWidth-r.right-r.left,s):Vi(t,e.left+l.placed,o,i,s),l.start=o,l.placed+=i,o=t.bottom}else{const i=e.h*h,o=l.size||t.width;mt(l.start)&&(s=l.start),t.fullSize?Vi(t,s,r.top,o,n.outerHeight-r.bottom-r.top):Vi(t,s,e.top+l.placed,o,i),l.start=s,l.placed+=i,s=t.right}}e.x=s,e.y=o}var Wi={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 n=t.boxes?t.boxes.indexOf(e):-1;-1!==n&&t.boxes.splice(n,1)},configure(t,e,n){e.fullSize=n.fullSize,e.position=n.position,e.weight=n.weight},update(t,e,n,i){if(!t)return;const r=We(t.options.layout.padding),s=Math.max(e-r.width,0),o=Math.max(n-r.height,0),a=function(t){const e=function(t){const e=[];let n,i,r,s,o,a;for(n=0,i=(t||[]).length;n<i;++n)r=t[n],({position:s,options:{stack:o,stackWeight:a=1}}=r),e.push({index:n,box:r,pos:s,horizontal:r.isHorizontal(),weight:r.weight,stack:o&&s+o,stackWeight:a});return e}(t),n=Ei(e.filter((t=>t.box.fullSize)),!0),i=Ei(Ci(e,"left"),!0),r=Ei(Ci(e,"right")),s=Ei(Ci(e,"top"),!0),o=Ei(Ci(e,"bottom")),a=Ti(e,"x"),l=Ti(e,"y");return{fullSize:n,leftAndTop:i.concat(s),rightAndBottom:r.concat(l).concat(o).concat(a),chartArea:Ci(e,"chartArea"),vertical:i.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:n,padding:r,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/c,hBoxMaxHeight:o/2}),f=Object.assign({},r);Ii(f,We(i));const d=Object.assign({maxPadding:f,w:s,h:o,x:r.left,y:r.top},r),p=Li(l.concat(h),u);ji(a.fullSize,d,u,p),ji(l,d,u,p),ji(h,d,u,p)&&ji(l,d,u,p),function(t){const e=t.maxPadding;function n(n){const i=Math.max(e[n]-t[n],0);return t[n]+=i,i}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}(d),Bi(a.leftAndTop,d,u,p),d.x+=d.w,d.y+=d.h,Bi(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 n=e.box;Object.assign(n,t.chartArea),n.update(d.w,d.h,{left:0,top:0,right:0,bottom:0})}))}};class Ni{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,n){}removeEventListener(t,e,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,n,i){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,i?Math.floor(e/i):n)}}isAttached(t){return!0}updateConfig(t){}}class Hi extends Ni{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const $i="$chartjs",Ui={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Yi=t=>null===t||""===t;const qi=!!Mn&&{passive:!0};function Xi(t,e,n){t.canvas.removeEventListener(e,n,qi)}function Ki(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function Zi(t,e,n){const i=t.canvas,r=new MutationObserver((t=>{let e=!1;for(const n of t)e=e||Ki(n.addedNodes,i),e=e&&!Ki(n.removedNodes,i);e&&n()}));return r.observe(document,{childList:!0,subtree:!0}),r}function Gi(t,e,n){const i=t.canvas,r=new MutationObserver((t=>{let e=!1;for(const n of t)e=e||Ki(n.removedNodes,i),e=e&&!Ki(n.addedNodes,i);e&&n()}));return r.observe(document,{childList:!0,subtree:!0}),r}const Ji=new Map;let Qi=0;function tr(){const t=window.devicePixelRatio;t!==Qi&&(Qi=t,Ji.forEach(((e,n)=>{n.currentDevicePixelRatio!==t&&e()})))}function er(t,e,n){const i=t.canvas,r=i&&pn(i);if(!r)return;const s=Zt(((t,e)=>{const i=r.clientWidth;n(t,e),i<r.clientWidth&&n()}),window),o=new ResizeObserver((t=>{const e=t[0],n=e.contentRect.width,i=e.contentRect.height;0===n&&0===i||s(n,i)}));return o.observe(r),function(t,e){Ji.size||window.addEventListener("resize",tr),Ji.set(t,e)}(t,s),o}function nr(t,e,n){n&&n.disconnect(),"resize"===e&&function(t){Ji.delete(t),Ji.size||window.removeEventListener("resize",tr)}(t)}function ir(t,e,n){const i=t.canvas,r=Zt((e=>{null!==t.ctx&&n(function(t,e){const n=Ui[t.type]||t.type,{x:i,y:r}=xn(t,e);return{type:n,chart:e,native:t,x:void 0!==i?i:null,y:void 0!==r?r:null}}(e,t))}),t);return function(t,e,n){t.addEventListener(e,n,qi)}(i,e,r),r}class rr extends Ni{acquireContext(t,e){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(function(t,e){const n=t.style,i=t.getAttribute("height"),r=t.getAttribute("width");if(t[$i]={initial:{height:i,width:r,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Yi(r)){const e=kn(t,"width");void 0!==e&&(t.width=e)}if(Yi(i))if(""===t.style.height)t.height=t.width/(e||2);else{const e=kn(t,"height");void 0!==e&&(t.height=e)}}(t,e),n):null}releaseContext(t){const e=t.canvas;if(!e[$i])return!1;const n=e[$i].initial;["height","width"].forEach((t=>{const i=n[t];G(i)?e.removeAttribute(t):e.setAttribute(t,i)}));const i=n.style||{};return Object.keys(i).forEach((t=>{e.style[t]=i[t]})),e.width=e.width,delete e[$i],!0}addEventListener(t,e,n){this.removeEventListener(t,e);const i=t.$proxies||(t.$proxies={}),r={attach:Zi,detach:Gi,resize:er}[e]||ir;i[e]=r(t,e,n)}removeEventListener(t,e){const n=t.$proxies||(t.$proxies={}),i=n[e];if(!i)return;({attach:nr,detach:nr,resize:nr}[e]||Xi)(t,e,i),n[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,i){return yn(t,e,n,i)}isAttached(t){const e=pn(t);return!(!e||!e.isConnected)}}class sr{constructor(){t(this,"active",!1)}tooltipPosition(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}hasValue(){return Tt(this.x)&&Tt(this.y)}getProps(t,e){const n=this.$animations;if(!e||!n)return this;const i={};return t.forEach((t=>{i[t]=n[t]&&n[t].active()?n[t]._to:this[t]})),i}}function or(t,e){const n=t.options.ticks,i=function(t){const e=t.options.offset,n=t._tickSize(),i=t._length/n+(e?0:1),r=t._maxLength/n;return Math.floor(Math.min(i,r))}(t),r=Math.min(n.maxTicksLimit||i,i),s=n.major.enabled?function(t){const e=[];let n,i;for(n=0,i=t.length;n<i;n++)t[n].major&&e.push(n);return e}(e):[],o=s.length,a=s[0],l=s[o-1],h=[];if(o>r)return function(t,e,n,i){let r,s=0,o=n[0];for(i=Math.ceil(i),r=0;r<t.length;r++)r===o&&(e.push(t[r]),s++,o=n[s*i])}(e,h,s,o/r),h;const c=function(t,e,n){const i=function(t){const e=t.length;let n,i;if(e<2)return!1;for(i=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==i)return!1;return i}(t),r=e.length/n;if(!i)return Math.max(r,1);const s=function(t){const e=[],n=Math.sqrt(t);let i;for(i=1;i<n;i++)t%i==0&&(e.push(i),e.push(t/i));return n===(0|n)&&e.push(n),e.sort(((t,e)=>t-e)).pop(),e}(i);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,n;const i=o>1?Math.round((l-a)/(o-1)):null;for(ar(e,h,c,G(i)?0:a-i,a),t=0,n=o-1;t<n;t++)ar(e,h,c,s[t],s[t+1]);return ar(e,h,c,l,G(i)?e.length:l+i),h}return ar(e,h,c),h}function ar(t,e,n,i,r){const s=nt(i,0),o=Math.min(nt(r,t.length),t.length);let a,l,h,c=0;for(n=Math.ceil(n),r&&(a=r-i,n=a/Math.floor(a/n)),h=s;h<0;)c++,h=Math.round(s+c*n);for(l=Math.max(s,0);l<o;l++)l===h&&(e.push(t[l]),c++,h=Math.round(s+c*n))}t(sr,"defaults",{}),t(sr,"defaultRoutes",void 0);const lr=(t,e,n)=>"top"===e||"left"===e?t[e]+n:t[e]-n;function hr(t,e){const n=[],i=t.length/e,r=t.length;let s=0;for(;s<r;s+=i)n.push(t[Math.floor(s)]);return n}function cr(t,e,n){const i=t.ticks.length,r=Math.min(e,i-1),s=t._startPixel,o=t._endPixel,a=1e-6;let l,h=t.getPixelForTick(r);if(!(n&&(l=1===i?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 n=Ne(t.font,e),i=We(t.padding);return(J(t.text)?t.text.length:1)*n.lineHeight+i.height}function dr(t,e,n){let i=Gt(t);return(n&&"right"!==e||!n&&"right"===e)&&(i=(t=>"left"===t?"right":"right"===t?"left":t)(i)),i}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:n,_suggestedMax:i}=this;return t=et(t,Number.POSITIVE_INFINITY),e=et(e,Number.NEGATIVE_INFINITY),n=et(n,Number.POSITIVE_INFINITY),i=et(i,Number.NEGATIVE_INFINITY),{min:et(t,n),max:et(e,i),minDefined:tt(t),maxDefined:tt(e)}}getMinMax(t){let e,{min:n,max:i,minDefined:r,maxDefined:s}=this.getUserBounds();if(r&&s)return{min:n,max:i};const o=this.getMatchingVisibleMetas();for(let a=0,l=o.length;a<l;++a)e=o[a].controller.getMinMax(this,t),r||(n=Math.min(n,e.min)),s||(i=Math.max(i,e.max));return n=s&&n>i?i:n,i=r&&n>i?n:i,{min:et(n,et(i,n)),max:et(i,et(n,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){rt(this.options.beforeUpdate,[this])}update(t,e,n){const{beginAtZero:i,grace:r,ticks:s}=this.options,o=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,n){const{min:i,max:r}=t,s=it(e,(r-i)/2),o=(t,e)=>n&&0===t?0:t+e;return{min:o(i,-Math.abs(s)),max:o(r,s)}}(this,r,i),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,n=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,n=!n),this._startPixel=t,this._endPixel=e,this._reversePixels=n,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 n,i,r;for(n=0,i=t.length;n<i;n++)r=t[n],r.label=rt(e.callback,[r.value,n,t],this)}afterTickToLabelConversion(){rt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){rt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,n=this.ticks.length,i=e.minRotation||0,r=e.maxRotation;let s,o,a,l=i;if(!this._isVisible()||!e.display||i>=r||n<=1||!this.isHorizontal())return void(this.labelRotation=i);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/n:f/(n-1),c+6>s&&(s=f/(n-(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(i,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:n,title:i,grid:r}}=this,s=this._isVisible(),o=this.isHorizontal();if(s){const s=fr(i,e.options.font);if(o?(t.width=this.maxWidth,t.height=ur(r)+s):(t.height=this.maxHeight,t.width=ur(r)+s),n.display&&this.ticks.length){const{first:e,last:i,widest:r,highest:s}=this._getLabelSizes(),a=2*n.padding,l=Lt(this.labelRotation),h=Math.cos(l),c=Math.sin(l);if(o){const e=n.mirror?0:c*r.width+h*s.height;t.height=Math.min(this.maxHeight,t.height+e+a)}else{const e=n.mirror?0:h*r.width+c*s.height;t.width=Math.min(this.maxWidth,t.width+e+a)}this._calculatePadding(e,i,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,n,i){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=i*t.width,u=n*e.height):(c=n*t.height,u=i*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 n=e.height/2,i=t.height/2;"start"===r?(n=0,i=t.height):"end"===r&&(n=e.height,i=0),this.paddingTop=n+s,this.paddingBottom=i+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,n;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,n=t.length;e<n;e++)G(t[e].label)&&(t.splice(e,1),n--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let n=this.ticks;e<n.length&&(n=hr(n,e)),this._labelSizes=t=this._computeLabelSizes(n,n.length)}return t}_computeLabelSizes(t,e){const{ctx:n,_longestTextCache:i}=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),n.font=u=c.string,f=i[u]=i[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(n,f.data,f.gc,p,m),g+=d)}else p=ve(n,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 n=t.gc,i=n.length/2;let r;if(i>e){for(r=0;r<i;++r)delete t.data[n[r]];n.splice(0,i)}}))}(i,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 n=e[t];return n.$context||(n.$context=function(t,e,n){return $e(t,{tick:n,index:e,type:"tick"})}(this.getContext(),t,n))}return this.$context||(this.$context=$e(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){const t=this.options.ticks,e=Lt(this.labelRotation),n=Math.abs(Math.cos(e)),i=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*n>o*i?o/n:a/i:a*i<o*n?a/n:o/i}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,n=this.chart,i=this.options,{grid:r,position:s,border:o}=i,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(n,t,d)};let m,b,_,x,v,y,w,M,k,S,P,A;if("top"===s)m=g(this.bottom),y=this.bottom-c,M=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,M=this.top+c;else if("left"===s)m=g(this.right),v=this.right-c,w=m-p,k=g(t.left)+p,P=t.right;else if("right"===s)m=g(this.left),k=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,M=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,k=t.left,P=t.right}const D=nt(i.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),i=o.setContext(t),s=e.lineWidth,h=e.color,c=i.dash||[],f=i.dashOffset,d=e.tickWidth,p=e.tickColor,g=e.tickBorderDash||[],m=e.tickBorderDashOffset;_=cr(this,b,a),void 0!==_&&(x=we(n,_,s),l?v=w=k=P=x:y=M=S=A=x,u.push({tx1:v,ty1:y,tx2:w,ty2:M,x1:k,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,n=this.options,{position:i,ticks:r}=n,s=this.isHorizontal(),o=this.ticks,{align:a,crossAlign:l,padding:h,mirror:c}=r,u=ur(n.grid),f=u+h,d=c?-h:f,p=-Lt(this.labelRotation),g=[];let m,b,_,x,v,y,w,M,k,S,P,A,D="middle";if("top"===i)y=this.bottom-d,w=this._getXAxisLabelAlignment();else if("bottom"===i)y=this.top+d,w=this._getXAxisLabelAlignment();else if("left"===i){const t=this._getYAxisLabelAlignment(u);w=t.textAlign,v=t.x}else if("right"===i){const t=this._getYAxisLabelAlignment(u);w=t.textAlign,v=t.x}else if("x"===e){if("center"===i)y=(t.top+t.bottom)/2+f;else if(Q(i)){const t=Object.keys(i)[0],e=i[t];y=this.chart.scales[t].getPixelForValue(e)+f}w=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===i)v=(t.left+t.right)/2-f;else if(Q(i)){const t=Object.keys(i)[0],e=i[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));M=this.getPixelForTick(m)+r.labelOffset,k=this._resolveTickFontOptions(m),S=k.lineHeight,P=J(x)?x.length:1;const e=P/2,n=t.color,a=t.textStrokeColor,h=t.textStrokeWidth;let u,f=w;if(s?(v=M,"inner"===w&&(f=m===b-1?this.options.reverse?"left":"right":0===m?this.options.reverse?"right":"left":"center"),A="top"===i?"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=M,A=(1-P)*S/2),t.showLabelBackdrop){const e=We(t.backdropPadding),n=O.heights[m],i=O.widths[m];let r=A-e.top,s=0-e.left;switch(D){case"middle":r-=n/2;break;case"bottom":r-=n}switch(w){case"center":s-=i/2;break;case"right":s-=i}u={left:s,top:r,width:i+e.width,height:n+e.height,color:t.backdropColor}}g.push({label:x,font:k,textOffset:A,options:{rotation:p,color:n,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 n="center";return"start"===e.align?n="left":"end"===e.align?n="right":"inner"===e.align&&(n="inner"),n}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:n,mirror:i,padding:r}}=this.options,s=t+r,o=this._getLabelSizes().widest.width;let a,l;return"left"===e?i?(l=this.right+r,"near"===n?a="left":"center"===n?(a="center",l+=o/2):(a="right",l+=o)):(l=this.right-s,"near"===n?a="right":"center"===n?(a="center",l-=o/2):(a="left",l=this.left)):"right"===e?i?(l=this.left+r,"near"===n?a="right":"center"===n?(a="center",l-=o/2):(a="left",l-=o)):(l=this.left+s,"near"===n?a="left":"center"===n?(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:n,top:i,width:r,height:s}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(n,i,r,s),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const n=this.ticks.findIndex((e=>e.value===t));if(n>=0){return e.setContext(this.getContext(n)).lineWidth}return 0}drawGrid(t){const e=this.options.grid,n=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,s;const o=(t,e,i)=>{i.width&&i.color&&(n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.setLineDash(i.borderDash||[]),n.lineDashOffset=i.borderDashOffset,n.beginPath(),n.moveTo(t.x,t.y),n.lineTo(e.x,e.y),n.stroke(),n.restore())};if(e.display)for(r=0,s=i.length;r<s;++r){const t=i[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:n,grid:i}}=this,r=n.setContext(this.getContext()),s=n.display?r.width:0;if(!s)return;const o=i.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,n=this._computeLabelArea();n&&Ae(e,n);const i=this.getLabelItems(t);for(const r of i){const t=r.options,n=r.font;Te(e,r.label,0,r.textOffset,n,t)}n&&De(e)}drawTitle(){const{ctx:t,options:{position:e,title:n,reverse:i}}=this;if(!n.display)return;const r=Ne(n.font),s=We(n.padding),o=n.align;let a=r.lineHeight/2;"bottom"===e||"center"===e||Q(e)?(a+=s.bottom,J(n.text)&&(a+=r.lineHeight*(n.text.length-1))):a+=s.top;const{titleX:l,titleY:h,maxWidth:c,rotation:u}=function(t,e,n,i){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(i,s,a),Q(n)){const t=Object.keys(n)[0],i=n[t];d=c[t].getPixelForValue(i)+g-e}else d="center"===n?(h.bottom+h.top)/2+g-e:lr(t,n,e);u=a-s}else{if(Q(n)){const t=Object.keys(n)[0],i=n[t];f=c[t].getPixelForValue(i)-m+e}else f="center"===n?(h.left+h.right)/2-m+e:lr(t,n,e);d=Jt(i,o,r),p="left"===n?-kt:kt}return{titleX:f,titleY:d,maxWidth:u,rotation:p}}(this,a,e,o);Te(t,n.text,0,0,r,{color:n.color,maxWidth:c,rotation:u,textAlign:dr(o,e,i),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,n=nt(t.grid&&t.grid.z,-1),i=nt(t.border&&t.border.z,0);return this._isVisible()&&this.draw===pr.prototype.draw?[{z:n,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",i=[];let r,s;for(r=0,s=e.length;r<s;++r){const s=e[r];s[n]!==this.id||t&&s.type!==t||i.push(s)}return i}_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,n){this.type=t,this.scope=e,this.override=n,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 n;(function(t){return"id"in t&&"defaults"in t})(e)&&(n=this.register(e));const i=this.items,r=t.id,s=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in i||(i[r]=t,function(t,e,n){const i=ct(Object.create(null),[n?xe.get(n):{},xe.get(e),t.defaults]);xe.set(e,i),t.defaultRoutes&&function(t,e){Object.keys(e).forEach((n=>{const i=n.split("."),r=i.pop(),s=[t].concat(i).join("."),o=e[n].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,n),this.override&&xe.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const e=this.items,n=t.id,i=this.scope;n in e&&delete e[n],i&&n in xe[i]&&(delete xe[i][n],this.override&&delete pe[n])}}class mr{constructor(){this.controllers=new gr(ei,"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,n){[...e].forEach((e=>{const i=n||this._getRegistryForType(e);n||i.isForType(e)||i===this.plugins&&e.id?this._exec(t,i,e):st(e,(e=>{const i=n||this._getRegistryForType(e);this._exec(t,i,e)}))}))}_exec(t,e,n){const i=gt(t);rt(n["before"+i],[],n),e[t](n),rt(n["after"+i],[],n)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const n=this._typedRegistries[e];if(n.isForType(t))return n}return this.plugins}_get(t,e,n){const i=e.get(t);if(void 0===i)throw new Error('"'+t+'" is not a registered '+n+".");return i}}var br=new mr;class _r{constructor(){this._init=[]}notify(t,e,n,i){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const r=i?this._descriptors(t).filter(i):this._descriptors(t),s=this._notify(r,t,e,n);return"afterDestroy"===e&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),s}_notify(t,e,n,i){i=i||{};for(const r of t){const t=r.plugin;if(!1===rt(t[n],[e,i,r.options],t)&&i.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 n=t&&t.config,i=nt(n.options&&n.options.plugins,{}),r=function(t){const e={},n=[],i=Object.keys(br.plugins.items);for(let s=0;s<i.length;s++)n.push(br.getPlugin(i[s]));const r=t.plugins||[];for(let s=0;s<r.length;s++){const t=r[s];-1===n.indexOf(t)&&(n.push(t),e[t.id]=!0)}return{plugins:n,localIds:e}}(n);return!1!==i||e?function(t,{plugins:e,localIds:n},i,r){const s=[],o=t.getContext();for(const a of e){const e=a.id,l=xr(i[e],r);null!==l&&s.push({plugin:a,options:vr(t.config,{plugin:a,local:n[e]},l,o)})}return s}(t,r,i,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],n=this._cache,i=(t,e)=>t.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(i(e,n),t,"stop"),this._notify(i(n,e),t,"start")}}function xr(t,e){return e||!1!==t?!0===t?{}:t:null}function vr(t,{plugin:e,local:n},i,r){const s=t.pluginScopeKeys(e),o=t.getOptionScopes(i,s);return n&&e.defaults&&o.push(e.defaults),t.createResolver(o,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function yr(t,e){const n=xe.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function wr(t,e){if("x"===t||"y"===t||"r"===t)return t;var n;if(t=e.axis||("top"===(n=e.position)||"bottom"===n?"x":"left"===n||"right"===n?"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 Mr(t){const e=t.options||(t.options={});e.plugins=nt(e.plugins,{}),e.scales=function(t,e){const n=pe[t.type]||{scales:{}},i=e.scales||{},r=yr(t.type,e),s=Object.create(null);return Object.keys(i).forEach((t=>{const e=i[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=n.scales||{};s[t]=ut(Object.create(null),[{axis:o},e,l[o],l[a]])})),t.data.datasets.forEach((n=>{const r=n.type||t.type,o=n.indexAxis||yr(r,e),a=(pe[r]||{}).scales||{};Object.keys(a).forEach((t=>{const e=function(t,e){let n=t;return"_index_"===t?n=e:"_value_"===t&&(n="x"===e?"y":"x"),n}(t,o),r=n[e+"AxisID"]||e;s[r]=s[r]||Object.create(null),ut(s[r],[{axis:e},i[r],a[t]])}))})),Object.keys(s).forEach((t=>{const e=s[t];ut(e,[xe.scales[e.type],xe.scale])})),s}(t,e)}function kr(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Sr=new Map,Pr=new Set;function Ar(t,e){let n=Sr.get(t);return n||(n=e(),Sr.set(t,n),Pr.add(n)),n}const Dr=(t,e,n)=>{const i=pt(e,n);void 0!==i&&t.add(i)};class Or{constructor(t){this._config=function(t){return(t=t||{}).data=kr(t.data),Mr(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=kr(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(),Mr(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 n=this._scopeCache;let i=n.get(t);return i&&!e||(i=new Map,n.set(t,i)),i}getOptionScopes(t,e,n){const{options:i,type:r}=this,s=this._cachedScopes(t,n),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,i,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,n,i=[""]){const r={$shared:!0},{resolver:s,subPrefixes:o}=Cr(this._resolverCache,t,i);let a=s;if(function(t,e){const{isScriptable:n,isIndexable:i}=qe(t);for(const r of e){const e=n(r),s=i(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,n=bt(n)?n():n,this.createResolver(t,n,o))}for(const l of e)r[l]=a[l];return r}createResolver(t,e,n=[""],i){const{resolver:r}=Cr(this._resolverCache,t,n);return Q(e)?Ye(r,e,void 0,i):r}}function Cr(t,e,n){let i=t.get(e);i||(i=new Map,t.set(e,i));const r=n.join();let s=i.get(r);if(!s){s={resolver:Ue(e,n),subPrefixes:n.filter((t=>!t.toLowerCase().includes("hover")))},i.set(r,s)}return s}const Tr=t=>Q(t)&&Object.getOwnPropertyNames(t).reduce(((e,n)=>e||bt(t[n])),!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(n,i){return n[t]===i[t]?n[e]-i[e]:n[t]-i[t]}}function Ir(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),rt(n&&n.onComplete,[t],e)}function zr(t){const e=t.chart,n=e.options.animation;rt(n&&n.onProgress,[t],e)}function Fr(t){return dn()&&"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,n){const i=Object.keys(t);for(const r of i){const i=+r;if(i>=e){const s=t[r];delete t[r],(n>0||i>e)&&(t[i+n]=s)}}}class Wr{static register(...t){br.add(...t),Nr()}static unregister(...t){br.remove(...t),Nr()}constructor(t,e){const n=this.config=new Or(e),i=Fr(t),r=Vr(i);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const s=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||function(t){return!dn()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Hi:rr}(i)),this.platform.updateConfig(n);const o=this.platform.acquireContext(i,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 n;return function(...i){return e?(clearTimeout(n),n=setTimeout(t,e,i)):t.apply(this,i),e}}((t=>this.update(t)),s.resizeDelay||0),this._dataChanges=[],jr[this.id]=this,o&&a?(Vn.listen(this,"complete",Ir),Vn.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:n,height:i,_aspectRatio:r}=this;return G(t)?e&&r?r:i?n/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return br}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():wn(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Me(this.canvas,this.ctx),this}stop(){return Vn.stop(this),this}resize(t,e){Vn.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const n=this.options,i=this.canvas,r=n.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(i,t,e,r),o=n.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,wn(this,o,!0)&&(this.notifyPlugins("resize",{size:s}),rt(n.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,n=this.scales,i=Object.keys(n).reduce(((t,e)=>(t[e]=!1,t)),{});let r=[];e&&(r=r.concat(Object.keys(e).map((t=>{const n=e[t],i=wr(t,n),r="r"===i,s="x"===i;return{options:n,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=nt(r.type,e.dtype);void 0!==r.position&&Lr(r.position,o)===Lr(e.dposition)||(r.position=e.dposition),i[s]=!0;let l=null;if(s in n&&n[s].type===a)l=n[s];else{l=new(br.getScale(a))({id:s,type:a,ctx:this.ctx,chart:this}),n[l.id]=l}l.init(r,t)})),st(i,((t,e)=>{t||delete n[e]})),st(n,(t=>{Wi.configure(this,t,t.options),Wi.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,n=t.length;if(t.sort(((t,e)=>t.index-e.index)),n>e){for(let t=e;t<n;++t)this._destroyDatasetMeta(t);t.splice(e,n-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,n)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(n)}))}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let n,i;for(this._removeUnreferencedMetasets(),n=0,i=e.length;n<i;n++){const i=e[n];let r=this.getDatasetMeta(n);const s=i.type||this.config.type;if(r.type&&r.type!==s&&(this._destroyDatasetMeta(n),r=this.getDatasetMeta(n)),r.type=s,r.indexAxis=i.indexAxis||yr(s,this.options),r.order=i.order||0,r.index=n,r.label=""+i.label,r.visible=this.isDatasetVisible(n),r.controller)r.controller.updateIndex(n),r.controller.linkScales();else{const e=br.getController(s),{datasetElementType:i,dataElementType:o}=xe.datasets[s];Object.assign(e,{dataElementType:br.getElement(o),datasetElementType:i&&br.getElement(i)}),r.controller=new e(this,n),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 n=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!n.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=!i&&-1===r.indexOf(t);t.buildOrUpdateElements(e),s=Math.max(+t.getMaxOverflow(),s)}s=this._minPadding=n.layout.autoPadding?s:0,this._updateLayout(s),i||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=>{Wi.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),n=new Set(t.events);_t(e,n)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:n,start:i,count:r}of e){Br(t,i,"_removeElements"===n?-r:r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,n=e=>new Set(t.filter((t=>t[0]===e)).map(((t,e)=>e+","+t.splice(1).join(",")))),i=n(0);for(let r=1;r<e;r++)if(!_t(i,n(r)))return;return Array.from(i).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;Wi.update(this,this.width,this.height,t);const e=this.chartArea,n=e.width<=0||e.height<=0;this._layers=[],st(this.boxes,(t=>{n&&"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,n=this.data.datasets.length;e<n;++e)this._updateDataset(e,bt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const n=this.getDatasetMeta(t),i={meta:n,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",i)&&(n.controller._update(e),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(Vn.has(this)?this.attached&&!Vn.running(this)&&Vn.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,n=[];let i,r;for(i=0,r=e.length;i<r;++i){const r=e[i];t&&!r.visible||n.push(r)}return n}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,n=t._clip,i=!n.disabled,r=function(t){const{xScale:e,yScale:n}=t;if(e&&n)return{left:e.left,right:e.right,top:n.top,bottom:n.bottom}}(t)||this.chartArea,s={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",s)&&(i&&Ae(e,{left:!1===n.left?0:r.left-n.left,right:!1===n.right?this.width:r.right+n.right,top:!1===n.top?0:r.top-n.top,bottom:!1===n.bottom?this.height:r.bottom+n.bottom}),t.controller.draw(),i&&De(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return Pe(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,n,i){const r=Di.modes[e];return"function"==typeof r?r(this,t,n,i):[]}getDatasetMeta(t){const e=this.data.datasets[t],n=this._metasets;let i=n.filter((t=>t&&t._dataset===e)).pop();return i||(i={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},n.push(i)),i}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 n=this.getDatasetMeta(t);return"boolean"==typeof n.hidden?!n.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,n){const i=n?"show":"hide",r=this.getDatasetMeta(t),s=r.controller._resolveAnimations(void 0,i);mt(e)?(r.data[e].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),s.update(r,{visible:n}),this.update((e=>e.datasetIndex===t?i: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(),Vn.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(),Me(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,n=(n,i)=>{e.addEventListener(this,n,i),t[n]=i},i=(t,e,n)=>{t.offsetX=e,t.offsetY=n,this._eventHandler(t)};st(this.options.events,(t=>n(t,i)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,n=(n,i)=>{e.addEventListener(this,n,i),t[n]=i},i=(n,i)=>{t[n]&&(e.removeEventListener(this,n,i),delete t[n])},r=(t,e)=>{this.canvas&&this.resize(t,e)};let s;const o=()=>{i("attach",o),this.attached=!0,this.resize(),n("resize",r),n("detach",s)};s=()=>{this.attached=!1,i("resize",r),this._stop(),this._resize(0,0),n("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,n){const i=n?"set":"remove";let r,s,o,a;for("dataset"===e&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+i+"DatasetHoverStyle"]()),o=0,a=t.length;o<a;++o){s=t[o];const e=s&&this.getDatasetMeta(s.datasetIndex).controller;e&&e[i+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],n=t.map((({datasetIndex:t,index:e})=>{const n=this.getDatasetMeta(t);if(!n)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:n.data[e],index:e}}));!ot(n,e)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,e))}notifyPlugins(t,e,n){return this._plugins.notify(this,t,e,n)}isPluginEnabled(t){return 1===this._plugins._cache.filter((e=>e.plugin.id===t)).length}_updateHoverStyles(t,e,n){const i=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=n?t:r(t,e);s.length&&this.updateHoverStyle(s,i.mode,!1),o.length&&i.mode&&this.updateHoverStyle(o,i.mode,!0)}_eventHandler(t,e){const n={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},i=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",n,i))return;const r=this._handleEvent(t,e,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,i),(r||n.changed)&&this.render(),this}_handleEvent(t,e,n){const{_active:i=[],options:r}=this,s=e,o=this._getActiveElements(t,i,n,s),a=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,n,i){return n&&"mouseout"!==t.type?i?e:t:null}(t,this._lastEvent,n,a);n&&(this._lastEvent=null,rt(r.onHover,[t,o,this],this),a&&rt(r.onClick,[t,o,this],this));const h=!ot(o,i);return(h||e)&&(this._active=o,this._updateHoverStyles(o,i,e)),this._lastEvent=l,h}_getActiveElements(t,e,n,i){if("mouseout"===t.type)return[];if(!n)return e;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,i)}}function Nr(){return st(Wr.instances,(t=>t._plugins.invalidate()))}function Hr(t,e,n,i){const r=je(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const s=(n-e)/2,o=Math.min(s,i*e/2),a=t=>{const e=(n-Math.min(s,t))*i/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,n,i){return{x:n+t*Math.cos(e),y:i+t*Math.sin(e)}}function Ur(t,e,n,i,r,s){const{x:o,y:a,startAngle:l,pixelMargin:h,innerRadius:c}=e,u=Math.max(e.outerRadius+i+n-h,0),f=c>0?c+i+n+h:0;let d=0;const p=r-l;if(i){const t=((c>0?c-i:0)+(u>0?u-i:0))/2;d=(p-(0!==t?p*t/(t+i):p))/2}const g=(p-Math.max(.001,p*u-n/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-_,M=u-x,k=m+_/w,S=b-x/M,P=f+v,A=f+y,D=m+v/P,O=b-y/A;if(t.beginPath(),s){const e=(k+S)/2;if(t.arc(o,a,u,k,e),t.arc(o,a,u,e,S),x>0){const e=$r(M,S,o,a);t.arc(e.x,e.y,x,S,b+kt)}const n=$r(A,b,o,a);if(t.lineTo(n.x,n.y),y>0){const e=$r(A,O,o,a);t.arc(e.x,e.y,y,b+kt,O+Math.PI)}const i=(b-y/f+(m+v/f))/2;if(t.arc(o,a,f,b-y/f,i,!0),t.arc(o,a,f,i,m+v/f,!0),v>0){const e=$r(P,D,o,a);t.arc(e.x,e.y,v,D+Math.PI,m-kt)}const r=$r(w,m,o,a);if(t.lineTo(r.x,r.y),_>0){const e=$r(w,k,o,a);t.arc(e.x,e.y,_,m-kt,k)}}else{t.moveTo(o,a);const e=Math.cos(k)*u+o,n=Math.sin(k)*u+a;t.lineTo(e,n);const i=Math.cos(S)*u+o,r=Math.sin(S)*u+a;t.lineTo(i,r)}t.closePath()}function Yr(t,e,n,i,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,n,i,f,r);for(let e=0;e<s;++e)t.stroke();isNaN(a)||(f=o+(a%vt||vt))}u&&function(t,e,n){const{startAngle:i,pixelMargin:r,x:s,y:o,outerRadius:a,innerRadius:l}=e;let h=r/a;t.beginPath(),t.arc(s,o,a,i-h,n+h),l>r?(h=r/l,t.arc(s,o,l,n+h,i-h,!0)):t.arc(s,o,r,n+kt,i-kt),t.closePath(),t.clip()}(t,e,f),s||(Ur(t,e,n,i,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,n){const i=this.getProps(["x","y"],n),{angle:r,distance:s}=zt(i,{x:t,y:e}),{startAngle:o,endAngle:a,innerRadius:l,outerRadius:h,circumference:c}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),u=this.options.spacing/2,f=nt(c,a-o)>=vt||Bt(r,o,a),d=Nt(s,l+u,h+u);return f&&d}getCenterPoint(t){const{x:e,y:n,startAngle:i,endAngle:r,innerRadius:s,outerRadius:o}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:a,spacing:l}=this.options,h=(i+r)/2,c=(s+o+l+a)/2;return{x:e+Math.cos(h)*c,y:n+Math.sin(h)*c}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:n}=this,i=(e.offset||0)/4,r=(e.spacing||0)/2,s=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=n>vt?Math.floor(n/vt):0,0===n||this.innerRadius<0||this.outerRadius<0)return;t.save();const o=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(o)*i,Math.sin(o)*i);const a=i*(1-Math.sin(Math.min(xt,n||0)));t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,function(t,e,n,i,r){const{fullCircles:s,startAngle:o,circumference:a}=e;let l=e.endAngle;if(s){Ur(t,e,n,i,l,r);for(let e=0;e<s;++e)t.fill();isNaN(a)||(l=o+(a%vt||vt))}Ur(t,e,n,i,l,r),t.fill()}(t,this,a,r,s),Yr(t,this,a,r,s),t.restore()}}function Xr(t,e,n=e){t.lineCap=nt(n.borderCapStyle,e.borderCapStyle),t.setLineDash(nt(n.borderDash,e.borderDash)),t.lineDashOffset=nt(n.borderDashOffset,e.borderDashOffset),t.lineJoin=nt(n.borderJoinStyle,e.borderJoinStyle),t.lineWidth=nt(n.borderWidth,e.borderWidth),t.strokeStyle=nt(n.borderColor,e.borderColor)}function Kr(t,e,n){t.lineTo(n.x,n.y)}function Zr(t,e,n={}){const i=t.length,{start:r=0,end:s=i-1}=n,{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:i,start:l,loop:e.loop,ilen:h<l&&!c?i+h-l:h-l}}function Gr(t,e,n,i){const{points:r,options:s}=e,{count:o,start:a,loop:l,ilen:h}=Zr(r,n,i),c=function(t){return t.stepped?Oe:t.tension||"monotone"===t.cubicInterpolationMode?Ce:Kr}(s);let u,f,d,{move:p=!0,reverse:g}=i||{};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,n,i){const r=e.points,{count:s,start:o,ilen:a}=Zr(r,n,i),{move:l=!0,reverse:h}=i||{};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,n=u.y,i=0|e;i===f?(n<d?d=n:n>p&&(p=n),m=(b*m+e)/++b):(x(),t.lineTo(e,n),f=i,b=0,d=p=n),g=n}x()}function Qr(t){const e=t.options,n=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||n)?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,n,i){ts&&!e.options.segment?function(t,e,n,i){let r=e._path;r||(r=e._path=new Path2D,e.path(r,n,i)&&r.closePath()),Xr(t,e.options),t.stroke(r)}(t,e,n,i):function(t,e,n,i){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:n,end:n+i-1})&&t.closePath(),t.stroke()}(t,e,n,i)}class ns 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 n=this.options;if((n.tension||"monotone"===n.cubicInterpolationMode)&&!n.stepped&&!this._pointsUpdated){const i=n.spanGaps?this._loop:this._fullLoop;fn(this._points,n,t,i,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 n=t.points,i=t.options.spanGaps,r=n.length;if(!r)return[];const s=!!t._loop,{start:o,end:a}=function(t,e,n,i){let r=0,s=e-1;if(n&&!i)for(;r<e&&!t[r].skip;)r++;for(;r<e&&t[r].skip;)r++;for(r%=e,n&&(s+=r);s>r&&t[s%e].skip;)s--;return s%=e,{start:r,end:s}}(n,r,s,i);return In(t,!0===i?[{start:o,end:a,loop:s}]:function(t,e,n,i){const r=t.length,s=[];let o,a=e,l=t[e];for(o=e+1;o<=n;++o){const n=t[o%r];n.skip||n.stop?l.skip||(i=!1,s.push({start:e%r,end:(o-1)%r,loop:i}),e=a=n.stop?o:null):(a=o,l.skip&&(e=o)),l=n}return null!==a&&s.push({start:e%r,end:a%r,loop:i}),s}(n,o,a<o?a+r:a,!!t._fullLoop&&0===o&&a===r-1),n,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,n=t.length;return n&&e[t[n-1].end]}interpolate(t,e){const n=this.options,i=t[e],r=this.points,s=Rn(this,{property:e,start:i,end:i});if(!s.length)return;const o=[],a=function(t){return t.stepped?Pn:t.tension||"monotone"===t.cubicInterpolationMode?An:Sn}(n);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((i-u[e])/(f[e]-u[e])),n.stepped);d[e]=t[e],o.push(d)}return 1===o.length?o[0]:o}pathSegment(t,e,n){return Qr(this)(t,this,e,n)}path(t,e,n){const i=this.segments,r=Qr(this);let s=this._loop;e=e||0,n=n||this.points.length-e;for(const o of i)s&=r(t,this,o,{start:e,end:e+n-1});return!!s}draw(t,e,n,i){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),es(t,this,n,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function is(t,e,n,i){const r=t.options,{[n]:s}=t.getProps([n],i);return Math.abs(e-s)<r.radius+r.hitRadius}t(ns,"id","line"),t(ns,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),t(ns,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),t(ns,"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,n){const i=this.options,{x:r,y:s}=this.getProps(["x","y"],n);return Math.pow(t-r,2)+Math.pow(e-s,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(t,e){return is(this,t,"x",e)}inYRange(t,e){return is(this,t,"y",e)}getCenterPoint(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}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 n=this.options;this.skip||n.radius<.1||!Pe(this,e,this.size(n)/2)||(t.strokeStyle=n.borderColor,t.lineWidth=n.borderWidth,t.fillStyle=n.backgroundColor,ke(t,n,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function ss(t,e){const{x:n,y:i,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(n,r),l=Math.max(n,r),h=i-u,c=i+u):(u=s/2,a=n-u,l=n+u,h=Math.min(i,r),c=Math.max(i,r)),{left:a,top:h,right:l,bottom:c}}function os(t,e,n,i){return t?0:Wt(e,n,i)}function as(t){const e=ss(t),n=e.right-e.left,i=e.bottom-e.top,r=function(t,e,n){const i=t.options.borderWidth,r=t.borderSkipped,s=Ve(i);return{t:os(r.top,s.top,0,n),r:os(r.right,s.right,0,e),b:os(r.bottom,s.bottom,0,n),l:os(r.left,s.left,0,e)}}(t,n/2,i/2),s=function(t,e,n){const{enableBorderRadius:i}=t.getProps(["enableBorderRadius"]),r=t.options.borderRadius,s=Be(r),o=Math.min(e,n),a=t.borderSkipped,l=i||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,n/2,i/2);return{outer:{x:e.left,y:e.top,w:n,h:i,radius:s},inner:{x:e.left+r.l,y:e.top+r.t,w:n-r.l-r.r,h:i-r.t-r.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,s.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(r.b,r.r))}}}}function ls(t,e,n,i){const r=null===e,s=null===n,o=t&&!(r&&s)&&ss(t,i);return o&&(r||Nt(e,o.left,o.right))&&(s||Nt(n,o.top,o.bottom))}function hs(t,e){t.rect(e.x,e.y,e.w,e.h)}function cs(t,e,n={}){const i=t.x!==n.x?-e:0,r=t.y!==n.y?-e:0,s=(t.x+t.w!==n.x+n.w?e:0)-i,o=(t.y+t.h!==n.y+n.h?e:0)-r;return{x:t.x+i,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:n,backgroundColor:i}}=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=n,t.fill("evenodd")),t.beginPath(),o(t,cs(r,e)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,e,n){return ls(this,t,e,n)}inXRange(t,e){return ls(this,t,null,e)}inYRange(t,e){return ls(this,null,t,e)}getCenterPoint(t){const{x:e,y:n,base:i,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(e+i)/2:e,y:r?n:(n+i)/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:ns,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(n,i)=>{const r=t.getDatasetMeta(i).controller;r instanceof fi?e=function(t,e){return t.backgroundColor=t.data.map((()=>gs(e++))),e}(n,e):r instanceof pi?e=function(t,e){return t.backgroundColor=t.data.map((()=>ms(e++))),e}(n,e):r&&(e=function(t,e){return t.borderColor=gs(e),t.backgroundColor=ms(e),++e}(n,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,n){if(!n.enabled)return;const{options:{elements:i},data:{datasets:r}}=t.config;if(!n.forceOverride&&(_s(r)||i&&_s(i)))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,n)=>{if(!n.enabled)return void ys(t);const i=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 n=e.length;let i,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,n-1)),i=h?Wt($t(e,s.axis,a).hi+1,r,n)-r:n-r,{start:r,count:i}}(a,l);if(u<=(n.threshold||4*i))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}})),n.algorithm){case"lttb":f=function(t,e,n,i,r){const s=r.samples||i;if(s>=n)return t.slice(e,e+n);const o=[],a=(n-2)/(s-2);let l=0;const h=e+n-1;let c,u,f,d,p,g=e;for(o[l++]=t[g],c=0;c<s-2;c++){let i,r=0,s=0;const h=Math.floor((c+1)*a)+1+e,m=Math.min(Math.floor((c+2)*a)+1,n)+e,b=m-h;for(i=h;i<m;i++)r+=t[i].x,s+=t[i].y;r/=b,s/=b;const _=Math.floor(c*a)+1+e,x=Math.min(Math.floor((c+1)*a)+1,n)+e,{x:v,y:y}=t[g];for(f=d=-1,i=_;i<x;i++)d=.5*Math.abs((v-r)*(t[i].y-y)-(v-t[i].x)*(s-y)),d>f&&(f=d,u=t[i],p=i);o[l++]=u,g=p}return o[l++]=t[h],o}(l,c,u,i,n);break;case"min-max":f=function(t,e,n,i){let r,s,o,a,l,h,c,u,f,d,p=0,g=0;const m=[],b=e+n-1,_=t[e].x,x=t[b].x-_;for(r=e;r<e+n;++r){s=t[r],o=(s.x-_)/x*i,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 n=r-1;if(!G(h)&&!G(c)){const e=Math.min(h,c),i=Math.max(h,c);e!==u&&e!==n&&m.push({...t[e],x:p}),i!==u&&i!==n&&m.push({...t[i],x:p})}r>0&&n!==u&&m.push(t[n]),m.push(s),l=e,g=0,f=d=a,h=c=u=r}}return m}(l,c,u,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}e._decimated=f}))},destroy(t){ys(t)}};function Ms(t,e,n,i){if(i)return;let r=e[t],s=n[t];return"angle"===t&&(r=Vt(r),s=Vt(s)),{property:t,start:r,end:s}}function ks(t,e,n){for(;e>t;e--){const t=n[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function Ss(t,e,n,i){return t&&e?i(t[n],e[n]):t?t[n]:e?e[n]:0}function Ps(t,e){let n=[],i=!1;return J(t)?(i=!0,n=t):n=function(t,e){const{x:n=null,y:i=null}=t||{},r=e.points,s=[];return e.segments.forEach((({start:t,end:e})=>{e=ks(t,e,r);const o=r[t],a=r[e];null!==i?(s.push({x:o.x,y:i}),s.push({x:a.x,y:i})):null!==n&&(s.push({x:n,y:o.y}),s.push({x:n,y:a.y}))})),s}(t,e),n.length?new ns({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function As(t){return t&&!1!==t.fill}function Ds(t,e,n){let i=t[e].fill;const r=[e];let s;if(!n)return i;for(;!1!==i&&-1===r.indexOf(i);){if(!tt(i))return i;if(s=t[i],!s)return!1;if(s.visible)return i;r.push(i),i=s.fill}return!1}function Os(t,e,n){const i=function(t){const e=t.options,n=e.fill;let i=nt(n&&n.target,n);void 0===i&&(i=!!e.backgroundColor);if(!1===i||null===i)return!1;if(!0===i)return"origin";return i}(t);if(Q(i))return!isNaN(i.value)&&i;let r=parseFloat(i);return tt(r)&&Math.floor(r)===r?function(t,e,n,i){"-"!==t&&"+"!==t||(n=e+n);if(n===e||n<0||n>=i)return!1;return n}(i[0],e,r,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function Cs(t,e,n){const i=[];for(let r=0;r<n.length;r++){const s=n[r],{first:o,last:a,point:l}=Ts(s,e,"x");if(!(!l||o&&a))if(o)i.unshift(l);else if(t.push(l),!a)break}t.push(...i)}function Ts(t,e,n){const i=t.interpolate(e,n);if(!i)return{};const r=i[n],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][n],i=o[t.end][n];if(Nt(r,e,i)){a=r===e,l=r===i;break}}return{first:a,last:l,point:i}}class Es{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,n){const{x:i,y:r,radius:s}=this;return e=e||{start:0,end:vt},t.arc(i,r,s,e.end,e.start,!0),!n.bounds}interpolate(t){const{x:e,y:n,radius:i}=this,r=t.angle;return{x:e+Math.cos(r)*i,y:n+Math.sin(r)*i,angle:r}}}function Ls(t){const{chart:e,fill:n,line:i}=t;if(tt(n))return function(t,e){const n=t.getDatasetMeta(e),i=n&&t.isDatasetVisible(e);return i?n.dataset:null}(e,n);if("stack"===n)return function(t){const{scale:e,index:n,line:i}=t,r=[],s=i.segments,o=i.points,a=function(t,e){const n=[],i=t.getMatchingVisibleMetas("line");for(let r=0;r<i.length;r++){const t=i[r];if(t.index===e)break;t.hidden||n.unshift(t.dataset)}return n}(e,n);a.push(Ps({x:null,y:e.bottom},i));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 ns({points:r,options:{}})}(t);if("shape"===n)return!0;const r=function(t){const e=t.scale||{};if(e.getPointPositionForValue)return function(t){const{scale:e,fill:n}=t,i=e.options,r=e.getLabels().length,s=i.reverse?e.max:e.min,o=function(t,e,n){let i;return i="start"===t?n:"end"===t?e.options.reverse?e.min:e.max:Q(t)?t.value:e.getBaseValue(),i}(n,e,s),a=[];if(i.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:n}=t,i=function(t,e){let n=null;return"start"===t?n=e.bottom:"end"===t?n=e.top:Q(t)?n=e.getPixelForValue(t.value):e.getBasePixel&&(n=e.getBasePixel()),n}(n,e);if(tt(i)){const t=e.isHorizontal();return{x:t?i:null,y:t?null:i}}return null}(t)}(t);return r instanceof Es?r:Ps(r,i)}function Rs(t,e,n){const i=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||{};i&&r.points.length&&(Ae(t,n),function(t,e){const{line:n,target:i,above:r,below:s,area:o,scale:a}=e,l=n._loop?"angle":e.axis;t.save(),"x"===l&&s!==r&&(Is(t,i,o.top),zs(t,{line:n,target:i,color:r,scale:a,property:l}),t.restore(),t.save(),Is(t,i,o.bottom));zs(t,{line:n,target:i,color:s,scale:a,property:l}),t.restore()}(t,{line:r,target:i,above:c,below:u,area:n,scale:s,axis:o}),De(t))}function Is(t,e,n){const{segments:i,points:r}=e;let s=!0,o=!1;t.beginPath();for(const a of i){const{start:i,end:l}=a,h=r[i],c=r[ks(i,l,r)];s?(t.moveTo(h.x,h.y),s=!1):(t.lineTo(h.x,n),t.lineTo(h.x,h.y)),o=!!e.pathSegment(t,a,{move:o}),o?t.closePath():t.lineTo(c.x,n)}t.lineTo(e.first().x,n),t.closePath(),t.clip()}function zs(t,e){const{line:n,target:i,property:r,color:s,scale:o}=e,a=function(t,e,n){const i=t.segments,r=t.points,s=e.points,o=[];for(const a of i){let{start:t,end:i}=a;i=ks(t,i,r);const l=Ms(n,r[t],r[i],a.loop);if(!e.segments){o.push({source:a,target:l,start:r[t],end:r[i]});continue}const h=Rn(e,l);for(const e of h){const t=Ms(n,s[e.start],s[e.end],e.loop),i=Ln(a,r,t);for(const r of i)o.push({source:r,target:e,start:{[n]:Ss(l,t,"start",Math.max)},end:{[n]:Ss(l,t,"end",Math.min)}})}}return o}(n,i,r);for(const{source:l,target:h,start:c,end:u}of a){const{style:{backgroundColor:e=s}={}}=l,a=!0!==i;t.save(),t.fillStyle=e,Fs(t,o,a&&Ms(r,c,u)),t.beginPath();const f=!!n.pathSegment(t,l);let d;if(a){f?t.closePath():js(t,i,u,r);const e=!!i.pathSegment(t,h,{move:f,reverse:!0});d=f&&e,d||js(t,i,c,r)}t.closePath(),t.fill(d?"evenodd":"nonzero"),t.restore()}}function Fs(t,e,n){const{top:i,bottom:r}=e.chart.chartArea,{property:s,start:o,end:a}=n||{};"x"===s&&(t.beginPath(),t.rect(o,i,a-o,r-i),t.clip())}function js(t,e,n,i){const r=e.interpolate(n,i);r&&t.lineTo(r.x,r.y)}var Vs={id:"filler",afterDatasetsUpdate(t,e,n){const i=(t.data.datasets||[]).length,r=[];let s,o,a,l;for(o=0;o<i;++o)s=t.getDatasetMeta(o),a=s.dataset,l=null,a&&a.options&&a instanceof ns&&(l={visible:t.isDatasetVisible(o),index:o,fill:Os(a,o,i),chart:t,axis:s.controller.options.indexAxis,scale:s.vScale,line:a}),s.$filler=l,r.push(l);for(o=0;o<i;++o)l=r[o],l&&!1!==l.fill&&(l.fill=Ds(r,o,n.propagate))},beforeDraw(t,e,n){const i="beforeDraw"===n.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),i&&e.fill&&Rs(t.ctx,e,s))}},beforeDatasetsDraw(t,e,n){if("beforeDatasetsDraw"!==n.drawTime)return;const i=t.getSortedVisibleDatasetMetas();for(let r=i.length-1;r>=0;--r){const e=i[r].$filler;As(e)&&Rs(t.ctx,e,t.chartArea)}},beforeDatasetDraw(t,e,n){const i=e.meta.$filler;As(i)&&"beforeDatasetDraw"===n.drawTime&&Rs(t.ctx,i,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Bs=(t,e)=>{let{boxHeight:n=e,boxWidth:i=e}=t;return t.usePointStyle&&(n=Math.min(n,e),i=t.pointStyleWidth||Math.min(i,e)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(e,n)}};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,n){this.maxWidth=t,this.maxHeight=e,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let 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,n)=>t.sort(e,n,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 n=t.labels,i=Ne(n.font),r=i.size,s=this._computeTitleHeight(),{boxWidth:o,itemHeight:a}=Bs(n,r);let l,h;e.font=i.string,this.isHorizontal()?(l=this.maxWidth,h=this._fitRows(s,r,o,a)+10):(h=this.maxHeight,l=this._fitCols(s,i,o,a)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,n,i){const{ctx:r,maxWidth:s,options:{labels:{padding:o}}}=this,a=this.legendHitBoxes=[],l=this.lineWidths=[0],h=i+o;let c=t;r.textAlign="left",r.textBaseline="middle";let u=-1,f=-h;return this.legendItems.forEach(((t,d)=>{const p=n+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:i},l[l.length-1]+=p+o})),c}_fitCols(t,e,n,i){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,n,i,r){const s=function(t,e,n,i){let r=t.text;r&&"string"!=typeof r&&(r=r.reduce(((t,e)=>t.length>e.length?t:e)));return e+n.size/2+i.measureText(r).width}(i,t,e,n),o=function(t,e,n){let i=t;"string"!=typeof e.text&&(i=Ns(e,n));return i}(r,i,e.lineHeight);return{itemWidth:s,itemHeight:o}}(n,e,r,t,i);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:n,labels:{padding:i},rtl:r}}=this,s=Dn(r,this.left,this.width);if(this.isHorizontal()){let r=0,o=Jt(n,this.left+i,this.right-this.lineWidths[r]);for(const a of e)r!==a.row&&(r=a.row,o=Jt(n,this.left+i,this.right-this.lineWidths[r])),a.top+=this.top+t+i,a.left=s.leftForLtr(s.x(o),a.width),o+=a.width+i}else{let r=0,o=Jt(n,this.top+t+i,this.bottom-this.columnSizes[r].height);for(const a of e)a.col!==r&&(r=a.col,o=Jt(n,this.top+t+i,this.bottom-this.columnSizes[r].height)),a.top=o,a.left+=this.left+i,a.left=s.leftForLtr(s.x(a.left),a.width),o+=a.height+i}}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:n,ctx:i}=this,{align:r,labels:s}=t,o=xe.color,a=Dn(t.rtl,this.left,this.width),l=Ne(s.font),{padding:h}=s,c=l.size,u=c/2;let f;this.drawTitle(),i.textAlign=a.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.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-n[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},On(this.ctx,t.textDirection);const _=g+h;this.legendItems.forEach(((x,v)=>{i.strokeStyle=x.fontColor,i.fillStyle=x.fontColor;const y=i.measureText(x.text).width,w=a.textAlign(x.textAlign||(x.textAlign=s.textAlign)),M=d+u+y;let k=f.x,S=f.y;a.setWidth(this.width),m?v>0&&k+M+h>this.right&&(S=f.y+=_,f.line++,k=f.x=Jt(r,this.left+h,this.right-n[f.line])):v>0&&S+_>this.bottom&&(k=f.x=k+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,n){if(isNaN(d)||d<=0||isNaN(p)||p<0)return;i.save();const r=nt(n.lineWidth,1);if(i.fillStyle=nt(n.fillStyle,o),i.lineCap=nt(n.lineCap,"butt"),i.lineDashOffset=nt(n.lineDashOffset,0),i.lineJoin=nt(n.lineJoin,"miter"),i.lineWidth=r,i.strokeStyle=nt(n.strokeStyle,o),i.setLineDash(nt(n.lineDash,[])),s.usePointStyle){const o={radius:p*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:r},l=a.xPlus(t,d/2);Se(i,o,l,e+u,s.pointStyleWidth&&d)}else{const s=e+Math.max((c-p)/2,0),o=a.leftForLtr(t,d),l=Be(n.borderRadius);i.beginPath(),Object.values(l).some((t=>0!==t))?Re(i,{x:o,y:s,w:d,h:p,radius:l}):i.rect(o,s,d,p),i.fill(),0!==r&&i.stroke()}i.restore()}(a.x(k),S,x),k=((t,e,n,i)=>t===(i?"left":"right")?n:"center"===t?(e+n)/2:e)(w,k+d+u,m?k+M:this.right,t.rtl),function(t,e,n){Te(i,n.text,t,e+g/2,l,{strikethrough:n.hidden,textAlign:a.textAlign(n.textAlign)})}(a.x(k),S,x),m)f.x+=M+h;else if("string"!=typeof x.text){const t=l.lineHeight;f.y+=Ns(x,t)}else f.y+=_})),Cn(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,n=Ne(e.font),i=We(e.padding);if(!e.display)return;const r=Dn(t.rtl,this.left,this.width),s=this.ctx,o=e.position,a=n.size/2,l=i.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=n.string,Te(s,e.text,f,h,n)}_computeTitleHeight(){const t=this.options.title,e=Ne(t.font),n=We(t.padding);return t.display?e.lineHeight+n.height:0}_getLegendItemAt(t,e){let n,i,r;if(Nt(t,this.left,this.right)&&Nt(e,this.top,this.bottom))for(r=this.legendHitBoxes,n=0;n<r.length;++n)if(i=r[n],Nt(t,i.left,i.left+i.width)&&Nt(e,i.top,i.top+i.height))return this.legendItems[n];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 n=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){const i=this._hoveredItem,r=((t,e)=>null!==t&&null!==e&&t.datasetIndex===e.datasetIndex&&t.index===e.index)(i,n);i&&!r&&rt(e.onLeave,[t,i,this],this),this._hoveredItem=n,n&&!r&&rt(e.onHover,[t,n,this],this)}else n&&rt(e.onClick,[t,n,this],this)}}function Ns(t,e){return e*(t.text?t.text.length+.5:0)}var Hs={id:"legend",_element:Ws,start(t,e,n){const i=t.legend=new Ws({ctx:t.ctx,options:n,chart:t});Wi.configure(t,i,n),Wi.addBox(t,i)},stop(t){Wi.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const i=t.legend;Wi.configure(t,i,n),i.options=n},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,n){const i=e.datasetIndex,r=n.chart;r.isDatasetVisible(i)?(r.hide(i),e.hidden=!0):(r.show(i),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:n,pointStyle:i,textAlign:r,color:s,useBorderRadius:o,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const l=t.controller.getStyle(n?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:i||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 n=this.options;if(this.left=0,this.top=0,!n.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const i=J(n.text)?n.text.length:1;this._padding=We(n.padding);const r=i*Ne(n.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:n,bottom:i,right:r,options:s}=this,o=s.align;let a,l,h,c=0;return this.isHorizontal()?(l=Jt(o,n,r),h=e+t,a=r-n):("left"===s.position?(l=n+t,h=Jt(o,i,e),c=-.5*xt):(l=r-t,h=Jt(o,e,i),c=.5*xt),a=i-e),{titleX:l,titleY:h,maxWidth:a,rotation:c}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const n=Ne(e.font),i=n.lineHeight/2+this._padding.top,{titleX:r,titleY:s,maxWidth:o,rotation:a}=this._drawArgs(i);Te(t,e.text,0,0,n,{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,n){!function(t,e){const n=new $s({ctx:t.ctx,options:e,chart:t});Wi.configure(t,n,e),Wi.addBox(t,n),t.titleBlock=n}(t,n)},stop(t){const e=t.titleBlock;Wi.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const i=t.titleBlock;Wi.configure(t,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Ys=new WeakMap;var qs={id:"subtitle",start(t,e,n){const i=new $s({ctx:t.ctx,options:n,chart:t});Wi.configure(t,i,n),Wi.addBox(t,i),Ys.set(t,i)},stop(t){Wi.removeBox(t,Ys.get(t)),Ys.delete(t)},beforeUpdate(t,e,n){const i=Ys.get(t);Wi.configure(t,i,n),i.options=n},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,n,i=0,r=0,s=0;for(e=0,n=t.length;e<n;++e){const n=t[e].element;if(n&&n.hasValue()){const t=n.tooltipPosition();i+=t.x,r+=t.y,++s}}return{x:i/s,y:r/s}},nearest(t,e){if(!t.length)return!1;let n,i,r,s=e.x,o=e.y,a=Number.POSITIVE_INFINITY;for(n=0,i=t.length;n<i;++n){const i=t[n].element;if(i&&i.hasValue()){const t=Ft(e,i.getCenterPoint());t<a&&(a=t,r=i)}}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:n,datasetIndex:i,index:r}=e,s=t.getDatasetMeta(i).controller,{label:o,value:a}=s.getLabelAndValue(r);return{chart:t,label:o,parsed:s.getParsed(r),raw:t.data.datasets[i].data[r],formattedValue:a,dataset:s.getDataset(),dataIndex:r,datasetIndex:i,element:n}}function Js(t,e){const n=t.chart.ctx,{body:i,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=i.length,p=We(e.padding);let g=p.height,m=0,b=i.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,n.measureText(t).width+_)};return n.save(),n.font=h.string,st(t.title,x),n.font=l.string,st(t.beforeBody.concat(t.afterBody),x),_=e.displayColors?o+2+e.boxPadding:0,st(i,(t=>{st(t.before,x),st(t.lines,x),st(t.after,x)})),_=0,n.font=c.string,st(t.footer,x),n.restore(),m+=p.width,{width:m,height:g}}function Qs(t,e,n,i){const{x:r,width:s}=n,{width:o,chartArea:{left:a,right:l}}=t;let h="center";return"center"===i?h=r<=(a+l)/2?"left":"right":r<=s/2?h="left":r>=o-s/2&&(h="right"),function(t,e,n,i){const{x:r,width:s}=i,o=n.caretSize+n.caretPadding;return"left"===t&&r+s+o>e.width||"right"===t&&r-s-o<0||void 0}(h,t,e,n)&&(h="center"),h}function to(t,e,n){const i=n.yAlign||e.yAlign||function(t,e){const{y:n,height:i}=e;return n<i/2?"top":n>t.height-i/2?"bottom":"center"}(t,n);return{xAlign:n.xAlign||e.xAlign||Qs(t,e,n,i),yAlign:i}}function eo(t,e,n,i){const{caretSize:r,caretPadding:s,cornerRadius:o}=t,{xAlign:a,yAlign:l}=n,h=r+s,{topLeft:c,topRight:u,bottomLeft:f,bottomRight:d}=Be(o);let p=function(t,e){let{x:n,width:i}=t;return"right"===e?n-=i:"center"===e&&(n-=i/2),n}(e,a);const g=function(t,e,n){let{y:i,height:r}=t;return"top"===e?i+=n:i-="bottom"===e?r+n:r/2,i}(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,i.width-e.width),y:Wt(g,0,i.height-e.height)}}function no(t,e,n){const i=We(n.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-i.right:t.x+i.left}function io(t){return Ks([],Zs(t))}function ro(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const so={beforeTitle:K,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,i=n?n.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex<i)return n[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 n=t.formattedValue;return G(n)||(e+=n),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,n,i){const r=t[e].call(n,i);return void 0===r?so[e].call(n,i):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,n=this.options.setContext(this.getContext()),i=n.enabled&&e.options.animation&&n.animations,r=new Hn(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=(t=this.chart.getContext(),e=this,n=this._tooltipItems,$e(t,{tooltip:e,tooltipItems:n,type:"tooltip"})));var t,e,n}getTitle(t,e){const{callbacks:n}=e,i=oo(n,"beforeTitle",this,t),r=oo(n,"title",this,t),s=oo(n,"afterTitle",this,t);let o=[];return o=Ks(o,Zs(i)),o=Ks(o,Zs(r)),o=Ks(o,Zs(s)),o}getBeforeBody(t,e){return io(oo(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:n}=e,i=[];return st(t,(t=>{const e={before:[],lines:[],after:[]},r=ro(n,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))),i.push(e)})),i}getAfterBody(t,e){return io(oo(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:n}=e,i=oo(n,"beforeFooter",this,t),r=oo(n,"footer",this,t),s=oo(n,"afterFooter",this,t);let o=[];return o=Ks(o,Zs(i)),o=Ks(o,Zs(r)),o=Ks(o,Zs(s)),o}_createItems(t){const e=this._active,n=this.chart.data,i=[],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,i,r)=>t.filter(e,i,r,n)))),t.itemSort&&(l=l.sort(((e,i)=>t.itemSort(e,i,n)))),st(l,(e=>{const n=ro(t.callbacks,e);i.push(oo(n,"labelColor",this,e)),r.push(oo(n,"labelPointStyle",this,e)),s.push(oo(n,"labelTextColor",this,e))})),this.labelColors=i,this.labelPointStyles=r,this.labelTextColors=s,this.dataPoints=l,l}update(t,e){const n=this.options.setContext(this.getContext()),i=this._active;let r,s=[];if(i.length){const t=Xs[n.position].call(this,i,this._eventPosition);s=this._createItems(n),this.title=this.getTitle(s,n),this.beforeBody=this.getBeforeBody(s,n),this.body=this.getBody(s,n),this.afterBody=this.getAfterBody(s,n),this.footer=this.getFooter(s,n);const e=this._size=Js(this,n),o=Object.assign({},t,e),a=to(this.chart,n,o),l=eo(n,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&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,n,i){const r=this.getCaretPosition(t,n,i);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,n){const{xAlign:i,yAlign:r}=this,{caretSize:s,cornerRadius:o}=n,{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"===i?(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"===i?u+Math.max(a,h)+s:"right"===i?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,n){const i=this.title,r=i.length;let s,o,a;if(r){const l=Dn(n.rtl,this.x,this.width);for(t.x=no(this,n.titleAlign,n),e.textAlign=l.textAlign(n.titleAlign),e.textBaseline="middle",s=Ne(n.titleFont),o=n.titleSpacing,e.fillStyle=n.titleColor,e.font=s.string,a=0;a<r;++a)e.fillText(i[a],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+o,a+1===r&&(t.y+=n.titleMarginBottom-o)}}_drawColorBox(t,e,n,i,r){const s=this.labelColors[n],o=this.labelPointStyles[n],{boxHeight:a,boxWidth:l,boxPadding:h}=r,c=Ne(r.bodyFont),u=no(this,"left",r),f=i.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},n=i.leftForLtr(f,l)+l/2,h=p+a/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,ke(t,e,n,h),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,ke(t,e,n,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=i.leftForLtr(f,l-h),n=i.leftForLtr(i.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:n,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(n,p+1,l-2,a-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,e,n){const{body:i}=this,{bodySpacing:r,bodyAlign:s,displayColors:o,boxHeight:a,boxWidth:l,boxPadding:h}=n,c=Ne(n.bodyFont);let u=c.lineHeight,f=0;const d=Dn(n.rtl,this.x,this.width),p=function(n){e.fillText(n,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=no(this,g,n),e.fillStyle=n.bodyColor,st(this.beforeBody,p),f=o&&"right"!==g?"center"===s?l/2+h:l+2+h:0,x=0,y=i.length;x<y;++x){for(m=i[x],b=this.labelTextColors[x],e.fillStyle=b,st(m.before,p),_=m.lines,o&&_.length&&(this._drawColorBox(e,t,x,d,n),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,n){const i=this.footer,r=i.length;let s,o;if(r){const a=Dn(n.rtl,this.x,this.width);for(t.x=no(this,n.footerAlign,n),t.y+=n.footerMarginTop,e.textAlign=a.textAlign(n.footerAlign),e.textBaseline="middle",s=Ne(n.footerFont),e.fillStyle=n.footerColor,e.font=s.string,o=0;o<r;++o)e.fillText(i[o],a.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+n.footerSpacing}}drawBackground(t,e,n,i){const{xAlign:r,yAlign:s}=this,{x:o,y:a}=t,{width:l,height:h}=n,{topLeft:c,topRight:u,bottomLeft:f,bottomRight:d}=Be(i.cornerRadius);e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.beginPath(),e.moveTo(o+c,a),"top"===s&&this.drawCaret(t,e,n,i),e.lineTo(o+l-u,a),e.quadraticCurveTo(o+l,a,o+l,a+u),"center"===s&&"right"===r&&this.drawCaret(t,e,n,i),e.lineTo(o+l,a+h-d),e.quadraticCurveTo(o+l,a+h,o+l-d,a+h),"bottom"===s&&this.drawCaret(t,e,n,i),e.lineTo(o+f,a+h),e.quadraticCurveTo(o,a+h,o,a+h-f),"center"===s&&"left"===r&&this.drawCaret(t,e,n,i),e.lineTo(o,a+c),e.quadraticCurveTo(o,a,o+c,a),e.closePath(),e.fill(),i.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,n=this.$animations,i=n&&n.x,r=n&&n.y;if(i||r){const n=Xs[t.position].call(this,this._active,this._eventPosition);if(!n)return;const s=this._size=Js(this,t),o=Object.assign({},n,this._size),a=to(e,t,o),l=eo(t,o,a,e);i._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=n.x,this.caretY=n.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(e);const i={width:this.width,height:this.height},r={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;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=n,this.drawBackground(r,t,i,e),On(t,e.textDirection),r.y+=s.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),Cn(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const n=this._active,i=t.map((({datasetIndex:t,index:e})=>{const n=this.chart.getDatasetMeta(t);if(!n)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:n.data[e],index:e}})),r=!ot(n,i),s=this._positionChanged(i,e);(r||s)&&(this._active=i,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,n=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,r=this._active||[],s=this._getActiveElements(t,r,e,n),o=this._positionChanged(s,t),a=e||!ot(s,r)||o;return a&&(this._active=s,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),a}_getActiveElements(t,e,n,i){const r=this.options;if("mouseout"===t.type)return[];if(!i)return e;const s=this.chart.getElementsAtEventForMode(t,r.mode,r,n);return r.reverse&&s.reverse(),s}_positionChanged(t,e){const{caretX:n,caretY:i,options:r}=this,s=Xs[r.position].call(this,t,e);return!1!==s&&(n!==s.x||i!==s.y)}}t(ao,"positioners",Xs);var lo={id:"tooltip",_element:ao,positioners:Xs,afterInit(t,e,n){n&&(t.tooltip=new ao({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,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,n,i){const r=t.indexOf(e);if(-1===r)return((t,e,n,i)=>("string"==typeof e?(n=t.push(e)-1,i.unshift({index:n,label:e})):isNaN(e)&&(n=null),n))(t,e,n,i);return r!==t.lastIndexOf(e)?n: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:n,label:i}of e)t[n]===i&&t.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(G(t))return null;const n=this.getLabels();return((t,e)=>null===t?null:Wt(Math.round(t),0,e))(e=isFinite(e)&&n[e]===t?e:co(n,t,nt(e,t),this._addedLabels),n.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:n,max:i}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(n=0),e||(i=this.getLabels().length-1)),this.min=n,this.max=i}buildTicks(){const t=this.min,e=this.max,n=this.options.offset,i=[];let r=this.getLabels();r=0===t&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let s=t;s<=e;s++)i.push({value:s});return i}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 n=[],{bounds:i,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,M,k=Ct((g-p)/d/f)*f;if(k<1e-14&&!m&&!b)return[{value:p},{value:g}];M=Math.ceil(g/k)-Math.floor(p/k),M>d&&(k=Ct(M*k/d/f)*f),G(a)||(v=Math.pow(10,a),k=Math.ceil(k*v)/v),"ticks"===i?(y=Math.floor(p/k)*k,w=Math.ceil(g/k)*k):(y=p,w=g),m&&b&&r&&function(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}((o-s)/r,k/1e3)?(M=Math.round(Math.min((o-s)/k,h)),k=(o-s)/M,y=s,w=o):_?(y=m?s:y,w=b?o:w,M=l-1,k=(w-y)/M):(M=(w-y)/k,M=Ot(M,Math.round(M),k/1e3)?Math.round(M):Math.ceil(M));const S=Math.max(It(k),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?(n.push({value:s}),y<s&&P++,Ot(Math.round((y+P*k)*v)/v,s,go(s,x,t))&&P++):y<s&&P++);P<M;++P)n.push({value:Math.round((y+P*k)*v)/v});return b&&u&&w!==o?n.length&&Ot(n[n.length-1].value,o,go(o,x,t))?n[n.length-1].value=o:n.push({value:o}):b&&w!==o||n.push({value:w}),n}function go(t,e,{horizontal:n,minRotation:i}){const r=Lt(i),s=(n?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:n}=this.getUserBounds();let{min:i,max:r}=this;const s=t=>i=e?i:t,o=t=>r=n?r:t;if(t){const t=Dt(i),e=Dt(r);t<0&&e<0?o(0):t>0&&e>0&&s(0)}if(i===r){let e=0===r?1:Math.abs(.05*r);o(r+e),t||s(i-e)}this.min=i,this.max=r}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:n,stepSize:i}=t;return i?(e=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),n=n||11),n&&(e=Math.min(n,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let n=this.getTickLimit();n=Math.max(2,n);const i=po({maxTicks:n,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(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){const t=this.ticks;let e=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){const i=(n-e)/Math.max(t.length-1,1)/2;e-=i,n+=i}this._startValue=e,this._endValue=n,this._valueRange=n-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,n=Lt(this.options.ticks.minRotation),i=(t?Math.sin(n):Math.cos(n))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/i))}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,n){const i=Math.pow(10,n),r=Math.floor(t/i);return Math.ceil(e/i)-r}function wo(t,{min:e,max:n}){e=et(t.min,e);const i=[],r=_o(e);let s=function(t,e){let n=_o(e-t);for(;yo(t,e,n)>10;)n++;for(;yo(t,e,n)<10;)n--;return Math.min(n,_o(t))}(e,n),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<n;)i.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 i.push({value:d,major:vo(d),significand:u}),i}class Mo 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 n=mo.prototype.parse.apply(this,[t,e]);if(0!==n)return tt(n)&&n>0?n: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 n=this.min,i=this.max;const r=e=>n=t?n:e,s=t=>i=e?i:t;n===i&&(n<=0?(r(1),s(10)):(r(xo(n,-1)),s(xo(i,1)))),n<=0&&r(xo(i,-1)),i<=0&&s(xo(n,1)),this.min=n,this.max=i}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 ko(t){const e=t.ticks;if(e.display&&t.display){const t=We(e.backdropPadding);return nt(e.font&&e.font.size,xe.font.size)+t.height}return 0}function So(t,e,n,i,r){return t===i||t===r?{start:e-n/2,end:e+n/2}:t<i||t>r?{start:e-n,end:e}:{start:e,end:e+n}}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},n=Object.assign({},e),i=[],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});i[u]=p;const g=Vt(t.getIndexAngle(u)+a),m=Math.round(Rt(g));Ao(n,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-n.l,n.r-e.r,e.t-n.t,n.b-e.b),t._pointLabelItems=function(t,e,n){const i=[],r=t._pointLabels.length,s=t.options,o=ko(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+n[h],l),s=Math.round(Rt(Vt(r.angle+kt))),c=e[h],u=Co(r.y,c.h,s),f=Do(s),d=Oo(r.x,c.w,f);i.push({x:r.x,y:u,textAlign:f,left:d,top:u,right:d+c.w,bottom:u+c.h})}return i}(t,i,r)}function Ao(t,e,n,i,r){const s=Math.abs(Math.sin(n)),o=Math.abs(Math.cos(n));let a=0,l=0;i.start<e.l?(a=(e.l-i.start)/s,t.l=Math.min(t.l,e.l-a)):i.end>e.r&&(a=(i.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,n){return"right"===n?t-=e:"center"===n&&(t-=e/2),t}function Co(t,e,n){return 90===n||270===n?t-=e/2:(n>270||n<90)&&(t-=e),t}function To(t,e,n,i){const{ctx:r}=t;if(n)r.arc(t.xCenter,t.yCenter,e,0,vt);else{let n=t.getPointPosition(0,e);r.moveTo(n.x,n.y);for(let s=1;s<i;s++)n=t.getPointPosition(s,e),r.lineTo(n.x,n.y)}}t(Mo,"id","logarithmic"),t(Mo,"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(ko(this.options)/2),e=this.width=this.maxWidth-t.width,n=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+n/2+t.top),this.drawingArea=Math.floor(Math.min(e,n)/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/ko(this.options))}generateTickLabels(t){mo.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map(((t,e)=>{const n=rt(this.options.pointLabels.callback,[t,e],this);return n||0===n?n:""})).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,n,i){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((n-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,n,i))}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 n=e[t];return function(t,e,n){return $e(t,{label:n,index:e,type:"pointLabel"})}(this.getContext(),t,n)}}getPointPosition(t,e,n=0){const i=this.getIndexAngle(t)-kt+n;return{x:Math.cos(i)*e+this.xCenter,y:Math.sin(i)*e+this.yCenter,angle:i}}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:n,right:i,bottom:r}=this._pointLabelItems[t];return{left:e,top:n,right:i,bottom:r}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const n=this.ctx;n.save(),n.beginPath(),To(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),n.closePath(),n.fillStyle=t,n.fill(),n.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:n,grid:i,border:r}=e,s=this._pointLabels.length;let o,a,l;if(e.pointLabels.display&&function(t,e){const{ctx:n,options:{pointLabels:i}}=t;for(let r=e-1;r>=0;r--){const e=i.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),i=We(e.backdropPadding);n.fillStyle=d;const r=h-i.left,s=c-i.top,o=u-h+i.width,a=f-c+i.height;Object.values(t).some((t=>0!==t))?(n.beginPath(),Re(n,{x:r,y:s,w:o,h:a,radius:t}),n.fill()):n.fillRect(r,s,o,a)}Te(n,t._pointLabels[r],o,a+s.lineHeight/2,s,{color:e.color,textAlign:l,textBaseline:"middle"})}}(this,s),i.display&&this.ticks.forEach(((t,e)=>{if(0!==e){a=this.getDistanceFromCenterForValue(t.value);const n=this.getContext(e),o=i.setContext(n),l=r.setContext(n);!function(t,e,n,i,r){const s=t.ctx,o=e.circular,{color:a,lineWidth:l}=e;!o&&!i||!a||!l||n<0||(s.save(),s.strokeStyle=a,s.lineWidth=l,s.setLineDash(r.dash),s.lineDashOffset=r.dashOffset,s.beginPath(),To(t,n,o,i),s.closePath(),s.stroke(),s.restore())}(this,o,a,s,l)}})),n.display){for(t.save(),o=s-1;o>=0;o--){const i=n.setContext(this.getPointLabelContext(o)),{color:r,lineWidth:s}=i;s&&r&&(t.lineWidth=s,t.strokeStyle=r,t.setLineDash(i.borderDash),t.lineDashOffset=i.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,n=e.ticks;if(!n.display)return;const i=this.getIndexAngle(0);let r,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach(((i,o)=>{if(0===o&&!e.reverse)return;const a=n.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(i.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,i.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 n=t._adapter,{parser:i,round:r,isoWeekday:s}=t._parseOpts;let o=e;return"function"==typeof i&&(o=i(o)),tt(o)||(o="string"==typeof i?n.parse(o,i):n.parse(o)),null===o?null:(r&&(o="week"!==r||!Tt(s)&&!0!==s?n.startOf(o,r):n.startOf(o,"isoWeek",s)),+o)}function Fo(t,e,n,i){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((n-e)/(r*t.size))<=i)return Ro[s]}return Ro[r-1]}function jo(t,e,n){if(n){if(n.length){const{lo:i,hi:r}=Ht(n,e);t[n[i]>=e?n[i]:n[r]]=!0}}else t[e]=!0}function Vo(t,e,n){const i=[],r={},s=e.length;let o,a;for(o=0;o<s;++o)a=e[o],r[a]=o,i.push({value:a,major:!1});return 0!==s&&n?function(t,e,n,i){const r=t._adapter,s=+r.startOf(e[0].value,i),o=e[e.length-1].value;let a,l;for(a=s;a<=o;a=+r.add(a,1,i))l=n[a],l>=0&&(e[l].major=!0);return e}(t,i,r,n):i}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 n=t.time||(t.time={}),i=this._adapter=new yi(t.adapters.date);i.init(e),ut(n.displayFormats,i.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.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,n=t.time.unit||"day";let{min:i,max:r,minDefined:s,maxDefined:o}=this.getUserBounds();function a(t){s||isNaN(t.min)||(i=Math.min(i,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))),i=tt(i)&&!isNaN(i)?i:+e.startOf(Date.now(),n),r=tt(r)&&!isNaN(r)?r:+e.endOf(Date.now(),n)+1,this.min=Math.min(i,r-1),this.max=Math.max(i+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],n=t[t.length-1]),{min:e,max:n}}buildTicks(){const t=this.options,e=t.time,n=t.ticks,i="labels"===n.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const r=this.min,s=function(t,e,n){let i=0,r=t.length;for(;i<r&&t[i]<e;)i++;for(;r>i&&t[r-1]>n;)r--;return i>0||r<t.length?t.slice(i,r):t}(i,r,this.max);return this._unit=e.unit||(n.autoSkip?Fo(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):function(t,e,n,i,r){for(let s=Ro.length-1;s>=Ro.indexOf(n);s--){const n=Ro[s];if(Lo[n].common&&t._adapter.diff(r,i,n)>=e-1)return n}return Ro[n?Ro.indexOf(n):0]}(this,s.length,e.minUnit,this.min,this.max)),this._majorUnit=n.major.enabled&&"year"!==this._unit?function(t){for(let e=Ro.indexOf(t)+1,n=Ro.length;e<n;++e)if(Lo[Ro[e]].common)return Ro[e]}(this._unit):void 0,this.initOffsets(i),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,n,i=0,r=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),i=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,n=this.getDecimalForValue(t[t.length-1]),r=1===t.length?n:(n-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;i=Wt(i,0,s),r=Wt(r,0,s),this._offsets={start:i,end:r,factor:1/(i+1+r)}}_generate(){const t=this._adapter,e=this.min,n=this.max,i=this.options,r=i.time,s=r.unit||Fo(r.minUnit,e,n,this._getLabelCapacity(e)),o=nt(i.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(n,e,s)>1e5*o)throw new Error(e+" and "+n+" are too far apart with stepSize of "+o+" "+s);const d="data"===i.ticks.source&&this.getDataTimestamps();for(c=f,u=0;c<n;c=+t.add(c,o,s),u++)jo(h,c,d);return c!==n&&"ticks"!==i.bounds&&1!==u||jo(h,c,d),Object.keys(h).sort(((t,e)=>t-e)).map((t=>+t))}getLabelForValue(t){const e=this._adapter,n=this.options.time;return n.tooltipFormat?e.format(t,n.tooltipFormat):e.format(t,n.displayFormats.datetime)}_tickFormatFunction(t,e,n,i){const r=this.options,s=r.ticks.callback;if(s)return rt(s,[t,e,n],this);const o=r.time.displayFormats,a=this._unit,l=this._majorUnit,h=a&&o[a],c=l&&o[l],u=n[e],f=l&&c&&u&&u.major;return this._adapter.format(t,i||(f?c:h))}generateTickLabels(t){let e,n,i;for(e=0,n=t.length;e<n;++e)i=t[e],i.label=this._tickFormatFunction(i.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,n=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+n)*e.factor)}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+n*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,n=this.ctx.measureText(t).width,i=Lt(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(i),s=Math.sin(i),o=this._resolveTickFontOptions(0).size;return{w:n*r+o*s,h:n*s+o*r}}_getLabelCapacity(t){const e=this.options.time,n=e.displayFormats,i=n[e.unit]||n.millisecond,r=this._tickFormatFunction(t,0,Vo(this,[t],this._majorUnit),i),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,n=this._cache.data||[];if(n.length)return n;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(t=0,e=i.length;t<e;++t)n=n.concat(i[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(n)}getLabelTimestamps(){const t=this._cache.labels||[];let e,n;if(t.length)return t;const i=this.getLabels();for(e=0,n=i.length;e<n;++e)t.push(zo(this,i[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Xt(t.sort(Io))}}function Wo(t,e,n){let i,r,s,o,a=0,l=t.length-1;n?(e>=t[a].pos&&e<=t[l].pos&&({lo:a,hi:l}=$t(t,"pos",e)),({pos:i,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:i,pos:s}=t[a]),({time:r,pos:o}=t[l]));const h=r-i;return h?s+(o-s)*(e-i)/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:n}=this,i=[],r=[];let s,o,a,l,h;for(s=0,o=t.length;s<o;++s)l=t[s],l>=e&&l<=n&&i.push(l);if(i.length<2)return[{time:e,pos:0},{time:n,pos:1}];for(s=0,o=i.length;s<o;++s)h=i[s+1],a=i[s-1],l=i[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(),n=this.getLabelTimestamps();return t=e.length&&n.length?this.normalize(e.concat(n)):e.length?e:n,t=this._cache.all=t,t}getDecimalForValue(t){return(Wo(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return Wo(this._table,n*this._tableRange+this._minPos,!0)}}t(No,"id","timeseries"),t(No,"defaults",Bo.defaults);e("r",[_i,fs,ho,Object.freeze({__proto__:null,CategoryScale:fo,LinearScale:bo,LogarithmicScale:Mo,RadialLinearScale:Eo,TimeScale:Bo,TimeSeriesScale:No})])}}}))}();