HumanBreak/assets/common-f43039af.js
2023-04-17 14:09:01 +00:00

45 lines
279 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.

var Ix=Object.defineProperty;var Fx=(n,t,e)=>t in n?Ix(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var U=(n,t,e)=>(Fx(n,typeof t!="symbol"?t+"":t,e),e);import{c as Ei}from"./antdv-4c8751a8.js";var Bx=Object.defineProperty,zx=(n,t,e)=>t in n?Bx(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,ft=(n,t,e)=>(zx(n,typeof t!="symbol"?t+"":t,e),e);let ur=[];const Ku=n=>{for(const t of ur)if(t.status==="running")try{for(const e of t.funcs)e(n-t.startTime)}catch(e){t.destroy(),console.error(e)}requestAnimationFrame(Ku)};requestAnimationFrame(Ku);class Wx{constructor(){ft(this,"funcs",[]),ft(this,"status","stop"),ft(this,"startTime",0),this.status="running",ur.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(i=>i===t);if(e===-1)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",ur=ur.filter(t=>t!==this)}}class qu{constructor(){ft(this,"timing"),ft(this,"relation","absolute"),ft(this,"easeTime",0),ft(this,"applying",{}),ft(this,"getTime",Date.now),ft(this,"ticker",new Wx),ft(this,"value",{}),ft(this,"listener",{}),this.timing=t=>t}async all(){if(Object.values(this.applying).every(t=>t===!0))throw new ReferenceError("There is no animates to be waited.");await new Promise(t=>{const e=()=>{Object.values(this.applying).every(i=>i===!1)&&(this.unlisten("end",e),t("all animated."))};this.listen("end",e)})}async n(t){const e=Object.values(this.applying).filter(r=>r===!0).length;if(e<t)throw new ReferenceError(`You are trying to wait ${t} animate, but there are only ${e} animate animating.`);let i=0;await new Promise(r=>{const a=()=>{i++,i===t&&(this.unlisten("end",a),r(`${t} animated.`))};this.listen("end",a)})}async w(t){if(this.applying[t]===!1)throw new ReferenceError(`The ${t} animate is not animating.`);await new Promise(e=>{const i=()=>{this.applying[t]===!1&&(this.unlisten("end",i),e(`${t} animated.`))};this.listen("end",i)})}listen(t,e){var i;(i=this.listener)[t]!=null||(i[t]=[]),this.listener[t].push(e)}unlisten(t,e){const i=this.listener[t].findIndex(r=>r===e);if(i===-1)throw new ReferenceError("You are trying to remove a nonexistent listener.");this.listener[t].splice(i,1)}hook(...t){const e=Object.entries(this.listener).filter(i=>t.includes(i[0]));for(const[i,r]of e)for(const a of r)a(this,i)}}function ba(n){return n!=null}async function GM(n){return new Promise(t=>setTimeout(t,n))}class KM extends qu{constructor(){super(),ft(this,"shakeTiming"),ft(this,"path"),ft(this,"multiTiming"),ft(this,"value",{}),ft(this,"size",1),ft(this,"angle",0),ft(this,"targetValue",{system:{move:[0,0],moveAs:[0,0],resize:0,rotate:0,shake:0,"@@bind":[]},custom:{}}),ft(this,"animateFn",{system:{move:[()=>0,()=>0],moveAs:()=>0,resize:()=>0,rotate:()=>0,shake:()=>0,"@@bind":()=>0},custom:{}}),ft(this,"ox",0),ft(this,"oy",0),ft(this,"sx",0),ft(this,"sy",0),ft(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(ba(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 typeof t(0)=="number"?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 this.applying["@@bind"]===!0&&this.end(!1,"@@bind"),this.bindInfo=t,this}unbind(){return this.applying["@@bind"]===!0&&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){this.applying.shake===!0&&this.end(!0,"shake"),this.applying.shake=!0;const{easeTime:i,shakeTiming:r}=this,a=this.getTime();this.hook("start","shakestart");const l=()=>{const c=this.getTime()-a;c>i&&(this.ticker.remove(l),this.applying.shake=!1,this.sx=0,this.sy=0,this.hook("end","shakeend"));const u=c/i,f=r(u);this.sx=f*t,this.sy=f*e};return this.ticker.add(l),this.animateFn.system.shake=l,this}moveAs(t){this.applying.moveAs&&this.end(!0,"moveAs"),this.applying.moveAs=!0,this.path=t;const{easeTime:e,relation:i,timing:r}=this,a=this.getTime(),[l,c]=[this.x,this.y],[u,f]=(()=>{if(i==="absolute")return t(1);{const[p,_]=t(1);return[l+p,c+_]}})();this.hook("start","movestart");const g=()=>{const p=this.getTime()-a;if(p>e){this.end(!0,"moveAs");return}const _=p/e,[y,w]=t(r(_));i==="absolute"?(this.ox=y,this.oy=w):(this.ox=l+y,this.oy=c+w)};return this.ticker.add(g,!0),this.animateFn.system.moveAs=g,this.targetValue.system.moveAs=[u,f],this}register(t,e){if(typeof this.value[t]=="number")return this.error(`Property ${t} has been regietered twice.`,"reregister");this.value[t]=e,this.applying[t]=!1}apply(t,e,i=!1){this.applying[t]===!0&&this.end(!1,t),t in this.value||this.error(`You are trying to execute nonexistent property ${t}.`),this.applying[t]=!0;const r=this.value[t],a=this.getTime(),{timing:l,relation:c,easeTime:u}=this,f=c==="absolute"?e-r:e;this.hook("start");const g=()=>{const p=this.getTime()-a;if(p>u){this.end(!1,t);return}const _=p/u,y=l(_);this.value[t]=r+y*f};return this.ticker.add(g,i),this.animateFn.custom[t]=g,this.targetValue.custom[t]=f+r,this}applyMulti(t=!1){this.applying["@@bind"]===!0&&this.end(!1,"@@bind"),this.applying["@@bind"]=!0;const e=this.bindInfo,i=e.map(g=>this.value[g]),r=this.getTime(),{multiTiming:a,relation:l,easeTime:c}=this,u=a(1);if(u.length!==i.length)throw new TypeError(`The number of binded animate attributes and timing function returns's length does not match. binded: ${e.length}, timing: ${u.length}`);this.hook("start");const f=()=>{const g=this.getTime()-r;if(g>c){this.end(!1,"@@bind");return}const p=g/c,_=a(p);e.forEach((y,w)=>{l==="absolute"?this.value[y]=_[w]:this.value[y]=i[w]+_[w]})};return this.ticker.add(f,t),this.animateFn.custom["@@bind"]=f,this.targetValue.system["@@bind"]=u,this}applySys(t,e,i){i!=="move"&&this.applying[i]===!0&&this.end(!0,i),this.applying[i]=!0;const r=this[t],a=this.getTime(),l=this.timing,c=this.relation,u=this.easeTime,f=c==="absolute"?e-r:e;this.hook("start",`${i}start`);const g=()=>{const p=this.getTime()-a;if(p>u){this.end(!0,i);return}const _=p/u,y=l(_);this[t]=r+f*y,t!=="oy"&&this.hook(i)};this.ticker.add(g,!0),t==="ox"?this.animateFn.system.move[0]=g:t==="oy"?this.animateFn.system.move[1]=g:this.animateFn.system[i]=g,i==="move"?(t==="ox"&&(this.targetValue.system.move[0]=f+r),t==="oy"&&(this.targetValue.system.move[1]=f+r)):i!=="shake"&&(this.targetValue.system[i]=f+r)}error(t,e){throw e==="repeat"?new Error(`Cannot execute the same animation twice. Info: ${t}`):e==="reregister"?new Error(`Cannot register a animated property twice. Info: ${t}`):new Error(t)}end(t,e){if(t===!0)if(this.applying[e]=!1,e==="move"?(this.ticker.remove(this.animateFn.system.move[0]),this.ticker.remove(this.animateFn.system.move[1])):e==="moveAs"?this.ticker.remove(this.animateFn.system.moveAs):e==="@@bind"?this.ticker.remove(this.animateFn.system["@@bind"]):this.ticker.remove(this.animateFn.system[e]),e==="move"){const[i,r]=this.targetValue.system.move;this.ox=i,this.oy=r,this.hook("moveend","end")}else if(e==="moveAs"){const[i,r]=this.targetValue.system.moveAs;this.ox=i,this.oy=r,this.hook("moveend","end")}else e==="rotate"?(this.angle=this.targetValue.system.rotate,this.hook("rotateend","end")):e==="resize"?(this.size=this.targetValue.system.resize,this.hook("resizeend","end")):e==="@@bind"?this.bindInfo.forEach((i,r)=>{this.value[i]=this.targetValue.system["@@bind"][r]}):(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")}}class qM extends qu{constructor(){super(),ft(this,"now",{}),ft(this,"target",{}),ft(this,"transitionFn",{}),ft(this,"value"),ft(this,"handleSet",(t,e,i)=>(this.transition(e,i),!0)),ft(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(!ba(this.now[t]))return this.now[t]=e,this;this.applying[t]&&this.end(t,!0),this.applying[t]=!0,this.hook("start");const i=this.getTime(),r=this.easeTime,a=this.timing,l=this.now[t],c=e+(this.relation==="absolute"?0:l),u=c-l;this.target[t]=c;const f=()=>{const g=this.getTime()-i;g>=r&&this.end(t);const p=g/r;this.now[t]=a(p)*u+l,this.hook("running")};return this.transitionFn[t]=f,this.ticker.add(f),this}end(t,e=!1){const i=this.transitionFn[t];if(!ba(i))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 xa=(...n)=>n.reduce((t,e)=>t+e,0),ra=n=>{if(n===0)return 1;let t=n;for(;n>1;)n--,t*=n;return t},ju=(n,t)=>Math.round(ra(t)/(ra(n)*ra(t-n))),fr=(n,t,e=i=>1-t(1-i))=>n==="in"?t:n==="out"?e:n==="in-out"?i=>i<.5?t(i*2)/2:.5+e((i-.5)*2)/2:i=>i<.5?e(i*2)/2:.5+t((i-.5)*2)/2,Nx=Math.cosh(2),Hx=Math.acosh(2),Vx=Math.tanh(3);function jM(){return n=>n}function ZM(...n){const t=[0].concat(n);t.push(1);const e=t.length,i=Array(e).fill(0).map((r,a)=>ju(a,e-1));return r=>{const a=i.map((l,c)=>l*t[c]*(1-r)**(e-c-1)*r**c);return xa(...a)}}function JM(n,t){if(!Number.isInteger(n))throw new TypeError("The first parameter of power timing function only allow integer.");return fr(t,e=>e**n)}function QM(n,t){if(n==="sin")return fr(t,e=>(Math.cosh(e*2)-1)/(Nx-1));if(n==="tan"){const e=i=>Math.tanh(i*3)*1/Vx;return fr(t,i=>1-e(1-i),e)}if(n==="sec"){const e=i=>1/Math.cosh(i);return fr(t,i=>1-(e(i*Hx)-.5)*2)}throw new TypeError("Unexpected parameters are delivered in hyper timing function.")}function tS(n,t,...e){const i=[n].concat(e);i.push(t);const r=i.length,a=Array(r).fill(0).map((l,c)=>ju(c,r-1));return l=>{const c=a.map((f,g)=>f*i[g][0]*(1-l)**(r-g-1)*l**g),u=a.map((f,g)=>f*i[g][1]*(1-l)**(r-g-1)*l**g);return[xa(...c),xa(...u)]}}var ya={},Ux={get exports(){return ya},set exports(n){ya=n}};/**
* @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
*/(function(n,t){(function(){var e,i="4.17.21",r=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",c="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",f=500,g="__lodash_placeholder__",p=1,_=2,y=4,w=1,M=2,A=1,C=2,O=4,I=8,F=16,L=32,W=64,z=128,N=256,Y=512,J=30,Q="...",at=800,Rt=16,Vt=1,ht=2,_t=3,dt=1/0,Lt=9007199254740991,Bt=17976931348623157e292,Me=0/0,Kt=4294967295,nn=Kt-1,vn=Kt>>>1,wn=[["ary",z],["bind",A],["bindKey",C],["curry",I],["curryRight",F],["flip",Y],["partial",L],["partialRight",W],["rearg",N]],fe="[object Arguments]",Re="[object Array]",jf="[object AsyncFunction]",fi="[object Boolean]",di="[object Date]",Zf="[object DOMException]",as="[object Error]",ls="[object Function]",Za="[object GeneratorFunction]",Se="[object Map]",gi="[object Number]",Jf="[object Null]",Ne="[object Object]",Ja="[object Promise]",Qf="[object Proxy]",pi="[object RegExp]",Ae="[object Set]",mi="[object String]",cs="[object Symbol]",td="[object Undefined]",_i="[object WeakMap]",ed="[object WeakSet]",bi="[object ArrayBuffer]",Yn="[object DataView]",Br="[object Float32Array]",zr="[object Float64Array]",Wr="[object Int8Array]",Nr="[object Int16Array]",Hr="[object Int32Array]",Vr="[object Uint8Array]",Ur="[object Uint8ClampedArray]",$r="[object Uint16Array]",Yr="[object Uint32Array]",nd=/\b__p \+= '';/g,id=/\b(__p \+=) '' \+/g,sd=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Qa=/&(?:amp|lt|gt|quot|#39);/g,tl=/[&<>"']/g,rd=RegExp(Qa.source),od=RegExp(tl.source),ad=/<%-([\s\S]+?)%>/g,ld=/<%([\s\S]+?)%>/g,el=/<%=([\s\S]+?)%>/g,cd=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,hd=/^\w*$/,ud=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Xr=/[\\^$.*+?()[\]{}|]/g,fd=RegExp(Xr.source),Gr=/^\s+/,dd=/\s/,gd=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,pd=/\{\n\/\* \[wrapped with (.+)\] \*/,md=/,? & /,_d=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,bd=/[()=,{}\[\]\/\s]/,xd=/\\(\\)?/g,yd=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,nl=/\w*$/,vd=/^[-+]0x[0-9a-f]+$/i,wd=/^0b[01]+$/i,Md=/^\[object .+?Constructor\]$/,Sd=/^0o[0-7]+$/i,Ad=/^(?:0|[1-9]\d*)$/,kd=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,hs=/($^)/,Pd=/['\n\r\u2028\u2029\\]/g,us="\\ud800-\\udfff",Cd="\\u0300-\\u036f",Td="\\ufe20-\\ufe2f",Od="\\u20d0-\\u20ff",il=Cd+Td+Od,sl="\\u2700-\\u27bf",rl="a-z\\xdf-\\xf6\\xf8-\\xff",Dd="\\xac\\xb1\\xd7\\xf7",Ld="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Rd="\\u2000-\\u206f",Ed=" \\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",ol="A-Z\\xc0-\\xd6\\xd8-\\xde",al="\\ufe0e\\ufe0f",ll=Dd+Ld+Rd+Ed,Kr="[']",Id="["+us+"]",cl="["+ll+"]",fs="["+il+"]",hl="\\d+",Fd="["+sl+"]",ul="["+rl+"]",fl="[^"+us+ll+hl+sl+rl+ol+"]",qr="\\ud83c[\\udffb-\\udfff]",Bd="(?:"+fs+"|"+qr+")",dl="[^"+us+"]",jr="(?:\\ud83c[\\udde6-\\uddff]){2}",Zr="[\\ud800-\\udbff][\\udc00-\\udfff]",Xn="["+ol+"]",gl="\\u200d",pl="(?:"+ul+"|"+fl+")",zd="(?:"+Xn+"|"+fl+")",ml="(?:"+Kr+"(?:d|ll|m|re|s|t|ve))?",_l="(?:"+Kr+"(?:D|LL|M|RE|S|T|VE))?",bl=Bd+"?",xl="["+al+"]?",Wd="(?:"+gl+"(?:"+[dl,jr,Zr].join("|")+")"+xl+bl+")*",Nd="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Hd="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",yl=xl+bl+Wd,Vd="(?:"+[Fd,jr,Zr].join("|")+")"+yl,Ud="(?:"+[dl+fs+"?",fs,jr,Zr,Id].join("|")+")",$d=RegExp(Kr,"g"),Yd=RegExp(fs,"g"),Jr=RegExp(qr+"(?="+qr+")|"+Ud+yl,"g"),Xd=RegExp([Xn+"?"+ul+"+"+ml+"(?="+[cl,Xn,"$"].join("|")+")",zd+"+"+_l+"(?="+[cl,Xn+pl,"$"].join("|")+")",Xn+"?"+pl+"+"+ml,Xn+"+"+_l,Hd,Nd,hl,Vd].join("|"),"g"),Gd=RegExp("["+gl+us+il+al+"]"),Kd=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,qd=["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"],jd=-1,yt={};yt[Br]=yt[zr]=yt[Wr]=yt[Nr]=yt[Hr]=yt[Vr]=yt[Ur]=yt[$r]=yt[Yr]=!0,yt[fe]=yt[Re]=yt[bi]=yt[fi]=yt[Yn]=yt[di]=yt[as]=yt[ls]=yt[Se]=yt[gi]=yt[Ne]=yt[pi]=yt[Ae]=yt[mi]=yt[_i]=!1;var bt={};bt[fe]=bt[Re]=bt[bi]=bt[Yn]=bt[fi]=bt[di]=bt[Br]=bt[zr]=bt[Wr]=bt[Nr]=bt[Hr]=bt[Se]=bt[gi]=bt[Ne]=bt[pi]=bt[Ae]=bt[mi]=bt[cs]=bt[Vr]=bt[Ur]=bt[$r]=bt[Yr]=!0,bt[as]=bt[ls]=bt[_i]=!1;var Zd={À:"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"},Jd={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Qd={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},tg={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},eg=parseFloat,ng=parseInt,vl=typeof Ei=="object"&&Ei&&Ei.Object===Object&&Ei,ig=typeof self=="object"&&self&&self.Object===Object&&self,Nt=vl||ig||Function("return this")(),Qr=t&&!t.nodeType&&t,Mn=Qr&&!0&&n&&!n.nodeType&&n,wl=Mn&&Mn.exports===Qr,to=wl&&vl.process,de=function(){try{var k=Mn&&Mn.require&&Mn.require("util").types;return k||to&&to.binding&&to.binding("util")}catch(D){}}(),Ml=de&&de.isArrayBuffer,Sl=de&&de.isDate,Al=de&&de.isMap,kl=de&&de.isRegExp,Pl=de&&de.isSet,Cl=de&&de.isTypedArray;function se(k,D,T){switch(T.length){case 0:return k.call(D);case 1:return k.call(D,T[0]);case 2:return k.call(D,T[0],T[1]);case 3:return k.call(D,T[0],T[1],T[2])}return k.apply(D,T)}function sg(k,D,T,V){for(var q=-1,ct=k==null?0:k.length;++q<ct;){var Et=k[q];D(V,Et,T(Et),k)}return V}function ge(k,D){for(var T=-1,V=k==null?0:k.length;++T<V&&D(k[T],T,k)!==!1;);return k}function rg(k,D){for(var T=k==null?0:k.length;T--&&D(k[T],T,k)!==!1;);return k}function Tl(k,D){for(var T=-1,V=k==null?0:k.length;++T<V;)if(!D(k[T],T,k))return!1;return!0}function sn(k,D){for(var T=-1,V=k==null?0:k.length,q=0,ct=[];++T<V;){var Et=k[T];D(Et,T,k)&&(ct[q++]=Et)}return ct}function ds(k,D){var T=k==null?0:k.length;return!!T&&Gn(k,D,0)>-1}function eo(k,D,T){for(var V=-1,q=k==null?0:k.length;++V<q;)if(T(D,k[V]))return!0;return!1}function Mt(k,D){for(var T=-1,V=k==null?0:k.length,q=Array(V);++T<V;)q[T]=D(k[T],T,k);return q}function rn(k,D){for(var T=-1,V=D.length,q=k.length;++T<V;)k[q+T]=D[T];return k}function no(k,D,T,V){var q=-1,ct=k==null?0:k.length;for(V&&ct&&(T=k[++q]);++q<ct;)T=D(T,k[q],q,k);return T}function og(k,D,T,V){var q=k==null?0:k.length;for(V&&q&&(T=k[--q]);q--;)T=D(T,k[q],q,k);return T}function io(k,D){for(var T=-1,V=k==null?0:k.length;++T<V;)if(D(k[T],T,k))return!0;return!1}var ag=so("length");function lg(k){return k.split("")}function cg(k){return k.match(_d)||[]}function Ol(k,D,T){var V;return T(k,function(q,ct,Et){if(D(q,ct,Et))return V=ct,!1}),V}function gs(k,D,T,V){for(var q=k.length,ct=T+(V?1:-1);V?ct--:++ct<q;)if(D(k[ct],ct,k))return ct;return-1}function Gn(k,D,T){return D===D?vg(k,D,T):gs(k,Dl,T)}function hg(k,D,T,V){for(var q=T-1,ct=k.length;++q<ct;)if(V(k[q],D))return q;return-1}function Dl(k){return k!==k}function Ll(k,D){var T=k==null?0:k.length;return T?oo(k,D)/T:Me}function so(k){return function(D){return D==null?e:D[k]}}function ro(k){return function(D){return k==null?e:k[D]}}function Rl(k,D,T,V,q){return q(k,function(ct,Et,mt){T=V?(V=!1,ct):D(T,ct,Et,mt)}),T}function ug(k,D){var T=k.length;for(k.sort(D);T--;)k[T]=k[T].value;return k}function oo(k,D){for(var T,V=-1,q=k.length;++V<q;){var ct=D(k[V]);ct!==e&&(T=T===e?ct:T+ct)}return T}function ao(k,D){for(var T=-1,V=Array(k);++T<k;)V[T]=D(T);return V}function fg(k,D){return Mt(D,function(T){return[T,k[T]]})}function El(k){return k&&k.slice(0,zl(k)+1).replace(Gr,"")}function re(k){return function(D){return k(D)}}function lo(k,D){return Mt(D,function(T){return k[T]})}function xi(k,D){return k.has(D)}function Il(k,D){for(var T=-1,V=k.length;++T<V&&Gn(D,k[T],0)>-1;);return T}function Fl(k,D){for(var T=k.length;T--&&Gn(D,k[T],0)>-1;);return T}function dg(k,D){for(var T=k.length,V=0;T--;)k[T]===D&&++V;return V}var gg=ro(Zd),pg=ro(Jd);function mg(k){return"\\"+tg[k]}function _g(k,D){return k==null?e:k[D]}function Kn(k){return Gd.test(k)}function bg(k){return Kd.test(k)}function xg(k){for(var D,T=[];!(D=k.next()).done;)T.push(D.value);return T}function co(k){var D=-1,T=Array(k.size);return k.forEach(function(V,q){T[++D]=[q,V]}),T}function Bl(k,D){return function(T){return k(D(T))}}function on(k,D){for(var T=-1,V=k.length,q=0,ct=[];++T<V;){var Et=k[T];(Et===D||Et===g)&&(k[T]=g,ct[q++]=T)}return ct}function ps(k){var D=-1,T=Array(k.size);return k.forEach(function(V){T[++D]=V}),T}function yg(k){var D=-1,T=Array(k.size);return k.forEach(function(V){T[++D]=[V,V]}),T}function vg(k,D,T){for(var V=T-1,q=k.length;++V<q;)if(k[V]===D)return V;return-1}function wg(k,D,T){for(var V=T+1;V--;)if(k[V]===D)return V;return V}function qn(k){return Kn(k)?Sg(k):ag(k)}function ke(k){return Kn(k)?Ag(k):lg(k)}function zl(k){for(var D=k.length;D--&&dd.test(k.charAt(D)););return D}var Mg=ro(Qd);function Sg(k){for(var D=Jr.lastIndex=0;Jr.test(k);)++D;return D}function Ag(k){return k.match(Jr)||[]}function kg(k){return k.match(Xd)||[]}var Pg=function k(D){D=D==null?Nt:jn.defaults(Nt.Object(),D,jn.pick(Nt,qd));var T=D.Array,V=D.Date,q=D.Error,ct=D.Function,Et=D.Math,mt=D.Object,ho=D.RegExp,Cg=D.String,pe=D.TypeError,ms=T.prototype,Tg=ct.prototype,Zn=mt.prototype,_s=D["__core-js_shared__"],bs=Tg.toString,gt=Zn.hasOwnProperty,Og=0,Wl=function(){var s=/[^.]+$/.exec(_s&&_s.keys&&_s.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),xs=Zn.toString,Dg=bs.call(mt),Lg=Nt._,Rg=ho("^"+bs.call(gt).replace(Xr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ys=wl?D.Buffer:e,an=D.Symbol,vs=D.Uint8Array,Nl=ys?ys.allocUnsafe:e,ws=Bl(mt.getPrototypeOf,mt),Hl=mt.create,Vl=Zn.propertyIsEnumerable,Ms=ms.splice,Ul=an?an.isConcatSpreadable:e,yi=an?an.iterator:e,Sn=an?an.toStringTag:e,Ss=function(){try{var s=Tn(mt,"defineProperty");return s({},"",{}),s}catch(o){}}(),Eg=D.clearTimeout!==Nt.clearTimeout&&D.clearTimeout,Ig=V&&V.now!==Nt.Date.now&&V.now,Fg=D.setTimeout!==Nt.setTimeout&&D.setTimeout,As=Et.ceil,ks=Et.floor,uo=mt.getOwnPropertySymbols,Bg=ys?ys.isBuffer:e,$l=D.isFinite,zg=ms.join,Wg=Bl(mt.keys,mt),It=Et.max,Ut=Et.min,Ng=V.now,Hg=D.parseInt,Yl=Et.random,Vg=ms.reverse,fo=Tn(D,"DataView"),vi=Tn(D,"Map"),go=Tn(D,"Promise"),Jn=Tn(D,"Set"),wi=Tn(D,"WeakMap"),Mi=Tn(mt,"create"),Ps=wi&&new wi,Qn={},Ug=On(fo),$g=On(vi),Yg=On(go),Xg=On(Jn),Gg=On(wi),Cs=an?an.prototype:e,Si=Cs?Cs.valueOf:e,Xl=Cs?Cs.toString:e;function b(s){if(kt(s)&&!j(s)&&!(s instanceof st)){if(s instanceof me)return s;if(gt.call(s,"__wrapped__"))return Gc(s)}return new me(s)}var ti=function(){function s(){}return function(o){if(!At(o))return{};if(Hl)return Hl(o);s.prototype=o;var h=new s;return s.prototype=e,h}}();function Ts(){}function me(s,o){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!o,this.__index__=0,this.__values__=e}b.templateSettings={escape:ad,evaluate:ld,interpolate:el,variable:"",imports:{_:b}},b.prototype=Ts.prototype,b.prototype.constructor=b,me.prototype=ti(Ts.prototype),me.prototype.constructor=me;function st(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Kt,this.__views__=[]}function Kg(){var s=new st(this.__wrapped__);return s.__actions__=Jt(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=Jt(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=Jt(this.__views__),s}function qg(){if(this.__filtered__){var s=new st(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function jg(){var s=this.__wrapped__.value(),o=this.__dir__,h=j(s),d=o<0,m=h?s.length:0,x=lm(0,m,this.__views__),v=x.start,S=x.end,P=S-v,R=d?S:v-1,E=this.__iteratees__,B=E.length,H=0,$=Ut(P,this.__takeCount__);if(!h||!d&&m==P&&$==P)return mc(s,this.__actions__);var G=[];t:for(;P--&&H<$;){R+=o;for(var et=-1,K=s[R];++et<B;){var it=E[et],ot=it.iteratee,le=it.type,Zt=ot(K);if(le==ht)K=Zt;else if(!Zt){if(le==Vt)continue t;break t}}G[H++]=K}return G}st.prototype=ti(Ts.prototype),st.prototype.constructor=st;function An(s){var o=-1,h=s==null?0:s.length;for(this.clear();++o<h;){var d=s[o];this.set(d[0],d[1])}}function Zg(){this.__data__=Mi?Mi(null):{},this.size=0}function Jg(s){var o=this.has(s)&&delete this.__data__[s];return this.size-=o?1:0,o}function Qg(s){var o=this.__data__;if(Mi){var h=o[s];return h===u?e:h}return gt.call(o,s)?o[s]:e}function tp(s){var o=this.__data__;return Mi?o[s]!==e:gt.call(o,s)}function ep(s,o){var h=this.__data__;return this.size+=this.has(s)?0:1,h[s]=Mi&&o===e?u:o,this}An.prototype.clear=Zg,An.prototype.delete=Jg,An.prototype.get=Qg,An.prototype.has=tp,An.prototype.set=ep;function He(s){var o=-1,h=s==null?0:s.length;for(this.clear();++o<h;){var d=s[o];this.set(d[0],d[1])}}function np(){this.__data__=[],this.size=0}function ip(s){var o=this.__data__,h=Os(o,s);if(h<0)return!1;var d=o.length-1;return h==d?o.pop():Ms.call(o,h,1),--this.size,!0}function sp(s){var o=this.__data__,h=Os(o,s);return h<0?e:o[h][1]}function rp(s){return Os(this.__data__,s)>-1}function op(s,o){var h=this.__data__,d=Os(h,s);return d<0?(++this.size,h.push([s,o])):h[d][1]=o,this}He.prototype.clear=np,He.prototype.delete=ip,He.prototype.get=sp,He.prototype.has=rp,He.prototype.set=op;function Ve(s){var o=-1,h=s==null?0:s.length;for(this.clear();++o<h;){var d=s[o];this.set(d[0],d[1])}}function ap(){this.size=0,this.__data__={hash:new An,map:new(vi||He),string:new An}}function lp(s){var o=Vs(this,s).delete(s);return this.size-=o?1:0,o}function cp(s){return Vs(this,s).get(s)}function hp(s){return Vs(this,s).has(s)}function up(s,o){var h=Vs(this,s),d=h.size;return h.set(s,o),this.size+=h.size==d?0:1,this}Ve.prototype.clear=ap,Ve.prototype.delete=lp,Ve.prototype.get=cp,Ve.prototype.has=hp,Ve.prototype.set=up;function kn(s){var o=-1,h=s==null?0:s.length;for(this.__data__=new Ve;++o<h;)this.add(s[o])}function fp(s){return this.__data__.set(s,u),this}function dp(s){return this.__data__.has(s)}kn.prototype.add=kn.prototype.push=fp,kn.prototype.has=dp;function Pe(s){var o=this.__data__=new He(s);this.size=o.size}function gp(){this.__data__=new He,this.size=0}function pp(s){var o=this.__data__,h=o.delete(s);return this.size=o.size,h}function mp(s){return this.__data__.get(s)}function _p(s){return this.__data__.has(s)}function bp(s,o){var h=this.__data__;if(h instanceof He){var d=h.__data__;if(!vi||d.length<r-1)return d.push([s,o]),this.size=++h.size,this;h=this.__data__=new Ve(d)}return h.set(s,o),this.size=h.size,this}Pe.prototype.clear=gp,Pe.prototype.delete=pp,Pe.prototype.get=mp,Pe.prototype.has=_p,Pe.prototype.set=bp;function Gl(s,o){var h=j(s),d=!h&&Dn(s),m=!h&&!d&&fn(s),x=!h&&!d&&!m&&si(s),v=h||d||m||x,S=v?ao(s.length,Cg):[],P=S.length;for(var R in s)(o||gt.call(s,R))&&!(v&&(R=="length"||m&&(R=="offset"||R=="parent")||x&&(R=="buffer"||R=="byteLength"||R=="byteOffset")||Xe(R,P)))&&S.push(R);return S}function Kl(s){var o=s.length;return o?s[Ao(0,o-1)]:e}function xp(s,o){return Us(Jt(s),Pn(o,0,s.length))}function yp(s){return Us(Jt(s))}function po(s,o,h){(h!==e&&!Ce(s[o],h)||h===e&&!(o in s))&&Ue(s,o,h)}function Ai(s,o,h){var d=s[o];(!(gt.call(s,o)&&Ce(d,h))||h===e&&!(o in s))&&Ue(s,o,h)}function Os(s,o){for(var h=s.length;h--;)if(Ce(s[h][0],o))return h;return-1}function vp(s,o,h,d){return ln(s,function(m,x,v){o(d,m,h(m),v)}),d}function ql(s,o){return s&&Ie(o,zt(o),s)}function wp(s,o){return s&&Ie(o,te(o),s)}function Ue(s,o,h){o=="__proto__"&&Ss?Ss(s,o,{configurable:!0,enumerable:!0,value:h,writable:!0}):s[o]=h}function mo(s,o){for(var h=-1,d=o.length,m=T(d),x=s==null;++h<d;)m[h]=x?e:jo(s,o[h]);return m}function Pn(s,o,h){return s===s&&(h!==e&&(s=s<=h?s:h),o!==e&&(s=s>=o?s:o)),s}function _e(s,o,h,d,m,x){var v,S=o&p,P=o&_,R=o&y;if(h&&(v=m?h(s,d,m,x):h(s)),v!==e)return v;if(!At(s))return s;var E=j(s);if(E){if(v=hm(s),!S)return Jt(s,v)}else{var B=$t(s),H=B==ls||B==Za;if(fn(s))return xc(s,S);if(B==Ne||B==fe||H&&!m){if(v=P||H?{}:zc(s),!S)return P?Qp(s,wp(v,s)):Jp(s,ql(v,s))}else{if(!bt[B])return m?s:{};v=um(s,B,S)}}x||(x=new Pe);var $=x.get(s);if($)return $;x.set(s,v),dh(s)?s.forEach(function(K){v.add(_e(K,o,h,K,s,x))}):uh(s)&&s.forEach(function(K,it){v.set(it,_e(K,o,h,it,s,x))});var G=R?P?Fo:Io:P?te:zt,et=E?e:G(s);return ge(et||s,function(K,it){et&&(it=K,K=s[it]),Ai(v,it,_e(K,o,h,it,s,x))}),v}function Mp(s){var o=zt(s);return function(h){return jl(h,s,o)}}function jl(s,o,h){var d=h.length;if(s==null)return!d;for(s=mt(s);d--;){var m=h[d],x=o[m],v=s[m];if(v===e&&!(m in s)||!x(v))return!1}return!0}function Zl(s,o,h){if(typeof s!="function")throw new pe(l);return Li(function(){s.apply(e,h)},o)}function ki(s,o,h,d){var m=-1,x=ds,v=!0,S=s.length,P=[],R=o.length;if(!S)return P;h&&(o=Mt(o,re(h))),d?(x=eo,v=!1):o.length>=r&&(x=xi,v=!1,o=new kn(o));t:for(;++m<S;){var E=s[m],B=h==null?E:h(E);if(E=d||E!==0?E:0,v&&B===B){for(var H=R;H--;)if(o[H]===B)continue t;P.push(E)}else x(o,B,d)||P.push(E)}return P}var ln=Sc(Ee),Jl=Sc(bo,!0);function Sp(s,o){var h=!0;return ln(s,function(d,m,x){return h=!!o(d,m,x),h}),h}function Ds(s,o,h){for(var d=-1,m=s.length;++d<m;){var x=s[d],v=o(x);if(v!=null&&(S===e?v===v&&!ae(v):h(v,S)))var S=v,P=x}return P}function Ap(s,o,h,d){var m=s.length;for(h=tt(h),h<0&&(h=-h>m?0:m+h),d=d===e||d>m?m:tt(d),d<0&&(d+=m),d=h>d?0:ph(d);h<d;)s[h++]=o;return s}function Ql(s,o){var h=[];return ln(s,function(d,m,x){o(d,m,x)&&h.push(d)}),h}function Ht(s,o,h,d,m){var x=-1,v=s.length;for(h||(h=dm),m||(m=[]);++x<v;){var S=s[x];o>0&&h(S)?o>1?Ht(S,o-1,h,d,m):rn(m,S):d||(m[m.length]=S)}return m}var _o=Ac(),tc=Ac(!0);function Ee(s,o){return s&&_o(s,o,zt)}function bo(s,o){return s&&tc(s,o,zt)}function Ls(s,o){return sn(o,function(h){return Ge(s[h])})}function Cn(s,o){o=hn(o,s);for(var h=0,d=o.length;s!=null&&h<d;)s=s[Fe(o[h++])];return h&&h==d?s:e}function ec(s,o,h){var d=o(s);return j(s)?d:rn(d,h(s))}function qt(s){return s==null?s===e?td:Jf:Sn&&Sn in mt(s)?am(s):ym(s)}function xo(s,o){return s>o}function kp(s,o){return s!=null&&gt.call(s,o)}function Pp(s,o){return s!=null&&o in mt(s)}function Cp(s,o,h){return s>=Ut(o,h)&&s<It(o,h)}function yo(s,o,h){for(var d=h?eo:ds,m=s[0].length,x=s.length,v=x,S=T(x),P=1/0,R=[];v--;){var E=s[v];v&&o&&(E=Mt(E,re(o))),P=Ut(E.length,P),S[v]=!h&&(o||m>=120&&E.length>=120)?new kn(v&&E):e}E=s[0];var B=-1,H=S[0];t:for(;++B<m&&R.length<P;){var $=E[B],G=o?o($):$;if($=h||$!==0?$:0,!(H?xi(H,G):d(R,G,h))){for(v=x;--v;){var et=S[v];if(!(et?xi(et,G):d(s[v],G,h)))continue t}H&&H.push(G),R.push($)}}return R}function Tp(s,o,h,d){return Ee(s,function(m,x,v){o(d,h(m),x,v)}),d}function Pi(s,o,h){o=hn(o,s),s=Vc(s,o);var d=s==null?s:s[Fe(xe(o))];return d==null?e:se(d,s,h)}function nc(s){return kt(s)&&qt(s)==fe}function Op(s){return kt(s)&&qt(s)==bi}function Dp(s){return kt(s)&&qt(s)==di}function Ci(s,o,h,d,m){return s===o?!0:s==null||o==null||!kt(s)&&!kt(o)?s!==s&&o!==o:Lp(s,o,h,d,Ci,m)}function Lp(s,o,h,d,m,x){var v=j(s),S=j(o),P=v?Re:$t(s),R=S?Re:$t(o);P=P==fe?Ne:P,R=R==fe?Ne:R;var E=P==Ne,B=R==Ne,H=P==R;if(H&&fn(s)){if(!fn(o))return!1;v=!0,E=!1}if(H&&!E)return x||(x=new Pe),v||si(s)?Ic(s,o,h,d,m,x):rm(s,o,P,h,d,m,x);if(!(h&w)){var $=E&&gt.call(s,"__wrapped__"),G=B&&gt.call(o,"__wrapped__");if($||G){var et=$?s.value():s,K=G?o.value():o;return x||(x=new Pe),m(et,K,h,d,x)}}return H?(x||(x=new Pe),om(s,o,h,d,m,x)):!1}function Rp(s){return kt(s)&&$t(s)==Se}function vo(s,o,h,d){var m=h.length,x=m,v=!d;if(s==null)return!x;for(s=mt(s);m--;){var S=h[m];if(v&&S[2]?S[1]!==s[S[0]]:!(S[0]in s))return!1}for(;++m<x;){S=h[m];var P=S[0],R=s[P],E=S[1];if(v&&S[2]){if(R===e&&!(P in s))return!1}else{var B=new Pe;if(d)var H=d(R,E,P,s,o,B);if(!(H===e?Ci(E,R,w|M,d,B):H))return!1}}return!0}function ic(s){if(!At(s)||pm(s))return!1;var o=Ge(s)?Rg:Md;return o.test(On(s))}function Ep(s){return kt(s)&&qt(s)==pi}function Ip(s){return kt(s)&&$t(s)==Ae}function Fp(s){return kt(s)&&qs(s.length)&&!!yt[qt(s)]}function sc(s){return typeof s=="function"?s:s==null?ee:typeof s=="object"?j(s)?ac(s[0],s[1]):oc(s):kh(s)}function wo(s){if(!Di(s))return Wg(s);var o=[];for(var h in mt(s))gt.call(s,h)&&h!="constructor"&&o.push(h);return o}function Bp(s){if(!At(s))return xm(s);var o=Di(s),h=[];for(var d in s)d=="constructor"&&(o||!gt.call(s,d))||h.push(d);return h}function Mo(s,o){return s<o}function rc(s,o){var h=-1,d=Qt(s)?T(s.length):[];return ln(s,function(m,x,v){d[++h]=o(m,x,v)}),d}function oc(s){var o=zo(s);return o.length==1&&o[0][2]?Nc(o[0][0],o[0][1]):function(h){return h===s||vo(h,s,o)}}function ac(s,o){return No(s)&&Wc(o)?Nc(Fe(s),o):function(h){var d=jo(h,s);return d===e&&d===o?Zo(h,s):Ci(o,d,w|M)}}function Rs(s,o,h,d,m){s!==o&&_o(o,function(x,v){if(m||(m=new Pe),At(x))zp(s,o,v,h,Rs,d,m);else{var S=d?d(Vo(s,v),x,v+"",s,o,m):e;S===e&&(S=x),po(s,v,S)}},te)}function zp(s,o,h,d,m,x,v){var S=Vo(s,h),P=Vo(o,h),R=v.get(P);if(R){po(s,h,R);return}var E=x?x(S,P,h+"",s,o,v):e,B=E===e;if(B){var H=j(P),$=!H&&fn(P),G=!H&&!$&&si(P);E=P,H||$||G?j(S)?E=S:Tt(S)?E=Jt(S):$?(B=!1,E=xc(P,!0)):G?(B=!1,E=yc(P,!0)):E=[]:Ri(P)||Dn(P)?(E=S,Dn(S)?E=mh(S):(!At(S)||Ge(S))&&(E=zc(P))):B=!1}B&&(v.set(P,E),m(E,P,d,x,v),v.delete(P)),po(s,h,E)}function lc(s,o){var h=s.length;if(h)return o+=o<0?h:0,Xe(o,h)?s[o]:e}function cc(s,o,h){o.length?o=Mt(o,function(x){return j(x)?function(v){return Cn(v,x.length===1?x[0]:x)}:x}):o=[ee];var d=-1;o=Mt(o,re(X()));var m=rc(s,function(x,v,S){var P=Mt(o,function(R){return R(x)});return{criteria:P,index:++d,value:x}});return ug(m,function(x,v){return Zp(x,v,h)})}function Wp(s,o){return hc(s,o,function(h,d){return Zo(s,d)})}function hc(s,o,h){for(var d=-1,m=o.length,x={};++d<m;){var v=o[d],S=Cn(s,v);h(S,v)&&Ti(x,hn(v,s),S)}return x}function Np(s){return function(o){return Cn(o,s)}}function So(s,o,h,d){var m=d?hg:Gn,x=-1,v=o.length,S=s;for(s===o&&(o=Jt(o)),h&&(S=Mt(s,re(h)));++x<v;)for(var P=0,R=o[x],E=h?h(R):R;(P=m(S,E,P,d))>-1;)S!==s&&Ms.call(S,P,1),Ms.call(s,P,1);return s}function uc(s,o){for(var h=s?o.length:0,d=h-1;h--;){var m=o[h];if(h==d||m!==x){var x=m;Xe(m)?Ms.call(s,m,1):Co(s,m)}}return s}function Ao(s,o){return s+ks(Yl()*(o-s+1))}function Hp(s,o,h,d){for(var m=-1,x=It(As((o-s)/(h||1)),0),v=T(x);x--;)v[d?x:++m]=s,s+=h;return v}function ko(s,o){var h="";if(!s||o<1||o>Lt)return h;do o%2&&(h+=s),o=ks(o/2),o&&(s+=s);while(o);return h}function nt(s,o){return Uo(Hc(s,o,ee),s+"")}function Vp(s){return Kl(ri(s))}function Up(s,o){var h=ri(s);return Us(h,Pn(o,0,h.length))}function Ti(s,o,h,d){if(!At(s))return s;o=hn(o,s);for(var m=-1,x=o.length,v=x-1,S=s;S!=null&&++m<x;){var P=Fe(o[m]),R=h;if(P==="__proto__"||P==="constructor"||P==="prototype")return s;if(m!=v){var E=S[P];R=d?d(E,P,S):e,R===e&&(R=At(E)?E:Xe(o[m+1])?[]:{})}Ai(S,P,R),S=S[P]}return s}var fc=Ps?function(s,o){return Ps.set(s,o),s}:ee,$p=Ss?function(s,o){return Ss(s,"toString",{configurable:!0,enumerable:!1,value:Qo(o),writable:!0})}:ee;function Yp(s){return Us(ri(s))}function be(s,o,h){var d=-1,m=s.length;o<0&&(o=-o>m?0:m+o),h=h>m?m:h,h<0&&(h+=m),m=o>h?0:h-o>>>0,o>>>=0;for(var x=T(m);++d<m;)x[d]=s[d+o];return x}function Xp(s,o){var h;return ln(s,function(d,m,x){return h=o(d,m,x),!h}),!!h}function Es(s,o,h){var d=0,m=s==null?d:s.length;if(typeof o=="number"&&o===o&&m<=vn){for(;d<m;){var x=d+m>>>1,v=s[x];v!==null&&!ae(v)&&(h?v<=o:v<o)?d=x+1:m=x}return m}return Po(s,o,ee,h)}function Po(s,o,h,d){var m=0,x=s==null?0:s.length;if(x===0)return 0;o=h(o);for(var v=o!==o,S=o===null,P=ae(o),R=o===e;m<x;){var E=ks((m+x)/2),B=h(s[E]),H=B!==e,$=B===null,G=B===B,et=ae(B);if(v)var K=d||G;else R?K=G&&(d||H):S?K=G&&H&&(d||!$):P?K=G&&H&&!$&&(d||!et):$||et?K=!1:K=d?B<=o:B<o;K?m=E+1:x=E}return Ut(x,nn)}function dc(s,o){for(var h=-1,d=s.length,m=0,x=[];++h<d;){var v=s[h],S=o?o(v):v;if(!h||!Ce(S,P)){var P=S;x[m++]=v===0?0:v}}return x}function gc(s){return typeof s=="number"?s:ae(s)?Me:+s}function oe(s){if(typeof s=="string")return s;if(j(s))return Mt(s,oe)+"";if(ae(s))return Xl?Xl.call(s):"";var o=s+"";return o=="0"&&1/s==-dt?"-0":o}function cn(s,o,h){var d=-1,m=ds,x=s.length,v=!0,S=[],P=S;if(h)v=!1,m=eo;else if(x>=r){var R=o?null:im(s);if(R)return ps(R);v=!1,m=xi,P=new kn}else P=o?[]:S;t:for(;++d<x;){var E=s[d],B=o?o(E):E;if(E=h||E!==0?E:0,v&&B===B){for(var H=P.length;H--;)if(P[H]===B)continue t;o&&P.push(B),S.push(E)}else m(P,B,h)||(P!==S&&P.push(B),S.push(E))}return S}function Co(s,o){return o=hn(o,s),s=Vc(s,o),s==null||delete s[Fe(xe(o))]}function pc(s,o,h,d){return Ti(s,o,h(Cn(s,o)),d)}function Is(s,o,h,d){for(var m=s.length,x=d?m:-1;(d?x--:++x<m)&&o(s[x],x,s););return h?be(s,d?0:x,d?x+1:m):be(s,d?x+1:0,d?m:x)}function mc(s,o){var h=s;return h instanceof st&&(h=h.value()),no(o,function(d,m){return m.func.apply(m.thisArg,rn([d],m.args))},h)}function To(s,o,h){var d=s.length;if(d<2)return d?cn(s[0]):[];for(var m=-1,x=T(d);++m<d;)for(var v=s[m],S=-1;++S<d;)S!=m&&(x[m]=ki(x[m]||v,s[S],o,h));return cn(Ht(x,1),o,h)}function _c(s,o,h){for(var d=-1,m=s.length,x=o.length,v={};++d<m;){var S=d<x?o[d]:e;h(v,s[d],S)}return v}function Oo(s){return Tt(s)?s:[]}function Do(s){return typeof s=="function"?s:ee}function hn(s,o){return j(s)?s:No(s,o)?[s]:Xc(ut(s))}var Gp=nt;function un(s,o,h){var d=s.length;return h=h===e?d:h,!o&&h>=d?s:be(s,o,h)}var bc=Eg||function(s){return Nt.clearTimeout(s)};function xc(s,o){if(o)return s.slice();var h=s.length,d=Nl?Nl(h):new s.constructor(h);return s.copy(d),d}function Lo(s){var o=new s.constructor(s.byteLength);return new vs(o).set(new vs(s)),o}function Kp(s,o){var h=o?Lo(s.buffer):s.buffer;return new s.constructor(h,s.byteOffset,s.byteLength)}function qp(s){var o=new s.constructor(s.source,nl.exec(s));return o.lastIndex=s.lastIndex,o}function jp(s){return Si?mt(Si.call(s)):{}}function yc(s,o){var h=o?Lo(s.buffer):s.buffer;return new s.constructor(h,s.byteOffset,s.length)}function vc(s,o){if(s!==o){var h=s!==e,d=s===null,m=s===s,x=ae(s),v=o!==e,S=o===null,P=o===o,R=ae(o);if(!S&&!R&&!x&&s>o||x&&v&&P&&!S&&!R||d&&v&&P||!h&&P||!m)return 1;if(!d&&!x&&!R&&s<o||R&&h&&m&&!d&&!x||S&&h&&m||!v&&m||!P)return-1}return 0}function Zp(s,o,h){for(var d=-1,m=s.criteria,x=o.criteria,v=m.length,S=h.length;++d<v;){var P=vc(m[d],x[d]);if(P){if(d>=S)return P;var R=h[d];return P*(R=="desc"?-1:1)}}return s.index-o.index}function wc(s,o,h,d){for(var m=-1,x=s.length,v=h.length,S=-1,P=o.length,R=It(x-v,0),E=T(P+R),B=!d;++S<P;)E[S]=o[S];for(;++m<v;)(B||m<x)&&(E[h[m]]=s[m]);for(;R--;)E[S++]=s[m++];return E}function Mc(s,o,h,d){for(var m=-1,x=s.length,v=-1,S=h.length,P=-1,R=o.length,E=It(x-S,0),B=T(E+R),H=!d;++m<E;)B[m]=s[m];for(var $=m;++P<R;)B[$+P]=o[P];for(;++v<S;)(H||m<x)&&(B[$+h[v]]=s[m++]);return B}function Jt(s,o){var h=-1,d=s.length;for(o||(o=T(d));++h<d;)o[h]=s[h];return o}function Ie(s,o,h,d){var m=!h;h||(h={});for(var x=-1,v=o.length;++x<v;){var S=o[x],P=d?d(h[S],s[S],S,h,s):e;P===e&&(P=s[S]),m?Ue(h,S,P):Ai(h,S,P)}return h}function Jp(s,o){return Ie(s,Wo(s),o)}function Qp(s,o){return Ie(s,Fc(s),o)}function Fs(s,o){return function(h,d){var m=j(h)?sg:vp,x=o?o():{};return m(h,s,X(d,2),x)}}function ei(s){return nt(function(o,h){var d=-1,m=h.length,x=m>1?h[m-1]:e,v=m>2?h[2]:e;for(x=s.length>3&&typeof x=="function"?(m--,x):e,v&&jt(h[0],h[1],v)&&(x=m<3?e:x,m=1),o=mt(o);++d<m;){var S=h[d];S&&s(o,S,d,x)}return o})}function Sc(s,o){return function(h,d){if(h==null)return h;if(!Qt(h))return s(h,d);for(var m=h.length,x=o?m:-1,v=mt(h);(o?x--:++x<m)&&d(v[x],x,v)!==!1;);return h}}function Ac(s){return function(o,h,d){for(var m=-1,x=mt(o),v=d(o),S=v.length;S--;){var P=v[s?S:++m];if(h(x[P],P,x)===!1)break}return o}}function tm(s,o,h){var d=o&A,m=Oi(s);function x(){var v=this&&this!==Nt&&this instanceof x?m:s;return v.apply(d?h:this,arguments)}return x}function kc(s){return function(o){o=ut(o);var h=Kn(o)?ke(o):e,d=h?h[0]:o.charAt(0),m=h?un(h,1).join(""):o.slice(1);return d[s]()+m}}function ni(s){return function(o){return no(Sh(Mh(o).replace($d,"")),s,"")}}function Oi(s){return function(){var o=arguments;switch(o.length){case 0:return new s;case 1:return new s(o[0]);case 2:return new s(o[0],o[1]);case 3:return new s(o[0],o[1],o[2]);case 4:return new s(o[0],o[1],o[2],o[3]);case 5:return new s(o[0],o[1],o[2],o[3],o[4]);case 6:return new s(o[0],o[1],o[2],o[3],o[4],o[5]);case 7:return new s(o[0],o[1],o[2],o[3],o[4],o[5],o[6])}var h=ti(s.prototype),d=s.apply(h,o);return At(d)?d:h}}function em(s,o,h){var d=Oi(s);function m(){for(var x=arguments.length,v=T(x),S=x,P=ii(m);S--;)v[S]=arguments[S];var R=x<3&&v[0]!==P&&v[x-1]!==P?[]:on(v,P);if(x-=R.length,x<h)return Dc(s,o,Bs,m.placeholder,e,v,R,e,e,h-x);var E=this&&this!==Nt&&this instanceof m?d:s;return se(E,this,v)}return m}function Pc(s){return function(o,h,d){var m=mt(o);if(!Qt(o)){var x=X(h,3);o=zt(o),h=function(S){return x(m[S],S,m)}}var v=s(o,h,d);return v>-1?m[x?o[v]:v]:e}}function Cc(s){return Ye(function(o){var h=o.length,d=h,m=me.prototype.thru;for(s&&o.reverse();d--;){var x=o[d];if(typeof x!="function")throw new pe(l);if(m&&!v&&Hs(x)=="wrapper")var v=new me([],!0)}for(d=v?d:h;++d<h;){x=o[d];var S=Hs(x),P=S=="wrapper"?Bo(x):e;P&&Ho(P[0])&&P[1]==(z|I|L|N)&&!P[4].length&&P[9]==1?v=v[Hs(P[0])].apply(v,P[3]):v=x.length==1&&Ho(x)?v[S]():v.thru(x)}return function(){var R=arguments,E=R[0];if(v&&R.length==1&&j(E))return v.plant(E).value();for(var B=0,H=h?o[B].apply(this,R):E;++B<h;)H=o[B].call(this,H);return H}})}function Bs(s,o,h,d,m,x,v,S,P,R){var E=o&z,B=o&A,H=o&C,$=o&(I|F),G=o&Y,et=H?e:Oi(s);function K(){for(var it=arguments.length,ot=T(it),le=it;le--;)ot[le]=arguments[le];if($)var Zt=ii(K),ce=dg(ot,Zt);if(d&&(ot=wc(ot,d,m,$)),x&&(ot=Mc(ot,x,v,$)),it-=ce,$&&it<R){var Ot=on(ot,Zt);return Dc(s,o,Bs,K.placeholder,h,ot,Ot,S,P,R-it)}var Te=B?h:this,qe=H?Te[s]:s;return it=ot.length,S?ot=vm(ot,S):G&&it>1&&ot.reverse(),E&&P<it&&(ot.length=P),this&&this!==Nt&&this instanceof K&&(qe=et||Oi(qe)),qe.apply(Te,ot)}return K}function Tc(s,o){return function(h,d){return Tp(h,s,o(d),{})}}function zs(s,o){return function(h,d){var m;if(h===e&&d===e)return o;if(h!==e&&(m=h),d!==e){if(m===e)return d;typeof h=="string"||typeof d=="string"?(h=oe(h),d=oe(d)):(h=gc(h),d=gc(d)),m=s(h,d)}return m}}function Ro(s){return Ye(function(o){return o=Mt(o,re(X())),nt(function(h){var d=this;return s(o,function(m){return se(m,d,h)})})})}function Ws(s,o){o=o===e?" ":oe(o);var h=o.length;if(h<2)return h?ko(o,s):o;var d=ko(o,As(s/qn(o)));return Kn(o)?un(ke(d),0,s).join(""):d.slice(0,s)}function nm(s,o,h,d){var m=o&A,x=Oi(s);function v(){for(var S=-1,P=arguments.length,R=-1,E=d.length,B=T(E+P),H=this&&this!==Nt&&this instanceof v?x:s;++R<E;)B[R]=d[R];for(;P--;)B[R++]=arguments[++S];return se(H,m?h:this,B)}return v}function Oc(s){return function(o,h,d){return d&&typeof d!="number"&&jt(o,h,d)&&(h=d=e),o=Ke(o),h===e?(h=o,o=0):h=Ke(h),d=d===e?o<h?1:-1:Ke(d),Hp(o,h,d,s)}}function Ns(s){return function(o,h){return typeof o=="string"&&typeof h=="string"||(o=ye(o),h=ye(h)),s(o,h)}}function Dc(s,o,h,d,m,x,v,S,P,R){var E=o&I,B=E?v:e,H=E?e:v,$=E?x:e,G=E?e:x;o|=E?L:W,o&=~(E?W:L),o&O||(o&=~(A|C));var et=[s,o,m,$,B,G,H,S,P,R],K=h.apply(e,et);return Ho(s)&&Uc(K,et),K.placeholder=d,$c(K,s,o)}function Eo(s){var o=Et[s];return function(h,d){if(h=ye(h),d=d==null?0:Ut(tt(d),292),d&&$l(h)){var m=(ut(h)+"e").split("e"),x=o(m[0]+"e"+(+m[1]+d));return m=(ut(x)+"e").split("e"),+(m[0]+"e"+(+m[1]-d))}return o(h)}}var im=Jn&&1/ps(new Jn([,-0]))[1]==dt?function(s){return new Jn(s)}:na;function Lc(s){return function(o){var h=$t(o);return h==Se?co(o):h==Ae?yg(o):fg(o,s(o))}}function $e(s,o,h,d,m,x,v,S){var P=o&C;if(!P&&typeof s!="function")throw new pe(l);var R=d?d.length:0;if(R||(o&=~(L|W),d=m=e),v=v===e?v:It(tt(v),0),S=S===e?S:tt(S),R-=m?m.length:0,o&W){var E=d,B=m;d=m=e}var H=P?e:Bo(s),$=[s,o,h,d,m,E,B,x,v,S];if(H&&bm($,H),s=$[0],o=$[1],h=$[2],d=$[3],m=$[4],S=$[9]=$[9]===e?P?0:s.length:It($[9]-R,0),!S&&o&(I|F)&&(o&=~(I|F)),!o||o==A)var G=tm(s,o,h);else o==I||o==F?G=em(s,o,S):(o==L||o==(A|L))&&!m.length?G=nm(s,o,h,d):G=Bs.apply(e,$);var et=H?fc:Uc;return $c(et(G,$),s,o)}function Rc(s,o,h,d){return s===e||Ce(s,Zn[h])&&!gt.call(d,h)?o:s}function Ec(s,o,h,d,m,x){return At(s)&&At(o)&&(x.set(o,s),Rs(s,o,e,Ec,x),x.delete(o)),s}function sm(s){return Ri(s)?e:s}function Ic(s,o,h,d,m,x){var v=h&w,S=s.length,P=o.length;if(S!=P&&!(v&&P>S))return!1;var R=x.get(s),E=x.get(o);if(R&&E)return R==o&&E==s;var B=-1,H=!0,$=h&M?new kn:e;for(x.set(s,o),x.set(o,s);++B<S;){var G=s[B],et=o[B];if(d)var K=v?d(et,G,B,o,s,x):d(G,et,B,s,o,x);if(K!==e){if(K)continue;H=!1;break}if($){if(!io(o,function(it,ot){if(!xi($,ot)&&(G===it||m(G,it,h,d,x)))return $.push(ot)})){H=!1;break}}else if(!(G===et||m(G,et,h,d,x))){H=!1;break}}return x.delete(s),x.delete(o),H}function rm(s,o,h,d,m,x,v){switch(h){case Yn:if(s.byteLength!=o.byteLength||s.byteOffset!=o.byteOffset)return!1;s=s.buffer,o=o.buffer;case bi:return!(s.byteLength!=o.byteLength||!x(new vs(s),new vs(o)));case fi:case di:case gi:return Ce(+s,+o);case as:return s.name==o.name&&s.message==o.message;case pi:case mi:return s==o+"";case Se:var S=co;case Ae:var P=d&w;if(S||(S=ps),s.size!=o.size&&!P)return!1;var R=v.get(s);if(R)return R==o;d|=M,v.set(s,o);var E=Ic(S(s),S(o),d,m,x,v);return v.delete(s),E;case cs:if(Si)return Si.call(s)==Si.call(o)}return!1}function om(s,o,h,d,m,x){var v=h&w,S=Io(s),P=S.length,R=Io(o),E=R.length;if(P!=E&&!v)return!1;for(var B=P;B--;){var H=S[B];if(!(v?H in o:gt.call(o,H)))return!1}var $=x.get(s),G=x.get(o);if($&&G)return $==o&&G==s;var et=!0;x.set(s,o),x.set(o,s);for(var K=v;++B<P;){H=S[B];var it=s[H],ot=o[H];if(d)var le=v?d(ot,it,H,o,s,x):d(it,ot,H,s,o,x);if(!(le===e?it===ot||m(it,ot,h,d,x):le)){et=!1;break}K||(K=H=="constructor")}if(et&&!K){var Zt=s.constructor,ce=o.constructor;Zt!=ce&&"constructor"in s&&"constructor"in o&&!(typeof Zt=="function"&&Zt instanceof Zt&&typeof ce=="function"&&ce instanceof ce)&&(et=!1)}return x.delete(s),x.delete(o),et}function Ye(s){return Uo(Hc(s,e,jc),s+"")}function Io(s){return ec(s,zt,Wo)}function Fo(s){return ec(s,te,Fc)}var Bo=Ps?function(s){return Ps.get(s)}:na;function Hs(s){for(var o=s.name+"",h=Qn[o],d=gt.call(Qn,o)?h.length:0;d--;){var m=h[d],x=m.func;if(x==null||x==s)return m.name}return o}function ii(s){var o=gt.call(b,"placeholder")?b:s;return o.placeholder}function X(){var s=b.iteratee||ta;return s=s===ta?sc:s,arguments.length?s(arguments[0],arguments[1]):s}function Vs(s,o){var h=s.__data__;return gm(o)?h[typeof o=="string"?"string":"hash"]:h.map}function zo(s){for(var o=zt(s),h=o.length;h--;){var d=o[h],m=s[d];o[h]=[d,m,Wc(m)]}return o}function Tn(s,o){var h=_g(s,o);return ic(h)?h:e}function am(s){var o=gt.call(s,Sn),h=s[Sn];try{s[Sn]=e;var d=!0}catch(x){}var m=xs.call(s);return d&&(o?s[Sn]=h:delete s[Sn]),m}var Wo=uo?function(s){return s==null?[]:(s=mt(s),sn(uo(s),function(o){return Vl.call(s,o)}))}:ia,Fc=uo?function(s){for(var o=[];s;)rn(o,Wo(s)),s=ws(s);return o}:ia,$t=qt;(fo&&$t(new fo(new ArrayBuffer(1)))!=Yn||vi&&$t(new vi)!=Se||go&&$t(go.resolve())!=Ja||Jn&&$t(new Jn)!=Ae||wi&&$t(new wi)!=_i)&&($t=function(s){var o=qt(s),h=o==Ne?s.constructor:e,d=h?On(h):"";if(d)switch(d){case Ug:return Yn;case $g:return Se;case Yg:return Ja;case Xg:return Ae;case Gg:return _i}return o});function lm(s,o,h){for(var d=-1,m=h.length;++d<m;){var x=h[d],v=x.size;switch(x.type){case"drop":s+=v;break;case"dropRight":o-=v;break;case"take":o=Ut(o,s+v);break;case"takeRight":s=It(s,o-v);break}}return{start:s,end:o}}function cm(s){var o=s.match(pd);return o?o[1].split(md):[]}function Bc(s,o,h){o=hn(o,s);for(var d=-1,m=o.length,x=!1;++d<m;){var v=Fe(o[d]);if(!(x=s!=null&&h(s,v)))break;s=s[v]}return x||++d!=m?x:(m=s==null?0:s.length,!!m&&qs(m)&&Xe(v,m)&&(j(s)||Dn(s)))}function hm(s){var o=s.length,h=new s.constructor(o);return o&&typeof s[0]=="string"&&gt.call(s,"index")&&(h.index=s.index,h.input=s.input),h}function zc(s){return typeof s.constructor=="function"&&!Di(s)?ti(ws(s)):{}}function um(s,o,h){var d=s.constructor;switch(o){case bi:return Lo(s);case fi:case di:return new d(+s);case Yn:return Kp(s,h);case Br:case zr:case Wr:case Nr:case Hr:case Vr:case Ur:case $r:case Yr:return yc(s,h);case Se:return new d;case gi:case mi:return new d(s);case pi:return qp(s);case Ae:return new d;case cs:return jp(s)}}function fm(s,o){var h=o.length;if(!h)return s;var d=h-1;return o[d]=(h>1?"& ":"")+o[d],o=o.join(h>2?", ":" "),s.replace(gd,`{
/* [wrapped with `+o+`] */
`)}function dm(s){return j(s)||Dn(s)||!!(Ul&&s&&s[Ul])}function Xe(s,o){var h=typeof s;return o=o==null?Lt:o,!!o&&(h=="number"||h!="symbol"&&Ad.test(s))&&s>-1&&s%1==0&&s<o}function jt(s,o,h){if(!At(h))return!1;var d=typeof o;return(d=="number"?Qt(h)&&Xe(o,h.length):d=="string"&&o in h)?Ce(h[o],s):!1}function No(s,o){if(j(s))return!1;var h=typeof s;return h=="number"||h=="symbol"||h=="boolean"||s==null||ae(s)?!0:hd.test(s)||!cd.test(s)||o!=null&&s in mt(o)}function gm(s){var o=typeof s;return o=="string"||o=="number"||o=="symbol"||o=="boolean"?s!=="__proto__":s===null}function Ho(s){var o=Hs(s),h=b[o];if(typeof h!="function"||!(o in st.prototype))return!1;if(s===h)return!0;var d=Bo(h);return!!d&&s===d[0]}function pm(s){return!!Wl&&Wl in s}var mm=_s?Ge:sa;function Di(s){var o=s&&s.constructor,h=typeof o=="function"&&o.prototype||Zn;return s===h}function Wc(s){return s===s&&!At(s)}function Nc(s,o){return function(h){return h==null?!1:h[s]===o&&(o!==e||s in mt(h))}}function _m(s){var o=Gs(s,function(d){return h.size===f&&h.clear(),d}),h=o.cache;return o}function bm(s,o){var h=s[1],d=o[1],m=h|d,x=m<(A|C|z),v=d==z&&h==I||d==z&&h==N&&s[7].length<=o[8]||d==(z|N)&&o[7].length<=o[8]&&h==I;if(!(x||v))return s;d&A&&(s[2]=o[2],m|=h&A?0:O);var S=o[3];if(S){var P=s[3];s[3]=P?wc(P,S,o[4]):S,s[4]=P?on(s[3],g):o[4]}return S=o[5],S&&(P=s[5],s[5]=P?Mc(P,S,o[6]):S,s[6]=P?on(s[5],g):o[6]),S=o[7],S&&(s[7]=S),d&z&&(s[8]=s[8]==null?o[8]:Ut(s[8],o[8])),s[9]==null&&(s[9]=o[9]),s[0]=o[0],s[1]=m,s}function xm(s){var o=[];if(s!=null)for(var h in mt(s))o.push(h);return o}function ym(s){return xs.call(s)}function Hc(s,o,h){return o=It(o===e?s.length-1:o,0),function(){for(var d=arguments,m=-1,x=It(d.length-o,0),v=T(x);++m<x;)v[m]=d[o+m];m=-1;for(var S=T(o+1);++m<o;)S[m]=d[m];return S[o]=h(v),se(s,this,S)}}function Vc(s,o){return o.length<2?s:Cn(s,be(o,0,-1))}function vm(s,o){for(var h=s.length,d=Ut(o.length,h),m=Jt(s);d--;){var x=o[d];s[d]=Xe(x,h)?m[x]:e}return s}function Vo(s,o){if(!(o==="constructor"&&typeof s[o]=="function")&&o!="__proto__")return s[o]}var Uc=Yc(fc),Li=Fg||function(s,o){return Nt.setTimeout(s,o)},Uo=Yc($p);function $c(s,o,h){var d=o+"";return Uo(s,fm(d,wm(cm(d),h)))}function Yc(s){var o=0,h=0;return function(){var d=Ng(),m=Rt-(d-h);if(h=d,m>0){if(++o>=at)return arguments[0]}else o=0;return s.apply(e,arguments)}}function Us(s,o){var h=-1,d=s.length,m=d-1;for(o=o===e?d:o;++h<o;){var x=Ao(h,m),v=s[x];s[x]=s[h],s[h]=v}return s.length=o,s}var Xc=_m(function(s){var o=[];return s.charCodeAt(0)===46&&o.push(""),s.replace(ud,function(h,d,m,x){o.push(m?x.replace(xd,"$1"):d||h)}),o});function Fe(s){if(typeof s=="string"||ae(s))return s;var o=s+"";return o=="0"&&1/s==-dt?"-0":o}function On(s){if(s!=null){try{return bs.call(s)}catch(o){}try{return s+""}catch(o){}}return""}function wm(s,o){return ge(wn,function(h){var d="_."+h[0];o&h[1]&&!ds(s,d)&&s.push(d)}),s.sort()}function Gc(s){if(s instanceof st)return s.clone();var o=new me(s.__wrapped__,s.__chain__);return o.__actions__=Jt(s.__actions__),o.__index__=s.__index__,o.__values__=s.__values__,o}function Mm(s,o,h){(h?jt(s,o,h):o===e)?o=1:o=It(tt(o),0);var d=s==null?0:s.length;if(!d||o<1)return[];for(var m=0,x=0,v=T(As(d/o));m<d;)v[x++]=be(s,m,m+=o);return v}function Sm(s){for(var o=-1,h=s==null?0:s.length,d=0,m=[];++o<h;){var x=s[o];x&&(m[d++]=x)}return m}function Am(){var s=arguments.length;if(!s)return[];for(var o=T(s-1),h=arguments[0],d=s;d--;)o[d-1]=arguments[d];return rn(j(h)?Jt(h):[h],Ht(o,1))}var km=nt(function(s,o){return Tt(s)?ki(s,Ht(o,1,Tt,!0)):[]}),Pm=nt(function(s,o){var h=xe(o);return Tt(h)&&(h=e),Tt(s)?ki(s,Ht(o,1,Tt,!0),X(h,2)):[]}),Cm=nt(function(s,o){var h=xe(o);return Tt(h)&&(h=e),Tt(s)?ki(s,Ht(o,1,Tt,!0),e,h):[]});function Tm(s,o,h){var d=s==null?0:s.length;return d?(o=h||o===e?1:tt(o),be(s,o<0?0:o,d)):[]}function Om(s,o,h){var d=s==null?0:s.length;return d?(o=h||o===e?1:tt(o),o=d-o,be(s,0,o<0?0:o)):[]}function Dm(s,o){return s&&s.length?Is(s,X(o,3),!0,!0):[]}function Lm(s,o){return s&&s.length?Is(s,X(o,3),!0):[]}function Rm(s,o,h,d){var m=s==null?0:s.length;return m?(h&&typeof h!="number"&&jt(s,o,h)&&(h=0,d=m),Ap(s,o,h,d)):[]}function Kc(s,o,h){var d=s==null?0:s.length;if(!d)return-1;var m=h==null?0:tt(h);return m<0&&(m=It(d+m,0)),gs(s,X(o,3),m)}function qc(s,o,h){var d=s==null?0:s.length;if(!d)return-1;var m=d-1;return h!==e&&(m=tt(h),m=h<0?It(d+m,0):Ut(m,d-1)),gs(s,X(o,3),m,!0)}function jc(s){var o=s==null?0:s.length;return o?Ht(s,1):[]}function Em(s){var o=s==null?0:s.length;return o?Ht(s,dt):[]}function Im(s,o){var h=s==null?0:s.length;return h?(o=o===e?1:tt(o),Ht(s,o)):[]}function Fm(s){for(var o=-1,h=s==null?0:s.length,d={};++o<h;){var m=s[o];d[m[0]]=m[1]}return d}function Zc(s){return s&&s.length?s[0]:e}function Bm(s,o,h){var d=s==null?0:s.length;if(!d)return-1;var m=h==null?0:tt(h);return m<0&&(m=It(d+m,0)),Gn(s,o,m)}function zm(s){var o=s==null?0:s.length;return o?be(s,0,-1):[]}var Wm=nt(function(s){var o=Mt(s,Oo);return o.length&&o[0]===s[0]?yo(o):[]}),Nm=nt(function(s){var o=xe(s),h=Mt(s,Oo);return o===xe(h)?o=e:h.pop(),h.length&&h[0]===s[0]?yo(h,X(o,2)):[]}),Hm=nt(function(s){var o=xe(s),h=Mt(s,Oo);return o=typeof o=="function"?o:e,o&&h.pop(),h.length&&h[0]===s[0]?yo(h,e,o):[]});function Vm(s,o){return s==null?"":zg.call(s,o)}function xe(s){var o=s==null?0:s.length;return o?s[o-1]:e}function Um(s,o,h){var d=s==null?0:s.length;if(!d)return-1;var m=d;return h!==e&&(m=tt(h),m=m<0?It(d+m,0):Ut(m,d-1)),o===o?wg(s,o,m):gs(s,Dl,m,!0)}function $m(s,o){return s&&s.length?lc(s,tt(o)):e}var Ym=nt(Jc);function Jc(s,o){return s&&s.length&&o&&o.length?So(s,o):s}function Xm(s,o,h){return s&&s.length&&o&&o.length?So(s,o,X(h,2)):s}function Gm(s,o,h){return s&&s.length&&o&&o.length?So(s,o,e,h):s}var Km=Ye(function(s,o){var h=s==null?0:s.length,d=mo(s,o);return uc(s,Mt(o,function(m){return Xe(m,h)?+m:m}).sort(vc)),d});function qm(s,o){var h=[];if(!(s&&s.length))return h;var d=-1,m=[],x=s.length;for(o=X(o,3);++d<x;){var v=s[d];o(v,d,s)&&(h.push(v),m.push(d))}return uc(s,m),h}function $o(s){return s==null?s:Vg.call(s)}function jm(s,o,h){var d=s==null?0:s.length;return d?(h&&typeof h!="number"&&jt(s,o,h)?(o=0,h=d):(o=o==null?0:tt(o),h=h===e?d:tt(h)),be(s,o,h)):[]}function Zm(s,o){return Es(s,o)}function Jm(s,o,h){return Po(s,o,X(h,2))}function Qm(s,o){var h=s==null?0:s.length;if(h){var d=Es(s,o);if(d<h&&Ce(s[d],o))return d}return-1}function t_(s,o){return Es(s,o,!0)}function e_(s,o,h){return Po(s,o,X(h,2),!0)}function n_(s,o){var h=s==null?0:s.length;if(h){var d=Es(s,o,!0)-1;if(Ce(s[d],o))return d}return-1}function i_(s){return s&&s.length?dc(s):[]}function s_(s,o){return s&&s.length?dc(s,X(o,2)):[]}function r_(s){var o=s==null?0:s.length;return o?be(s,1,o):[]}function o_(s,o,h){return s&&s.length?(o=h||o===e?1:tt(o),be(s,0,o<0?0:o)):[]}function a_(s,o,h){var d=s==null?0:s.length;return d?(o=h||o===e?1:tt(o),o=d-o,be(s,o<0?0:o,d)):[]}function l_(s,o){return s&&s.length?Is(s,X(o,3),!1,!0):[]}function c_(s,o){return s&&s.length?Is(s,X(o,3)):[]}var h_=nt(function(s){return cn(Ht(s,1,Tt,!0))}),u_=nt(function(s){var o=xe(s);return Tt(o)&&(o=e),cn(Ht(s,1,Tt,!0),X(o,2))}),f_=nt(function(s){var o=xe(s);return o=typeof o=="function"?o:e,cn(Ht(s,1,Tt,!0),e,o)});function d_(s){return s&&s.length?cn(s):[]}function g_(s,o){return s&&s.length?cn(s,X(o,2)):[]}function p_(s,o){return o=typeof o=="function"?o:e,s&&s.length?cn(s,e,o):[]}function Yo(s){if(!(s&&s.length))return[];var o=0;return s=sn(s,function(h){if(Tt(h))return o=It(h.length,o),!0}),ao(o,function(h){return Mt(s,so(h))})}function Qc(s,o){if(!(s&&s.length))return[];var h=Yo(s);return o==null?h:Mt(h,function(d){return se(o,e,d)})}var m_=nt(function(s,o){return Tt(s)?ki(s,o):[]}),__=nt(function(s){return To(sn(s,Tt))}),b_=nt(function(s){var o=xe(s);return Tt(o)&&(o=e),To(sn(s,Tt),X(o,2))}),x_=nt(function(s){var o=xe(s);return o=typeof o=="function"?o:e,To(sn(s,Tt),e,o)}),y_=nt(Yo);function v_(s,o){return _c(s||[],o||[],Ai)}function w_(s,o){return _c(s||[],o||[],Ti)}var M_=nt(function(s){var o=s.length,h=o>1?s[o-1]:e;return h=typeof h=="function"?(s.pop(),h):e,Qc(s,h)});function th(s){var o=b(s);return o.__chain__=!0,o}function S_(s,o){return o(s),s}function $s(s,o){return o(s)}var A_=Ye(function(s){var o=s.length,h=o?s[0]:0,d=this.__wrapped__,m=function(x){return mo(x,s)};return o>1||this.__actions__.length||!(d instanceof st)||!Xe(h)?this.thru(m):(d=d.slice(h,+h+(o?1:0)),d.__actions__.push({func:$s,args:[m],thisArg:e}),new me(d,this.__chain__).thru(function(x){return o&&!x.length&&x.push(e),x}))});function k_(){return th(this)}function P_(){return new me(this.value(),this.__chain__)}function C_(){this.__values__===e&&(this.__values__=gh(this.value()));var s=this.__index__>=this.__values__.length,o=s?e:this.__values__[this.__index__++];return{done:s,value:o}}function T_(){return this}function O_(s){for(var o,h=this;h instanceof Ts;){var d=Gc(h);d.__index__=0,d.__values__=e,o?m.__wrapped__=d:o=d;var m=d;h=h.__wrapped__}return m.__wrapped__=s,o}function D_(){var s=this.__wrapped__;if(s instanceof st){var o=s;return this.__actions__.length&&(o=new st(this)),o=o.reverse(),o.__actions__.push({func:$s,args:[$o],thisArg:e}),new me(o,this.__chain__)}return this.thru($o)}function L_(){return mc(this.__wrapped__,this.__actions__)}var R_=Fs(function(s,o,h){gt.call(s,h)?++s[h]:Ue(s,h,1)});function E_(s,o,h){var d=j(s)?Tl:Sp;return h&&jt(s,o,h)&&(o=e),d(s,X(o,3))}function I_(s,o){var h=j(s)?sn:Ql;return h(s,X(o,3))}var F_=Pc(Kc),B_=Pc(qc);function z_(s,o){return Ht(Ys(s,o),1)}function W_(s,o){return Ht(Ys(s,o),dt)}function N_(s,o,h){return h=h===e?1:tt(h),Ht(Ys(s,o),h)}function eh(s,o){var h=j(s)?ge:ln;return h(s,X(o,3))}function nh(s,o){var h=j(s)?rg:Jl;return h(s,X(o,3))}var H_=Fs(function(s,o,h){gt.call(s,h)?s[h].push(o):Ue(s,h,[o])});function V_(s,o,h,d){s=Qt(s)?s:ri(s),h=h&&!d?tt(h):0;var m=s.length;return h<0&&(h=It(m+h,0)),js(s)?h<=m&&s.indexOf(o,h)>-1:!!m&&Gn(s,o,h)>-1}var U_=nt(function(s,o,h){var d=-1,m=typeof o=="function",x=Qt(s)?T(s.length):[];return ln(s,function(v){x[++d]=m?se(o,v,h):Pi(v,o,h)}),x}),$_=Fs(function(s,o,h){Ue(s,h,o)});function Ys(s,o){var h=j(s)?Mt:rc;return h(s,X(o,3))}function Y_(s,o,h,d){return s==null?[]:(j(o)||(o=o==null?[]:[o]),h=d?e:h,j(h)||(h=h==null?[]:[h]),cc(s,o,h))}var X_=Fs(function(s,o,h){s[h?0:1].push(o)},function(){return[[],[]]});function G_(s,o,h){var d=j(s)?no:Rl,m=arguments.length<3;return d(s,X(o,4),h,m,ln)}function K_(s,o,h){var d=j(s)?og:Rl,m=arguments.length<3;return d(s,X(o,4),h,m,Jl)}function q_(s,o){var h=j(s)?sn:Ql;return h(s,Ks(X(o,3)))}function j_(s){var o=j(s)?Kl:Vp;return o(s)}function Z_(s,o,h){(h?jt(s,o,h):o===e)?o=1:o=tt(o);var d=j(s)?xp:Up;return d(s,o)}function J_(s){var o=j(s)?yp:Yp;return o(s)}function Q_(s){if(s==null)return 0;if(Qt(s))return js(s)?qn(s):s.length;var o=$t(s);return o==Se||o==Ae?s.size:wo(s).length}function t0(s,o,h){var d=j(s)?io:Xp;return h&&jt(s,o,h)&&(o=e),d(s,X(o,3))}var e0=nt(function(s,o){if(s==null)return[];var h=o.length;return h>1&&jt(s,o[0],o[1])?o=[]:h>2&&jt(o[0],o[1],o[2])&&(o=[o[0]]),cc(s,Ht(o,1),[])}),Xs=Ig||function(){return Nt.Date.now()};function n0(s,o){if(typeof o!="function")throw new pe(l);return s=tt(s),function(){if(--s<1)return o.apply(this,arguments)}}function ih(s,o,h){return o=h?e:o,o=s&&o==null?s.length:o,$e(s,z,e,e,e,e,o)}function sh(s,o){var h;if(typeof o!="function")throw new pe(l);return s=tt(s),function(){return--s>0&&(h=o.apply(this,arguments)),s<=1&&(o=e),h}}var Xo=nt(function(s,o,h){var d=A;if(h.length){var m=on(h,ii(Xo));d|=L}return $e(s,d,o,h,m)}),rh=nt(function(s,o,h){var d=A|C;if(h.length){var m=on(h,ii(rh));d|=L}return $e(o,d,s,h,m)});function oh(s,o,h){o=h?e:o;var d=$e(s,I,e,e,e,e,e,o);return d.placeholder=oh.placeholder,d}function ah(s,o,h){o=h?e:o;var d=$e(s,F,e,e,e,e,e,o);return d.placeholder=ah.placeholder,d}function lh(s,o,h){var d,m,x,v,S,P,R=0,E=!1,B=!1,H=!0;if(typeof s!="function")throw new pe(l);o=ye(o)||0,At(h)&&(E=!!h.leading,B="maxWait"in h,x=B?It(ye(h.maxWait)||0,o):x,H="trailing"in h?!!h.trailing:H);function $(Ot){var Te=d,qe=m;return d=m=e,R=Ot,v=s.apply(qe,Te),v}function G(Ot){return R=Ot,S=Li(it,o),E?$(Ot):v}function et(Ot){var Te=Ot-P,qe=Ot-R,Ph=o-Te;return B?Ut(Ph,x-qe):Ph}function K(Ot){var Te=Ot-P,qe=Ot-R;return P===e||Te>=o||Te<0||B&&qe>=x}function it(){var Ot=Xs();if(K(Ot))return ot(Ot);S=Li(it,et(Ot))}function ot(Ot){return S=e,H&&d?$(Ot):(d=m=e,v)}function le(){S!==e&&bc(S),R=0,d=P=m=S=e}function Zt(){return S===e?v:ot(Xs())}function ce(){var Ot=Xs(),Te=K(Ot);if(d=arguments,m=this,P=Ot,Te){if(S===e)return G(P);if(B)return bc(S),S=Li(it,o),$(P)}return S===e&&(S=Li(it,o)),v}return ce.cancel=le,ce.flush=Zt,ce}var i0=nt(function(s,o){return Zl(s,1,o)}),s0=nt(function(s,o,h){return Zl(s,ye(o)||0,h)});function r0(s){return $e(s,Y)}function Gs(s,o){if(typeof s!="function"||o!=null&&typeof o!="function")throw new pe(l);var h=function(){var d=arguments,m=o?o.apply(this,d):d[0],x=h.cache;if(x.has(m))return x.get(m);var v=s.apply(this,d);return h.cache=x.set(m,v)||x,v};return h.cache=new(Gs.Cache||Ve),h}Gs.Cache=Ve;function Ks(s){if(typeof s!="function")throw new pe(l);return function(){var o=arguments;switch(o.length){case 0:return!s.call(this);case 1:return!s.call(this,o[0]);case 2:return!s.call(this,o[0],o[1]);case 3:return!s.call(this,o[0],o[1],o[2])}return!s.apply(this,o)}}function o0(s){return sh(2,s)}var a0=Gp(function(s,o){o=o.length==1&&j(o[0])?Mt(o[0],re(X())):Mt(Ht(o,1),re(X()));var h=o.length;return nt(function(d){for(var m=-1,x=Ut(d.length,h);++m<x;)d[m]=o[m].call(this,d[m]);return se(s,this,d)})}),Go=nt(function(s,o){var h=on(o,ii(Go));return $e(s,L,e,o,h)}),ch=nt(function(s,o){var h=on(o,ii(ch));return $e(s,W,e,o,h)}),l0=Ye(function(s,o){return $e(s,N,e,e,e,o)});function c0(s,o){if(typeof s!="function")throw new pe(l);return o=o===e?o:tt(o),nt(s,o)}function h0(s,o){if(typeof s!="function")throw new pe(l);return o=o==null?0:It(tt(o),0),nt(function(h){var d=h[o],m=un(h,0,o);return d&&rn(m,d),se(s,this,m)})}function u0(s,o,h){var d=!0,m=!0;if(typeof s!="function")throw new pe(l);return At(h)&&(d="leading"in h?!!h.leading:d,m="trailing"in h?!!h.trailing:m),lh(s,o,{leading:d,maxWait:o,trailing:m})}function f0(s){return ih(s,1)}function d0(s,o){return Go(Do(o),s)}function g0(){if(!arguments.length)return[];var s=arguments[0];return j(s)?s:[s]}function p0(s){return _e(s,y)}function m0(s,o){return o=typeof o=="function"?o:e,_e(s,y,o)}function _0(s){return _e(s,p|y)}function b0(s,o){return o=typeof o=="function"?o:e,_e(s,p|y,o)}function x0(s,o){return o==null||jl(s,o,zt(o))}function Ce(s,o){return s===o||s!==s&&o!==o}var y0=Ns(xo),v0=Ns(function(s,o){return s>=o}),Dn=nc(function(){return arguments}())?nc:function(s){return kt(s)&&gt.call(s,"callee")&&!Vl.call(s,"callee")},j=T.isArray,w0=Ml?re(Ml):Op;function Qt(s){return s!=null&&qs(s.length)&&!Ge(s)}function Tt(s){return kt(s)&&Qt(s)}function M0(s){return s===!0||s===!1||kt(s)&&qt(s)==fi}var fn=Bg||sa,S0=Sl?re(Sl):Dp;function A0(s){return kt(s)&&s.nodeType===1&&!Ri(s)}function k0(s){if(s==null)return!0;if(Qt(s)&&(j(s)||typeof s=="string"||typeof s.splice=="function"||fn(s)||si(s)||Dn(s)))return!s.length;var o=$t(s);if(o==Se||o==Ae)return!s.size;if(Di(s))return!wo(s).length;for(var h in s)if(gt.call(s,h))return!1;return!0}function P0(s,o){return Ci(s,o)}function C0(s,o,h){h=typeof h=="function"?h:e;var d=h?h(s,o):e;return d===e?Ci(s,o,e,h):!!d}function Ko(s){if(!kt(s))return!1;var o=qt(s);return o==as||o==Zf||typeof s.message=="string"&&typeof s.name=="string"&&!Ri(s)}function T0(s){return typeof s=="number"&&$l(s)}function Ge(s){if(!At(s))return!1;var o=qt(s);return o==ls||o==Za||o==jf||o==Qf}function hh(s){return typeof s=="number"&&s==tt(s)}function qs(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=Lt}function At(s){var o=typeof s;return s!=null&&(o=="object"||o=="function")}function kt(s){return s!=null&&typeof s=="object"}var uh=Al?re(Al):Rp;function O0(s,o){return s===o||vo(s,o,zo(o))}function D0(s,o,h){return h=typeof h=="function"?h:e,vo(s,o,zo(o),h)}function L0(s){return fh(s)&&s!=+s}function R0(s){if(mm(s))throw new q(a);return ic(s)}function E0(s){return s===null}function I0(s){return s==null}function fh(s){return typeof s=="number"||kt(s)&&qt(s)==gi}function Ri(s){if(!kt(s)||qt(s)!=Ne)return!1;var o=ws(s);if(o===null)return!0;var h=gt.call(o,"constructor")&&o.constructor;return typeof h=="function"&&h instanceof h&&bs.call(h)==Dg}var qo=kl?re(kl):Ep;function F0(s){return hh(s)&&s>=-Lt&&s<=Lt}var dh=Pl?re(Pl):Ip;function js(s){return typeof s=="string"||!j(s)&&kt(s)&&qt(s)==mi}function ae(s){return typeof s=="symbol"||kt(s)&&qt(s)==cs}var si=Cl?re(Cl):Fp;function B0(s){return s===e}function z0(s){return kt(s)&&$t(s)==_i}function W0(s){return kt(s)&&qt(s)==ed}var N0=Ns(Mo),H0=Ns(function(s,o){return s<=o});function gh(s){if(!s)return[];if(Qt(s))return js(s)?ke(s):Jt(s);if(yi&&s[yi])return xg(s[yi]());var o=$t(s),h=o==Se?co:o==Ae?ps:ri;return h(s)}function Ke(s){if(!s)return s===0?s:0;if(s=ye(s),s===dt||s===-dt){var o=s<0?-1:1;return o*Bt}return s===s?s:0}function tt(s){var o=Ke(s),h=o%1;return o===o?h?o-h:o:0}function ph(s){return s?Pn(tt(s),0,Kt):0}function ye(s){if(typeof s=="number")return s;if(ae(s))return Me;if(At(s)){var o=typeof s.valueOf=="function"?s.valueOf():s;s=At(o)?o+"":o}if(typeof s!="string")return s===0?s:+s;s=El(s);var h=wd.test(s);return h||Sd.test(s)?ng(s.slice(2),h?2:8):vd.test(s)?Me:+s}function mh(s){return Ie(s,te(s))}function V0(s){return s?Pn(tt(s),-Lt,Lt):s===0?s:0}function ut(s){return s==null?"":oe(s)}var U0=ei(function(s,o){if(Di(o)||Qt(o)){Ie(o,zt(o),s);return}for(var h in o)gt.call(o,h)&&Ai(s,h,o[h])}),_h=ei(function(s,o){Ie(o,te(o),s)}),Zs=ei(function(s,o,h,d){Ie(o,te(o),s,d)}),$0=ei(function(s,o,h,d){Ie(o,zt(o),s,d)}),Y0=Ye(mo);function X0(s,o){var h=ti(s);return o==null?h:ql(h,o)}var G0=nt(function(s,o){s=mt(s);var h=-1,d=o.length,m=d>2?o[2]:e;for(m&&jt(o[0],o[1],m)&&(d=1);++h<d;)for(var x=o[h],v=te(x),S=-1,P=v.length;++S<P;){var R=v[S],E=s[R];(E===e||Ce(E,Zn[R])&&!gt.call(s,R))&&(s[R]=x[R])}return s}),K0=nt(function(s){return s.push(e,Ec),se(bh,e,s)});function q0(s,o){return Ol(s,X(o,3),Ee)}function j0(s,o){return Ol(s,X(o,3),bo)}function Z0(s,o){return s==null?s:_o(s,X(o,3),te)}function J0(s,o){return s==null?s:tc(s,X(o,3),te)}function Q0(s,o){return s&&Ee(s,X(o,3))}function tb(s,o){return s&&bo(s,X(o,3))}function eb(s){return s==null?[]:Ls(s,zt(s))}function nb(s){return s==null?[]:Ls(s,te(s))}function jo(s,o,h){var d=s==null?e:Cn(s,o);return d===e?h:d}function ib(s,o){return s!=null&&Bc(s,o,kp)}function Zo(s,o){return s!=null&&Bc(s,o,Pp)}var sb=Tc(function(s,o,h){o!=null&&typeof o.toString!="function"&&(o=xs.call(o)),s[o]=h},Qo(ee)),rb=Tc(function(s,o,h){o!=null&&typeof o.toString!="function"&&(o=xs.call(o)),gt.call(s,o)?s[o].push(h):s[o]=[h]},X),ob=nt(Pi);function zt(s){return Qt(s)?Gl(s):wo(s)}function te(s){return Qt(s)?Gl(s,!0):Bp(s)}function ab(s,o){var h={};return o=X(o,3),Ee(s,function(d,m,x){Ue(h,o(d,m,x),d)}),h}function lb(s,o){var h={};return o=X(o,3),Ee(s,function(d,m,x){Ue(h,m,o(d,m,x))}),h}var cb=ei(function(s,o,h){Rs(s,o,h)}),bh=ei(function(s,o,h,d){Rs(s,o,h,d)}),hb=Ye(function(s,o){var h={};if(s==null)return h;var d=!1;o=Mt(o,function(x){return x=hn(x,s),d||(d=x.length>1),x}),Ie(s,Fo(s),h),d&&(h=_e(h,p|_|y,sm));for(var m=o.length;m--;)Co(h,o[m]);return h});function ub(s,o){return xh(s,Ks(X(o)))}var fb=Ye(function(s,o){return s==null?{}:Wp(s,o)});function xh(s,o){if(s==null)return{};var h=Mt(Fo(s),function(d){return[d]});return o=X(o),hc(s,h,function(d,m){return o(d,m[0])})}function db(s,o,h){o=hn(o,s);var d=-1,m=o.length;for(m||(m=1,s=e);++d<m;){var x=s==null?e:s[Fe(o[d])];x===e&&(d=m,x=h),s=Ge(x)?x.call(s):x}return s}function gb(s,o,h){return s==null?s:Ti(s,o,h)}function pb(s,o,h,d){return d=typeof d=="function"?d:e,s==null?s:Ti(s,o,h,d)}var yh=Lc(zt),vh=Lc(te);function mb(s,o,h){var d=j(s),m=d||fn(s)||si(s);if(o=X(o,4),h==null){var x=s&&s.constructor;m?h=d?new x:[]:At(s)?h=Ge(x)?ti(ws(s)):{}:h={}}return(m?ge:Ee)(s,function(v,S,P){return o(h,v,S,P)}),h}function _b(s,o){return s==null?!0:Co(s,o)}function bb(s,o,h){return s==null?s:pc(s,o,Do(h))}function xb(s,o,h,d){return d=typeof d=="function"?d:e,s==null?s:pc(s,o,Do(h),d)}function ri(s){return s==null?[]:lo(s,zt(s))}function yb(s){return s==null?[]:lo(s,te(s))}function vb(s,o,h){return h===e&&(h=o,o=e),h!==e&&(h=ye(h),h=h===h?h:0),o!==e&&(o=ye(o),o=o===o?o:0),Pn(ye(s),o,h)}function wb(s,o,h){return o=Ke(o),h===e?(h=o,o=0):h=Ke(h),s=ye(s),Cp(s,o,h)}function Mb(s,o,h){if(h&&typeof h!="boolean"&&jt(s,o,h)&&(o=h=e),h===e&&(typeof o=="boolean"?(h=o,o=e):typeof s=="boolean"&&(h=s,s=e)),s===e&&o===e?(s=0,o=1):(s=Ke(s),o===e?(o=s,s=0):o=Ke(o)),s>o){var d=s;s=o,o=d}if(h||s%1||o%1){var m=Yl();return Ut(s+m*(o-s+eg("1e-"+((m+"").length-1))),o)}return Ao(s,o)}var Sb=ni(function(s,o,h){return o=o.toLowerCase(),s+(h?wh(o):o)});function wh(s){return Jo(ut(s).toLowerCase())}function Mh(s){return s=ut(s),s&&s.replace(kd,gg).replace(Yd,"")}function Ab(s,o,h){s=ut(s),o=oe(o);var d=s.length;h=h===e?d:Pn(tt(h),0,d);var m=h;return h-=o.length,h>=0&&s.slice(h,m)==o}function kb(s){return s=ut(s),s&&od.test(s)?s.replace(tl,pg):s}function Pb(s){return s=ut(s),s&&fd.test(s)?s.replace(Xr,"\\$&"):s}var Cb=ni(function(s,o,h){return s+(h?"-":"")+o.toLowerCase()}),Tb=ni(function(s,o,h){return s+(h?" ":"")+o.toLowerCase()}),Ob=kc("toLowerCase");function Db(s,o,h){s=ut(s),o=tt(o);var d=o?qn(s):0;if(!o||d>=o)return s;var m=(o-d)/2;return Ws(ks(m),h)+s+Ws(As(m),h)}function Lb(s,o,h){s=ut(s),o=tt(o);var d=o?qn(s):0;return o&&d<o?s+Ws(o-d,h):s}function Rb(s,o,h){s=ut(s),o=tt(o);var d=o?qn(s):0;return o&&d<o?Ws(o-d,h)+s:s}function Eb(s,o,h){return h||o==null?o=0:o&&(o=+o),Hg(ut(s).replace(Gr,""),o||0)}function Ib(s,o,h){return(h?jt(s,o,h):o===e)?o=1:o=tt(o),ko(ut(s),o)}function Fb(){var s=arguments,o=ut(s[0]);return s.length<3?o:o.replace(s[1],s[2])}var Bb=ni(function(s,o,h){return s+(h?"_":"")+o.toLowerCase()});function zb(s,o,h){return h&&typeof h!="number"&&jt(s,o,h)&&(o=h=e),h=h===e?Kt:h>>>0,h?(s=ut(s),s&&(typeof o=="string"||o!=null&&!qo(o))&&(o=oe(o),!o&&Kn(s))?un(ke(s),0,h):s.split(o,h)):[]}var Wb=ni(function(s,o,h){return s+(h?" ":"")+Jo(o)});function Nb(s,o,h){return s=ut(s),h=h==null?0:Pn(tt(h),0,s.length),o=oe(o),s.slice(h,h+o.length)==o}function Hb(s,o,h){var d=b.templateSettings;h&&jt(s,o,h)&&(o=e),s=ut(s),o=Zs({},o,d,Rc);var m=Zs({},o.imports,d.imports,Rc),x=zt(m),v=lo(m,x),S,P,R=0,E=o.interpolate||hs,B="__p += '",H=ho((o.escape||hs).source+"|"+E.source+"|"+(E===el?yd:hs).source+"|"+(o.evaluate||hs).source+"|$","g"),$="//# sourceURL="+(gt.call(o,"sourceURL")?(o.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++jd+"]")+`
`;s.replace(H,function(K,it,ot,le,Zt,ce){return ot||(ot=le),B+=s.slice(R,ce).replace(Pd,mg),it&&(S=!0,B+=`' +
__e(`+it+`) +
'`),Zt&&(P=!0,B+=`';
`+Zt+`;
__p += '`),ot&&(B+=`' +
((__t = (`+ot+`)) == null ? '' : __t) +
'`),R=ce+K.length,K}),B+=`';
`;var G=gt.call(o,"variable")&&o.variable;if(!G)B=`with (obj) {
`+B+`
}
`;else if(bd.test(G))throw new q(c);B=(P?B.replace(nd,""):B).replace(id,"$1").replace(sd,"$1;"),B="function("+(G||"obj")+`) {
`+(G?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(S?", __e = _.escape":"")+(P?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+B+`return __p
}`;var et=Ah(function(){return ct(x,$+"return "+B).apply(e,v)});if(et.source=B,Ko(et))throw et;return et}function Vb(s){return ut(s).toLowerCase()}function Ub(s){return ut(s).toUpperCase()}function $b(s,o,h){if(s=ut(s),s&&(h||o===e))return El(s);if(!s||!(o=oe(o)))return s;var d=ke(s),m=ke(o),x=Il(d,m),v=Fl(d,m)+1;return un(d,x,v).join("")}function Yb(s,o,h){if(s=ut(s),s&&(h||o===e))return s.slice(0,zl(s)+1);if(!s||!(o=oe(o)))return s;var d=ke(s),m=Fl(d,ke(o))+1;return un(d,0,m).join("")}function Xb(s,o,h){if(s=ut(s),s&&(h||o===e))return s.replace(Gr,"");if(!s||!(o=oe(o)))return s;var d=ke(s),m=Il(d,ke(o));return un(d,m).join("")}function Gb(s,o){var h=J,d=Q;if(At(o)){var m="separator"in o?o.separator:m;h="length"in o?tt(o.length):h,d="omission"in o?oe(o.omission):d}s=ut(s);var x=s.length;if(Kn(s)){var v=ke(s);x=v.length}if(h>=x)return s;var S=h-qn(d);if(S<1)return d;var P=v?un(v,0,S).join(""):s.slice(0,S);if(m===e)return P+d;if(v&&(S+=P.length-S),qo(m)){if(s.slice(S).search(m)){var R,E=P;for(m.global||(m=ho(m.source,ut(nl.exec(m))+"g")),m.lastIndex=0;R=m.exec(E);)var B=R.index;P=P.slice(0,B===e?S:B)}}else if(s.indexOf(oe(m),S)!=S){var H=P.lastIndexOf(m);H>-1&&(P=P.slice(0,H))}return P+d}function Kb(s){return s=ut(s),s&&rd.test(s)?s.replace(Qa,Mg):s}var qb=ni(function(s,o,h){return s+(h?" ":"")+o.toUpperCase()}),Jo=kc("toUpperCase");function Sh(s,o,h){return s=ut(s),o=h?e:o,o===e?bg(s)?kg(s):cg(s):s.match(o)||[]}var Ah=nt(function(s,o){try{return se(s,e,o)}catch(h){return Ko(h)?h:new q(h)}}),jb=Ye(function(s,o){return ge(o,function(h){h=Fe(h),Ue(s,h,Xo(s[h],s))}),s});function Zb(s){var o=s==null?0:s.length,h=X();return s=o?Mt(s,function(d){if(typeof d[1]!="function")throw new pe(l);return[h(d[0]),d[1]]}):[],nt(function(d){for(var m=-1;++m<o;){var x=s[m];if(se(x[0],this,d))return se(x[1],this,d)}})}function Jb(s){return Mp(_e(s,p))}function Qo(s){return function(){return s}}function Qb(s,o){return s==null||s!==s?o:s}var tx=Cc(),ex=Cc(!0);function ee(s){return s}function ta(s){return sc(typeof s=="function"?s:_e(s,p))}function nx(s){return oc(_e(s,p))}function ix(s,o){return ac(s,_e(o,p))}var sx=nt(function(s,o){return function(h){return Pi(h,s,o)}}),rx=nt(function(s,o){return function(h){return Pi(s,h,o)}});function ea(s,o,h){var d=zt(o),m=Ls(o,d);h==null&&!(At(o)&&(m.length||!d.length))&&(h=o,o=s,s=this,m=Ls(o,zt(o)));var x=!(At(h)&&"chain"in h)||!!h.chain,v=Ge(s);return ge(m,function(S){var P=o[S];s[S]=P,v&&(s.prototype[S]=function(){var R=this.__chain__;if(x||R){var E=s(this.__wrapped__),B=E.__actions__=Jt(this.__actions__);return B.push({func:P,args:arguments,thisArg:s}),E.__chain__=R,E}return P.apply(s,rn([this.value()],arguments))})}),s}function ox(){return Nt._===this&&(Nt._=Lg),this}function na(){}function ax(s){return s=tt(s),nt(function(o){return lc(o,s)})}var lx=Ro(Mt),cx=Ro(Tl),hx=Ro(io);function kh(s){return No(s)?so(Fe(s)):Np(s)}function ux(s){return function(o){return s==null?e:Cn(s,o)}}var fx=Oc(),dx=Oc(!0);function ia(){return[]}function sa(){return!1}function gx(){return{}}function px(){return""}function mx(){return!0}function _x(s,o){if(s=tt(s),s<1||s>Lt)return[];var h=Kt,d=Ut(s,Kt);o=X(o),s-=Kt;for(var m=ao(d,o);++h<s;)o(h);return m}function bx(s){return j(s)?Mt(s,Fe):ae(s)?[s]:Jt(Xc(ut(s)))}function xx(s){var o=++Og;return ut(s)+o}var yx=zs(function(s,o){return s+o},0),vx=Eo("ceil"),wx=zs(function(s,o){return s/o},1),Mx=Eo("floor");function Sx(s){return s&&s.length?Ds(s,ee,xo):e}function Ax(s,o){return s&&s.length?Ds(s,X(o,2),xo):e}function kx(s){return Ll(s,ee)}function Px(s,o){return Ll(s,X(o,2))}function Cx(s){return s&&s.length?Ds(s,ee,Mo):e}function Tx(s,o){return s&&s.length?Ds(s,X(o,2),Mo):e}var Ox=zs(function(s,o){return s*o},1),Dx=Eo("round"),Lx=zs(function(s,o){return s-o},0);function Rx(s){return s&&s.length?oo(s,ee):0}function Ex(s,o){return s&&s.length?oo(s,X(o,2)):0}return b.after=n0,b.ary=ih,b.assign=U0,b.assignIn=_h,b.assignInWith=Zs,b.assignWith=$0,b.at=Y0,b.before=sh,b.bind=Xo,b.bindAll=jb,b.bindKey=rh,b.castArray=g0,b.chain=th,b.chunk=Mm,b.compact=Sm,b.concat=Am,b.cond=Zb,b.conforms=Jb,b.constant=Qo,b.countBy=R_,b.create=X0,b.curry=oh,b.curryRight=ah,b.debounce=lh,b.defaults=G0,b.defaultsDeep=K0,b.defer=i0,b.delay=s0,b.difference=km,b.differenceBy=Pm,b.differenceWith=Cm,b.drop=Tm,b.dropRight=Om,b.dropRightWhile=Dm,b.dropWhile=Lm,b.fill=Rm,b.filter=I_,b.flatMap=z_,b.flatMapDeep=W_,b.flatMapDepth=N_,b.flatten=jc,b.flattenDeep=Em,b.flattenDepth=Im,b.flip=r0,b.flow=tx,b.flowRight=ex,b.fromPairs=Fm,b.functions=eb,b.functionsIn=nb,b.groupBy=H_,b.initial=zm,b.intersection=Wm,b.intersectionBy=Nm,b.intersectionWith=Hm,b.invert=sb,b.invertBy=rb,b.invokeMap=U_,b.iteratee=ta,b.keyBy=$_,b.keys=zt,b.keysIn=te,b.map=Ys,b.mapKeys=ab,b.mapValues=lb,b.matches=nx,b.matchesProperty=ix,b.memoize=Gs,b.merge=cb,b.mergeWith=bh,b.method=sx,b.methodOf=rx,b.mixin=ea,b.negate=Ks,b.nthArg=ax,b.omit=hb,b.omitBy=ub,b.once=o0,b.orderBy=Y_,b.over=lx,b.overArgs=a0,b.overEvery=cx,b.overSome=hx,b.partial=Go,b.partialRight=ch,b.partition=X_,b.pick=fb,b.pickBy=xh,b.property=kh,b.propertyOf=ux,b.pull=Ym,b.pullAll=Jc,b.pullAllBy=Xm,b.pullAllWith=Gm,b.pullAt=Km,b.range=fx,b.rangeRight=dx,b.rearg=l0,b.reject=q_,b.remove=qm,b.rest=c0,b.reverse=$o,b.sampleSize=Z_,b.set=gb,b.setWith=pb,b.shuffle=J_,b.slice=jm,b.sortBy=e0,b.sortedUniq=i_,b.sortedUniqBy=s_,b.split=zb,b.spread=h0,b.tail=r_,b.take=o_,b.takeRight=a_,b.takeRightWhile=l_,b.takeWhile=c_,b.tap=S_,b.throttle=u0,b.thru=$s,b.toArray=gh,b.toPairs=yh,b.toPairsIn=vh,b.toPath=bx,b.toPlainObject=mh,b.transform=mb,b.unary=f0,b.union=h_,b.unionBy=u_,b.unionWith=f_,b.uniq=d_,b.uniqBy=g_,b.uniqWith=p_,b.unset=_b,b.unzip=Yo,b.unzipWith=Qc,b.update=bb,b.updateWith=xb,b.values=ri,b.valuesIn=yb,b.without=m_,b.words=Sh,b.wrap=d0,b.xor=__,b.xorBy=b_,b.xorWith=x_,b.zip=y_,b.zipObject=v_,b.zipObjectDeep=w_,b.zipWith=M_,b.entries=yh,b.entriesIn=vh,b.extend=_h,b.extendWith=Zs,ea(b,b),b.add=yx,b.attempt=Ah,b.camelCase=Sb,b.capitalize=wh,b.ceil=vx,b.clamp=vb,b.clone=p0,b.cloneDeep=_0,b.cloneDeepWith=b0,b.cloneWith=m0,b.conformsTo=x0,b.deburr=Mh,b.defaultTo=Qb,b.divide=wx,b.endsWith=Ab,b.eq=Ce,b.escape=kb,b.escapeRegExp=Pb,b.every=E_,b.find=F_,b.findIndex=Kc,b.findKey=q0,b.findLast=B_,b.findLastIndex=qc,b.findLastKey=j0,b.floor=Mx,b.forEach=eh,b.forEachRight=nh,b.forIn=Z0,b.forInRight=J0,b.forOwn=Q0,b.forOwnRight=tb,b.get=jo,b.gt=y0,b.gte=v0,b.has=ib,b.hasIn=Zo,b.head=Zc,b.identity=ee,b.includes=V_,b.indexOf=Bm,b.inRange=wb,b.invoke=ob,b.isArguments=Dn,b.isArray=j,b.isArrayBuffer=w0,b.isArrayLike=Qt,b.isArrayLikeObject=Tt,b.isBoolean=M0,b.isBuffer=fn,b.isDate=S0,b.isElement=A0,b.isEmpty=k0,b.isEqual=P0,b.isEqualWith=C0,b.isError=Ko,b.isFinite=T0,b.isFunction=Ge,b.isInteger=hh,b.isLength=qs,b.isMap=uh,b.isMatch=O0,b.isMatchWith=D0,b.isNaN=L0,b.isNative=R0,b.isNil=I0,b.isNull=E0,b.isNumber=fh,b.isObject=At,b.isObjectLike=kt,b.isPlainObject=Ri,b.isRegExp=qo,b.isSafeInteger=F0,b.isSet=dh,b.isString=js,b.isSymbol=ae,b.isTypedArray=si,b.isUndefined=B0,b.isWeakMap=z0,b.isWeakSet=W0,b.join=Vm,b.kebabCase=Cb,b.last=xe,b.lastIndexOf=Um,b.lowerCase=Tb,b.lowerFirst=Ob,b.lt=N0,b.lte=H0,b.max=Sx,b.maxBy=Ax,b.mean=kx,b.meanBy=Px,b.min=Cx,b.minBy=Tx,b.stubArray=ia,b.stubFalse=sa,b.stubObject=gx,b.stubString=px,b.stubTrue=mx,b.multiply=Ox,b.nth=$m,b.noConflict=ox,b.noop=na,b.now=Xs,b.pad=Db,b.padEnd=Lb,b.padStart=Rb,b.parseInt=Eb,b.random=Mb,b.reduce=G_,b.reduceRight=K_,b.repeat=Ib,b.replace=Fb,b.result=db,b.round=Dx,b.runInContext=k,b.sample=j_,b.size=Q_,b.snakeCase=Bb,b.some=t0,b.sortedIndex=Zm,b.sortedIndexBy=Jm,b.sortedIndexOf=Qm,b.sortedLastIndex=t_,b.sortedLastIndexBy=e_,b.sortedLastIndexOf=n_,b.startCase=Wb,b.startsWith=Nb,b.subtract=Lx,b.sum=Rx,b.sumBy=Ex,b.template=Hb,b.times=_x,b.toFinite=Ke,b.toInteger=tt,b.toLength=ph,b.toLower=Vb,b.toNumber=ye,b.toSafeInteger=V0,b.toString=ut,b.toUpper=Ub,b.trim=$b,b.trimEnd=Yb,b.trimStart=Xb,b.truncate=Gb,b.unescape=Kb,b.uniqueId=xx,b.upperCase=qb,b.upperFirst=Jo,b.each=eh,b.eachRight=nh,b.first=Zc,ea(b,function(){var s={};return Ee(b,function(o,h){gt.call(b.prototype,h)||(s[h]=o)}),s}(),{chain:!1}),b.VERSION=i,ge(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){b[s].placeholder=b}),ge(["drop","take"],function(s,o){st.prototype[s]=function(h){h=h===e?1:It(tt(h),0);var d=this.__filtered__&&!o?new st(this):this.clone();return d.__filtered__?d.__takeCount__=Ut(h,d.__takeCount__):d.__views__.push({size:Ut(h,Kt),type:s+(d.__dir__<0?"Right":"")}),d},st.prototype[s+"Right"]=function(h){return this.reverse()[s](h).reverse()}}),ge(["filter","map","takeWhile"],function(s,o){var h=o+1,d=h==Vt||h==_t;st.prototype[s]=function(m){var x=this.clone();return x.__iteratees__.push({iteratee:X(m,3),type:h}),x.__filtered__=x.__filtered__||d,x}}),ge(["head","last"],function(s,o){var h="take"+(o?"Right":"");st.prototype[s]=function(){return this[h](1).value()[0]}}),ge(["initial","tail"],function(s,o){var h="drop"+(o?"":"Right");st.prototype[s]=function(){return this.__filtered__?new st(this):this[h](1)}}),st.prototype.compact=function(){return this.filter(ee)},st.prototype.find=function(s){return this.filter(s).head()},st.prototype.findLast=function(s){return this.reverse().find(s)},st.prototype.invokeMap=nt(function(s,o){return typeof s=="function"?new st(this):this.map(function(h){return Pi(h,s,o)})}),st.prototype.reject=function(s){return this.filter(Ks(X(s)))},st.prototype.slice=function(s,o){s=tt(s);var h=this;return h.__filtered__&&(s>0||o<0)?new st(h):(s<0?h=h.takeRight(-s):s&&(h=h.drop(s)),o!==e&&(o=tt(o),h=o<0?h.dropRight(-o):h.take(o-s)),h)},st.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},st.prototype.toArray=function(){return this.take(Kt)},Ee(st.prototype,function(s,o){var h=/^(?:filter|find|map|reject)|While$/.test(o),d=/^(?:head|last)$/.test(o),m=b[d?"take"+(o=="last"?"Right":""):o],x=d||/^find/.test(o);m&&(b.prototype[o]=function(){var v=this.__wrapped__,S=d?[1]:arguments,P=v instanceof st,R=S[0],E=P||j(v),B=function(it){var ot=m.apply(b,rn([it],S));return d&&H?ot[0]:ot};E&&h&&typeof R=="function"&&R.length!=1&&(P=E=!1);var H=this.__chain__,$=!!this.__actions__.length,G=x&&!H,et=P&&!$;if(!x&&E){v=et?v:new st(this);var K=s.apply(v,S);return K.__actions__.push({func:$s,args:[B],thisArg:e}),new me(K,H)}return G&&et?s.apply(this,S):(K=this.thru(B),G?d?K.value()[0]:K.value():K)})}),ge(["pop","push","shift","sort","splice","unshift"],function(s){var o=ms[s],h=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",d=/^(?:pop|shift)$/.test(s);b.prototype[s]=function(){var m=arguments;if(d&&!this.__chain__){var x=this.value();return o.apply(j(x)?x:[],m)}return this[h](function(v){return o.apply(j(v)?v:[],m)})}}),Ee(st.prototype,function(s,o){var h=b[o];if(h){var d=h.name+"";gt.call(Qn,d)||(Qn[d]=[]),Qn[d].push({name:o,func:h})}}),Qn[Bs(e,C).name]=[{name:"wrapper",func:e}],st.prototype.clone=Kg,st.prototype.reverse=qg,st.prototype.value=jg,b.prototype.at=A_,b.prototype.chain=k_,b.prototype.commit=P_,b.prototype.next=C_,b.prototype.plant=O_,b.prototype.reverse=D_,b.prototype.toJSON=b.prototype.valueOf=b.prototype.value=L_,b.prototype.first=b.prototype.head,yi&&(b.prototype[yi]=T_),b},jn=Pg();Mn?((Mn.exports=jn)._=jn,Qr._=jn):Nt._=jn}).call(Ei)})(Ux,ya);/*!
* @kurkle/color v0.3.2
* https://github.com/kurkle/color#readme
* (c) 2023 Jukka Kurkela
* Released under the MIT License
*/function ss(n){return n+.5|0}const dn=(n,t,e)=>Math.max(Math.min(n,e),t);function Ni(n){return dn(ss(n*2.55),0,255)}function _n(n){return dn(ss(n*255),0,255)}function Qe(n){return dn(ss(n/2.55)/100,0,1)}function Ch(n){return dn(ss(n*100),0,100)}const ve={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},va=[..."0123456789ABCDEF"],$x=n=>va[n&15],Yx=n=>va[(n&240)>>4]+va[n&15],Js=n=>(n&240)>>4===(n&15),Xx=n=>Js(n.r)&&Js(n.g)&&Js(n.b)&&Js(n.a);function Gx(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&ve[n[1]]*17,g:255&ve[n[2]]*17,b:255&ve[n[3]]*17,a:t===5?ve[n[4]]*17:255}:(t===7||t===9)&&(e={r:ve[n[1]]<<4|ve[n[2]],g:ve[n[3]]<<4|ve[n[4]],b:ve[n[5]]<<4|ve[n[6]],a:t===9?ve[n[7]]<<4|ve[n[8]]:255})),e}const Kx=(n,t)=>n<255?t(n):"";function qx(n){var t=Xx(n)?$x:Yx;return n?"#"+t(n.r)+t(n.g)+t(n.b)+Kx(n.a,t):void 0}const jx=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Zu(n,t,e){const i=t*Math.min(e,1-e),r=(a,l=(a+n/30)%12)=>e-i*Math.max(Math.min(l-3,9-l,1),-1);return[r(0),r(8),r(4)]}function Zx(n,t,e){const i=(r,a=(r+n/60)%6)=>e-e*t*Math.max(Math.min(a,4-a,1),0);return[i(5),i(3),i(1)]}function Jx(n,t,e){const i=Zu(n,1,.5);let r;for(t+e>1&&(r=1/(t+e),t*=r,e*=r),r=0;r<3;r++)i[r]*=1-t-e,i[r]+=t;return i}function Qx(n,t,e,i,r){return n===r?(t-e)/i+(t<e?6:0):t===r?(e-n)/i+2:(n-t)/i+4}function Fa(n){const e=n.r/255,i=n.g/255,r=n.b/255,a=Math.max(e,i,r),l=Math.min(e,i,r),c=(a+l)/2;let u,f,g;return a!==l&&(g=a-l,f=c>.5?g/(2-a-l):g/(a+l),u=Qx(e,i,r,g,a),u=u*60+.5),[u|0,f||0,c]}function Ba(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(_n)}function za(n,t,e){return Ba(Zu,n,t,e)}function ty(n,t,e){return Ba(Jx,n,t,e)}function ey(n,t,e){return Ba(Zx,n,t,e)}function Ju(n){return(n%360+360)%360}function ny(n){const t=jx.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?Ni(+t[5]):_n(+t[5]));const r=Ju(+t[2]),a=+t[3]/100,l=+t[4]/100;return t[1]==="hwb"?i=ty(r,a,l):t[1]==="hsv"?i=ey(r,a,l):i=za(r,a,l),{r:i[0],g:i[1],b:i[2],a:e}}function iy(n,t){var e=Fa(n);e[0]=Ju(e[0]+t),e=za(e),n.r=e[0],n.g=e[1],n.b=e[2]}function sy(n){if(!n)return;const t=Fa(n),e=t[0],i=Ch(t[1]),r=Ch(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${r}%, ${Qe(n.a)})`:`hsl(${e}, ${i}%, ${r}%)`}const Th={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"},Oh={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function ry(){const n={},t=Object.keys(Oh),e=Object.keys(Th);let i,r,a,l,c;for(i=0;i<t.length;i++){for(l=c=t[i],r=0;r<e.length;r++)a=e[r],c=c.replace(a,Th[a]);a=parseInt(Oh[l],16),n[c]=[a>>16&255,a>>8&255,a&255]}return n}let Qs;function oy(n){Qs||(Qs=ry(),Qs.transparent=[0,0,0,0]);const t=Qs[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const ay=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function ly(n){const t=ay.exec(n);let e=255,i,r,a;if(t){if(t[7]!==i){const l=+t[7];e=t[8]?Ni(l):dn(l*255,0,255)}return i=+t[1],r=+t[3],a=+t[5],i=255&(t[2]?Ni(i):dn(i,0,255)),r=255&(t[4]?Ni(r):dn(r,0,255)),a=255&(t[6]?Ni(a):dn(a,0,255)),{r:i,g:r,b:a,a:e}}}function cy(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${Qe(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const oa=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,oi=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function hy(n,t,e){const i=oi(Qe(n.r)),r=oi(Qe(n.g)),a=oi(Qe(n.b));return{r:_n(oa(i+e*(oi(Qe(t.r))-i))),g:_n(oa(r+e*(oi(Qe(t.g))-r))),b:_n(oa(a+e*(oi(Qe(t.b))-a))),a:n.a+e*(t.a-n.a)}}function tr(n,t,e){if(n){let i=Fa(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=za(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Qu(n,t){return n&&Object.assign(t||{},n)}function Dh(n){var t={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(t={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(t.a=_n(n[3]))):(t=Qu(n,{r:0,g:0,b:0,a:1}),t.a=_n(t.a)),t}function uy(n){return n.charAt(0)==="r"?ly(n):ny(n)}class ji{constructor(t){if(t instanceof ji)return t;const e=typeof t;let i;e==="object"?i=Dh(t):e==="string"&&(i=Gx(t)||oy(t)||uy(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Qu(this._rgb);return t&&(t.a=Qe(t.a)),t}set rgb(t){this._rgb=Dh(t)}rgbString(){return this._valid?cy(this._rgb):void 0}hexString(){return this._valid?qx(this._rgb):void 0}hslString(){return this._valid?sy(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,r=t.rgb;let a;const l=e===a?.5:e,c=2*l-1,u=i.a-r.a,f=((c*u===-1?c:(c+u)/(1+c*u))+1)/2;a=1-f,i.r=255&f*i.r+a*r.r+.5,i.g=255&f*i.g+a*r.g+.5,i.b=255&f*i.b+a*r.b+.5,i.a=l*i.a+(1-l)*r.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=hy(this._rgb,t._rgb,e)),this}clone(){return new ji(this.rgb)}alpha(t){return this._rgb.a=_n(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=ss(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.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 tr(this._rgb,2,t),this}darken(t){return tr(this._rgb,2,-t),this}saturate(t){return tr(this._rgb,1,t),this}desaturate(t){return tr(this._rgb,1,-t),this}rotate(t){return iy(this._rgb,t),this}}/*!
* Chart.js v4.2.1
* https://www.chartjs.org
* (c) 2023 Chart.js Contributors
* Released under the MIT License
*/function je(){}const fy=(()=>{let n=0;return()=>n++})();function lt(n){return n===null||typeof n>"u"}function vt(n){if(Array.isArray&&Array.isArray(n))return!0;const t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function rt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function Pt(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function he(n,t){return Pt(n)?n:t}function Z(n,t){return typeof n>"u"?t:n}const dy=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,tf=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function xt(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function pt(n,t,e,i){let r,a,l;if(vt(n))if(a=n.length,i)for(r=a-1;r>=0;r--)t.call(e,n[r],r);else for(r=0;r<a;r++)t.call(e,n[r],r);else if(rt(n))for(l=Object.keys(n),a=l.length,r=0;r<a;r++)t.call(e,n[l[r]],l[r])}function Mr(n,t){let e,i,r,a;if(!n||!t||n.length!==t.length)return!1;for(e=0,i=n.length;e<i;++e)if(r=n[e],a=t[e],r.datasetIndex!==a.datasetIndex||r.index!==a.index)return!1;return!0}function Sr(n){if(vt(n))return n.map(Sr);if(rt(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let r=0;for(;r<i;++r)t[e[r]]=Sr(n[e[r]]);return t}return n}function ef(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function gy(n,t,e,i){if(!ef(n))return;const r=t[n],a=e[n];rt(r)&&rt(a)?Zi(r,a,i):t[n]=Sr(a)}function Zi(n,t,e){const i=vt(t)?t:[t],r=i.length;if(!rt(n))return n;e=e||{};const a=e.merger||gy;let l;for(let c=0;c<r;++c){if(l=i[c],!rt(l))continue;const u=Object.keys(l);for(let f=0,g=u.length;f<g;++f)a(u[f],n,l,e)}return n}function Yi(n,t){return Zi(n,t,{merger:py})}function py(n,t,e){if(!ef(n))return;const i=t[n],r=e[n];rt(i)&&rt(r)?Yi(i,r):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=Sr(r))}const Lh={"":n=>n,x:n=>n.x,y:n=>n.y};function my(n){const t=n.split("."),e=[];let i="";for(const r of t)i+=r,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function _y(n){const t=my(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function bn(n,t){return(Lh[t]||(Lh[t]=_y(t)))(n)}function Wa(n){return n.charAt(0).toUpperCase()+n.slice(1)}const we=n=>typeof n<"u",xn=n=>typeof n=="function",Rh=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function by(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const St=Math.PI,wt=2*St,xy=wt+St,Ar=Number.POSITIVE_INFINITY,yy=St/180,Ct=St/2,Ln=St/4,Eh=St*2/3,gn=Math.log10,We=Math.sign;function Xi(n,t,e){return Math.abs(n-t)<e}function Ih(n){const t=Math.round(n);n=Xi(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(gn(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function vy(n){const t=[],e=Math.sqrt(n);let i;for(i=1;i<e;i++)n%i===0&&(t.push(i),t.push(n/i));return e===(e|0)&&t.push(e),t.sort((r,a)=>r-a).pop(),t}function ci(n){return!isNaN(parseFloat(n))&&isFinite(n)}function wy(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function nf(n,t,e){let i,r,a;for(i=0,r=n.length;i<r;i++)a=n[i][e],isNaN(a)||(t.min=Math.min(t.min,a),t.max=Math.max(t.max,a))}function Oe(n){return n*(St/180)}function Na(n){return n*(180/St)}function Fh(n){if(!Pt(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function sf(n,t){const e=t.x-n.x,i=t.y-n.y,r=Math.sqrt(e*e+i*i);let a=Math.atan2(i,e);return a<-.5*St&&(a+=wt),{angle:a,distance:r}}function wa(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function My(n,t){return(n-t+xy)%wt-St}function ue(n){return(n%wt+wt)%wt}function Ji(n,t,e,i){const r=ue(n),a=ue(t),l=ue(e),c=ue(a-r),u=ue(l-r),f=ue(r-a),g=ue(r-l);return r===a||r===l||i&&a===l||c>u&&f<g}function Wt(n,t,e){return Math.max(t,Math.min(e,n))}function Sy(n){return Wt(n,-32768,32767)}function tn(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function Ha(n,t,e){e=e||(l=>n[l]<t);let i=n.length-1,r=0,a;for(;i-r>1;)a=r+i>>1,e(a)?r=a:i=a;return{lo:r,hi:i}}const en=(n,t,e,i)=>Ha(n,e,i?r=>{const a=n[r][t];return a<e||a===e&&n[r+1][t]===e}:r=>n[r][t]<e),Ay=(n,t,e)=>Ha(n,e,i=>n[i][t]>=e);function ky(n,t,e){let i=0,r=n.length;for(;i<r&&n[i]<t;)i++;for(;r>i&&n[r-1]>e;)r--;return i>0||r<n.length?n.slice(i,r):n}const rf=["push","pop","shift","splice","unshift"];function Py(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),rf.forEach(e=>{const i="_onData"+Wa(e),r=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...a){const l=r.apply(this,a);return n._chartjs.listeners.forEach(c=>{typeof c[i]=="function"&&c[i](...a)}),l}})})}function Bh(n,t){const e=n._chartjs;if(!e)return;const i=e.listeners,r=i.indexOf(t);r!==-1&&i.splice(r,1),!(i.length>0)&&(rf.forEach(a=>{delete n[a]}),delete n._chartjs)}function of(n){const t=new Set;let e,i;for(e=0,i=n.length;e<i;++e)t.add(n[e]);return t.size===i?n:Array.from(t)}const af=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function lf(n,t){let e=[],i=!1;return function(...r){e=r,i||(i=!0,af.call(window,()=>{i=!1,n.apply(t,e)}))}}function Cy(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const Va=n=>n==="start"?"left":n==="end"?"right":"center",Yt=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,Ty=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function cf(n,t,e){const i=t.length;let r=0,a=i;if(n._sorted){const{iScale:l,_parsed:c}=n,u=l.axis,{min:f,max:g,minDefined:p,maxDefined:_}=l.getUserBounds();p&&(r=Wt(Math.min(en(c,l.axis,f).lo,e?i:en(t,u,l.getPixelForValue(f)).lo),0,i-1)),_?a=Wt(Math.max(en(c,l.axis,g,!0).hi+1,e?0:en(t,u,l.getPixelForValue(g),!0).hi+1),r,i)-r:a=i-r}return{start:r,count:a}}function hf(n){const{xScale:t,yScale:e,_scaleRanges:i}=n,r={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=r,!0;const a=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,r),a}const er=n=>n===0||n===1,zh=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*wt/e)),Wh=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*wt/e)+1,Gi={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*Ct)+1,easeOutSine:n=>Math.sin(n*Ct),easeInOutSine:n=>-.5*(Math.cos(St*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>er(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>er(n)?n:zh(n,.075,.3),easeOutElastic:n=>er(n)?n:Wh(n,.075,.3),easeInOutElastic(n){return er(n)?n:n<.5?.5*zh(n*2,.1125,.45):.5+.5*Wh(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let t=1.70158;return(n/=.5)<1?.5*(n*n*(((t*=1.525)+1)*n-t)):.5*((n-=2)*n*(((t*=1.525)+1)*n+t)+2)},easeInBounce:n=>1-Gi.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?Gi.easeInBounce(n*2)*.5:Gi.easeOutBounce(n*2-1)*.5+.5};function uf(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Nh(n){return uf(n)?n:new ji(n)}function aa(n){return uf(n)?n:new ji(n).saturate(.5).darken(.1).hexString()}const Oy=["x","y","borderWidth","radius","tension"],Dy=["color","borderColor","backgroundColor"];function Ly(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),n.set("animations",{colors:{type:"color",properties:Dy},numbers:{type:"number",properties:Oy}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function Ry(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Hh=new Map;function Ey(n,t){t=t||{};const e=n+JSON.stringify(t);let i=Hh.get(e);return i||(i=new Intl.NumberFormat(n,t),Hh.set(e,i)),i}function rs(n,t,e){return Ey(t,e).format(n)}const ff={values(n){return vt(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const i=this.chart.options.locale;let r,a=n;if(e.length>1){const f=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(f<1e-4||f>1e15)&&(r="scientific"),a=Iy(n,e)}const l=gn(Math.abs(a)),c=Math.max(Math.min(-1*Math.floor(l),20),0),u={notation:r,minimumFractionDigits:c,maximumFractionDigits:c};return Object.assign(u,this.options.ticks.format),rs(n,i,u)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(gn(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?ff.numeric.call(this,n,t,e):""}};function Iy(n,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&n!==Math.floor(n)&&(e=n-Math.floor(n)),e}var Lr={formatters:ff};function Fy(n){n.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:Lr.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Vn=Object.create(null),Ma=Object.create(null);function Ki(n,t){if(!t)return n;const e=t.split(".");for(let i=0,r=e.length;i<r;++i){const a=e[i];n=n[a]||(n[a]=Object.create(null))}return n}function la(n,t,e){return typeof t=="string"?Zi(Ki(n,t),e):Zi(Ki(n,""),t)}class By{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=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,r)=>aa(r.backgroundColor),this.hoverBorderColor=(i,r)=>aa(r.borderColor),this.hoverColor=(i,r)=>aa(r.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return la(this,t,e)}get(t){return Ki(this,t)}describe(t,e){return la(Ma,t,e)}override(t,e){return la(Vn,t,e)}route(t,e,i,r){const a=Ki(this,t),l=Ki(this,i),c="_"+e;Object.defineProperties(a,{[c]:{value:a[e],writable:!0},[e]:{enumerable:!0,get(){const u=this[c],f=l[r];return rt(u)?Object.assign({},f,u):Z(u,f)},set(u){this[c]=u}}})}apply(t){t.forEach(e=>e(this))}}var Dt=new By({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Ly,Ry,Fy]);function zy(n){return!n||lt(n.size)||lt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function kr(n,t,e,i,r){let a=t[r];return a||(a=t[r]=n.measureText(r).width,e.push(r)),a>i&&(i=a),i}function Wy(n,t,e,i){i=i||{};let r=i.data=i.data||{},a=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(r=i.data={},a=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let l=0;const c=e.length;let u,f,g,p,_;for(u=0;u<c;u++)if(p=e[u],p!=null&&vt(p)!==!0)l=kr(n,r,a,l,p);else if(vt(p))for(f=0,g=p.length;f<g;f++)_=p[f],_!=null&&!vt(_)&&(l=kr(n,r,a,l,_));n.restore();const y=a.length/2;if(y>e.length){for(u=0;u<y;u++)delete r[a[u]];a.splice(0,y)}return l}function Rn(n,t,e){const i=n.currentDevicePixelRatio,r=e!==0?Math.max(e/2,.5):0;return Math.round((t-r)*i)/i+r}function Vh(n,t){t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore()}function Sa(n,t,e,i){df(n,t,e,i,null)}function df(n,t,e,i,r){let a,l,c,u,f,g,p,_;const y=t.pointStyle,w=t.rotation,M=t.radius;let A=(w||0)*yy;if(y&&typeof y=="object"&&(a=y.toString(),a==="[object HTMLImageElement]"||a==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(A),n.drawImage(y,-y.width/2,-y.height/2,y.width,y.height),n.restore();return}if(!(isNaN(M)||M<=0)){switch(n.beginPath(),y){default:r?n.ellipse(e,i,r/2,M,0,0,wt):n.arc(e,i,M,0,wt),n.closePath();break;case"triangle":g=r?r/2:M,n.moveTo(e+Math.sin(A)*g,i-Math.cos(A)*M),A+=Eh,n.lineTo(e+Math.sin(A)*g,i-Math.cos(A)*M),A+=Eh,n.lineTo(e+Math.sin(A)*g,i-Math.cos(A)*M),n.closePath();break;case"rectRounded":f=M*.516,u=M-f,l=Math.cos(A+Ln)*u,p=Math.cos(A+Ln)*(r?r/2-f:u),c=Math.sin(A+Ln)*u,_=Math.sin(A+Ln)*(r?r/2-f:u),n.arc(e-p,i-c,f,A-St,A-Ct),n.arc(e+_,i-l,f,A-Ct,A),n.arc(e+p,i+c,f,A,A+Ct),n.arc(e-_,i+l,f,A+Ct,A+St),n.closePath();break;case"rect":if(!w){u=Math.SQRT1_2*M,g=r?r/2:u,n.rect(e-g,i-u,2*g,2*u);break}A+=Ln;case"rectRot":p=Math.cos(A)*(r?r/2:M),l=Math.cos(A)*M,c=Math.sin(A)*M,_=Math.sin(A)*(r?r/2:M),n.moveTo(e-p,i-c),n.lineTo(e+_,i-l),n.lineTo(e+p,i+c),n.lineTo(e-_,i+l),n.closePath();break;case"crossRot":A+=Ln;case"cross":p=Math.cos(A)*(r?r/2:M),l=Math.cos(A)*M,c=Math.sin(A)*M,_=Math.sin(A)*(r?r/2:M),n.moveTo(e-p,i-c),n.lineTo(e+p,i+c),n.moveTo(e+_,i-l),n.lineTo(e-_,i+l);break;case"star":p=Math.cos(A)*(r?r/2:M),l=Math.cos(A)*M,c=Math.sin(A)*M,_=Math.sin(A)*(r?r/2:M),n.moveTo(e-p,i-c),n.lineTo(e+p,i+c),n.moveTo(e+_,i-l),n.lineTo(e-_,i+l),A+=Ln,p=Math.cos(A)*(r?r/2:M),l=Math.cos(A)*M,c=Math.sin(A)*M,_=Math.sin(A)*(r?r/2:M),n.moveTo(e-p,i-c),n.lineTo(e+p,i+c),n.moveTo(e+_,i-l),n.lineTo(e-_,i+l);break;case"line":l=r?r/2:Math.cos(A)*M,c=Math.sin(A)*M,n.moveTo(e-l,i-c),n.lineTo(e+l,i+c);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(A)*(r?r/2:M),i+Math.sin(A)*M);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function Qi(n,t,e){return e=e||.5,!t||n&&n.x>t.left-e&&n.x<t.right+e&&n.y>t.top-e&&n.y<t.bottom+e}function Rr(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function Er(n){n.restore()}function Ny(n,t,e,i,r){if(!t)return n.lineTo(e.x,e.y);if(r==="middle"){const a=(t.x+e.x)/2;n.lineTo(a,t.y),n.lineTo(a,e.y)}else r==="after"!=!!i?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function Hy(n,t,e,i){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function Un(n,t,e,i,r,a={}){const l=vt(t)?t:[t],c=a.strokeWidth>0&&a.strokeColor!=="";let u,f;for(n.save(),n.font=r.string,Vy(n,a),u=0;u<l.length;++u)f=l[u],a.backdrop&&$y(n,a.backdrop),c&&(a.strokeColor&&(n.strokeStyle=a.strokeColor),lt(a.strokeWidth)||(n.lineWidth=a.strokeWidth),n.strokeText(f,e,i,a.maxWidth)),n.fillText(f,e,i,a.maxWidth),Uy(n,e,i,f,a),i+=r.lineHeight;n.restore()}function Vy(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),lt(t.rotation)||n.rotate(t.rotation),t.color&&(n.fillStyle=t.color),t.textAlign&&(n.textAlign=t.textAlign),t.textBaseline&&(n.textBaseline=t.textBaseline)}function Uy(n,t,e,i,r){if(r.strikethrough||r.underline){const a=n.measureText(i),l=t-a.actualBoundingBoxLeft,c=t+a.actualBoundingBoxRight,u=e-a.actualBoundingBoxAscent,f=e+a.actualBoundingBoxDescent,g=r.strikethrough?(u+f)/2:f;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=r.decorationWidth||2,n.moveTo(l,g),n.lineTo(c,g),n.stroke()}}function $y(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function ts(n,t){const{x:e,y:i,w:r,h:a,radius:l}=t;n.arc(e+l.topLeft,i+l.topLeft,l.topLeft,-Ct,St,!0),n.lineTo(e,i+a-l.bottomLeft),n.arc(e+l.bottomLeft,i+a-l.bottomLeft,l.bottomLeft,St,Ct,!0),n.lineTo(e+r-l.bottomRight,i+a),n.arc(e+r-l.bottomRight,i+a-l.bottomRight,l.bottomRight,Ct,0,!0),n.lineTo(e+r,i+l.topRight),n.arc(e+r-l.topRight,i+l.topRight,l.topRight,0,-Ct,!0),n.lineTo(e+l.topLeft,i)}const Yy=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Xy=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Gy(n,t){const e=(""+n).match(Yy);if(!e||e[1]==="normal")return t*1.2;switch(n=+e[2],e[3]){case"px":return n;case"%":n/=100;break}return t*n}const Ky=n=>+n||0;function Ua(n,t){const e={},i=rt(t),r=i?Object.keys(t):t,a=rt(n)?i?l=>Z(n[l],n[t[l]]):l=>n[l]:()=>n;for(const l of r)e[l]=Ky(a(l));return e}function gf(n){return Ua(n,{top:"y",right:"x",bottom:"y",left:"x"})}function Nn(n){return Ua(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Gt(n){const t=gf(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Ft(n,t){n=n||{},t=t||Dt.font;let e=Z(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=Z(n.style,t.style);i&&!(""+i).match(Xy)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:Z(n.family,t.family),lineHeight:Gy(Z(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:Z(n.weight,t.weight),string:""};return r.string=zy(r),r}function Hi(n,t,e,i){let r=!0,a,l,c;for(a=0,l=n.length;a<l;++a)if(c=n[a],c!==void 0&&(t!==void 0&&typeof c=="function"&&(c=c(t),r=!1),e!==void 0&&vt(c)&&(c=c[e%c.length],r=!1),c!==void 0))return i&&!r&&(i.cacheable=!1),c}function qy(n,t,e){const{min:i,max:r}=n,a=tf(t,(r-i)/2),l=(c,u)=>e&&c===0?0:c+u;return{min:l(i,-Math.abs(a)),max:l(r,a)}}function yn(n,t){return Object.assign(Object.create(n),t)}function $a(n,t=[""],e=n,i,r=()=>n[0]){we(i)||(i=bf("_fallback",n));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:e,_fallback:i,_getTarget:r,override:l=>$a([l,...n],t,e,i)};return new Proxy(a,{deleteProperty(l,c){return delete l[c],delete l._keys,delete n[0][c],!0},get(l,c){return mf(l,c,()=>iv(c,t,n,l))},getOwnPropertyDescriptor(l,c){return Reflect.getOwnPropertyDescriptor(l._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(l,c){return $h(l).includes(c)},ownKeys(l){return $h(l)},set(l,c,u){const f=l._storage||(l._storage=r());return l[c]=f[c]=u,delete l._keys,!0}})}function hi(n,t,e,i){const r={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:pf(n,i),setContext:a=>hi(n,a,e,i),override:a=>hi(n.override(a),t,e,i)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete n[l],!0},get(a,l,c){return mf(a,l,()=>Zy(a,l,c))},getOwnPropertyDescriptor(a,l){return a._descriptors.allKeys?Reflect.has(n,l)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,l)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(a,l){return Reflect.has(n,l)},ownKeys(){return Reflect.ownKeys(n)},set(a,l,c){return n[l]=c,delete a[l],!0}})}function pf(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:r=t.allKeys}=n;return{allKeys:r,scriptable:e,indexable:i,isScriptable:xn(e)?e:()=>e,isIndexable:xn(i)?i:()=>i}}const jy=(n,t)=>n?n+Wa(t):t,Ya=(n,t)=>rt(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function mf(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t))return n[t];const i=e();return n[t]=i,i}function Zy(n,t,e){const{_proxy:i,_context:r,_subProxy:a,_descriptors:l}=n;let c=i[t];return xn(c)&&l.isScriptable(t)&&(c=Jy(t,c,n,e)),vt(c)&&c.length&&(c=Qy(t,c,n,l.isIndexable)),Ya(t,c)&&(c=hi(c,r,a&&a[t],l)),c}function Jy(n,t,e,i){const{_proxy:r,_context:a,_subProxy:l,_stack:c}=e;if(c.has(n))throw new Error("Recursion detected: "+Array.from(c).join("->")+"->"+n);return c.add(n),t=t(a,l||i),c.delete(n),Ya(n,t)&&(t=Xa(r._scopes,r,n,t)),t}function Qy(n,t,e,i){const{_proxy:r,_context:a,_subProxy:l,_descriptors:c}=e;if(we(a.index)&&i(n))t=t[a.index%t.length];else if(rt(t[0])){const u=t,f=r._scopes.filter(g=>g!==u);t=[];for(const g of u){const p=Xa(f,r,n,g);t.push(hi(p,a,l&&l[n],c))}}return t}function _f(n,t,e){return xn(n)?n(t,e):n}const tv=(n,t)=>n===!0?t:typeof n=="string"?bn(t,n):void 0;function ev(n,t,e,i,r){for(const a of t){const l=tv(e,a);if(l){n.add(l);const c=_f(l._fallback,e,r);if(we(c)&&c!==e&&c!==i)return c}else if(l===!1&&we(i)&&e!==i)return null}return!1}function Xa(n,t,e,i){const r=t._rootScopes,a=_f(t._fallback,e,i),l=[...n,...r],c=new Set;c.add(i);let u=Uh(c,l,e,a||e,i);return u===null||we(a)&&a!==e&&(u=Uh(c,l,a,u,i),u===null)?!1:$a(Array.from(c),[""],r,a,()=>nv(t,e,i))}function Uh(n,t,e,i,r){for(;e;)e=ev(n,t,e,i,r);return e}function nv(n,t,e){const i=n._getTarget();t in i||(i[t]={});const r=i[t];return vt(r)&&rt(e)?e:r||{}}function iv(n,t,e,i){let r;for(const a of t)if(r=bf(jy(a,n),e),we(r))return Ya(n,r)?Xa(e,i,n,r):r}function bf(n,t){for(const e of t){if(!e)continue;const i=e[n];if(we(i))return i}}function $h(n){let t=n._keys;return t||(t=n._keys=sv(n._scopes)),t}function sv(n){const t=new Set;for(const e of n)for(const i of Object.keys(e).filter(r=>!r.startsWith("_")))t.add(i);return Array.from(t)}function xf(n,t,e,i){const{iScale:r}=n,{key:a="r"}=this._parsing,l=new Array(i);let c,u,f,g;for(c=0,u=i;c<u;++c)f=c+e,g=t[f],l[c]={r:r.parse(bn(g,a),f)};return l}const rv=Number.EPSILON||1e-14,ui=(n,t)=>t<n.length&&!n[t].skip&&n[t],yf=n=>n==="x"?"y":"x";function ov(n,t,e,i){const r=n.skip?t:n,a=t,l=e.skip?t:e,c=wa(a,r),u=wa(l,a);let f=c/(c+u),g=u/(c+u);f=isNaN(f)?0:f,g=isNaN(g)?0:g;const p=i*f,_=i*g;return{previous:{x:a.x-p*(l.x-r.x),y:a.y-p*(l.y-r.y)},next:{x:a.x+_*(l.x-r.x),y:a.y+_*(l.y-r.y)}}}function av(n,t,e){const i=n.length;let r,a,l,c,u,f=ui(n,0);for(let g=0;g<i-1;++g)if(u=f,f=ui(n,g+1),!(!u||!f)){if(Xi(t[g],0,rv)){e[g]=e[g+1]=0;continue}r=e[g]/t[g],a=e[g+1]/t[g],c=Math.pow(r,2)+Math.pow(a,2),!(c<=9)&&(l=3/Math.sqrt(c),e[g]=r*l*t[g],e[g+1]=a*l*t[g])}}function lv(n,t,e="x"){const i=yf(e),r=n.length;let a,l,c,u=ui(n,0);for(let f=0;f<r;++f){if(l=c,c=u,u=ui(n,f+1),!c)continue;const g=c[e],p=c[i];l&&(a=(g-l[e])/3,c[`cp1${e}`]=g-a,c[`cp1${i}`]=p-a*t[f]),u&&(a=(u[e]-g)/3,c[`cp2${e}`]=g+a,c[`cp2${i}`]=p+a*t[f])}}function cv(n,t="x"){const e=yf(t),i=n.length,r=Array(i).fill(0),a=Array(i);let l,c,u,f=ui(n,0);for(l=0;l<i;++l)if(c=u,u=f,f=ui(n,l+1),!!u){if(f){const g=f[t]-u[t];r[l]=g!==0?(f[e]-u[e])/g:0}a[l]=c?f?We(r[l-1])!==We(r[l])?0:(r[l-1]+r[l])/2:r[l-1]:r[l]}av(n,r,a),lv(n,a,t)}function nr(n,t,e){return Math.max(Math.min(n,e),t)}function hv(n,t){let e,i,r,a,l,c=Qi(n[0],t);for(e=0,i=n.length;e<i;++e)l=a,a=c,c=e<i-1&&Qi(n[e+1],t),a&&(r=n[e],l&&(r.cp1x=nr(r.cp1x,t.left,t.right),r.cp1y=nr(r.cp1y,t.top,t.bottom)),c&&(r.cp2x=nr(r.cp2x,t.left,t.right),r.cp2y=nr(r.cp2y,t.top,t.bottom)))}function uv(n,t,e,i,r){let a,l,c,u;if(t.spanGaps&&(n=n.filter(f=>!f.skip)),t.cubicInterpolationMode==="monotone")cv(n,r);else{let f=i?n[n.length-1]:n[0];for(a=0,l=n.length;a<l;++a)c=n[a],u=ov(f,c,n[Math.min(a+1,l-(i?0:1))%l],t.tension),c.cp1x=u.previous.x,c.cp1y=u.previous.y,c.cp2x=u.next.x,c.cp2y=u.next.y,f=c}t.capBezierPoints&&hv(n,e)}function vf(){return typeof window<"u"&&typeof document<"u"}function Ga(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Pr(n,t,e){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=n,i}const Ir=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function fv(n,t){return Ir(n).getPropertyValue(t)}const dv=["top","right","bottom","left"];function Hn(n,t,e){const i={};e=e?"-"+e:"";for(let r=0;r<4;r++){const a=dv[r];i[a]=parseFloat(n[t+"-"+a+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const gv=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function pv(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:r,offsetY:a}=i;let l=!1,c,u;if(gv(r,a,n.target))c=r,u=a;else{const f=t.getBoundingClientRect();c=i.clientX-f.left,u=i.clientY-f.top,l=!0}return{x:c,y:u,box:l}}function Fn(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,r=Ir(e),a=r.boxSizing==="border-box",l=Hn(r,"padding"),c=Hn(r,"border","width"),{x:u,y:f,box:g}=pv(n,e),p=l.left+(g&&c.left),_=l.top+(g&&c.top);let{width:y,height:w}=t;return a&&(y-=l.width+c.width,w-=l.height+c.height),{x:Math.round((u-p)/y*e.width/i),y:Math.round((f-_)/w*e.height/i)}}function mv(n,t,e){let i,r;if(t===void 0||e===void 0){const a=Ga(n);if(!a)t=n.clientWidth,e=n.clientHeight;else{const l=a.getBoundingClientRect(),c=Ir(a),u=Hn(c,"border","width"),f=Hn(c,"padding");t=l.width-f.width-u.width,e=l.height-f.height-u.height,i=Pr(c.maxWidth,a,"clientWidth"),r=Pr(c.maxHeight,a,"clientHeight")}}return{width:t,height:e,maxWidth:i||Ar,maxHeight:r||Ar}}const ir=n=>Math.round(n*10)/10;function _v(n,t,e,i){const r=Ir(n),a=Hn(r,"margin"),l=Pr(r.maxWidth,n,"clientWidth")||Ar,c=Pr(r.maxHeight,n,"clientHeight")||Ar,u=mv(n,t,e);let{width:f,height:g}=u;if(r.boxSizing==="content-box"){const _=Hn(r,"border","width"),y=Hn(r,"padding");f-=y.width+_.width,g-=y.height+_.height}return f=Math.max(0,f-a.width),g=Math.max(0,i?f/i:g-a.height),f=ir(Math.min(f,l,u.maxWidth)),g=ir(Math.min(g,c,u.maxHeight)),f&&!g&&(g=ir(f/2)),(t!==void 0||e!==void 0)&&i&&u.height&&g>u.height&&(g=u.height,f=ir(Math.floor(g*i))),{width:f,height:g}}function Yh(n,t,e){const i=t||1,r=Math.floor(n.height*i),a=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const l=n.canvas;return l.style&&(e||!l.style.height&&!l.style.width)&&(l.style.height=`${n.height}px`,l.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||l.height!==r||l.width!==a?(n.currentDevicePixelRatio=i,l.height=r,l.width=a,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const bv=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(t){}return n}();function Xh(n,t){const e=fv(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Bn(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function xv(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:i==="middle"?e<.5?n.y:t.y:i==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function yv(n,t,e,i){const r={x:n.cp2x,y:n.cp2y},a={x:t.cp1x,y:t.cp1y},l=Bn(n,r,e),c=Bn(r,a,e),u=Bn(a,t,e),f=Bn(l,c,e),g=Bn(c,u,e);return Bn(f,g,e)}const vv=function(n,t){return{x(e){return n+n+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},wv=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function li(n,t,e){return n?vv(t,e):wv()}function wf(n,t){let e,i;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=i)}function Mf(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function Sf(n){return n==="angle"?{between:Ji,compare:My,normalize:ue}:{between:tn,compare:(t,e)=>t-e,normalize:t=>t}}function Gh({start:n,end:t,count:e,loop:i,style:r}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:r}}function Mv(n,t,e){const{property:i,start:r,end:a}=e,{between:l,normalize:c}=Sf(i),u=t.length;let{start:f,end:g,loop:p}=n,_,y;if(p){for(f+=u,g+=u,_=0,y=u;_<y&&l(c(t[f%u][i]),r,a);++_)f--,g--;f%=u,g%=u}return g<f&&(g+=u),{start:f,end:g,loop:p,style:n.style}}function Af(n,t,e){if(!e)return[n];const{property:i,start:r,end:a}=e,l=t.length,{compare:c,between:u,normalize:f}=Sf(i),{start:g,end:p,loop:_,style:y}=Mv(n,t,e),w=[];let M=!1,A=null,C,O,I;const F=()=>u(r,I,C)&&c(r,I)!==0,L=()=>c(a,C)===0||u(a,I,C),W=()=>M||F(),z=()=>!M||L();for(let N=g,Y=g;N<=p;++N)O=t[N%l],!O.skip&&(C=f(O[i]),C!==I&&(M=u(C,r,a),A===null&&W()&&(A=c(C,r)===0?N:Y),A!==null&&z()&&(w.push(Gh({start:A,end:N,loop:_,count:l,style:y})),A=null),Y=N,I=C));return A!==null&&w.push(Gh({start:A,end:p,loop:_,count:l,style:y})),w}function kf(n,t){const e=[],i=n.segments;for(let r=0;r<i.length;r++){const a=Af(i[r],n.points,t);a.length&&e.push(...a)}return e}function Sv(n,t,e,i){let r=0,a=t-1;if(e&&!i)for(;r<t&&!n[r].skip;)r++;for(;r<t&&n[r].skip;)r++;for(r%=t,e&&(a+=r);a>r&&n[a%t].skip;)a--;return a%=t,{start:r,end:a}}function Av(n,t,e,i){const r=n.length,a=[];let l=t,c=n[t],u;for(u=t+1;u<=e;++u){const f=n[u%r];f.skip||f.stop?c.skip||(i=!1,a.push({start:t%r,end:(u-1)%r,loop:i}),t=l=f.stop?u:null):(l=u,c.skip&&(t=u)),c=f}return l!==null&&a.push({start:t%r,end:l%r,loop:i}),a}function kv(n,t){const e=n.points,i=n.options.spanGaps,r=e.length;if(!r)return[];const a=!!n._loop,{start:l,end:c}=Sv(e,r,a,i);if(i===!0)return Kh(n,[{start:l,end:c,loop:a}],e,t);const u=c<l?c+r:c,f=!!n._fullLoop&&l===0&&c===r-1;return Kh(n,Av(e,l,u,f),e,t)}function Kh(n,t,e,i){return!i||!i.setContext||!e?t:Pv(n,t,e,i)}function Pv(n,t,e,i){const r=n._chart.getContext(),a=qh(n.options),{_datasetIndex:l,options:{spanGaps:c}}=n,u=e.length,f=[];let g=a,p=t[0].start,_=p;function y(w,M,A,C){const O=c?-1:1;if(w!==M){for(w+=u;e[w%u].skip;)w-=O;for(;e[M%u].skip;)M+=O;w%u!==M%u&&(f.push({start:w%u,end:M%u,loop:A,style:C}),g=C,p=M%u)}}for(const w of t){p=c?p:w.start;let M=e[p%u],A;for(_=p+1;_<=w.end;_++){const C=e[_%u];A=qh(i.setContext(yn(r,{type:"segment",p0:M,p1:C,p0DataIndex:(_-1)%u,p1DataIndex:_%u,datasetIndex:l}))),Cv(A,g)&&y(p,_-1,w.loop,g),M=C,g=A}p<_-1&&y(p,_-1,w.loop,g)}return f}function qh(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function Cv(n,t){return t&&JSON.stringify(n)!==JSON.stringify(t)}/*!
* Chart.js v4.2.1
* https://www.chartjs.org
* (c) 2023 Chart.js Contributors
* Released under the MIT License
*/class Tv{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,r){const a=e.listeners[r],l=e.duration;a.forEach(c=>c({chart:t,initial:e.initial,numSteps:l,currentStep:Math.min(i-e.start,l)}))}_refresh(){this._request||(this._running=!0,this._request=af.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,r)=>{if(!i.running||!i.items.length)return;const a=i.items;let l=a.length-1,c=!1,u;for(;l>=0;--l)u=a[l],u._active?(u._total>i.duration&&(i.duration=u._total),u.tick(t),c=!0):(a[l]=a[a.length-1],a.pop());c&&(r.draw(),this._notify(r,i,t,"progress")),a.length||(i.running=!1,this._notify(r,i,t,"complete"),i.initial=!1),e+=a.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,r)=>Math.max(i,r._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let r=i.length-1;for(;r>=0;--r)i[r].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Ze=new Tv;const jh="transparent",Ov={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=Nh(n||jh),r=i.valid&&Nh(t||jh);return r&&r.valid?r.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class Dv{constructor(t,e,i,r){const a=e[i];r=Hi([t.to,r,a,t.from]);const l=Hi([t.from,a,r]);this._active=!0,this._fn=t.fn||Ov[t.type||typeof l],this._easing=Gi[t.easing]||Gi.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=l,this._to=r,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const r=this._target[this._prop],a=i-this._start,l=this._duration-a;this._start=i,this._duration=Math.floor(Math.max(l,t.duration)),this._total+=a,this._loop=!!t.loop,this._to=Hi([t.to,e,r,t.from]),this._from=Hi([t.from,r,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,r=this._prop,a=this._from,l=this._loop,c=this._to;let u;if(this._active=a!==c&&(l||e<i),!this._active){this._target[r]=c,this._notify(!0);return}if(e<0){this._target[r]=a;return}u=e/i%2,u=l&&u>1?2-u:u,u=this._easing(Math.min(1,Math.max(0,u))),this._target[r]=this._fn(a,c,u)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let r=0;r<i.length;r++)i[r][e]()}}class Pf{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!rt(t))return;const e=Object.keys(Dt.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(r=>{const a=t[r];if(!rt(a))return;const l={};for(const c of e)l[c]=a[c];(vt(a.properties)&&a.properties||[r]).forEach(c=>{(c===r||!i.has(c))&&i.set(c,l)})})}_animateOptions(t,e){const i=e.options,r=Rv(t,i);if(!r)return[];const a=this._createAnimations(r,i);return i.$shared&&Lv(t.options.$animations,i).then(()=>{t.options=i},()=>{}),a}_createAnimations(t,e){const i=this._properties,r=[],a=t.$animations||(t.$animations={}),l=Object.keys(e),c=Date.now();let u;for(u=l.length-1;u>=0;--u){const f=l[u];if(f.charAt(0)==="$")continue;if(f==="options"){r.push(...this._animateOptions(t,e));continue}const g=e[f];let p=a[f];const _=i.get(f);if(p)if(_&&p.active()){p.update(_,g,c);continue}else p.cancel();if(!_||!_.duration){t[f]=g;continue}a[f]=p=new Dv(_,t,f,g),r.push(p)}return r}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return Ze.add(this._chart,i),!0}}function Lv(n,t){const e=[],i=Object.keys(t);for(let r=0;r<i.length;r++){const a=n[i[r]];a&&a.active()&&e.push(a.wait())}return Promise.all(e)}function Rv(n,t){if(!t)return;let e=n.options;if(!e){n.options=t;return}return e.$shared&&(n.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function Zh(n,t){const e=n&&n.options||{},i=e.reverse,r=e.min===void 0?t:0,a=e.max===void 0?t:0;return{start:i?a:r,end:i?r:a}}function Ev(n,t,e){if(e===!1)return!1;const i=Zh(n,e),r=Zh(t,e);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}function Iv(n){let t,e,i,r;return rt(n)?(t=n.top,e=n.right,i=n.bottom,r=n.left):t=e=i=r=n,{top:t,right:e,bottom:i,left:r,disabled:n===!1}}function Cf(n,t){const e=[],i=n._getSortedDatasetMetas(t);let r,a;for(r=0,a=i.length;r<a;++r)e.push(i[r].index);return e}function Jh(n,t,e,i={}){const r=n.keys,a=i.mode==="single";let l,c,u,f;if(t!==null){for(l=0,c=r.length;l<c;++l){if(u=+r[l],u===e){if(i.all)continue;break}f=n.values[u],Pt(f)&&(a||t===0||We(t)===We(f))&&(t+=f)}return t}}function Fv(n){const t=Object.keys(n),e=new Array(t.length);let i,r,a;for(i=0,r=t.length;i<r;++i)a=t[i],e[i]={x:a,y:n[a]};return e}function Qh(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function Bv(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function zv(n){const{min:t,max:e,minDefined:i,maxDefined:r}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:r?e:Number.POSITIVE_INFINITY}}function Wv(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function tu(n,t,e,i){for(const r of t.getMatchingVisibleMetas(i).reverse()){const a=n[r.index];if(e&&a>0||!e&&a<0)return r.index}return null}function eu(n,t){const{chart:e,_cachedMeta:i}=n,r=e._stacks||(e._stacks={}),{iScale:a,vScale:l,index:c}=i,u=a.axis,f=l.axis,g=Bv(a,l,i),p=t.length;let _;for(let y=0;y<p;++y){const w=t[y],{[u]:M,[f]:A}=w,C=w._stacks||(w._stacks={});_=C[f]=Wv(r,g,M),_[c]=A,_._top=tu(_,l,!0,i.type),_._bottom=tu(_,l,!1,i.type);const O=_._visualValues||(_._visualValues={});O[c]=A}}function ca(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function Nv(n,t){return yn(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Hv(n,t,e){return yn(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Ii(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const r of t){const a=r._stacks;if(!a||a[i]===void 0||a[i][e]===void 0)return;delete a[i][e],a[i]._visualValues!==void 0&&a[i]._visualValues[e]!==void 0&&delete a[i]._visualValues[e]}}}const ha=n=>n==="reset"||n==="none",nu=(n,t)=>t?n:Object.assign({},n),Vv=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:Cf(e,!0),values:null};class De{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=Qh(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&&Ii(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),r=(p,_,y,w)=>p==="x"?_:p==="r"?w:y,a=e.xAxisID=Z(i.xAxisID,ca(t,"x")),l=e.yAxisID=Z(i.yAxisID,ca(t,"y")),c=e.rAxisID=Z(i.rAxisID,ca(t,"r")),u=e.indexAxis,f=e.iAxisID=r(u,a,l,c),g=e.vAxisID=r(u,l,a,c);e.xScale=this.getScaleForId(a),e.yScale=this.getScaleForId(l),e.rScale=this.getScaleForId(c),e.iScale=this.getScaleForId(f),e.vScale=this.getScaleForId(g)}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&&Bh(this._data,this),t._stacked&&Ii(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(rt(e))this._data=Fv(e);else if(i!==e){if(i){Bh(i,this);const r=this._cachedMeta;Ii(r),r._parsed=[]}e&&Object.isExtensible(e)&&Py(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let r=!1;this._dataCheck();const a=e._stacked;e._stacked=Qh(e.vScale,e),e.stack!==i.stack&&(r=!0,Ii(e),e.stack=i.stack),this._resyncElements(t),(r||a!==e._stacked)&&eu(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:r}=this,{iScale:a,_stacked:l}=i,c=a.axis;let u=t===0&&e===r.length?!0:i._sorted,f=t>0&&i._parsed[t-1],g,p,_;if(this._parsing===!1)i._parsed=r,i._sorted=!0,_=r;else{vt(r[t])?_=this.parseArrayData(i,r,t,e):rt(r[t])?_=this.parseObjectData(i,r,t,e):_=this.parsePrimitiveData(i,r,t,e);const y=()=>p[c]===null||f&&p[c]<f[c];for(g=0;g<e;++g)i._parsed[g+t]=p=_[g],u&&(y()&&(u=!1),f=p);i._sorted=u}l&&eu(this,_)}parsePrimitiveData(t,e,i,r){const{iScale:a,vScale:l}=t,c=a.axis,u=l.axis,f=a.getLabels(),g=a===l,p=new Array(r);let _,y,w;for(_=0,y=r;_<y;++_)w=_+i,p[_]={[c]:g||a.parse(f[w],w),[u]:l.parse(e[w],w)};return p}parseArrayData(t,e,i,r){const{xScale:a,yScale:l}=t,c=new Array(r);let u,f,g,p;for(u=0,f=r;u<f;++u)g=u+i,p=e[g],c[u]={x:a.parse(p[0],g),y:l.parse(p[1],g)};return c}parseObjectData(t,e,i,r){const{xScale:a,yScale:l}=t,{xAxisKey:c="x",yAxisKey:u="y"}=this._parsing,f=new Array(r);let g,p,_,y;for(g=0,p=r;g<p;++g)_=g+i,y=e[_],f[g]={x:a.parse(bn(y,c),_),y:l.parse(bn(y,u),_)};return f}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const r=this.chart,a=this._cachedMeta,l=e[t.axis],c={keys:Cf(r,!0),values:e._stacks[t.axis]._visualValues};return Jh(c,l,a.index,{mode:i})}updateRangeFromParsed(t,e,i,r){const a=i[e.axis];let l=a===null?NaN:a;const c=r&&i._stacks[e.axis];r&&c&&(r.values=c,l=Jh(r,a,this._cachedMeta.index)),t.min=Math.min(t.min,l),t.max=Math.max(t.max,l)}getMinMax(t,e){const i=this._cachedMeta,r=i._parsed,a=i._sorted&&t===i.iScale,l=r.length,c=this._getOtherScale(t),u=Vv(e,i,this.chart),f={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:g,max:p}=zv(c);let _,y;function w(){y=r[_];const M=y[c.axis];return!Pt(y[t.axis])||g>M||p<M}for(_=0;_<l&&!(!w()&&(this.updateRangeFromParsed(f,t,y,u),a));++_);if(a){for(_=l-1;_>=0;--_)if(!w()){this.updateRangeFromParsed(f,t,y,u);break}}return f}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let r,a,l;for(r=0,a=e.length;r<a;++r)l=e[r][t.axis],Pt(l)&&i.push(l);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,r=e.vScale,a=this.getParsed(t);return{label:i?""+i.getLabelForValue(a[i.axis]):"",value:r?""+r.getLabelForValue(a[r.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=Iv(Z(this.options.clip,Ev(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,r=i.data||[],a=e.chartArea,l=[],c=this._drawStart||0,u=this._drawCount||r.length-c,f=this.options.drawActiveElementsOnTop;let g;for(i.dataset&&i.dataset.draw(t,a,c,u),g=c;g<c+u;++g){const p=r[g];p.hidden||(p.active&&f?l.push(p):p.draw(t,a))}for(g=0;g<l.length;++g)l[g].draw(t,a)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const r=this.getDataset();let a;if(t>=0&&t<this._cachedMeta.data.length){const l=this._cachedMeta.data[t];a=l.$context||(l.$context=Hv(this.getContext(),t,l)),a.parsed=this.getParsed(t),a.raw=r.data[t],a.index=a.dataIndex=t}else a=this.$context||(this.$context=Nv(this.chart.getContext(),this.index)),a.dataset=r,a.index=a.datasetIndex=this.index;return a.active=!!e,a.mode=i,a}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const r=e==="active",a=this._cachedDataOpts,l=t+"-"+e,c=a[l],u=this.enableOptionSharing&&we(i);if(c)return nu(c,u);const f=this.chart.config,g=f.datasetElementScopeKeys(this._type,t),p=r?[`${t}Hover`,"hover",t,""]:[t,""],_=f.getOptionScopes(this.getDataset(),g),y=Object.keys(Dt.elements[t]),w=()=>this.getContext(i,r,e),M=f.resolveNamedOptions(_,y,w,p);return M.$shared&&(M.$shared=u,a[l]=Object.freeze(nu(M,u))),M}_resolveAnimations(t,e,i){const r=this.chart,a=this._cachedDataOpts,l=`animation-${e}`,c=a[l];if(c)return c;let u;if(r.options.animation!==!1){const g=this.chart.config,p=g.datasetAnimationScopeKeys(this._type,e),_=g.getOptionScopes(this.getDataset(),p);u=g.createResolver(_,this.getContext(t,i,e))}const f=new Pf(r,u&&u.animations);return u&&u._cacheable&&(a[l]=Object.freeze(f)),f}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ha(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),r=this._sharedOptions,a=this.getSharedOptions(i),l=this.includeOptions(e,a)||a!==r;return this.updateSharedOptions(a,e,i),{sharedOptions:a,includeOptions:l}}updateElement(t,e,i,r){ha(r)?Object.assign(t,i):this._resolveAnimations(e,r).update(t,i)}updateSharedOptions(t,e,i){t&&!ha(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,r){t.active=r;const a=this.getStyle(e,r);this._resolveAnimations(e,i,r).update(t,{options:!r&&this.getSharedOptions(a)||a})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[c,u,f]of this._syncList)this[c](u,f);this._syncList=[];const r=i.length,a=e.length,l=Math.min(a,r);l&&this.parse(0,l),a>r?this._insertElements(r,a-r,t):a<r&&this._removeElements(a,r-a)}_insertElements(t,e,i=!0){const r=this._cachedMeta,a=r.data,l=t+e;let c;const u=f=>{for(f.length+=e,c=f.length-1;c>=l;c--)f[c]=f[c-e]};for(u(a),c=t;c<l;++c)a[c]=new this.dataElementType;this._parsing&&u(r._parsed),this.parse(t,e),i&&this.updateElements(a,t,e,"reset")}updateElements(t,e,i,r){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const r=i._parsed.splice(t,e);i._stacked&&Ii(i,r)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,r]=t;this[e](i,r)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}U(De,"defaults",{}),U(De,"datasetElementType",null),U(De,"dataElementType",null);function Uv(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let r=0,a=e.length;r<a;r++)i=i.concat(e[r].controller.getAllParsedValues(n));n._cache.$bar=of(i.sort((r,a)=>r-a))}return n._cache.$bar}function $v(n){const t=n.iScale,e=Uv(t,n.type);let i=t._length,r,a,l,c;const u=()=>{l===32767||l===-32768||(we(c)&&(i=Math.min(i,Math.abs(l-c)||i)),c=l)};for(r=0,a=e.length;r<a;++r)l=t.getPixelForValue(e[r]),u();for(c=void 0,r=0,a=t.ticks.length;r<a;++r)l=t.getPixelForTick(r),u();return i}function Yv(n,t,e,i){const r=e.barThickness;let a,l;return lt(r)?(a=t.min*e.categoryPercentage,l=e.barPercentage):(a=r*i,l=1),{chunk:a/i,ratio:l,start:t.pixels[n]-a/2}}function Xv(n,t,e,i){const r=t.pixels,a=r[n];let l=n>0?r[n-1]:null,c=n<r.length-1?r[n+1]:null;const u=e.categoryPercentage;l===null&&(l=a-(c===null?t.end-t.start:c-a)),c===null&&(c=a+a-l);const f=a-(a-Math.min(l,c))/2*u;return{chunk:Math.abs(c-l)/2*u/i,ratio:e.barPercentage,start:f}}function Gv(n,t,e,i){const r=e.parse(n[0],i),a=e.parse(n[1],i),l=Math.min(r,a),c=Math.max(r,a);let u=l,f=c;Math.abs(l)>Math.abs(c)&&(u=c,f=l),t[e.axis]=f,t._custom={barStart:u,barEnd:f,start:r,end:a,min:l,max:c}}function Tf(n,t,e,i){return vt(n)?Gv(n,t,e,i):t[e.axis]=e.parse(n,i),t}function iu(n,t,e,i){const r=n.iScale,a=n.vScale,l=r.getLabels(),c=r===a,u=[];let f,g,p,_;for(f=e,g=e+i;f<g;++f)_=t[f],p={},p[r.axis]=c||r.parse(l[f],f),u.push(Tf(_,p,a,f));return u}function ua(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function Kv(n,t,e){return n!==0?We(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function qv(n){let t,e,i,r,a;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(r="end",a="start"):(r="start",a="end"),{start:e,end:i,reverse:t,top:r,bottom:a}}function jv(n,t,e,i){let r=t.borderSkipped;const a={};if(!r){n.borderSkipped=a;return}if(r===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:l,end:c,reverse:u,top:f,bottom:g}=qv(n);r==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?r=f:(e._bottom||0)===i?r=g:(a[su(g,l,c,u)]=!0,r=f)),a[su(r,l,c,u)]=!0,n.borderSkipped=a}function su(n,t,e,i){return i?(n=Zv(n,t,e),n=ru(n,e,t)):n=ru(n,t,e),n}function Zv(n,t,e){return n===t?e:n===e?t:n}function ru(n,t,e){return n==="start"?t:n==="end"?e:n}function Jv(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class dr extends De{parsePrimitiveData(t,e,i,r){return iu(t,e,i,r)}parseArrayData(t,e,i,r){return iu(t,e,i,r)}parseObjectData(t,e,i,r){const{iScale:a,vScale:l}=t,{xAxisKey:c="x",yAxisKey:u="y"}=this._parsing,f=a.axis==="x"?c:u,g=l.axis==="x"?c:u,p=[];let _,y,w,M;for(_=i,y=i+r;_<y;++_)M=e[_],w={},w[a.axis]=a.parse(bn(M,f),_),p.push(Tf(bn(M,g),w,l,_));return p}updateRangeFromParsed(t,e,i,r){super.updateRangeFromParsed(t,e,i,r);const a=i._custom;a&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,a.min),t.max=Math.max(t.max,a.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:r}=e,a=this.getParsed(t),l=a._custom,c=ua(l)?"["+l.start+", "+l.end+"]":""+r.getLabelForValue(a[r.axis]);return{label:""+i.getLabelForValue(a[i.axis]),value:c}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,r){const a=r==="reset",{index:l,_cachedMeta:{vScale:c}}=this,u=c.getBasePixel(),f=c.isHorizontal(),g=this._getRuler(),{sharedOptions:p,includeOptions:_}=this._getSharedOptions(e,r);for(let y=e;y<e+i;y++){const w=this.getParsed(y),M=a||lt(w[c.axis])?{base:u,head:u}:this._calculateBarValuePixels(y),A=this._calculateBarIndexPixels(y,g),C=(w._stacks||{})[c.axis],O={horizontal:f,base:M.base,enableBorderRadius:!C||ua(w._custom)||l===C._top||l===C._bottom,x:f?M.head:A.center,y:f?A.center:M.head,height:f?A.size:Math.abs(M.size),width:f?Math.abs(M.size):A.size};_&&(O.options=p||this.resolveDataElementOptions(y,t[y].active?"active":r));const I=O.options||t[y].options;jv(O,I,C,l),Jv(O,I,g.ratio),this.updateElement(t[y],y,O,r)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,r=i.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),a=i.options.stacked,l=[],c=u=>{const f=u.controller.getParsed(e),g=f&&f[u.vScale.axis];if(lt(g)||isNaN(g))return!0};for(const u of r)if(!(e!==void 0&&c(u))&&((a===!1||l.indexOf(u.stack)===-1||a===void 0&&u.stack===void 0)&&l.push(u.stack),u.index===t))break;return l.length||l.push(void 0),l}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const r=this._getStacks(t,i),a=e!==void 0?r.indexOf(e):-1;return a===-1?r.length-1:a}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,r=[];let a,l;for(a=0,l=e.data.length;a<l;++a)r.push(i.getPixelForValue(this.getParsed(a)[i.axis],a));const c=t.barThickness;return{min:c||$v(e),pixels:r,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:c?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:r},options:{base:a,minBarLength:l}}=this,c=a||0,u=this.getParsed(t),f=u._custom,g=ua(f);let p=u[e.axis],_=0,y=i?this.applyStack(e,u,i):p,w,M;y!==p&&(_=y-p,y=p),g&&(p=f.barStart,y=f.barEnd-f.barStart,p!==0&&We(p)!==We(f.barEnd)&&(_=0),_+=p);const A=!lt(a)&&!g?a:_;let C=e.getPixelForValue(A);if(this.chart.getDataVisibility(t)?w=e.getPixelForValue(_+y):w=C,M=w-C,Math.abs(M)<l){M=Kv(M,e,c)*l,p===c&&(C-=M/2);const O=e.getPixelForDecimal(0),I=e.getPixelForDecimal(1),F=Math.min(O,I),L=Math.max(O,I);C=Math.max(Math.min(C,L),F),w=C+M,i&&!g&&(u._stacks[e.axis]._visualValues[r]=e.getValueForPixel(w)-e.getValueForPixel(C))}if(C===e.getPixelForValue(c)){const O=We(M)*e.getLineWidthForValue(c)/2;C+=O,M-=O}return{size:M,base:C,head:w,center:w+M/2}}_calculateBarIndexPixels(t,e){const i=e.scale,r=this.options,a=r.skipNull,l=Z(r.maxBarThickness,1/0);let c,u;if(e.grouped){const f=a?this._getStackCount(t):e.stackCount,g=r.barThickness==="flex"?Xv(t,e,r,f):Yv(t,e,r,f),p=this._getStackIndex(this.index,this._cachedMeta.stack,a?t:void 0);c=g.start+g.chunk*p+g.chunk/2,u=Math.min(l,g.chunk*g.ratio)}else c=i.getPixelForValue(this.getParsed(t)[i.axis],t),u=Math.min(l,e.min*e.ratio);return{base:c-u/2,head:c+u/2,center:c,size:u}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,r=i.length;let a=0;for(;a<r;++a)this.getParsed(a)[e.axis]!==null&&i[a].draw(this._ctx)}}U(dr,"id","bar"),U(dr,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),U(dr,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class gr extends De{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,r){const a=super.parsePrimitiveData(t,e,i,r);for(let l=0;l<a.length;l++)a[l]._custom=this.resolveDataElementOptions(l+i).radius;return a}parseArrayData(t,e,i,r){const a=super.parseArrayData(t,e,i,r);for(let l=0;l<a.length;l++){const c=e[i+l];a[l]._custom=Z(c[2],this.resolveDataElementOptions(l+i).radius)}return a}parseObjectData(t,e,i,r){const a=super.parseObjectData(t,e,i,r);for(let l=0;l<a.length;l++){const c=e[i+l];a[l]._custom=Z(c&&c.r&&+c.r,this.resolveDataElementOptions(l+i).radius)}return a}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:a}=e,l=this.getParsed(t),c=r.getLabelForValue(l.x),u=a.getLabelForValue(l.y),f=l._custom;return{label:i[t]||"",value:"("+c+", "+u+(f?", "+f:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,r){const a=r==="reset",{iScale:l,vScale:c}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(e,r),g=l.axis,p=c.axis;for(let _=e;_<e+i;_++){const y=t[_],w=!a&&this.getParsed(_),M={},A=M[g]=a?l.getPixelForDecimal(.5):l.getPixelForValue(w[g]),C=M[p]=a?c.getBasePixel():c.getPixelForValue(w[p]);M.skip=isNaN(A)||isNaN(C),f&&(M.options=u||this.resolveDataElementOptions(_,y.active?"active":r),a&&(M.options.radius=0)),this.updateElement(y,_,M,r)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let r=super.resolveDataElementOptions(t,e);r.$shared&&(r=Object.assign({},r,{$shared:!1}));const a=r.radius;return e!=="active"&&(r.radius=0),r.radius+=Z(i&&i._custom,a),r}}U(gr,"id","bubble"),U(gr,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),U(gr,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Qv(n,t,e){let i=1,r=1,a=0,l=0;if(t<wt){const c=n,u=c+t,f=Math.cos(c),g=Math.sin(c),p=Math.cos(u),_=Math.sin(u),y=(I,F,L)=>Ji(I,c,u,!0)?1:Math.max(F,F*e,L,L*e),w=(I,F,L)=>Ji(I,c,u,!0)?-1:Math.min(F,F*e,L,L*e),M=y(0,f,p),A=y(Ct,g,_),C=w(St,f,p),O=w(St+Ct,g,_);i=(M-C)/2,r=(A-O)/2,a=-(M+C)/2,l=-(A+O)/2}return{ratioX:i,ratioY:r,offsetX:a,offsetY:l}}class Wn extends De{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=i;else{let a=u=>+i[u];if(rt(i[t])){const{key:u="value"}=this._parsing;a=f=>+bn(i[f],u)}let l,c;for(l=t,c=t+e;l<c;++l)r._parsed[l]=a(l)}}_getRotation(){return Oe(this.options.rotation-90)}_getCircumference(){return Oe(this.options.circumference)}_getRotationExtents(){let t=wt,e=-wt;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const r=this.chart.getDatasetMeta(i).controller,a=r._getRotation(),l=r._getCircumference();t=Math.min(t,a),e=Math.max(e,a+l)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,r=this._cachedMeta,a=r.data,l=this.getMaxBorderWidth()+this.getMaxOffset(a)+this.options.spacing,c=Math.max((Math.min(i.width,i.height)-l)/2,0),u=Math.min(dy(this.options.cutout,c),1),f=this._getRingWeight(this.index),{circumference:g,rotation:p}=this._getRotationExtents(),{ratioX:_,ratioY:y,offsetX:w,offsetY:M}=Qv(p,g,u),A=(i.width-l)/_,C=(i.height-l)/y,O=Math.max(Math.min(A,C)/2,0),I=tf(this.options.radius,O),F=Math.max(I*u,0),L=(I-F)/this._getVisibleDatasetWeightTotal();this.offsetX=w*I,this.offsetY=M*I,r.total=this.calculateTotal(),this.outerRadius=I-L*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-L*f,0),this.updateElements(a,0,a.length,t)}_circumference(t,e){const i=this.options,r=this._cachedMeta,a=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||r._parsed[t]===null||r.data[t].hidden?0:this.calculateCircumference(r._parsed[t]*a/wt)}updateElements(t,e,i,r){const a=r==="reset",l=this.chart,c=l.chartArea,f=l.options.animation,g=(c.left+c.right)/2,p=(c.top+c.bottom)/2,_=a&&f.animateScale,y=_?0:this.innerRadius,w=_?0:this.outerRadius,{sharedOptions:M,includeOptions:A}=this._getSharedOptions(e,r);let C=this._getRotation(),O;for(O=0;O<e;++O)C+=this._circumference(O,a);for(O=e;O<e+i;++O){const I=this._circumference(O,a),F=t[O],L={x:g+this.offsetX,y:p+this.offsetY,startAngle:C,endAngle:C+I,circumference:I,outerRadius:w,innerRadius:y};A&&(L.options=M||this.resolveDataElementOptions(O,F.active?"active":r)),C+=I,this.updateElement(F,O,L,r)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,r;for(r=0;r<e.length;r++){const a=t._parsed[r];a!==null&&!isNaN(a)&&this.chart.getDataVisibility(r)&&!e[r].hidden&&(i+=Math.abs(a))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?wt*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,r=i.data.labels||[],a=rs(e._parsed[t],i.options.locale);return{label:r[t]||"",value:a}}getMaxBorderWidth(t){let e=0;const i=this.chart;let r,a,l,c,u;if(!t){for(r=0,a=i.data.datasets.length;r<a;++r)if(i.isDatasetVisible(r)){l=i.getDatasetMeta(r),t=l.data,c=l.controller;break}}if(!t)return 0;for(r=0,a=t.length;r<a;++r)u=c.resolveDataElementOptions(r),u.borderAlign!=="inner"&&(e=Math.max(e,u.borderWidth||0,u.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,r=t.length;i<r;++i){const a=this.resolveDataElementOptions(i);e=Math.max(e,a.offset||0,a.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(Z(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}U(Wn,"id","doughnut"),U(Wn,"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"}),U(Wn,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"}),U(Wn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return e.labels.map((a,l)=>{const u=t.getDatasetMeta(0).controller.getStyle(l);return{text:a,fillStyle:u.backgroundColor,strokeStyle:u.borderColor,fontColor:r,lineWidth:u.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(l),index:l}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class pr extends De{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:r=[],_dataset:a}=e,l=this.chart._animationsDisabled;let{start:c,count:u}=cf(e,r,l);this._drawStart=c,this._drawCount=u,hf(e)&&(c=0,u=r.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!a._decimated,i.points=r;const f=this.resolveDatasetElementOptions(t);this.options.showLine||(f.borderWidth=0),f.segment=this.options.segment,this.updateElement(i,void 0,{animated:!l,options:f},t),this.updateElements(r,c,u,t)}updateElements(t,e,i,r){const a=r==="reset",{iScale:l,vScale:c,_stacked:u,_dataset:f}=this._cachedMeta,{sharedOptions:g,includeOptions:p}=this._getSharedOptions(e,r),_=l.axis,y=c.axis,{spanGaps:w,segment:M}=this.options,A=ci(w)?w:Number.POSITIVE_INFINITY,C=this.chart._animationsDisabled||a||r==="none",O=e+i,I=t.length;let F=e>0&&this.getParsed(e-1);for(let L=0;L<I;++L){const W=t[L],z=C?W:{};if(L<e||L>=O){z.skip=!0;continue}const N=this.getParsed(L),Y=lt(N[y]),J=z[_]=l.getPixelForValue(N[_],L),Q=z[y]=a||Y?c.getBasePixel():c.getPixelForValue(u?this.applyStack(c,N,u):N[y],L);z.skip=isNaN(J)||isNaN(Q)||Y,z.stop=L>0&&Math.abs(N[_]-F[_])>A,M&&(z.parsed=N,z.raw=f.data[L]),p&&(z.options=g||this.resolveDataElementOptions(L,W.active?"active":r)),C||this.updateElement(W,L,z,r),F=N}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,r=t.data||[];if(!r.length)return i;const a=r[0].size(this.resolveDataElementOptions(0)),l=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(i,a,l)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}U(pr,"id","line"),U(pr,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),U(pr,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class qi extends De{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,r=i.data.labels||[],a=rs(e._parsed[t].r,i.options.locale);return{label:r[t]||"",value:a}}parseObjectData(t,e,i,r){return xf.bind(this)(t,e,i,r)}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((i,r)=>{const a=this.getParsed(r).r;!isNaN(a)&&this.chart.getDataVisibility(r)&&(a<e.min&&(e.min=a),a>e.max&&(e.max=a))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,r=Math.min(e.right-e.left,e.bottom-e.top),a=Math.max(r/2,0),l=Math.max(i.cutoutPercentage?a/100*i.cutoutPercentage:1,0),c=(a-l)/t.getVisibleDatasetCount();this.outerRadius=a-c*this.index,this.innerRadius=this.outerRadius-c}updateElements(t,e,i,r){const a=r==="reset",l=this.chart,u=l.options.animation,f=this._cachedMeta.rScale,g=f.xCenter,p=f.yCenter,_=f.getIndexAngle(0)-.5*St;let y=_,w;const M=360/this.countVisibleElements();for(w=0;w<e;++w)y+=this._computeAngle(w,r,M);for(w=e;w<e+i;w++){const A=t[w];let C=y,O=y+this._computeAngle(w,r,M),I=l.getDataVisibility(w)?f.getDistanceFromCenterForValue(this.getParsed(w).r):0;y=O,a&&(u.animateScale&&(I=0),u.animateRotate&&(C=O=_));const F={x:g,y:p,innerRadius:0,outerRadius:I,startAngle:C,endAngle:O,options:this.resolveDataElementOptions(w,A.active?"active":r)};this.updateElement(A,w,F,r)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,r)=>{!isNaN(this.getParsed(r).r)&&this.chart.getDataVisibility(r)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?Oe(this.resolveDataElementOptions(t,e).angle||i):0}}U(qi,"id","polarArea"),U(qi,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),U(qi,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return e.labels.map((a,l)=>{const u=t.getDatasetMeta(0).controller.getStyle(l);return{text:a,fillStyle:u.backgroundColor,strokeStyle:u.borderColor,fontColor:r,lineWidth:u.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(l),index:l}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Aa extends Wn{}U(Aa,"id","pie"),U(Aa,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class mr extends De{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,r){return xf.bind(this)(t,e,i,r)}update(t){const e=this._cachedMeta,i=e.dataset,r=e.data||[],a=e.iScale.getLabels();if(i.points=r,t!=="resize"){const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0);const c={_loop:!0,_fullLoop:a.length===r.length,options:l};this.updateElement(i,void 0,c,t)}this.updateElements(r,0,r.length,t)}updateElements(t,e,i,r){const a=this._cachedMeta.rScale,l=r==="reset";for(let c=e;c<e+i;c++){const u=t[c],f=this.resolveDataElementOptions(c,u.active?"active":r),g=a.getPointPositionForValue(c,this.getParsed(c).r),p=l?a.xCenter:g.x,_=l?a.yCenter:g.y,y={x:p,y:_,angle:g.angle,skip:isNaN(p)||isNaN(_),options:f};this.updateElement(u,c,y,r)}}}U(mr,"id","radar"),U(mr,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),U(mr,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class _r extends De{getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:a}=e,l=this.getParsed(t),c=r.getLabelForValue(l.x),u=a.getLabelForValue(l.y);return{label:i[t]||"",value:"("+c+", "+u+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,r=this.chart._animationsDisabled;let{start:a,count:l}=cf(e,i,r);if(this._drawStart=a,this._drawCount=l,hf(e)&&(a=0,l=i.length),this.options.showLine){const{dataset:c,_dataset:u}=e;c._chart=this.chart,c._datasetIndex=this.index,c._decimated=!!u._decimated,c.points=i;const f=this.resolveDatasetElementOptions(t);f.segment=this.options.segment,this.updateElement(c,void 0,{animated:!r,options:f},t)}this.updateElements(i,a,l,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,r){const a=r==="reset",{iScale:l,vScale:c,_stacked:u,_dataset:f}=this._cachedMeta,g=this.resolveDataElementOptions(e,r),p=this.getSharedOptions(g),_=this.includeOptions(r,p),y=l.axis,w=c.axis,{spanGaps:M,segment:A}=this.options,C=ci(M)?M:Number.POSITIVE_INFINITY,O=this.chart._animationsDisabled||a||r==="none";let I=e>0&&this.getParsed(e-1);for(let F=e;F<e+i;++F){const L=t[F],W=this.getParsed(F),z=O?L:{},N=lt(W[w]),Y=z[y]=l.getPixelForValue(W[y],F),J=z[w]=a||N?c.getBasePixel():c.getPixelForValue(u?this.applyStack(c,W,u):W[w],F);z.skip=isNaN(Y)||isNaN(J)||N,z.stop=F>0&&Math.abs(W[y]-I[y])>C,A&&(z.parsed=W,z.raw=f.data[F]),_&&(z.options=p||this.resolveDataElementOptions(F,L.active?"active":r)),O||this.updateElement(L,F,z,r),I=W}this.updateSharedOptions(p,r,g)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let c=0;for(let u=e.length-1;u>=0;--u)c=Math.max(c,e[u].size(this.resolveDataElementOptions(u))/2);return c>0&&c}const i=t.dataset,r=i.options&&i.options.borderWidth||0;if(!e.length)return r;const a=e[0].size(this.resolveDataElementOptions(0)),l=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(r,a,l)/2}}U(_r,"id","scatter"),U(_r,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),U(_r,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var t1=Object.freeze({__proto__:null,BarController:dr,BubbleController:gr,DoughnutController:Wn,LineController:pr,PolarAreaController:qi,PieController:Aa,RadarController:mr,ScatterController:_r});function En(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Ka{static override(t){Object.assign(Ka.prototype,t)}constructor(t){this.options=t||{}}init(){}formats(){return En()}parse(){return En()}format(){return En()}add(){return En()}diff(){return En()}startOf(){return En()}endOf(){return En()}}var e1={_date:Ka};function n1(n,t,e,i){const{controller:r,data:a,_sorted:l}=n,c=r._cachedMeta.iScale;if(c&&t===c.axis&&t!=="r"&&l&&a.length){const u=c._reversePixels?Ay:en;if(i){if(r._sharedOptions){const f=a[0],g=typeof f.getRange=="function"&&f.getRange(t);if(g){const p=u(a,t,e-g),_=u(a,t,e+g);return{lo:p.lo,hi:_.hi}}}}else return u(a,t,e)}return{lo:0,hi:a.length-1}}function os(n,t,e,i,r){const a=n.getSortedVisibleDatasetMetas(),l=e[t];for(let c=0,u=a.length;c<u;++c){const{index:f,data:g}=a[c],{lo:p,hi:_}=n1(a[c],t,l,r);for(let y=p;y<=_;++y){const w=g[y];w.skip||i(w,f,y)}}}function i1(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,r){const a=t?Math.abs(i.x-r.x):0,l=e?Math.abs(i.y-r.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(l,2))}}function fa(n,t,e,i,r){const a=[];return!r&&!n.isPointInArea(t)||os(n,e,t,function(c,u,f){!r&&!Qi(c,n.chartArea,0)||c.inRange(t.x,t.y,i)&&a.push({element:c,datasetIndex:u,index:f})},!0),a}function s1(n,t,e,i){let r=[];function a(l,c,u){const{startAngle:f,endAngle:g}=l.getProps(["startAngle","endAngle"],i),{angle:p}=sf(l,{x:t.x,y:t.y});Ji(p,f,g)&&r.push({element:l,datasetIndex:c,index:u})}return os(n,e,t,a),r}function r1(n,t,e,i,r,a){let l=[];const c=i1(e);let u=Number.POSITIVE_INFINITY;function f(g,p,_){const y=g.inRange(t.x,t.y,r);if(i&&!y)return;const w=g.getCenterPoint(r);if(!(!!a||n.isPointInArea(w))&&!y)return;const A=c(t,w);A<u?(l=[{element:g,datasetIndex:p,index:_}],u=A):A===u&&l.push({element:g,datasetIndex:p,index:_})}return os(n,e,t,f),l}function da(n,t,e,i,r,a){return!a&&!n.isPointInArea(t)?[]:e==="r"&&!i?s1(n,t,e,r):r1(n,t,e,i,r,a)}function ou(n,t,e,i,r){const a=[],l=e==="x"?"inXRange":"inYRange";let c=!1;return os(n,e,t,(u,f,g)=>{u[l](t[e],r)&&(a.push({element:u,datasetIndex:f,index:g}),c=c||u.inRange(t.x,t.y,r))}),i&&!c?[]:a}var o1={evaluateInteractionItems:os,modes:{index(n,t,e,i){const r=Fn(t,n),a=e.axis||"x",l=e.includeInvisible||!1,c=e.intersect?fa(n,r,a,i,l):da(n,r,a,!1,i,l),u=[];return c.length?(n.getSortedVisibleDatasetMetas().forEach(f=>{const g=c[0].index,p=f.data[g];p&&!p.skip&&u.push({element:p,datasetIndex:f.index,index:g})}),u):[]},dataset(n,t,e,i){const r=Fn(t,n),a=e.axis||"xy",l=e.includeInvisible||!1;let c=e.intersect?fa(n,r,a,i,l):da(n,r,a,!1,i,l);if(c.length>0){const u=c[0].datasetIndex,f=n.getDatasetMeta(u).data;c=[];for(let g=0;g<f.length;++g)c.push({element:f[g],datasetIndex:u,index:g})}return c},point(n,t,e,i){const r=Fn(t,n),a=e.axis||"xy",l=e.includeInvisible||!1;return fa(n,r,a,i,l)},nearest(n,t,e,i){const r=Fn(t,n),a=e.axis||"xy",l=e.includeInvisible||!1;return da(n,r,a,e.intersect,i,l)},x(n,t,e,i){const r=Fn(t,n);return ou(n,r,"x",e.intersect,i)},y(n,t,e,i){const r=Fn(t,n);return ou(n,r,"y",e.intersect,i)}}};const Of=["left","top","right","bottom"];function Fi(n,t){return n.filter(e=>e.pos===t)}function au(n,t){return n.filter(e=>Of.indexOf(e.pos)===-1&&e.box.axis===t)}function Bi(n,t){return n.sort((e,i)=>{const r=t?i:e,a=t?e:i;return r.weight===a.weight?r.index-a.index:r.weight-a.weight})}function a1(n){const t=[];let e,i,r,a,l,c;for(e=0,i=(n||[]).length;e<i;++e)r=n[e],{position:a,options:{stack:l,stackWeight:c=1}}=r,t.push({index:e,box:r,pos:a,horizontal:r.isHorizontal(),weight:r.weight,stack:l&&a+l,stackWeight:c});return t}function l1(n){const t={};for(const e of n){const{stack:i,pos:r,stackWeight:a}=e;if(!i||!Of.includes(r))continue;const l=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});l.count++,l.weight+=a}return t}function c1(n,t){const e=l1(n),{vBoxMaxWidth:i,hBoxMaxHeight:r}=t;let a,l,c;for(a=0,l=n.length;a<l;++a){c=n[a];const{fullSize:u}=c.box,f=e[c.stack],g=f&&c.stackWeight/f.weight;c.horizontal?(c.width=g?g*i:u&&t.availableWidth,c.height=r):(c.width=i,c.height=g?g*r:u&&t.availableHeight)}return e}function h1(n){const t=a1(n),e=Bi(t.filter(f=>f.box.fullSize),!0),i=Bi(Fi(t,"left"),!0),r=Bi(Fi(t,"right")),a=Bi(Fi(t,"top"),!0),l=Bi(Fi(t,"bottom")),c=au(t,"x"),u=au(t,"y");return{fullSize:e,leftAndTop:i.concat(a),rightAndBottom:r.concat(u).concat(l).concat(c),chartArea:Fi(t,"chartArea"),vertical:i.concat(r).concat(u),horizontal:a.concat(l).concat(c)}}function lu(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function Df(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right)}function u1(n,t,e,i){const{pos:r,box:a}=e,l=n.maxPadding;if(!rt(r)){e.size&&(n[r]-=e.size);const p=i[e.stack]||{size:0,count:1};p.size=Math.max(p.size,e.horizontal?a.height:a.width),e.size=p.size/p.count,n[r]+=e.size}a.getPadding&&Df(l,a.getPadding());const c=Math.max(0,t.outerWidth-lu(l,n,"left","right")),u=Math.max(0,t.outerHeight-lu(l,n,"top","bottom")),f=c!==n.w,g=u!==n.h;return n.w=c,n.h=u,e.horizontal?{same:f,other:g}:{same:g,other:f}}function f1(n){const t=n.maxPadding;function e(i){const r=Math.max(t[i]-n[i],0);return n[i]+=r,r}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function d1(n,t){const e=t.maxPadding;function i(r){const a={left:0,top:0,right:0,bottom:0};return r.forEach(l=>{a[l]=Math.max(t[l],e[l])}),a}return i(n?["left","right"]:["top","bottom"])}function Vi(n,t,e,i){const r=[];let a,l,c,u,f,g;for(a=0,l=n.length,f=0;a<l;++a){c=n[a],u=c.box,u.update(c.width||t.w,c.height||t.h,d1(c.horizontal,t));const{same:p,other:_}=u1(t,e,c,i);f|=p&&r.length,g=g||_,u.fullSize||r.push(c)}return f&&Vi(r,t,e,i)||g}function sr(n,t,e,i,r){n.top=e,n.left=t,n.right=t+i,n.bottom=e+r,n.width=i,n.height=r}function cu(n,t,e,i){const r=e.padding;let{x:a,y:l}=t;for(const c of n){const u=c.box,f=i[c.stack]||{count:1,placed:0,weight:1},g=c.stackWeight/f.weight||1;if(c.horizontal){const p=t.w*g,_=f.size||u.height;we(f.start)&&(l=f.start),u.fullSize?sr(u,r.left,l,e.outerWidth-r.right-r.left,_):sr(u,t.left+f.placed,l,p,_),f.start=l,f.placed+=p,l=u.bottom}else{const p=t.h*g,_=f.size||u.width;we(f.start)&&(a=f.start),u.fullSize?sr(u,a,r.top,_,e.outerHeight-r.bottom-r.top):sr(u,a,t.top+f.placed,_,p),f.start=a,f.placed+=p,a=u.right}}t.x=a,t.y=l}var Xt={addBox(n,t){n.boxes||(n.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,i){if(!n)return;const r=Gt(n.options.layout.padding),a=Math.max(t-r.width,0),l=Math.max(e-r.height,0),c=h1(n.boxes),u=c.vertical,f=c.horizontal;pt(n.boxes,M=>{typeof M.beforeLayout=="function"&&M.beforeLayout()});const g=u.reduce((M,A)=>A.box.options&&A.box.options.display===!1?M:M+1,0)||1,p=Object.freeze({outerWidth:t,outerHeight:e,padding:r,availableWidth:a,availableHeight:l,vBoxMaxWidth:a/2/g,hBoxMaxHeight:l/2}),_=Object.assign({},r);Df(_,Gt(i));const y=Object.assign({maxPadding:_,w:a,h:l,x:r.left,y:r.top},r),w=c1(u.concat(f),p);Vi(c.fullSize,y,p,w),Vi(u,y,p,w),Vi(f,y,p,w)&&Vi(u,y,p,w),f1(y),cu(c.leftAndTop,y,p,w),y.x+=y.w,y.y+=y.h,cu(c.rightAndBottom,y,p,w),n.chartArea={left:y.left,top:y.top,right:y.left+y.w,bottom:y.top+y.h,height:y.h,width:y.w},pt(c.chartArea,M=>{const A=M.box;Object.assign(A,n.chartArea),A.update(y.w,y.h,{left:0,top:0,right:0,bottom:0})})}};class Lf{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,r){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,r?Math.floor(e/r):i)}}isAttached(t){return!0}updateConfig(t){}}class g1 extends Lf{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const br="$chartjs",p1={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},hu=n=>n===null||n==="";function m1(n,t){const e=n.style,i=n.getAttribute("height"),r=n.getAttribute("width");if(n[br]={initial:{height:i,width:r,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",hu(r)){const a=Xh(n,"width");a!==void 0&&(n.width=a)}if(hu(i))if(n.style.height==="")n.height=n.width/(t||2);else{const a=Xh(n,"height");a!==void 0&&(n.height=a)}return n}const Rf=bv?{passive:!0}:!1;function _1(n,t,e){n.addEventListener(t,e,Rf)}function b1(n,t,e){n.canvas.removeEventListener(t,e,Rf)}function x1(n,t){const e=p1[n.type]||n.type,{x:i,y:r}=Fn(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:r!==void 0?r:null}}function Cr(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function y1(n,t,e){const i=n.canvas,r=new MutationObserver(a=>{let l=!1;for(const c of a)l=l||Cr(c.addedNodes,i),l=l&&!Cr(c.removedNodes,i);l&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}function v1(n,t,e){const i=n.canvas,r=new MutationObserver(a=>{let l=!1;for(const c of a)l=l||Cr(c.removedNodes,i),l=l&&!Cr(c.addedNodes,i);l&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}const es=new Map;let uu=0;function Ef(){const n=window.devicePixelRatio;n!==uu&&(uu=n,es.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function w1(n,t){es.size||window.addEventListener("resize",Ef),es.set(n,t)}function M1(n){es.delete(n),es.size||window.removeEventListener("resize",Ef)}function S1(n,t,e){const i=n.canvas,r=i&&Ga(i);if(!r)return;const a=lf((c,u)=>{const f=r.clientWidth;e(c,u),f<r.clientWidth&&e()},window),l=new ResizeObserver(c=>{const u=c[0],f=u.contentRect.width,g=u.contentRect.height;f===0&&g===0||a(f,g)});return l.observe(r),w1(n,a),l}function ga(n,t,e){e&&e.disconnect(),t==="resize"&&M1(n)}function A1(n,t,e){const i=n.canvas,r=lf(a=>{n.ctx!==null&&e(x1(a,n))},n);return _1(i,t,r),r}class k1 extends Lf{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(m1(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[br])return!1;const i=e[br].initial;["height","width"].forEach(a=>{const l=i[a];lt(l)?e.removeAttribute(a):e.setAttribute(a,l)});const r=i.style||{};return Object.keys(r).forEach(a=>{e.style[a]=r[a]}),e.width=e.width,delete e[br],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const r=t.$proxies||(t.$proxies={}),l={attach:y1,detach:v1,resize:S1}[e]||A1;r[e]=l(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),r=i[e];if(!r)return;({attach:ga,detach:ga,resize:ga}[e]||b1)(t,e,r),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,r){return _v(t,e,i,r)}isAttached(t){const e=Ga(t);return!!(e&&e.isConnected)}}function P1(n){return!vf()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?g1:k1}class Le{constructor(){U(this,"active",!1)}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return ci(this.x)&&ci(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const r={};return t.forEach(a=>{r[a]=i[a]&&i[a].active()?i[a]._to:this[a]}),r}}U(Le,"defaults",{}),U(Le,"defaultRoutes");function C1(n,t){const e=n.options.ticks,i=T1(n),r=Math.min(e.maxTicksLimit||i,i),a=e.major.enabled?D1(t):[],l=a.length,c=a[0],u=a[l-1],f=[];if(l>r)return L1(t,f,a,l/r),f;const g=O1(a,t,r);if(l>0){let p,_;const y=l>1?Math.round((u-c)/(l-1)):null;for(rr(t,f,g,lt(y)?0:c-y,c),p=0,_=l-1;p<_;p++)rr(t,f,g,a[p],a[p+1]);return rr(t,f,g,u,lt(y)?t.length:u+y),f}return rr(t,f,g),f}function T1(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),r=n._maxLength/e;return Math.floor(Math.min(i,r))}function O1(n,t,e){const i=R1(n),r=t.length/e;if(!i)return Math.max(r,1);const a=vy(i);for(let l=0,c=a.length-1;l<c;l++){const u=a[l];if(u>r)return u}return Math.max(r,1)}function D1(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function L1(n,t,e,i){let r=0,a=e[0],l;for(i=Math.ceil(i),l=0;l<n.length;l++)l===a&&(t.push(n[l]),r++,a=e[r*i])}function rr(n,t,e,i,r){const a=Z(i,0),l=Math.min(Z(r,n.length),n.length);let c=0,u,f,g;for(e=Math.ceil(e),r&&(u=r-i,e=u/Math.floor(u/e)),g=a;g<0;)c++,g=Math.round(a+c*e);for(f=Math.max(a,0);f<l;f++)f===g&&(t.push(n[f]),c++,g=Math.round(a+c*e))}function R1(n){const t=n.length;let e,i;if(t<2)return!1;for(i=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==i)return!1;return i}const E1=n=>n==="left"?"right":n==="right"?"left":n,fu=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,du=(n,t)=>Math.min(t||n,n);function gu(n,t){const e=[],i=n.length/t,r=n.length;let a=0;for(;a<r;a+=i)e.push(n[Math.floor(a)]);return e}function I1(n,t,e){const i=n.ticks.length,r=Math.min(t,i-1),a=n._startPixel,l=n._endPixel,c=1e-6;let u=n.getPixelForTick(r),f;if(!(e&&(i===1?f=Math.max(u-a,l-u):t===0?f=(n.getPixelForTick(1)-u)/2:f=(u-n.getPixelForTick(r-1))/2,u+=r<t?f:-f,u<a-c||u>l+c)))return u}function F1(n,t){pt(n,e=>{const i=e.gc,r=i.length/2;let a;if(r>t){for(a=0;a<r;++a)delete e.data[i[a]];i.splice(0,r)}})}function zi(n){return n.drawTicks?n.tickLength:0}function pu(n,t){if(!n.display)return 0;const e=Ft(n.font,t),i=Gt(n.padding);return(vt(n.text)?n.text.length:1)*e.lineHeight+i.height}function B1(n,t){return yn(n,{scale:t,type:"scale"})}function z1(n,t,e){return yn(n,{tick:e,index:t,type:"tick"})}function W1(n,t,e){let i=Va(n);return(e&&t!=="right"||!e&&t==="right")&&(i=E1(i)),i}function N1(n,t,e,i){const{top:r,left:a,bottom:l,right:c,chart:u}=n,{chartArea:f,scales:g}=u;let p=0,_,y,w;const M=l-r,A=c-a;if(n.isHorizontal()){if(y=Yt(i,a,c),rt(e)){const C=Object.keys(e)[0],O=e[C];w=g[C].getPixelForValue(O)+M-t}else e==="center"?w=(f.bottom+f.top)/2+M-t:w=fu(n,e,t);_=c-a}else{if(rt(e)){const C=Object.keys(e)[0],O=e[C];y=g[C].getPixelForValue(O)-A+t}else e==="center"?y=(f.left+f.right)/2-A+t:y=fu(n,e,t);w=Yt(i,l,r),p=e==="left"?-Ct:Ct}return{titleX:y,titleY:w,maxWidth:_,rotation:p}}class $n extends Le{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:r}=this;return t=he(t,Number.POSITIVE_INFINITY),e=he(e,Number.NEGATIVE_INFINITY),i=he(i,Number.POSITIVE_INFINITY),r=he(r,Number.NEGATIVE_INFINITY),{min:he(t,i),max:he(e,r),minDefined:Pt(t),maxDefined:Pt(e)}}getMinMax(t){let{min:e,max:i,minDefined:r,maxDefined:a}=this.getUserBounds(),l;if(r&&a)return{min:e,max:i};const c=this.getMatchingVisibleMetas();for(let u=0,f=c.length;u<f;++u)l=c[u].controller.getMinMax(this,t),r||(e=Math.min(e,l.min)),a||(i=Math.max(i,l.max));return e=a&&e>i?i:e,i=r&&e>i?e:i,{min:he(e,he(i,e)),max:he(i,he(e,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(){xt(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:r,grace:a,ticks:l}=this.options,c=l.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=qy(this,a,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const u=c<this.ticks.length;this._convertTicksToLabels(u?gu(this.ticks,c):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),l.display&&(l.autoSkip||l.source==="auto")&&(this.ticks=C1(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),u&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){xt(this.options.afterUpdate,[this])}beforeSetDimensions(){xt(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(){xt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),xt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){xt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,r,a;for(i=0,r=t.length;i<r;i++)a=t[i],a.label=xt(e.callback,[a.value,i,t],this)}afterTickToLabelConversion(){xt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){xt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=du(this.ticks.length,t.ticks.maxTicksLimit),r=e.minRotation||0,a=e.maxRotation;let l=r,c,u,f;if(!this._isVisible()||!e.display||r>=a||i<=1||!this.isHorizontal()){this.labelRotation=r;return}const g=this._getLabelSizes(),p=g.widest.width,_=g.highest.height,y=Wt(this.chart.width-p,0,this.maxWidth);c=t.offset?this.maxWidth/i:y/(i-1),p+6>c&&(c=y/(i-(t.offset?.5:1)),u=this.maxHeight-zi(t.grid)-e.padding-pu(t.title,this.chart.options.font),f=Math.sqrt(p*p+_*_),l=Na(Math.min(Math.asin(Wt((g.highest.height+6)/c,-1,1)),Math.asin(Wt(u/f,-1,1))-Math.asin(Wt(_/f,-1,1)))),l=Math.max(r,Math.min(a,l))),this.labelRotation=l}afterCalculateLabelRotation(){xt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){xt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:r,grid:a}}=this,l=this._isVisible(),c=this.isHorizontal();if(l){const u=pu(r,e.options.font);if(c?(t.width=this.maxWidth,t.height=zi(a)+u):(t.height=this.maxHeight,t.width=zi(a)+u),i.display&&this.ticks.length){const{first:f,last:g,widest:p,highest:_}=this._getLabelSizes(),y=i.padding*2,w=Oe(this.labelRotation),M=Math.cos(w),A=Math.sin(w);if(c){const C=i.mirror?0:A*p.width+M*_.height;t.height=Math.min(this.maxHeight,t.height+C+y)}else{const C=i.mirror?0:M*p.width+A*_.height;t.width=Math.min(this.maxWidth,t.width+C+y)}this._calculatePadding(f,g,A,M)}}this._handleMargins(),c?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,r){const{ticks:{align:a,padding:l},position:c}=this.options,u=this.labelRotation!==0,f=c!=="top"&&this.axis==="x";if(this.isHorizontal()){const g=this.getPixelForTick(0)-this.left,p=this.right-this.getPixelForTick(this.ticks.length-1);let _=0,y=0;u?f?(_=r*t.width,y=i*e.height):(_=i*t.height,y=r*e.width):a==="start"?y=e.width:a==="end"?_=t.width:a!=="inner"&&(_=t.width/2,y=e.width/2),this.paddingLeft=Math.max((_-g+l)*this.width/(this.width-g),0),this.paddingRight=Math.max((y-p+l)*this.width/(this.width-p),0)}else{let g=e.height/2,p=t.height/2;a==="start"?(g=0,p=t.height):a==="end"&&(g=e.height,p=0),this.paddingTop=g+l,this.paddingBottom=p+l}}_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(){xt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)lt(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=gu(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:r,_longestTextCache:a}=this,l=[],c=[],u=Math.floor(e/du(e,i));let f=0,g=0,p,_,y,w,M,A,C,O,I,F,L;for(p=0;p<e;p+=u){if(w=t[p].label,M=this._resolveTickFontOptions(p),r.font=A=M.string,C=a[A]=a[A]||{data:{},gc:[]},O=M.lineHeight,I=F=0,!lt(w)&&!vt(w))I=kr(r,C.data,C.gc,I,w),F=O;else if(vt(w))for(_=0,y=w.length;_<y;++_)L=w[_],!lt(L)&&!vt(L)&&(I=kr(r,C.data,C.gc,I,L),F+=O);l.push(I),c.push(F),f=Math.max(I,f),g=Math.max(F,g)}F1(a,e);const W=l.indexOf(f),z=c.indexOf(g),N=Y=>({width:l[Y]||0,height:c[Y]||0});return{first:N(0),last:N(e-1),widest:N(W),highest:N(z),widths:l,heights:c}}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 Sy(this._alignToPixels?Rn(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=z1(this.getContext(),t,i))}return this.$context||(this.$context=B1(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Oe(this.labelRotation),i=Math.abs(Math.cos(e)),r=Math.abs(Math.sin(e)),a=this._getLabelSizes(),l=t.autoSkipPadding||0,c=a?a.widest.width+l:0,u=a?a.highest.height+l:0;return this.isHorizontal()?u*i>c*r?c/i:u/r:u*r<c*i?u/i:c/r}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,r=this.options,{grid:a,position:l,border:c}=r,u=a.offset,f=this.isHorizontal(),p=this.ticks.length+(u?1:0),_=zi(a),y=[],w=c.setContext(this.getContext()),M=w.display?w.width:0,A=M/2,C=function(_t){return Rn(i,_t,M)};let O,I,F,L,W,z,N,Y,J,Q,at,Rt;if(l==="top")O=C(this.bottom),z=this.bottom-_,Y=O-A,Q=C(t.top)+A,Rt=t.bottom;else if(l==="bottom")O=C(this.top),Q=t.top,Rt=C(t.bottom)-A,z=O+A,Y=this.top+_;else if(l==="left")O=C(this.right),W=this.right-_,N=O-A,J=C(t.left)+A,at=t.right;else if(l==="right")O=C(this.left),J=t.left,at=C(t.right)-A,W=O+A,N=this.left+_;else if(e==="x"){if(l==="center")O=C((t.top+t.bottom)/2+.5);else if(rt(l)){const _t=Object.keys(l)[0],dt=l[_t];O=C(this.chart.scales[_t].getPixelForValue(dt))}Q=t.top,Rt=t.bottom,z=O+A,Y=z+_}else if(e==="y"){if(l==="center")O=C((t.left+t.right)/2);else if(rt(l)){const _t=Object.keys(l)[0],dt=l[_t];O=C(this.chart.scales[_t].getPixelForValue(dt))}W=O-A,N=W-_,J=t.left,at=t.right}const Vt=Z(r.ticks.maxTicksLimit,p),ht=Math.max(1,Math.ceil(p/Vt));for(I=0;I<p;I+=ht){const _t=this.getContext(I),dt=a.setContext(_t),Lt=c.setContext(_t),Bt=dt.lineWidth,Me=dt.color,Kt=Lt.dash||[],nn=Lt.dashOffset,vn=dt.tickWidth,wn=dt.tickColor,fe=dt.tickBorderDash||[],Re=dt.tickBorderDashOffset;F=I1(this,I,u),F!==void 0&&(L=Rn(i,F,Bt),f?W=N=J=at=L:z=Y=Q=Rt=L,y.push({tx1:W,ty1:z,tx2:N,ty2:Y,x1:J,y1:Q,x2:at,y2:Rt,width:Bt,color:Me,borderDash:Kt,borderDashOffset:nn,tickWidth:vn,tickColor:wn,tickBorderDash:fe,tickBorderDashOffset:Re}))}return this._ticksLength=p,this._borderValue=O,y}_computeLabelItems(t){const e=this.axis,i=this.options,{position:r,ticks:a}=i,l=this.isHorizontal(),c=this.ticks,{align:u,crossAlign:f,padding:g,mirror:p}=a,_=zi(i.grid),y=_+g,w=p?-g:y,M=-Oe(this.labelRotation),A=[];let C,O,I,F,L,W,z,N,Y,J,Q,at,Rt="middle";if(r==="top")W=this.bottom-w,z=this._getXAxisLabelAlignment();else if(r==="bottom")W=this.top+w,z=this._getXAxisLabelAlignment();else if(r==="left"){const ht=this._getYAxisLabelAlignment(_);z=ht.textAlign,L=ht.x}else if(r==="right"){const ht=this._getYAxisLabelAlignment(_);z=ht.textAlign,L=ht.x}else if(e==="x"){if(r==="center")W=(t.top+t.bottom)/2+y;else if(rt(r)){const ht=Object.keys(r)[0],_t=r[ht];W=this.chart.scales[ht].getPixelForValue(_t)+y}z=this._getXAxisLabelAlignment()}else if(e==="y"){if(r==="center")L=(t.left+t.right)/2-y;else if(rt(r)){const ht=Object.keys(r)[0],_t=r[ht];L=this.chart.scales[ht].getPixelForValue(_t)}z=this._getYAxisLabelAlignment(_).textAlign}e==="y"&&(u==="start"?Rt="top":u==="end"&&(Rt="bottom"));const Vt=this._getLabelSizes();for(C=0,O=c.length;C<O;++C){I=c[C],F=I.label;const ht=a.setContext(this.getContext(C));N=this.getPixelForTick(C)+a.labelOffset,Y=this._resolveTickFontOptions(C),J=Y.lineHeight,Q=vt(F)?F.length:1;const _t=Q/2,dt=ht.color,Lt=ht.textStrokeColor,Bt=ht.textStrokeWidth;let Me=z;l?(L=N,z==="inner"&&(C===O-1?Me=this.options.reverse?"left":"right":C===0?Me=this.options.reverse?"right":"left":Me="center"),r==="top"?f==="near"||M!==0?at=-Q*J+J/2:f==="center"?at=-Vt.highest.height/2-_t*J+J:at=-Vt.highest.height+J/2:f==="near"||M!==0?at=J/2:f==="center"?at=Vt.highest.height/2-_t*J:at=Vt.highest.height-Q*J,p&&(at*=-1),M!==0&&!ht.showLabelBackdrop&&(L+=J/2*Math.sin(M))):(W=N,at=(1-Q)*J/2);let Kt;if(ht.showLabelBackdrop){const nn=Gt(ht.backdropPadding),vn=Vt.heights[C],wn=Vt.widths[C];let fe=at-nn.top,Re=0-nn.left;switch(Rt){case"middle":fe-=vn/2;break;case"bottom":fe-=vn;break}switch(z){case"center":Re-=wn/2;break;case"right":Re-=wn;break}Kt={left:Re,top:fe,width:wn+nn.width,height:vn+nn.height,color:ht.backdropColor}}A.push({label:F,font:Y,textOffset:at,options:{rotation:M,color:dt,strokeColor:Lt,strokeWidth:Bt,textAlign:Me,textBaseline:Rt,translation:[L,W],backdrop:Kt}})}return A}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Oe(this.labelRotation))return t==="top"?"left":"right";let r="center";return e.align==="start"?r="left":e.align==="end"?r="right":e.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:r,padding:a}}=this.options,l=this._getLabelSizes(),c=t+a,u=l.widest.width;let f,g;return e==="left"?r?(g=this.right+a,i==="near"?f="left":i==="center"?(f="center",g+=u/2):(f="right",g+=u)):(g=this.right-c,i==="near"?f="right":i==="center"?(f="center",g-=u/2):(f="left",g=this.left)):e==="right"?r?(g=this.left+a,i==="near"?f="right":i==="center"?(f="center",g-=u/2):(f="left",g-=u)):(g=this.left+c,i==="near"?f="left":i==="center"?(f="center",g+=u/2):(f="right",g=this.right)):f="right",{textAlign:f,x:g}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:r,width:a,height:l}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,r,a,l),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const r=this.ticks.findIndex(a=>a.value===t);return r>=0?e.setContext(this.getContext(r)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let a,l;const c=(u,f,g)=>{!g.width||!g.color||(i.save(),i.lineWidth=g.width,i.strokeStyle=g.color,i.setLineDash(g.borderDash||[]),i.lineDashOffset=g.borderDashOffset,i.beginPath(),i.moveTo(u.x,u.y),i.lineTo(f.x,f.y),i.stroke(),i.restore())};if(e.display)for(a=0,l=r.length;a<l;++a){const u=r[a];e.drawOnChartArea&&c({x:u.x1,y:u.y1},{x:u.x2,y:u.y2},u),e.drawTicks&&c({x:u.tx1,y:u.ty1},{x:u.tx2,y:u.ty2},{color:u.tickColor,width:u.tickWidth,borderDash:u.tickBorderDash,borderDashOffset:u.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:r}}=this,a=i.setContext(this.getContext()),l=i.display?a.width:0;if(!l)return;const c=r.setContext(this.getContext(0)).lineWidth,u=this._borderValue;let f,g,p,_;this.isHorizontal()?(f=Rn(t,this.left,l)-l/2,g=Rn(t,this.right,c)+c/2,p=_=u):(p=Rn(t,this.top,l)-l/2,_=Rn(t,this.bottom,c)+c/2,f=g=u),e.save(),e.lineWidth=a.width,e.strokeStyle=a.color,e.beginPath(),e.moveTo(f,p),e.lineTo(g,_),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,r=this._computeLabelArea();r&&Rr(i,r);const a=this.getLabelItems(t);for(const l of a){const c=l.options,u=l.font,f=l.label,g=l.textOffset;Un(i,f,0,g,u,c)}r&&Er(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:r}}=this;if(!i.display)return;const a=Ft(i.font),l=Gt(i.padding),c=i.align;let u=a.lineHeight/2;e==="bottom"||e==="center"||rt(e)?(u+=l.bottom,vt(i.text)&&(u+=a.lineHeight*(i.text.length-1))):u+=l.top;const{titleX:f,titleY:g,maxWidth:p,rotation:_}=N1(this,u,e,c);Un(t,i.text,0,0,a,{color:i.color,maxWidth:p,rotation:_,textAlign:W1(c,e,r),textBaseline:"middle",translation:[f,g]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=Z(t.grid&&t.grid.z,-1),r=Z(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==$n.prototype.draw?[{z:e,draw:a=>{this.draw(a)}}]:[{z:i,draw:a=>{this.drawBackground(),this.drawGrid(a),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:e,draw:a=>{this.drawLabels(a)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",r=[];let a,l;for(a=0,l=e.length;a<l;++a){const c=e[a];c[i]===this.id&&(!t||c.type===t)&&r.push(c)}return r}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return Ft(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class or{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;U1(e)&&(i=this.register(e));const r=this.items,a=t.id,l=this.scope+"."+a;if(!a)throw new Error("class does not have id: "+t);return a in r||(r[a]=t,H1(t,l,i),this.override&&Dt.override(t.id,t.overrides)),l}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,r=this.scope;i in e&&delete e[i],r&&i in Dt[r]&&(delete Dt[r][i],this.override&&delete Vn[i])}}function H1(n,t,e){const i=Zi(Object.create(null),[e?Dt.get(e):{},Dt.get(t),n.defaults]);Dt.set(t,i),n.defaultRoutes&&V1(t,n.defaultRoutes),n.descriptors&&Dt.describe(t,n.descriptors)}function V1(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),r=i.pop(),a=[n].concat(i).join("."),l=t[e].split("."),c=l.pop(),u=l.join(".");Dt.route(a,r,u,c)})}function U1(n){return"id"in n&&"defaults"in n}class $1{constructor(){this.controllers=new or(De,"datasets",!0),this.elements=new or(Le,"elements"),this.plugins=new or(Object,"plugins"),this.scales=new or($n,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(r=>{const a=i||this._getRegistryForType(r);i||a.isForType(r)||a===this.plugins&&r.id?this._exec(t,a,r):pt(r,l=>{const c=i||this._getRegistryForType(l);this._exec(t,c,l)})})}_exec(t,e,i){const r=Wa(t);xt(i["before"+r],[],i),e[t](i),xt(i["after"+r],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const r=e.get(t);if(r===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return r}}var ze=new $1;class Y1{constructor(){this._init=[]}notify(t,e,i,r){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const a=r?this._descriptors(t).filter(r):this._descriptors(t),l=this._notify(a,t,e,i);return e==="afterDestroy"&&(this._notify(a,t,"stop"),this._notify(this._init,t,"uninstall")),l}_notify(t,e,i,r){r=r||{};for(const a of t){const l=a.plugin,c=l[i],u=[e,r,a.options];if(xt(c,u,l)===!1&&r.cancelable)return!1}return!0}invalidate(){lt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,r=Z(i.options&&i.options.plugins,{}),a=X1(i);return r===!1&&!e?[]:K1(t,a,r,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,r=(a,l)=>a.filter(c=>!l.some(u=>c.plugin.id===u.plugin.id));this._notify(r(e,i),t,"stop"),this._notify(r(i,e),t,"start")}}function X1(n){const t={},e=[],i=Object.keys(ze.plugins.items);for(let a=0;a<i.length;a++)e.push(ze.getPlugin(i[a]));const r=n.plugins||[];for(let a=0;a<r.length;a++){const l=r[a];e.indexOf(l)===-1&&(e.push(l),t[l.id]=!0)}return{plugins:e,localIds:t}}function G1(n,t){return!t&&n===!1?null:n===!0?{}:n}function K1(n,{plugins:t,localIds:e},i,r){const a=[],l=n.getContext();for(const c of t){const u=c.id,f=G1(i[u],r);f!==null&&a.push({plugin:c,options:q1(n.config,{plugin:c,local:e[u]},f,l)})}return a}function q1(n,{plugin:t,local:e},i,r){const a=n.pluginScopeKeys(t),l=n.getOptionScopes(i,a);return e&&t.defaults&&l.push(t.defaults),n.createResolver(l,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ka(n,t){const e=Dt.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function j1(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function Z1(n,t){return n===t?"_index_":"_value_"}function J1(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function Tr(n,t){if(n==="x"||n==="y"||n==="r"||(n=t.axis||J1(t.position)||n.length>1&&Tr(n[0].toLowerCase(),t),n))return n;throw new Error(`Cannot determine type of '${name}' axis. Please provide 'axis' or 'position' option.`)}function Q1(n,t){const e=Vn[n.type]||{scales:{}},i=t.scales||{},r=ka(n.type,t),a=Object.create(null);return Object.keys(i).forEach(l=>{const c=i[l];if(!rt(c))return console.error(`Invalid scale configuration for scale: ${l}`);if(c._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${l}`);const u=Tr(l,c),f=Z1(u,r),g=e.scales||{};a[l]=Yi(Object.create(null),[{axis:u},c,g[u],g[f]])}),n.data.datasets.forEach(l=>{const c=l.type||n.type,u=l.indexAxis||ka(c,t),g=(Vn[c]||{}).scales||{};Object.keys(g).forEach(p=>{const _=j1(p,u),y=l[_+"AxisID"]||_;a[y]=a[y]||Object.create(null),Yi(a[y],[{axis:_},i[y],g[p]])})}),Object.keys(a).forEach(l=>{const c=a[l];Yi(c,[Dt.scales[c.type],Dt.scale])}),a}function If(n){const t=n.options||(n.options={});t.plugins=Z(t.plugins,{}),t.scales=Q1(n,t)}function Ff(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function tw(n){return n=n||{},n.data=Ff(n.data),If(n),n}const mu=new Map,Bf=new Set;function ar(n,t){let e=mu.get(n);return e||(e=t(),mu.set(n,e),Bf.add(e)),e}const Wi=(n,t,e)=>{const i=bn(t,e);i!==void 0&&n.add(i)};class ew{constructor(t){this._config=tw(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=Ff(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(),If(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,i=this.type;return ar(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let r=i.get(t);return(!r||e)&&(r=new Map,i.set(t,r)),r}getOptionScopes(t,e,i){const{options:r,type:a}=this,l=this._cachedScopes(t,i),c=l.get(e);if(c)return c;const u=new Set;e.forEach(g=>{t&&(u.add(t),g.forEach(p=>Wi(u,t,p))),g.forEach(p=>Wi(u,r,p)),g.forEach(p=>Wi(u,Vn[a]||{},p)),g.forEach(p=>Wi(u,Dt,p)),g.forEach(p=>Wi(u,Ma,p))});const f=Array.from(u);return f.length===0&&f.push(Object.create(null)),Bf.has(e)&&l.set(e,f),f}chartOptionScopes(){const{options:t,type:e}=this;return[t,Vn[e]||{},Dt.datasets[e]||{},{type:e},Dt,Ma]}resolveNamedOptions(t,e,i,r=[""]){const a={$shared:!0},{resolver:l,subPrefixes:c}=_u(this._resolverCache,t,r);let u=l;if(iw(l,e)){a.$shared=!1,i=xn(i)?i():i;const f=this.createResolver(t,i,c);u=hi(l,i,f)}for(const f of e)a[f]=u[f];return a}createResolver(t,e,i=[""],r){const{resolver:a}=_u(this._resolverCache,t,i);return rt(e)?hi(a,e,void 0,r):a}}function _u(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const r=e.join();let a=i.get(r);return a||(a={resolver:$a(t,e),subPrefixes:e.filter(c=>!c.toLowerCase().includes("hover"))},i.set(r,a)),a}const nw=n=>rt(n)&&Object.getOwnPropertyNames(n).reduce((t,e)=>t||xn(n[e]),!1);function iw(n,t){const{isScriptable:e,isIndexable:i}=pf(n);for(const r of t){const a=e(r),l=i(r),c=(l||a)&&n[r];if(a&&(xn(c)||nw(c))||l&&vt(c))return!0}return!1}var sw="4.2.1";const rw=["top","bottom","left","right","chartArea"];function bu(n,t){return n==="top"||n==="bottom"||rw.indexOf(n)===-1&&t==="x"}function xu(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function yu(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),xt(e&&e.onComplete,[n],t)}function ow(n){const t=n.chart,e=t.options.animation;xt(e&&e.onProgress,[n],t)}function zf(n){return vf()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const xr={},vu=n=>{const t=zf(n);return Object.values(xr).filter(e=>e.canvas===t).pop()};function aw(n,t,e){const i=Object.keys(n);for(const r of i){const a=+r;if(a>=t){const l=n[r];delete n[r],(e>0||a>t)&&(n[a+e]=l)}}}function lw(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}function cw(n){const{xScale:t,yScale:e}=n;if(t&&e)return{left:t.left,right:t.right,top:e.top,bottom:e.bottom}}class zn{static register(...t){ze.add(...t),wu()}static unregister(...t){ze.remove(...t),wu()}constructor(t,e){const i=this.config=new ew(e),r=zf(t),a=vu(r);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas with ID '"+a.canvas.id+"' can be reused.");const l=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||P1(r)),this.platform.updateConfig(i);const c=this.platform.acquireContext(r,l.aspectRatio),u=c&&c.canvas,f=u&&u.height,g=u&&u.width;if(this.id=fy(),this.ctx=c,this.canvas=u,this.width=g,this.height=f,this._options=l,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 Y1,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Cy(p=>this.update(p),l.resizeDelay||0),this._dataChanges=[],xr[this.id]=this,!c||!u){console.error("Failed to create chart: can't acquire context from the given item");return}Ze.listen(this,"complete",yu),Ze.listen(this,"progress",ow),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:r,_aspectRatio:a}=this;return lt(t)?e&&a?a:r?i/r:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return ze}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Yh(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Vh(this.canvas,this.ctx),this}stop(){return Ze.stop(this),this}resize(t,e){Ze.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,r=this.canvas,a=i.maintainAspectRatio&&this.aspectRatio,l=this.platform.getMaximumSize(r,t,e,a),c=i.devicePixelRatio||this.platform.getDevicePixelRatio(),u=this.width?"resize":"attach";this.width=l.width,this.height=l.height,this._aspectRatio=this.aspectRatio,Yh(this,c,!0)&&(this.notifyPlugins("resize",{size:l}),xt(i.onResize,[this,l],this),this.attached&&this._doResize(u)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};pt(e,(i,r)=>{i.id=r})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,r=Object.keys(i).reduce((l,c)=>(l[c]=!1,l),{});let a=[];e&&(a=a.concat(Object.keys(e).map(l=>{const c=e[l],u=Tr(l,c),f=u==="r",g=u==="x";return{options:c,dposition:f?"chartArea":g?"bottom":"left",dtype:f?"radialLinear":g?"category":"linear"}}))),pt(a,l=>{const c=l.options,u=c.id,f=Tr(u,c),g=Z(c.type,l.dtype);(c.position===void 0||bu(c.position,f)!==bu(l.dposition))&&(c.position=l.dposition),r[u]=!0;let p=null;if(u in i&&i[u].type===g)p=i[u];else{const _=ze.getScale(g);p=new _({id:u,type:g,ctx:this.ctx,chart:this}),i[p.id]=p}p.init(c,t)}),pt(r,(l,c)=>{l||delete i[c]}),pt(i,l=>{Xt.configure(this,l,l.options),Xt.addBox(this,l)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((r,a)=>r.index-a.index),i>e){for(let r=e;r<i;++r)this._destroyDatasetMeta(r);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(xu("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,r)=>{e.filter(a=>a===i._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,r;for(this._removeUnreferencedMetasets(),i=0,r=e.length;i<r;i++){const a=e[i];let l=this.getDatasetMeta(i);const c=a.type||this.config.type;if(l.type&&l.type!==c&&(this._destroyDatasetMeta(i),l=this.getDatasetMeta(i)),l.type=c,l.indexAxis=a.indexAxis||ka(c,this.options),l.order=a.order||0,l.index=i,l.label=""+a.label,l.visible=this.isDatasetVisible(i),l.controller)l.controller.updateIndex(i),l.controller.linkScales();else{const u=ze.getController(c),{datasetElementType:f,dataElementType:g}=Dt.datasets[c];Object.assign(u,{dataElementType:ze.getElement(g),datasetElementType:f&&ze.getElement(f)}),l.controller=new u(this,i),t.push(l.controller)}}return this._updateMetasets(),t}_resetElements(){pt(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let l=0;for(let f=0,g=this.data.datasets.length;f<g;f++){const{controller:p}=this.getDatasetMeta(f),_=!r&&a.indexOf(p)===-1;p.buildOrUpdateElements(_),l=Math.max(+p.getMaxOverflow(),l)}l=this._minPadding=i.layout.autoPadding?l:0,this._updateLayout(l),r||pt(a,f=>{f.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(xu("z","_idx"));const{_active:c,_lastEvent:u}=this;u?this._eventHandler(u,!0):c.length&&this._updateHoverStyles(c,c,!0),this.render()}_updateScales(){pt(this.scales,t=>{Xt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Rh(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:r,count:a}of e){const l=i==="_removeElements"?-a:a;aw(t,r,l)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=a=>new Set(t.filter(l=>l[0]===a).map((l,c)=>c+","+l.splice(1).join(","))),r=i(0);for(let a=1;a<e;a++)if(!Rh(r,i(a)))return;return Array.from(r).map(a=>a.split(",")).map(a=>({method:a[1],start:+a[2],count:+a[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Xt.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],pt(this.boxes,r=>{i&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,a)=>{r._idx=a}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,xn(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),r={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(i.controller._update(e),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Ze.has(this)?this.attached&&!Ze.running(this)&&Ze.start(this):(this.draw(),yu({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:r}=this._resizeBeforeDraw;this._resize(i,r),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let r,a;for(r=0,a=e.length;r<a;++r){const l=e[r];(!t||l.visible)&&i.push(l)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,r=!i.disabled,a=cw(t)||this.chartArea,l={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",l)!==!1&&(r&&Rr(e,{left:i.left===!1?0:a.left-i.left,right:i.right===!1?this.width:a.right+i.right,top:i.top===!1?0:a.top-i.top,bottom:i.bottom===!1?this.height:a.bottom+i.bottom}),t.controller.draw(),r&&Er(e),l.cancelable=!1,this.notifyPlugins("afterDatasetDraw",l))}isPointInArea(t){return Qi(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,r){const a=o1.modes[e];return typeof a=="function"?a(this,t,i,r):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let r=i.filter(a=>a&&a._dataset===e).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(r)),r}getContext(){return this.$context||(this.$context=yn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const r=i?"show":"hide",a=this.getDatasetMeta(t),l=a.controller._resolveAnimations(void 0,r);we(e)?(a.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),l.update(a,{visible:i}),this.update(c=>c.datasetIndex===t?r: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(),Ze.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(),Vh(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete xr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(a,l)=>{e.addEventListener(this,a,l),t[a]=l},r=(a,l,c)=>{a.offsetX=l,a.offsetY=c,this._eventHandler(a)};pt(this.options.events,a=>i(a,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(u,f)=>{e.addEventListener(this,u,f),t[u]=f},r=(u,f)=>{t[u]&&(e.removeEventListener(this,u,f),delete t[u])},a=(u,f)=>{this.canvas&&this.resize(u,f)};let l;const c=()=>{r("attach",c),this.attached=!0,this.resize(),i("resize",a),i("detach",l)};l=()=>{this.attached=!1,r("resize",a),this._stop(),this._resize(0,0),i("attach",c)},e.isAttached(this.canvas)?c():l()}unbindEvents(){pt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},pt(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const r=i?"set":"remove";let a,l,c,u;for(e==="dataset"&&(a=this.getDatasetMeta(t[0].datasetIndex),a.controller["_"+r+"DatasetHoverStyle"]()),c=0,u=t.length;c<u;++c){l=t[c];const f=l&&this.getDatasetMeta(l.datasetIndex).controller;f&&f[r+"HoverStyle"](l.element,l.datasetIndex,l.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:a,index:l})=>{const c=this.getDatasetMeta(a);if(!c)throw new Error("No dataset found at index "+a);return{datasetIndex:a,element:c.data[l],index:l}});!Mr(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const r=this.options.hover,a=(u,f)=>u.filter(g=>!f.some(p=>g.datasetIndex===p.datasetIndex&&g.index===p.index)),l=a(e,t),c=i?t:a(t,e);l.length&&this.updateHoverStyle(l,r.mode,!1),c.length&&r.mode&&this.updateHoverStyle(c,r.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},r=l=>(l.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,r)===!1)return;const a=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,r),(a||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:r=[],options:a}=this,l=e,c=this._getActiveElements(t,r,i,l),u=by(t),f=lw(t,this._lastEvent,i,u);i&&(this._lastEvent=null,xt(a.onHover,[t,c,this],this),u&&xt(a.onClick,[t,c,this],this));const g=!Mr(c,r);return(g||e)&&(this._active=c,this._updateHoverStyles(c,r,e)),this._lastEvent=f,g}_getActiveElements(t,e,i,r){if(t.type==="mouseout")return[];if(!i)return e;const a=this.options.hover;return this.getElementsAtEventForMode(t,a.mode,a,r)}}U(zn,"defaults",Dt),U(zn,"instances",xr),U(zn,"overrides",Vn),U(zn,"registry",ze),U(zn,"version",sw),U(zn,"getChart",vu);function wu(){return pt(zn.instances,n=>n._plugins.invalidate())}function hw(n,t,e){const{startAngle:i,pixelMargin:r,x:a,y:l,outerRadius:c,innerRadius:u}=t;let f=r/c;n.beginPath(),n.arc(a,l,c,i-f,e+f),u>r?(f=r/u,n.arc(a,l,u,e+f,i-f,!0)):n.arc(a,l,r,e+Ct,i-Ct),n.closePath(),n.clip()}function uw(n){return Ua(n,["outerStart","outerEnd","innerStart","innerEnd"])}function fw(n,t,e,i){const r=uw(n.options.borderRadius),a=(e-t)/2,l=Math.min(a,i*t/2),c=u=>{const f=(e-Math.min(a,u))*i/2;return Wt(u,0,Math.min(a,f))};return{outerStart:c(r.outerStart),outerEnd:c(r.outerEnd),innerStart:Wt(r.innerStart,0,l),innerEnd:Wt(r.innerEnd,0,l)}}function ai(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function Or(n,t,e,i,r,a){const{x:l,y:c,startAngle:u,pixelMargin:f,innerRadius:g}=t,p=Math.max(t.outerRadius+i+e-f,0),_=g>0?g+i+e+f:0;let y=0;const w=r-u;if(i){const ht=g>0?g-i:0,_t=p>0?p-i:0,dt=(ht+_t)/2,Lt=dt!==0?w*dt/(dt+i):w;y=(w-Lt)/2}const M=Math.max(.001,w*p-e/St)/p,A=(w-M)/2,C=u+A+y,O=r-A-y,{outerStart:I,outerEnd:F,innerStart:L,innerEnd:W}=fw(t,_,p,O-C),z=p-I,N=p-F,Y=C+I/z,J=O-F/N,Q=_+L,at=_+W,Rt=C+L/Q,Vt=O-W/at;if(n.beginPath(),a){const ht=(Y+J)/2;if(n.arc(l,c,p,Y,ht),n.arc(l,c,p,ht,J),F>0){const Bt=ai(N,J,l,c);n.arc(Bt.x,Bt.y,F,J,O+Ct)}const _t=ai(at,O,l,c);if(n.lineTo(_t.x,_t.y),W>0){const Bt=ai(at,Vt,l,c);n.arc(Bt.x,Bt.y,W,O+Ct,Vt+Math.PI)}const dt=(O-W/_+(C+L/_))/2;if(n.arc(l,c,_,O-W/_,dt,!0),n.arc(l,c,_,dt,C+L/_,!0),L>0){const Bt=ai(Q,Rt,l,c);n.arc(Bt.x,Bt.y,L,Rt+Math.PI,C-Ct)}const Lt=ai(z,C,l,c);if(n.lineTo(Lt.x,Lt.y),I>0){const Bt=ai(z,Y,l,c);n.arc(Bt.x,Bt.y,I,C-Ct,Y)}}else{n.moveTo(l,c);const ht=Math.cos(Y)*p+l,_t=Math.sin(Y)*p+c;n.lineTo(ht,_t);const dt=Math.cos(J)*p+l,Lt=Math.sin(J)*p+c;n.lineTo(dt,Lt)}n.closePath()}function dw(n,t,e,i,r){const{fullCircles:a,startAngle:l,circumference:c}=t;let u=t.endAngle;if(a){Or(n,t,e,i,u,r);for(let f=0;f<a;++f)n.fill();isNaN(c)||(u=l+(c%wt||wt))}return Or(n,t,e,i,u,r),n.fill(),u}function gw(n,t,e,i,r){const{fullCircles:a,startAngle:l,circumference:c,options:u}=t,{borderWidth:f,borderJoinStyle:g}=u,p=u.borderAlign==="inner";if(!f)return;p?(n.lineWidth=f*2,n.lineJoin=g||"round"):(n.lineWidth=f,n.lineJoin=g||"bevel");let _=t.endAngle;if(a){Or(n,t,e,i,_,r);for(let y=0;y<a;++y)n.stroke();isNaN(c)||(_=l+(c%wt||wt))}p&&hw(n,t,_),a||(Or(n,t,e,i,_,r),n.stroke())}class yr extends Le{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const r=this.getProps(["x","y"],i),{angle:a,distance:l}=sf(r,{x:t,y:e}),{startAngle:c,endAngle:u,innerRadius:f,outerRadius:g,circumference:p}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),_=this.options.spacing/2,w=Z(p,u-c)>=wt||Ji(a,c,u),M=tn(l,f+_,g+_);return w&&M}getCenterPoint(t){const{x:e,y:i,startAngle:r,endAngle:a,innerRadius:l,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:u,spacing:f}=this.options,g=(r+a)/2,p=(l+c+f+u)/2;return{x:e+Math.cos(g)*p,y:i+Math.sin(g)*p}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,r=(e.offset||0)/4,a=(e.spacing||0)/2,l=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=i>wt?Math.floor(i/wt):0,i===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const c=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(c)*r,Math.sin(c)*r);const u=1-Math.sin(Math.min(St,i||0)),f=r*u;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,dw(t,this,f,a,l),gw(t,this,f,a,l),t.restore()}}U(yr,"id","arc"),U(yr,"defaults",{borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),U(yr,"defaultRoutes",{backgroundColor:"backgroundColor"});function Wf(n,t,e=t){n.lineCap=Z(e.borderCapStyle,t.borderCapStyle),n.setLineDash(Z(e.borderDash,t.borderDash)),n.lineDashOffset=Z(e.borderDashOffset,t.borderDashOffset),n.lineJoin=Z(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=Z(e.borderWidth,t.borderWidth),n.strokeStyle=Z(e.borderColor,t.borderColor)}function pw(n,t,e){n.lineTo(e.x,e.y)}function mw(n){return n.stepped?Ny:n.tension||n.cubicInterpolationMode==="monotone"?Hy:pw}function Nf(n,t,e={}){const i=n.length,{start:r=0,end:a=i-1}=e,{start:l,end:c}=t,u=Math.max(r,l),f=Math.min(a,c),g=r<l&&a<l||r>c&&a>c;return{count:i,start:u,loop:t.loop,ilen:f<u&&!g?i+f-u:f-u}}function _w(n,t,e,i){const{points:r,options:a}=t,{count:l,start:c,loop:u,ilen:f}=Nf(r,e,i),g=mw(a);let{move:p=!0,reverse:_}=i||{},y,w,M;for(y=0;y<=f;++y)w=r[(c+(_?f-y:y))%l],!w.skip&&(p?(n.moveTo(w.x,w.y),p=!1):g(n,M,w,_,a.stepped),M=w);return u&&(w=r[(c+(_?f:0))%l],g(n,M,w,_,a.stepped)),!!u}function bw(n,t,e,i){const r=t.points,{count:a,start:l,ilen:c}=Nf(r,e,i),{move:u=!0,reverse:f}=i||{};let g=0,p=0,_,y,w,M,A,C;const O=F=>(l+(f?c-F:F))%a,I=()=>{M!==A&&(n.lineTo(g,A),n.lineTo(g,M),n.lineTo(g,C))};for(u&&(y=r[O(0)],n.moveTo(y.x,y.y)),_=0;_<=c;++_){if(y=r[O(_)],y.skip)continue;const F=y.x,L=y.y,W=F|0;W===w?(L<M?M=L:L>A&&(A=L),g=(p*g+F)/++p):(I(),n.lineTo(F,L),w=W,p=0,M=A=L),C=L}I()}function Pa(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?bw:_w}function xw(n){return n.stepped?xv:n.tension||n.cubicInterpolationMode==="monotone"?yv:Bn}function yw(n,t,e,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,e,i)&&r.closePath()),Wf(n,t.options),n.stroke(r)}function vw(n,t,e,i){const{segments:r,options:a}=t,l=Pa(t);for(const c of r)Wf(n,a,c.style),n.beginPath(),l(n,t,c,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const ww=typeof Path2D=="function";function Mw(n,t,e,i){ww&&!t.options.segment?yw(n,t,e,i):vw(n,t,e,i)}class pn extends Le{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const r=i.spanGaps?this._loop:this._fullLoop;uv(this._points,i,t,r,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=kv(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,r=t[e],a=this.points,l=kf(this,{property:e,start:r,end:r});if(!l.length)return;const c=[],u=xw(i);let f,g;for(f=0,g=l.length;f<g;++f){const{start:p,end:_}=l[f],y=a[p],w=a[_];if(y===w){c.push(y);continue}const M=Math.abs((r-y[e])/(w[e]-y[e])),A=u(y,w,M,i.stepped);A[e]=t[e],c.push(A)}return c.length===1?c[0]:c}pathSegment(t,e,i){return Pa(this)(t,this,e,i)}path(t,e,i){const r=this.segments,a=Pa(this);let l=this._loop;e=e||0,i=i||this.points.length-e;for(const c of r)l&=a(t,this,c,{start:e,end:e+i-1});return!!l}draw(t,e,i,r){const a=this.options||{};(this.points||[]).length&&a.borderWidth&&(t.save(),Mw(t,this,i,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}U(pn,"id","line"),U(pn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),U(pn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),U(pn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Mu(n,t,e,i){const r=n.options,{[e]:a}=n.getProps([e],i);return Math.abs(t-a)<r.radius+r.hitRadius}class vr extends Le{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const r=this.options,{x:a,y:l}=this.getProps(["x","y"],i);return Math.pow(t-a,2)+Math.pow(e-l,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(t,e){return Mu(this,t,"x",e)}inYRange(t,e){return Mu(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);const i=e&&t.borderWidth||0;return(e+i)*2}draw(t,e){const i=this.options;this.skip||i.radius<.1||!Qi(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Sa(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}U(vr,"id","point"),U(vr,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),U(vr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Hf(n,t){const{x:e,y:i,base:r,width:a,height:l}=n.getProps(["x","y","base","width","height"],t);let c,u,f,g,p;return n.horizontal?(p=l/2,c=Math.min(e,r),u=Math.max(e,r),f=i-p,g=i+p):(p=a/2,c=e-p,u=e+p,f=Math.min(i,r),g=Math.max(i,r)),{left:c,top:f,right:u,bottom:g}}function mn(n,t,e,i){return n?0:Wt(t,e,i)}function Sw(n,t,e){const i=n.options.borderWidth,r=n.borderSkipped,a=gf(i);return{t:mn(r.top,a.top,0,e),r:mn(r.right,a.right,0,t),b:mn(r.bottom,a.bottom,0,e),l:mn(r.left,a.left,0,t)}}function Aw(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),r=n.options.borderRadius,a=Nn(r),l=Math.min(t,e),c=n.borderSkipped,u=i||rt(r);return{topLeft:mn(!u||c.top||c.left,a.topLeft,0,l),topRight:mn(!u||c.top||c.right,a.topRight,0,l),bottomLeft:mn(!u||c.bottom||c.left,a.bottomLeft,0,l),bottomRight:mn(!u||c.bottom||c.right,a.bottomRight,0,l)}}function kw(n){const t=Hf(n),e=t.right-t.left,i=t.bottom-t.top,r=Sw(n,e/2,i/2),a=Aw(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:a},inner:{x:t.left+r.l,y:t.top+r.t,w:e-r.l-r.r,h:i-r.t-r.b,radius:{topLeft:Math.max(0,a.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,a.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,a.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,a.bottomRight-Math.max(r.b,r.r))}}}}function pa(n,t,e,i){const r=t===null,a=e===null,c=n&&!(r&&a)&&Hf(n,i);return c&&(r||tn(t,c.left,c.right))&&(a||tn(e,c.top,c.bottom))}function Pw(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function Cw(n,t){n.rect(t.x,t.y,t.w,t.h)}function ma(n,t,e={}){const i=n.x!==e.x?-t:0,r=n.y!==e.y?-t:0,a=(n.x+n.w!==e.x+e.w?t:0)-i,l=(n.y+n.h!==e.y+e.h?t:0)-r;return{x:n.x+i,y:n.y+r,w:n.w+a,h:n.h+l,radius:n.radius}}class wr extends Le{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:r}}=this,{inner:a,outer:l}=kw(this),c=Pw(l.radius)?ts:Cw;t.save(),(l.w!==a.w||l.h!==a.h)&&(t.beginPath(),c(t,ma(l,e,a)),t.clip(),c(t,ma(a,-e,l)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),c(t,ma(a,e)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,e,i){return pa(this,t,e,i)}inXRange(t,e){return pa(this,t,null,e)}inYRange(t,e){return pa(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:r,horizontal:a}=this.getProps(["x","y","base","horizontal"],t);return{x:a?(e+r)/2:e,y:a?i:(i+r)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}U(wr,"id","bar"),U(wr,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),U(wr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Tw=Object.freeze({__proto__:null,ArcElement:yr,LineElement:pn,PointElement:vr,BarElement:wr});const Ca=["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)"],Su=Ca.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function Vf(n){return Ca[n%Ca.length]}function Uf(n){return Su[n%Su.length]}function Ow(n,t){return n.borderColor=Vf(t),n.backgroundColor=Uf(t),++t}function Dw(n,t){return n.backgroundColor=n.data.map(()=>Vf(t++)),t}function Lw(n,t){return n.backgroundColor=n.data.map(()=>Uf(t++)),t}function Rw(n){let t=0;return(e,i)=>{const r=n.getDatasetMeta(i).controller;r instanceof Wn?t=Dw(e,t):r instanceof qi?t=Lw(e,t):r&&(t=Ow(e,t))}}function Au(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function Ew(n){return n&&(n.borderColor||n.backgroundColor)}var Iw={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:r}=n.config,{elements:a}=r;if(!e.forceOverride&&(Au(i)||Ew(r)||a&&Au(a)))return;const l=Rw(n);i.forEach(l)}};function Fw(n,t,e,i,r){const a=r.samples||i;if(a>=e)return n.slice(t,t+e);const l=[],c=(e-2)/(a-2);let u=0;const f=t+e-1;let g=t,p,_,y,w,M;for(l[u++]=n[g],p=0;p<a-2;p++){let A=0,C=0,O;const I=Math.floor((p+1)*c)+1+t,F=Math.min(Math.floor((p+2)*c)+1,e)+t,L=F-I;for(O=I;O<F;O++)A+=n[O].x,C+=n[O].y;A/=L,C/=L;const W=Math.floor(p*c)+1+t,z=Math.min(Math.floor((p+1)*c)+1,e)+t,{x:N,y:Y}=n[g];for(y=w=-1,O=W;O<z;O++)w=.5*Math.abs((N-A)*(n[O].y-Y)-(N-n[O].x)*(C-Y)),w>y&&(y=w,_=n[O],M=O);l[u++]=_,g=M}return l[u++]=n[f],l}function Bw(n,t,e,i){let r=0,a=0,l,c,u,f,g,p,_,y,w,M;const A=[],C=t+e-1,O=n[t].x,F=n[C].x-O;for(l=t;l<t+e;++l){c=n[l],u=(c.x-O)/F*i,f=c.y;const L=u|0;if(L===g)f<w?(w=f,p=l):f>M&&(M=f,_=l),r=(a*r+c.x)/++a;else{const W=l-1;if(!lt(p)&&!lt(_)){const z=Math.min(p,_),N=Math.max(p,_);z!==y&&z!==W&&A.push({...n[z],x:r}),N!==y&&N!==W&&A.push({...n[N],x:r})}l>0&&W!==y&&A.push(n[W]),A.push(c),g=L,a=0,w=M=f,p=_=y=l}}return A}function $f(n){if(n._decimated){const t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function ku(n){n.data.datasets.forEach(t=>{$f(t)})}function zw(n,t){const e=t.length;let i=0,r;const{iScale:a}=n,{min:l,max:c,minDefined:u,maxDefined:f}=a.getUserBounds();return u&&(i=Wt(en(t,a.axis,l).lo,0,e-1)),f?r=Wt(en(t,a.axis,c).hi+1,i,e)-i:r=e-i,{start:i,count:r}}var Ww={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){ku(n);return}const i=n.width;n.data.datasets.forEach((r,a)=>{const{_data:l,indexAxis:c}=r,u=n.getDatasetMeta(a),f=l||r.data;if(Hi([c,n.options.indexAxis])==="y"||!u.controller.supportsDecimation)return;const g=n.scales[u.xAxisID];if(g.type!=="linear"&&g.type!=="time"||n.options.parsing)return;let{start:p,count:_}=zw(u,f);const y=e.threshold||4*i;if(_<=y){$f(r);return}lt(l)&&(r._data=f,delete r.data,Object.defineProperty(r,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(M){this._data=M}}));let w;switch(e.algorithm){case"lttb":w=Fw(f,p,_,i,e);break;case"min-max":w=Bw(f,p,_,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}r._decimated=w})},destroy(n){ku(n)}};function Nw(n,t,e){const i=n.segments,r=n.points,a=t.points,l=[];for(const c of i){let{start:u,end:f}=c;f=qa(u,f,r);const g=Ta(e,r[u],r[f],c.loop);if(!t.segments){l.push({source:c,target:g,start:r[u],end:r[f]});continue}const p=kf(t,g);for(const _ of p){const y=Ta(e,a[_.start],a[_.end],_.loop),w=Af(c,r,y);for(const M of w)l.push({source:M,target:_,start:{[e]:Pu(g,y,"start",Math.max)},end:{[e]:Pu(g,y,"end",Math.min)}})}}return l}function Ta(n,t,e,i){if(i)return;let r=t[n],a=e[n];return n==="angle"&&(r=ue(r),a=ue(a)),{property:n,start:r,end:a}}function Hw(n,t){const{x:e=null,y:i=null}=n||{},r=t.points,a=[];return t.segments.forEach(({start:l,end:c})=>{c=qa(l,c,r);const u=r[l],f=r[c];i!==null?(a.push({x:u.x,y:i}),a.push({x:f.x,y:i})):e!==null&&(a.push({x:e,y:u.y}),a.push({x:e,y:f.y}))}),a}function qa(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Pu(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function Yf(n,t){let e=[],i=!1;return vt(n)?(i=!0,e=n):e=Hw(n,t),e.length?new pn({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function Cu(n){return n&&n.fill!==!1}function Vw(n,t,e){let r=n[t].fill;const a=[t];let l;if(!e)return r;for(;r!==!1&&a.indexOf(r)===-1;){if(!Pt(r))return r;if(l=n[r],!l)return!1;if(l.visible)return r;a.push(r),r=l.fill}return!1}function Uw(n,t,e){const i=Gw(n);if(rt(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return Pt(r)&&Math.floor(r)===r?$w(i[0],t,r,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function $w(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function Yw(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:rt(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function Xw(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:rt(n)?i=n.value:i=t.getBaseValue(),i}function Gw(n){const t=n.options,e=t.fill;let i=Z(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function Kw(n){const{scale:t,index:e,line:i}=n,r=[],a=i.segments,l=i.points,c=qw(t,e);c.push(Yf({x:null,y:t.bottom},i));for(let u=0;u<a.length;u++){const f=a[u];for(let g=f.start;g<=f.end;g++)jw(r,l[g],c)}return new pn({points:r,options:{}})}function qw(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let r=0;r<i.length;r++){const a=i[r];if(a.index===t)break;a.hidden||e.unshift(a.dataset)}return e}function jw(n,t,e){const i=[];for(let r=0;r<e.length;r++){const a=e[r],{first:l,last:c,point:u}=Zw(a,t,"x");if(!(!u||l&&c)){if(l)i.unshift(u);else if(n.push(u),!c)break}}n.push(...i)}function Zw(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const r=i[e],a=n.segments,l=n.points;let c=!1,u=!1;for(let f=0;f<a.length;f++){const g=a[f],p=l[g.start][e],_=l[g.end][e];if(tn(r,p,_)){c=r===p,u=r===_;break}}return{first:c,last:u,point:i}}class Xf{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:r,y:a,radius:l}=this;return e=e||{start:0,end:wt},t.arc(r,a,l,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:r}=this,a=t.angle;return{x:e+Math.cos(a)*r,y:i+Math.sin(a)*r,angle:a}}}function Jw(n){const{chart:t,fill:e,line:i}=n;if(Pt(e))return Qw(t,e);if(e==="stack")return Kw(n);if(e==="shape")return!0;const r=tM(n);return r instanceof Xf?r:Yf(r,i)}function Qw(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function tM(n){return(n.scale||{}).getPointPositionForValue?nM(n):eM(n)}function eM(n){const{scale:t={},fill:e}=n,i=Yw(e,t);if(Pt(i)){const r=t.isHorizontal();return{x:r?i:null,y:r?null:i}}return null}function nM(n){const{scale:t,fill:e}=n,i=t.options,r=t.getLabels().length,a=i.reverse?t.max:t.min,l=Xw(e,t,a),c=[];if(i.grid.circular){const u=t.getPointPositionForValue(0,a);return new Xf({x:u.x,y:u.y,radius:t.getDistanceFromCenterForValue(l)})}for(let u=0;u<r;++u)c.push(t.getPointPositionForValue(u,l));return c}function _a(n,t,e){const i=Jw(t),{line:r,scale:a,axis:l}=t,c=r.options,u=c.fill,f=c.backgroundColor,{above:g=f,below:p=f}=u||{};i&&r.points.length&&(Rr(n,e),iM(n,{line:r,target:i,above:g,below:p,area:e,scale:a,axis:l}),Er(n))}function iM(n,t){const{line:e,target:i,above:r,below:a,area:l,scale:c}=t,u=e._loop?"angle":t.axis;n.save(),u==="x"&&a!==r&&(Tu(n,i,l.top),Ou(n,{line:e,target:i,color:r,scale:c,property:u}),n.restore(),n.save(),Tu(n,i,l.bottom)),Ou(n,{line:e,target:i,color:a,scale:c,property:u}),n.restore()}function Tu(n,t,e){const{segments:i,points:r}=t;let a=!0,l=!1;n.beginPath();for(const c of i){const{start:u,end:f}=c,g=r[u],p=r[qa(u,f,r)];a?(n.moveTo(g.x,g.y),a=!1):(n.lineTo(g.x,e),n.lineTo(g.x,g.y)),l=!!t.pathSegment(n,c,{move:l}),l?n.closePath():n.lineTo(p.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function Ou(n,t){const{line:e,target:i,property:r,color:a,scale:l}=t,c=Nw(e,i,r);for(const{source:u,target:f,start:g,end:p}of c){const{style:{backgroundColor:_=a}={}}=u,y=i!==!0;n.save(),n.fillStyle=_,sM(n,l,y&&Ta(r,g,p)),n.beginPath();const w=!!e.pathSegment(n,u);let M;if(y){w?n.closePath():Du(n,i,p,r);const A=!!i.pathSegment(n,f,{move:w,reverse:!0});M=w&&A,M||Du(n,i,g,r)}n.closePath(),n.fill(M?"evenodd":"nonzero"),n.restore()}}function sM(n,t,e){const{top:i,bottom:r}=t.chart.chartArea,{property:a,start:l,end:c}=e||{};a==="x"&&(n.beginPath(),n.rect(l,i,c-l,r-i),n.clip())}function Du(n,t,e,i){const r=t.interpolate(e,i);r&&n.lineTo(r.x,r.y)}var rM={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,r=[];let a,l,c,u;for(l=0;l<i;++l)a=n.getDatasetMeta(l),c=a.dataset,u=null,c&&c.options&&c instanceof pn&&(u={visible:n.isDatasetVisible(l),index:l,fill:Uw(c,l,i),chart:n,axis:a.controller.options.indexAxis,scale:a.vScale,line:c}),a.$filler=u,r.push(u);for(l=0;l<i;++l)u=r[l],!(!u||u.fill===!1)&&(u.fill=Vw(r,l,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",r=n.getSortedVisibleDatasetMetas(),a=n.chartArea;for(let l=r.length-1;l>=0;--l){const c=r[l].$filler;c&&(c.line.updateControlPoints(a,c.axis),i&&c.fill&&_a(n.ctx,c,a))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let r=i.length-1;r>=0;--r){const a=i[r].$filler;Cu(a)&&_a(n.ctx,a,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!Cu(i)||e.drawTime!=="beforeDatasetDraw"||_a(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Lu=(n,t)=>{let{boxHeight:e=t,boxWidth:i=t}=n;return n.usePointStyle&&(e=Math.min(e,t),i=n.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},oM=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class Ru extends Le{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=xt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,r)=>t.sort(i,r,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,r=Ft(i.font),a=r.size,l=this._computeTitleHeight(),{boxWidth:c,itemHeight:u}=Lu(i,a);let f,g;e.font=r.string,this.isHorizontal()?(f=this.maxWidth,g=this._fitRows(l,a,c,u)+10):(g=this.maxHeight,f=this._fitCols(l,r,c,u)+10),this.width=Math.min(f,t.maxWidth||this.maxWidth),this.height=Math.min(g,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,r){const{ctx:a,maxWidth:l,options:{labels:{padding:c}}}=this,u=this.legendHitBoxes=[],f=this.lineWidths=[0],g=r+c;let p=t;a.textAlign="left",a.textBaseline="middle";let _=-1,y=-g;return this.legendItems.forEach((w,M)=>{const A=i+e/2+a.measureText(w.text).width;(M===0||f[f.length-1]+A+2*c>l)&&(p+=g,f[f.length-(M>0?0:1)]=0,y+=g,_++),u[M]={left:0,top:y,row:_,width:A,height:r},f[f.length-1]+=A+c}),p}_fitCols(t,e,i,r){const{ctx:a,maxHeight:l,options:{labels:{padding:c}}}=this,u=this.legendHitBoxes=[],f=this.columnSizes=[],g=l-t;let p=c,_=0,y=0,w=0,M=0;return this.legendItems.forEach((A,C)=>{const{itemWidth:O,itemHeight:I}=aM(i,e,a,A,r);C>0&&y+I+2*c>g&&(p+=_+c,f.push({width:_,height:y}),w+=_+c,M++,_=y=0),u[C]={left:w,top:y,col:M,width:O,height:I},_=Math.max(_,O),y+=I+c}),p+=_,f.push({width:_,height:y}),p}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:r},rtl:a}}=this,l=li(a,this.left,this.width);if(this.isHorizontal()){let c=0,u=Yt(i,this.left+r,this.right-this.lineWidths[c]);for(const f of e)c!==f.row&&(c=f.row,u=Yt(i,this.left+r,this.right-this.lineWidths[c])),f.top+=this.top+t+r,f.left=l.leftForLtr(l.x(u),f.width),u+=f.width+r}else{let c=0,u=Yt(i,this.top+t+r,this.bottom-this.columnSizes[c].height);for(const f of e)f.col!==c&&(c=f.col,u=Yt(i,this.top+t+r,this.bottom-this.columnSizes[c].height)),f.top=u,f.left+=this.left+r,f.left=l.leftForLtr(l.x(f.left),f.width),u+=f.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Rr(t,this),this._draw(),Er(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:r}=this,{align:a,labels:l}=t,c=Dt.color,u=li(t.rtl,this.left,this.width),f=Ft(l.font),{padding:g}=l,p=f.size,_=p/2;let y;this.drawTitle(),r.textAlign=u.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=f.string;const{boxWidth:w,boxHeight:M,itemHeight:A}=Lu(l,p),C=function(W,z,N){if(isNaN(w)||w<=0||isNaN(M)||M<0)return;r.save();const Y=Z(N.lineWidth,1);if(r.fillStyle=Z(N.fillStyle,c),r.lineCap=Z(N.lineCap,"butt"),r.lineDashOffset=Z(N.lineDashOffset,0),r.lineJoin=Z(N.lineJoin,"miter"),r.lineWidth=Y,r.strokeStyle=Z(N.strokeStyle,c),r.setLineDash(Z(N.lineDash,[])),l.usePointStyle){const J={radius:M*Math.SQRT2/2,pointStyle:N.pointStyle,rotation:N.rotation,borderWidth:Y},Q=u.xPlus(W,w/2),at=z+_;df(r,J,Q,at,l.pointStyleWidth&&w)}else{const J=z+Math.max((p-M)/2,0),Q=u.leftForLtr(W,w),at=Nn(N.borderRadius);r.beginPath(),Object.values(at).some(Rt=>Rt!==0)?ts(r,{x:Q,y:J,w,h:M,radius:at}):r.rect(Q,J,w,M),r.fill(),Y!==0&&r.stroke()}r.restore()},O=function(W,z,N){Un(r,N.text,W,z+A/2,f,{strikethrough:N.hidden,textAlign:u.textAlign(N.textAlign)})},I=this.isHorizontal(),F=this._computeTitleHeight();I?y={x:Yt(a,this.left+g,this.right-i[0]),y:this.top+g+F,line:0}:y={x:this.left+g,y:Yt(a,this.top+F+g,this.bottom-e[0].height),line:0},wf(this.ctx,t.textDirection);const L=A+g;this.legendItems.forEach((W,z)=>{r.strokeStyle=W.fontColor,r.fillStyle=W.fontColor;const N=r.measureText(W.text).width,Y=u.textAlign(W.textAlign||(W.textAlign=l.textAlign)),J=w+_+N;let Q=y.x,at=y.y;u.setWidth(this.width),I?z>0&&Q+J+g>this.right&&(at=y.y+=L,y.line++,Q=y.x=Yt(a,this.left+g,this.right-i[y.line])):z>0&&at+L>this.bottom&&(Q=y.x=Q+e[y.line].width+g,y.line++,at=y.y=Yt(a,this.top+F+g,this.bottom-e[y.line].height));const Rt=u.x(Q);if(C(Rt,at,W),Q=Ty(Y,Q+w+_,I?Q+J:this.right,t.rtl),O(u.x(Q),at,W),I)y.x+=J+g;else if(typeof W.text!="string"){const Vt=f.lineHeight;y.y+=Gf(W,Vt)}else y.y+=L}),Mf(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=Ft(e.font),r=Gt(e.padding);if(!e.display)return;const a=li(t.rtl,this.left,this.width),l=this.ctx,c=e.position,u=i.size/2,f=r.top+u;let g,p=this.left,_=this.width;if(this.isHorizontal())_=Math.max(...this.lineWidths),g=this.top+f,p=Yt(t.align,p,this.right-_);else{const w=this.columnSizes.reduce((M,A)=>Math.max(M,A.height),0);g=f+Yt(t.align,this.top,this.bottom-w-t.labels.padding-this._computeTitleHeight())}const y=Yt(c,p,p+_);l.textAlign=a.textAlign(Va(c)),l.textBaseline="middle",l.strokeStyle=e.color,l.fillStyle=e.color,l.font=i.string,Un(l,e.text,y,g,i)}_computeTitleHeight(){const t=this.options.title,e=Ft(t.font),i=Gt(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,r,a;if(tn(t,this.left,this.right)&&tn(e,this.top,this.bottom)){for(a=this.legendHitBoxes,i=0;i<a.length;++i)if(r=a[i],tn(t,r.left,r.left+r.width)&&tn(e,r.top,r.top+r.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!hM(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,a=oM(r,i);r&&!a&&xt(e.onLeave,[t,r,this],this),this._hoveredItem=i,i&&!a&&xt(e.onHover,[t,i,this],this)}else i&&xt(e.onClick,[t,i,this],this)}}function aM(n,t,e,i,r){const a=lM(i,n,t,e),l=cM(r,i,t.lineHeight);return{itemWidth:a,itemHeight:l}}function lM(n,t,e,i){let r=n.text;return r&&typeof r!="string"&&(r=r.reduce((a,l)=>a.length>l.length?a:l)),t+e.size/2+i.measureText(r).width}function cM(n,t,e){let i=n;return typeof t.text!="string"&&(i=Gf(t,e)),i}function Gf(n,t){const e=n.text?n.text.length+.5:0;return t*e}function hM(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var uM={id:"legend",_element:Ru,start(n,t,e){const i=n.legend=new Ru({ctx:n.ctx,options:e,chart:n});Xt.configure(n,i,e),Xt.addBox(n,i)},stop(n){Xt.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;Xt.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,r=e.chart;r.isDatasetVisible(i)?(r.hide(i),t.hidden=!0):(r.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:r,color:a,useBorderRadius:l,borderRadius:c}}=n.legend.options;return n._getSortedDatasetMetas().map(u=>{const f=u.controller.getStyle(e?0:void 0),g=Gt(f.borderWidth);return{text:t[u.index].label,fillStyle:f.backgroundColor,fontColor:a,hidden:!u.visible,lineCap:f.borderCapStyle,lineDash:f.borderDash,lineDashOffset:f.borderDashOffset,lineJoin:f.borderJoinStyle,lineWidth:(g.width+g.height)/4,strokeStyle:f.borderColor,pointStyle:i||f.pointStyle,rotation:f.rotation,textAlign:r||f.textAlign,borderRadius:l&&(c||f.borderRadius),datasetIndex:u.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class ja extends Le{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const r=vt(i.text)?i.text.length:1;this._padding=Gt(i.padding);const a=r*Ft(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=a:this.width=a}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:r,right:a,options:l}=this,c=l.align;let u=0,f,g,p;return this.isHorizontal()?(g=Yt(c,i,a),p=e+t,f=a-i):(l.position==="left"?(g=i+t,p=Yt(c,r,e),u=St*-.5):(g=a-t,p=Yt(c,e,r),u=St*.5),f=r-e),{titleX:g,titleY:p,maxWidth:f,rotation:u}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=Ft(e.font),a=i.lineHeight/2+this._padding.top,{titleX:l,titleY:c,maxWidth:u,rotation:f}=this._drawArgs(a);Un(t,e.text,0,0,i,{color:e.color,maxWidth:u,rotation:f,textAlign:Va(e.align),textBaseline:"middle",translation:[l,c]})}}function fM(n,t){const e=new ja({ctx:n.ctx,options:t,chart:n});Xt.configure(n,e,t),Xt.addBox(n,e),n.titleBlock=e}var dM={id:"title",_element:ja,start(n,t,e){fM(n,e)},stop(n){const t=n.titleBlock;Xt.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;Xt.configure(n,i,e),i.options=e},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 lr=new WeakMap;var gM={id:"subtitle",start(n,t,e){const i=new ja({ctx:n.ctx,options:e,chart:n});Xt.configure(n,i,e),Xt.addBox(n,i),lr.set(n,i)},stop(n){Xt.removeBox(n,lr.get(n)),lr.delete(n)},beforeUpdate(n,t,e){const i=lr.get(n);Xt.configure(n,i,e),i.options=e},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 Ui={average(n){if(!n.length)return!1;let t,e,i=0,r=0,a=0;for(t=0,e=n.length;t<e;++t){const l=n[t].element;if(l&&l.hasValue()){const c=l.tooltipPosition();i+=c.x,r+=c.y,++a}}return{x:i/a,y:r/a}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,r=Number.POSITIVE_INFINITY,a,l,c;for(a=0,l=n.length;a<l;++a){const u=n[a].element;if(u&&u.hasValue()){const f=u.getCenterPoint(),g=wa(t,f);g<r&&(r=g,c=u)}}if(c){const u=c.tooltipPosition();e=u.x,i=u.y}return{x:e,y:i}}};function Be(n,t){return t&&(vt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function Je(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
`)>-1?n.split(`
`):n}function pM(n,t){const{element:e,datasetIndex:i,index:r}=t,a=n.getDatasetMeta(i).controller,{label:l,value:c}=a.getLabelAndValue(r);return{chart:n,label:l,parsed:a.getParsed(r),raw:n.data.datasets[i].data[r],formattedValue:c,dataset:a.getDataset(),dataIndex:r,datasetIndex:i,element:e}}function Eu(n,t){const e=n.chart.ctx,{body:i,footer:r,title:a}=n,{boxWidth:l,boxHeight:c}=t,u=Ft(t.bodyFont),f=Ft(t.titleFont),g=Ft(t.footerFont),p=a.length,_=r.length,y=i.length,w=Gt(t.padding);let M=w.height,A=0,C=i.reduce((F,L)=>F+L.before.length+L.lines.length+L.after.length,0);if(C+=n.beforeBody.length+n.afterBody.length,p&&(M+=p*f.lineHeight+(p-1)*t.titleSpacing+t.titleMarginBottom),C){const F=t.displayColors?Math.max(c,u.lineHeight):u.lineHeight;M+=y*F+(C-y)*u.lineHeight+(C-1)*t.bodySpacing}_&&(M+=t.footerMarginTop+_*g.lineHeight+(_-1)*t.footerSpacing);let O=0;const I=function(F){A=Math.max(A,e.measureText(F).width+O)};return e.save(),e.font=f.string,pt(n.title,I),e.font=u.string,pt(n.beforeBody.concat(n.afterBody),I),O=t.displayColors?l+2+t.boxPadding:0,pt(i,F=>{pt(F.before,I),pt(F.lines,I),pt(F.after,I)}),O=0,e.font=g.string,pt(n.footer,I),e.restore(),A+=w.width,{width:A,height:M}}function mM(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function _M(n,t,e,i){const{x:r,width:a}=i,l=e.caretSize+e.caretPadding;if(n==="left"&&r+a+l>t.width||n==="right"&&r-a-l<0)return!0}function bM(n,t,e,i){const{x:r,width:a}=e,{width:l,chartArea:{left:c,right:u}}=n;let f="center";return i==="center"?f=r<=(c+u)/2?"left":"right":r<=a/2?f="left":r>=l-a/2&&(f="right"),_M(f,n,t,e)&&(f="center"),f}function Iu(n,t,e){const i=e.yAlign||t.yAlign||mM(n,e);return{xAlign:e.xAlign||t.xAlign||bM(n,t,e,i),yAlign:i}}function xM(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function yM(n,t,e){let{y:i,height:r}=n;return t==="top"?i+=e:t==="bottom"?i-=r+e:i-=r/2,i}function Fu(n,t,e,i){const{caretSize:r,caretPadding:a,cornerRadius:l}=n,{xAlign:c,yAlign:u}=e,f=r+a,{topLeft:g,topRight:p,bottomLeft:_,bottomRight:y}=Nn(l);let w=xM(t,c);const M=yM(t,u,f);return u==="center"?c==="left"?w+=f:c==="right"&&(w-=f):c==="left"?w-=Math.max(g,_)+r:c==="right"&&(w+=Math.max(p,y)+r),{x:Wt(w,0,i.width-t.width),y:Wt(M,0,i.height-t.height)}}function cr(n,t,e){const i=Gt(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function Bu(n){return Be([],Je(n))}function vM(n,t,e){return yn(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function zu(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Kf={beforeTitle:je,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:je,beforeBody:je,beforeLabel:je,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return lt(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.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(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:je,afterBody:je,beforeFooter:je,footer:je,afterFooter:je};function ne(n,t,e,i){const r=n[t].call(e,i);return typeof r>"u"?Kf[t].call(e,i):r}class Oa extends Le{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),r=i.enabled&&e.options.animation&&i.animations,a=new Pf(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){return this.$context||(this.$context=vM(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,r=ne(i,"beforeTitle",this,t),a=ne(i,"title",this,t),l=ne(i,"afterTitle",this,t);let c=[];return c=Be(c,Je(r)),c=Be(c,Je(a)),c=Be(c,Je(l)),c}getBeforeBody(t,e){return Bu(ne(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,r=[];return pt(t,a=>{const l={before:[],lines:[],after:[]},c=zu(i,a);Be(l.before,Je(ne(c,"beforeLabel",this,a))),Be(l.lines,ne(c,"label",this,a)),Be(l.after,Je(ne(c,"afterLabel",this,a))),r.push(l)}),r}getAfterBody(t,e){return Bu(ne(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,r=ne(i,"beforeFooter",this,t),a=ne(i,"footer",this,t),l=ne(i,"afterFooter",this,t);let c=[];return c=Be(c,Je(r)),c=Be(c,Je(a)),c=Be(c,Je(l)),c}_createItems(t){const e=this._active,i=this.chart.data,r=[],a=[],l=[];let c=[],u,f;for(u=0,f=e.length;u<f;++u)c.push(pM(this.chart,e[u]));return t.filter&&(c=c.filter((g,p,_)=>t.filter(g,p,_,i))),t.itemSort&&(c=c.sort((g,p)=>t.itemSort(g,p,i))),pt(c,g=>{const p=zu(t.callbacks,g);r.push(ne(p,"labelColor",this,g)),a.push(ne(p,"labelPointStyle",this,g)),l.push(ne(p,"labelTextColor",this,g))}),this.labelColors=r,this.labelPointStyles=a,this.labelTextColors=l,this.dataPoints=c,c}update(t,e){const i=this.options.setContext(this.getContext()),r=this._active;let a,l=[];if(!r.length)this.opacity!==0&&(a={opacity:0});else{const c=Ui[i.position].call(this,r,this._eventPosition);l=this._createItems(i),this.title=this.getTitle(l,i),this.beforeBody=this.getBeforeBody(l,i),this.body=this.getBody(l,i),this.afterBody=this.getAfterBody(l,i),this.footer=this.getFooter(l,i);const u=this._size=Eu(this,i),f=Object.assign({},c,u),g=Iu(this.chart,i,f),p=Fu(i,f,g,this.chart);this.xAlign=g.xAlign,this.yAlign=g.yAlign,a={opacity:1,x:p.x,y:p.y,width:u.width,height:u.height,caretX:c.x,caretY:c.y}}this._tooltipItems=l,this.$context=void 0,a&&this._resolveAnimations().update(this,a),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,r){const a=this.getCaretPosition(t,i,r);e.lineTo(a.x1,a.y1),e.lineTo(a.x2,a.y2),e.lineTo(a.x3,a.y3)}getCaretPosition(t,e,i){const{xAlign:r,yAlign:a}=this,{caretSize:l,cornerRadius:c}=i,{topLeft:u,topRight:f,bottomLeft:g,bottomRight:p}=Nn(c),{x:_,y}=t,{width:w,height:M}=e;let A,C,O,I,F,L;return a==="center"?(F=y+M/2,r==="left"?(A=_,C=A-l,I=F+l,L=F-l):(A=_+w,C=A+l,I=F-l,L=F+l),O=A):(r==="left"?C=_+Math.max(u,g)+l:r==="right"?C=_+w-Math.max(f,p)-l:C=this.caretX,a==="top"?(I=y,F=I-l,A=C-l,O=C+l):(I=y+M,F=I+l,A=C+l,O=C-l),L=I),{x1:A,x2:C,x3:O,y1:I,y2:F,y3:L}}drawTitle(t,e,i){const r=this.title,a=r.length;let l,c,u;if(a){const f=li(i.rtl,this.x,this.width);for(t.x=cr(this,i.titleAlign,i),e.textAlign=f.textAlign(i.titleAlign),e.textBaseline="middle",l=Ft(i.titleFont),c=i.titleSpacing,e.fillStyle=i.titleColor,e.font=l.string,u=0;u<a;++u)e.fillText(r[u],f.x(t.x),t.y+l.lineHeight/2),t.y+=l.lineHeight+c,u+1===a&&(t.y+=i.titleMarginBottom-c)}}_drawColorBox(t,e,i,r,a){const l=this.labelColors[i],c=this.labelPointStyles[i],{boxHeight:u,boxWidth:f,boxPadding:g}=a,p=Ft(a.bodyFont),_=cr(this,"left",a),y=r.x(_),w=u<p.lineHeight?(p.lineHeight-u)/2:0,M=e.y+w;if(a.usePointStyle){const A={radius:Math.min(f,u)/2,pointStyle:c.pointStyle,rotation:c.rotation,borderWidth:1},C=r.leftForLtr(y,f)+f/2,O=M+u/2;t.strokeStyle=a.multiKeyBackground,t.fillStyle=a.multiKeyBackground,Sa(t,A,C,O),t.strokeStyle=l.borderColor,t.fillStyle=l.backgroundColor,Sa(t,A,C,O)}else{t.lineWidth=rt(l.borderWidth)?Math.max(...Object.values(l.borderWidth)):l.borderWidth||1,t.strokeStyle=l.borderColor,t.setLineDash(l.borderDash||[]),t.lineDashOffset=l.borderDashOffset||0;const A=r.leftForLtr(y,f-g),C=r.leftForLtr(r.xPlus(y,1),f-g-2),O=Nn(l.borderRadius);Object.values(O).some(I=>I!==0)?(t.beginPath(),t.fillStyle=a.multiKeyBackground,ts(t,{x:A,y:M,w:f,h:u,radius:O}),t.fill(),t.stroke(),t.fillStyle=l.backgroundColor,t.beginPath(),ts(t,{x:C,y:M+1,w:f-2,h:u-2,radius:O}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(A,M,f,u),t.strokeRect(A,M,f,u),t.fillStyle=l.backgroundColor,t.fillRect(C,M+1,f-2,u-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:r}=this,{bodySpacing:a,bodyAlign:l,displayColors:c,boxHeight:u,boxWidth:f,boxPadding:g}=i,p=Ft(i.bodyFont);let _=p.lineHeight,y=0;const w=li(i.rtl,this.x,this.width),M=function(N){e.fillText(N,w.x(t.x+y),t.y+_/2),t.y+=_+a},A=w.textAlign(l);let C,O,I,F,L,W,z;for(e.textAlign=l,e.textBaseline="middle",e.font=p.string,t.x=cr(this,A,i),e.fillStyle=i.bodyColor,pt(this.beforeBody,M),y=c&&A!=="right"?l==="center"?f/2+g:f+2+g:0,F=0,W=r.length;F<W;++F){for(C=r[F],O=this.labelTextColors[F],e.fillStyle=O,pt(C.before,M),I=C.lines,c&&I.length&&(this._drawColorBox(e,t,F,w,i),_=Math.max(p.lineHeight,u)),L=0,z=I.length;L<z;++L)M(I[L]),_=p.lineHeight;pt(C.after,M)}y=0,_=p.lineHeight,pt(this.afterBody,M),t.y-=a}drawFooter(t,e,i){const r=this.footer,a=r.length;let l,c;if(a){const u=li(i.rtl,this.x,this.width);for(t.x=cr(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=u.textAlign(i.footerAlign),e.textBaseline="middle",l=Ft(i.footerFont),e.fillStyle=i.footerColor,e.font=l.string,c=0;c<a;++c)e.fillText(r[c],u.x(t.x),t.y+l.lineHeight/2),t.y+=l.lineHeight+i.footerSpacing}}drawBackground(t,e,i,r){const{xAlign:a,yAlign:l}=this,{x:c,y:u}=t,{width:f,height:g}=i,{topLeft:p,topRight:_,bottomLeft:y,bottomRight:w}=Nn(r.cornerRadius);e.fillStyle=r.backgroundColor,e.strokeStyle=r.borderColor,e.lineWidth=r.borderWidth,e.beginPath(),e.moveTo(c+p,u),l==="top"&&this.drawCaret(t,e,i,r),e.lineTo(c+f-_,u),e.quadraticCurveTo(c+f,u,c+f,u+_),l==="center"&&a==="right"&&this.drawCaret(t,e,i,r),e.lineTo(c+f,u+g-w),e.quadraticCurveTo(c+f,u+g,c+f-w,u+g),l==="bottom"&&this.drawCaret(t,e,i,r),e.lineTo(c+y,u+g),e.quadraticCurveTo(c,u+g,c,u+g-y),l==="center"&&a==="left"&&this.drawCaret(t,e,i,r),e.lineTo(c,u+p),e.quadraticCurveTo(c,u,c+p,u),e.closePath(),e.fill(),r.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,r=i&&i.x,a=i&&i.y;if(r||a){const l=Ui[t.position].call(this,this._active,this._eventPosition);if(!l)return;const c=this._size=Eu(this,t),u=Object.assign({},l,this._size),f=Iu(e,t,u),g=Fu(t,u,f,e);(r._to!==g.x||a._to!==g.y)&&(this.xAlign=f.xAlign,this.yAlign=f.yAlign,this.width=c.width,this.height=c.height,this.caretX=l.x,this.caretY=l.y,this._resolveAnimations().update(this,g))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const r={width:this.width,height:this.height},a={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const l=Gt(e.padding),c=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&c&&(t.save(),t.globalAlpha=i,this.drawBackground(a,t,r,e),wf(t,e.textDirection),a.y+=l.top,this.drawTitle(a,t,e),this.drawBody(a,t,e),this.drawFooter(a,t,e),Mf(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,r=t.map(({datasetIndex:c,index:u})=>{const f=this.chart.getDatasetMeta(c);if(!f)throw new Error("Cannot find a dataset at index "+c);return{datasetIndex:c,element:f.data[u],index:u}}),a=!Mr(i,r),l=this._positionChanged(r,e);(a||l)&&(this._active=r,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,a=this._active||[],l=this._getActiveElements(t,a,e,i),c=this._positionChanged(l,t),u=e||!Mr(l,a)||c;return u&&(this._active=l,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),u}_getActiveElements(t,e,i,r){const a=this.options;if(t.type==="mouseout")return[];if(!r)return e;const l=this.chart.getElementsAtEventForMode(t,a.mode,a,i);return a.reverse&&l.reverse(),l}_positionChanged(t,e){const{caretX:i,caretY:r,options:a}=this,l=Ui[a.position].call(this,t,e);return l!==!1&&(i!==l.x||r!==l.y)}}U(Oa,"positioners",Ui);var wM={id:"tooltip",_element:Oa,positioners:Ui,afterInit(n,t,e){e&&(n.tooltip=new Oa({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,t)=>t.bodyFont.size,boxWidth:(n,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Kf},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},MM=Object.freeze({__proto__:null,Colors:Iw,Decimation:Ww,Filler:rM,Legend:uM,SubTitle:gM,Title:dM,Tooltip:wM});const SM=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function AM(n,t,e,i){const r=n.indexOf(t);if(r===-1)return SM(n,t,e,i);const a=n.lastIndexOf(t);return r!==a?e:r}const kM=(n,t)=>n===null?null:Wt(Math.round(n),0,t);function Wu(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class Da extends $n{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:r,label:a}of e)i[r]===a&&i.splice(r,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(lt(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:AM(i,t,Z(e,t),this._addedLabels),kM(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(r=this.getLabels().length-1)),this.min=i,this.max=r}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,r=[];let a=this.getLabels();a=t===0&&e===a.length-1?a:a.slice(t,e+1),this._valueRange=Math.max(a.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let l=t;l<=e;l++)r.push({value:l});return r}getLabelForValue(t){return Wu.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const 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}}U(Da,"id","category"),U(Da,"defaults",{ticks:{callback:Wu}});function PM(n,t){const e=[],{bounds:r,step:a,min:l,max:c,precision:u,count:f,maxTicks:g,maxDigits:p,includeBounds:_}=n,y=a||1,w=g-1,{min:M,max:A}=t,C=!lt(l),O=!lt(c),I=!lt(f),F=(A-M)/(p+1);let L=Ih((A-M)/w/y)*y,W,z,N,Y;if(L<1e-14&&!C&&!O)return[{value:M},{value:A}];Y=Math.ceil(A/L)-Math.floor(M/L),Y>w&&(L=Ih(Y*L/w/y)*y),lt(u)||(W=Math.pow(10,u),L=Math.ceil(L*W)/W),r==="ticks"?(z=Math.floor(M/L)*L,N=Math.ceil(A/L)*L):(z=M,N=A),C&&O&&a&&wy((c-l)/a,L/1e3)?(Y=Math.round(Math.min((c-l)/L,g)),L=(c-l)/Y,z=l,N=c):I?(z=C?l:z,N=O?c:N,Y=f-1,L=(N-z)/Y):(Y=(N-z)/L,Xi(Y,Math.round(Y),L/1e3)?Y=Math.round(Y):Y=Math.ceil(Y));const J=Math.max(Fh(L),Fh(z));W=Math.pow(10,lt(u)?J:u),z=Math.round(z*W)/W,N=Math.round(N*W)/W;let Q=0;for(C&&(_&&z!==l?(e.push({value:l}),z<l&&Q++,Xi(Math.round((z+Q*L)*W)/W,l,Nu(l,F,n))&&Q++):z<l&&Q++);Q<Y;++Q)e.push({value:Math.round((z+Q*L)*W)/W});return O&&_&&N!==c?e.length&&Xi(e[e.length-1].value,c,Nu(c,F,n))?e[e.length-1].value=c:e.push({value:c}):(!O||N===c)&&e.push({value:N}),e}function Nu(n,t,{horizontal:e,minRotation:i}){const r=Oe(i),a=(e?Math.sin(r):Math.cos(r))||.001,l=.75*t*(""+n).length;return Math.min(t/a,l)}class Dr extends $n{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 lt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:r,max:a}=this;const l=u=>r=e?r:u,c=u=>a=i?a:u;if(t){const u=We(r),f=We(a);u<0&&f<0?c(0):u>0&&f>0&&l(0)}if(r===a){let u=a===0?1:Math.abs(a*.05);c(a+u),t||l(r-u)}this.min=r,this.max=a}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,r;return i?(r=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),e=e||11),e&&(r=Math.min(e,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const r={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},a=this._range||this,l=PM(r,a);return t.bounds==="ticks"&&nf(l,this,"value"),t.reverse?(l.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),l}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const r=(i-e)/Math.max(t.length-1,1)/2;e-=r,i+=r}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return rs(t,this.chart.options.locale,this.options.ticks.format)}}class La extends Dr{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Pt(t)?t:0,this.max=Pt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Oe(this.options.ticks.minRotation),r=(t?Math.sin(i):Math.cos(i))||.001,a=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,a.lineHeight/r))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}U(La,"id","linear"),U(La,"defaults",{ticks:{callback:Lr.formatters.numeric}});const ns=n=>Math.floor(gn(n)),In=(n,t)=>Math.pow(10,ns(n)+t);function Hu(n){return n/Math.pow(10,ns(n))===1}function Vu(n,t,e){const i=Math.pow(10,e),r=Math.floor(n/i);return Math.ceil(t/i)-r}function CM(n,t){const e=t-n;let i=ns(e);for(;Vu(n,t,i)>10;)i++;for(;Vu(n,t,i)<10;)i--;return Math.min(i,ns(n))}function TM(n,{min:t,max:e}){t=he(n.min,t);const i=[],r=ns(t);let a=CM(t,e),l=a<0?Math.pow(10,Math.abs(a)):1;const c=Math.pow(10,a),u=r>a?Math.pow(10,r):0,f=Math.round((t-u)*l)/l,g=Math.floor((t-u)/c/10)*c*10;let p=Math.floor((f-g)/Math.pow(10,a)),_=he(n.min,Math.round((u+g+p*Math.pow(10,a))*l)/l);for(;_<e;)i.push({value:_,major:Hu(_),significand:p}),p>=10?p=p<15?15:20:p++,p>=20&&(a++,p=2,l=a>=0?1:l),_=Math.round((u+g+p*Math.pow(10,a))*l)/l;const y=he(n.max,_);return i.push({value:y,major:Hu(y),significand:p}),i}class Ra extends $n{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Dr.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return Pt(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Pt(t)?Math.max(0,t):null,this.max=Pt(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Pt(this._userMin)&&(this.min=t===In(this.min,0)?In(this.min,-1):In(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,r=this.max;const a=c=>i=t?i:c,l=c=>r=e?r:c;i===r&&(i<=0?(a(1),l(10)):(a(In(i,-1)),l(In(r,1)))),i<=0&&a(In(r,-1)),r<=0&&l(In(i,1)),this.min=i,this.max=r}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=TM(e,this);return t.bounds==="ticks"&&nf(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":rs(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=gn(t),this._valueRange=gn(this.max)-gn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(gn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}U(Ra,"id","logarithmic"),U(Ra,"defaults",{ticks:{callback:Lr.formatters.logarithmic,major:{enabled:!0}}});function Ea(n){const t=n.ticks;if(t.display&&n.display){const e=Gt(t.backdropPadding);return Z(t.font&&t.font.size,Dt.font.size)+e.height}return 0}function OM(n,t,e){return e=vt(e)?e:[e],{w:Wy(n,t.string,e),h:e.length*t.lineHeight}}function Uu(n,t,e,i,r){return n===i||n===r?{start:t-e/2,end:t+e/2}:n<i||n>r?{start:t-e,end:t}:{start:t,end:t+e}}function DM(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],r=[],a=n._pointLabels.length,l=n.options.pointLabels,c=l.centerPointLabels?St/a:0;for(let u=0;u<a;u++){const f=l.setContext(n.getPointLabelContext(u));r[u]=f.padding;const g=n.getPointPosition(u,n.drawingArea+r[u],c),p=Ft(f.font),_=OM(n.ctx,p,n._pointLabels[u]);i[u]=_;const y=ue(n.getIndexAngle(u)+c),w=Math.round(Na(y)),M=Uu(w,g.x,_.w,0,180),A=Uu(w,g.y,_.h,90,270);LM(e,t,y,M,A)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=RM(n,i,r)}function LM(n,t,e,i,r){const a=Math.abs(Math.sin(e)),l=Math.abs(Math.cos(e));let c=0,u=0;i.start<t.l?(c=(t.l-i.start)/a,n.l=Math.min(n.l,t.l-c)):i.end>t.r&&(c=(i.end-t.r)/a,n.r=Math.max(n.r,t.r+c)),r.start<t.t?(u=(t.t-r.start)/l,n.t=Math.min(n.t,t.t-u)):r.end>t.b&&(u=(r.end-t.b)/l,n.b=Math.max(n.b,t.b+u))}function RM(n,t,e){const i=[],r=n._pointLabels.length,a=n.options,l=Ea(a)/2,c=n.drawingArea,u=a.pointLabels.centerPointLabels?St/r:0;for(let f=0;f<r;f++){const g=n.getPointPosition(f,c+l+e[f],u),p=Math.round(Na(ue(g.angle+Ct))),_=t[f],y=FM(g.y,_.h,p),w=EM(p),M=IM(g.x,_.w,w);i.push({x:g.x,y,textAlign:w,left:M,top:y,right:M+_.w,bottom:y+_.h})}return i}function EM(n){return n===0||n===180?"center":n<180?"left":"right"}function IM(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function FM(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function BM(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let r=t-1;r>=0;r--){const a=i.setContext(n.getPointLabelContext(r)),l=Ft(a.font),{x:c,y:u,textAlign:f,left:g,top:p,right:_,bottom:y}=n._pointLabelItems[r],{backdropColor:w}=a;if(!lt(w)){const M=Nn(a.borderRadius),A=Gt(a.backdropPadding);e.fillStyle=w;const C=g-A.left,O=p-A.top,I=_-g+A.width,F=y-p+A.height;Object.values(M).some(L=>L!==0)?(e.beginPath(),ts(e,{x:C,y:O,w:I,h:F,radius:M}),e.fill()):e.fillRect(C,O,I,F)}Un(e,n._pointLabels[r],c,u+l.lineHeight/2,l,{color:a.color,textAlign:f,textBaseline:"middle"})}}function qf(n,t,e,i){const{ctx:r}=n;if(e)r.arc(n.xCenter,n.yCenter,t,0,wt);else{let a=n.getPointPosition(0,t);r.moveTo(a.x,a.y);for(let l=1;l<i;l++)a=n.getPointPosition(l,t),r.lineTo(a.x,a.y)}}function zM(n,t,e,i,r){const a=n.ctx,l=t.circular,{color:c,lineWidth:u}=t;!l&&!i||!c||!u||e<0||(a.save(),a.strokeStyle=c,a.lineWidth=u,a.setLineDash(r.dash),a.lineDashOffset=r.dashOffset,a.beginPath(),qf(n,e,l,i),a.closePath(),a.stroke(),a.restore())}function WM(n,t,e){return yn(n,{label:e,index:t,type:"pointLabel"})}class $i extends Dr{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=Gt(Ea(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=Pt(t)&&!isNaN(t)?t:0,this.max=Pt(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Ea(this.options))}generateTickLabels(t){Dr.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const r=xt(this.options.pointLabels.callback,[e,i],this);return r||r===0?r:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?DM(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,r){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,r))}getIndexAngle(t){const e=wt/(this._pointLabels.length||1),i=this.options.startAngle||0;return ue(t*e+Oe(i))}getDistanceFromCenterForValue(t){if(lt(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(lt(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return WM(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const r=this.getIndexAngle(t)-Ct+i;return{x:Math.cos(r)*e+this.xCenter,y:Math.sin(r)*e+this.yCenter,angle:r}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:r,bottom:a}=this._pointLabelItems[t];return{left:e,top:i,right:r,bottom:a}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),qf(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:r,border:a}=e,l=this._pointLabels.length;let c,u,f;if(e.pointLabels.display&&BM(this,l),r.display&&this.ticks.forEach((g,p)=>{if(p!==0){u=this.getDistanceFromCenterForValue(g.value);const _=this.getContext(p),y=r.setContext(_),w=a.setContext(_);zM(this,y,u,l,w)}}),i.display){for(t.save(),c=l-1;c>=0;c--){const g=i.setContext(this.getPointLabelContext(c)),{color:p,lineWidth:_}=g;!_||!p||(t.lineWidth=_,t.strokeStyle=p,t.setLineDash(g.borderDash),t.lineDashOffset=g.borderDashOffset,u=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),f=this.getPointPosition(c,u),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(f.x,f.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const r=this.getIndexAngle(0);let a,l;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(r),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((c,u)=>{if(u===0&&!e.reverse)return;const f=i.setContext(this.getContext(u)),g=Ft(f.font);if(a=this.getDistanceFromCenterForValue(this.ticks[u].value),f.showLabelBackdrop){t.font=g.string,l=t.measureText(c.label).width,t.fillStyle=f.backdropColor;const p=Gt(f.backdropPadding);t.fillRect(-l/2-p.left,-a-g.size/2-p.top,l+p.width,g.size+p.height)}Un(t,c.label,0,-a,g,{color:f.color})}),t.restore()}drawTitle(){}}U($i,"id","radialLinear"),U($i,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Lr.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),U($i,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),U($i,"descriptors",{angleLines:{_fallback:"grid"}});const Fr={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}},ie=Object.keys(Fr);function NM(n,t){return n-t}function $u(n,t){if(lt(t))return null;const e=n._adapter,{parser:i,round:r,isoWeekday:a}=n._parseOpts;let l=t;return typeof i=="function"&&(l=i(l)),Pt(l)||(l=typeof i=="string"?e.parse(l,i):e.parse(l)),l===null?null:(r&&(l=r==="week"&&(ci(a)||a===!0)?e.startOf(l,"isoWeek",a):e.startOf(l,r)),+l)}function Yu(n,t,e,i){const r=ie.length;for(let a=ie.indexOf(n);a<r-1;++a){const l=Fr[ie[a]],c=l.steps?l.steps:Number.MAX_SAFE_INTEGER;if(l.common&&Math.ceil((e-t)/(c*l.size))<=i)return ie[a]}return ie[r-1]}function HM(n,t,e,i,r){for(let a=ie.length-1;a>=ie.indexOf(e);a--){const l=ie[a];if(Fr[l].common&&n._adapter.diff(r,i,l)>=t-1)return l}return ie[e?ie.indexOf(e):0]}function VM(n){for(let t=ie.indexOf(n)+1,e=ie.length;t<e;++t)if(Fr[ie[t]].common)return ie[t]}function Xu(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:r}=Ha(e,t),a=e[i]>=t?e[i]:e[r];n[a]=!0}}function UM(n,t,e,i){const r=n._adapter,a=+r.startOf(t[0].value,i),l=t[t.length-1].value;let c,u;for(c=a;c<=l;c=+r.add(c,1,i))u=e[c],u>=0&&(t[u].major=!0);return t}function Gu(n,t,e){const i=[],r={},a=t.length;let l,c;for(l=0;l<a;++l)c=t[l],r[c]=l,i.push({value:c,major:!1});return a===0||!e?i:UM(n,i,r,e)}class is extends $n{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),r=this._adapter=new e1._date(t.adapters.date);r.init(e),Yi(i.displayFormats,r.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:$u(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:r,max:a,minDefined:l,maxDefined:c}=this.getUserBounds();function u(f){!l&&!isNaN(f.min)&&(r=Math.min(r,f.min)),!c&&!isNaN(f.max)&&(a=Math.max(a,f.max))}(!l||!c)&&(u(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&u(this.getMinMax(!1))),r=Pt(r)&&!isNaN(r)?r:+e.startOf(Date.now(),i),a=Pt(a)&&!isNaN(a)?a:+e.endOf(Date.now(),i)+1,this.min=Math.min(r,a-1),this.max=Math.max(r+1,a)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,r=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const a=this.min,l=this.max,c=ky(r,a,l);return this._unit=e.unit||(i.autoSkip?Yu(e.minUnit,this.min,this.max,this._getLabelCapacity(a)):HM(this,c.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:VM(this._unit),this.initOffsets(r),t.reverse&&c.reverse(),Gu(this,c,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,r,a;this.options.offset&&t.length&&(r=this.getDecimalForValue(t[0]),t.length===1?e=1-r:e=(this.getDecimalForValue(t[1])-r)/2,a=this.getDecimalForValue(t[t.length-1]),t.length===1?i=a:i=(a-this.getDecimalForValue(t[t.length-2]))/2);const l=t.length<3?.5:.25;e=Wt(e,0,l),i=Wt(i,0,l),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,r=this.options,a=r.time,l=a.unit||Yu(a.minUnit,e,i,this._getLabelCapacity(e)),c=Z(r.ticks.stepSize,1),u=l==="week"?a.isoWeekday:!1,f=ci(u)||u===!0,g={};let p=e,_,y;if(f&&(p=+t.startOf(p,"isoWeek",u)),p=+t.startOf(p,f?"day":l),t.diff(i,e,l)>1e5*c)throw new Error(e+" and "+i+" are too far apart with stepSize of "+c+" "+l);const w=r.ticks.source==="data"&&this.getDataTimestamps();for(_=p,y=0;_<i;_=+t.add(_,c,l),y++)Xu(g,_,w);return(_===i||r.bounds==="ticks"||y===1)&&Xu(g,_,w),Object.keys(g).sort((M,A)=>M-A).map(M=>+M)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const r=this.options.time.displayFormats,a=this._unit,l=e||r[a];return this._adapter.format(t,l)}_tickFormatFunction(t,e,i,r){const a=this.options,l=a.ticks.callback;if(l)return xt(l,[t,e,i],this);const c=a.time.displayFormats,u=this._unit,f=this._majorUnit,g=u&&c[u],p=f&&c[f],_=i[e],y=f&&p&&_&&_.major;return this._adapter.format(t,r||(y?p:g))}generateTickLabels(t){let e,i,r;for(e=0,i=t.length;e<i;++e)r=t[e],r.label=this._tickFormatFunction(r.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,r=Oe(this.isHorizontal()?e.maxRotation:e.minRotation),a=Math.cos(r),l=Math.sin(r),c=this._resolveTickFontOptions(0).size;return{w:i*a+c*l,h:i*l+c*a}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,r=i[e.unit]||i.millisecond,a=this._tickFormatFunction(t,0,Gu(this,[t],this._majorUnit),r),l=this._getLabelSize(a),c=Math.floor(this.isHorizontal()?this.width/l.w:this.height/l.h)-1;return c>0?c:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(e=0,i=r.length;e<i;++e)t=t.concat(r[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const r=this.getLabels();for(e=0,i=r.length;e<i;++e)t.push($u(this,r[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return of(t.sort(NM))}}U(is,"id","time"),U(is,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function hr(n,t,e){let i=0,r=n.length-1,a,l,c,u;e?(t>=n[i].pos&&t<=n[r].pos&&({lo:i,hi:r}=en(n,"pos",t)),{pos:a,time:c}=n[i],{pos:l,time:u}=n[r]):(t>=n[i].time&&t<=n[r].time&&({lo:i,hi:r}=en(n,"time",t)),{time:a,pos:c}=n[i],{time:l,pos:u}=n[r]);const f=l-a;return f?c+(u-c)*(t-a)/f:c}class Ia extends is{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=hr(e,this.min),this._tableRange=hr(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,r=[],a=[];let l,c,u,f,g;for(l=0,c=t.length;l<c;++l)f=t[l],f>=e&&f<=i&&r.push(f);if(r.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(l=0,c=r.length;l<c;++l)g=r[l+1],u=r[l-1],f=r[l],Math.round((g+u)/2)!==f&&a.push({time:f,pos:l/(c-1)});return a}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(hr(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return hr(this._table,i*this._tableRange+this._minPos,!0)}}U(Ia,"id","timeseries"),U(Ia,"defaults",is.defaults);var $M=Object.freeze({__proto__:null,CategoryScale:Da,LinearScale:La,LogarithmicScale:Ra,RadialLinearScale:$i,TimeScale:is,TimeSeriesScale:Ia});const eS=[t1,Tw,MM,$M];export{zn as C,QM as G,tS as H,Wx as I,jM as O,GM as R,KM as Y,JM as a,qM as j,ya as l,ZM as q,eS as r};