What changed, and why it matters
This commit changes how LNbits reports validation errors to users. Previously, the API returned a plain string summary of the error. Now it returns a structured list of individual validation failures. This is a user-experience improvement that makes error messages clearer, but it does not fix a security vulnerability and does not introduce a clear one. The main side effect is that error responses now expose slightly more internal detail about which fields failed validation and why.
Treat as a routine UX fix. If the project is sensitive about information disclosure, review whether Pydantic error details expose internal field names or values that should not be returned to unauthenticated clients, and consider sanitizing loc/msg before returning them. No urgent security action is required based on this commit alone.
Security signals we found
Error response format change from string to structured Pydantic error objects
Potential minor information disclosure: validation errors now reveal field names, expected types, and invalid input values
No change to authentication, authorization, input parsing, or business logic
Evidence from the diff
The core change is in lnbits/exceptions.py: the RequestValidationError handler now returns JSONResponse(content={‘detail’: [dict(e) for e in exc.errors()]}) instead of {‘detail’: str(exc)}. This exposes Pydantic’s per-error dictionaries (containing loc, msg, type, ctx, input) to API clients. The frontend bundle and a JS utility were rebuilt to consume the new format, and tests were updated to assert the new structure. There is no authentication bypass, injection flaw, or access-control change in the diff.
Changed components
lnbits/exceptions.pylnbits/static/bundle.min.jslnbits/static/js/utils.jstests/api/test_api.pytests/api/test_auth.pyInspect captured patch +35 / −16
diff --git a/lnbits/exceptions.py b/lnbits/exceptions.py
index 0b17c4f..5701e2d 100644
--- a/lnbits/exceptions.py
+++ b/lnbits/exceptions.py
@@ -109,7 +109,7 @@ def register_exception_handlers(app: FastAPI): # noqa: C901
logger.error(f"RequestValidationError: {exc!s}")
return render_html_error(request, exc) or JSONResponse(
status_code=HTTPStatus.BAD_REQUEST,
- content={"detail": str(exc)},
+ content={"detail": [dict(e) for e in exc.errors()]},
)
@app.exception_handler(HTTPException)
diff --git a/lnbits/static/bundle.min.js b/lnbits/static/bundle.min.js
index 6168785..373cacf 100644
--- a/lnbits/static/bundle.min.js
+++ b/lnbits/static/bundle.min.js
@@ -43,4 +43,4 @@ function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,req
* (c) 2023 Jukka Kurkela
* Released under the MIT License
*/function ve(e){return e+.5|0}const be=(e,t,n)=>Math.max(Math.min(e,n),t);function ye(e){return be(ve(2.55*e),0,255)}function we(e){return be(ve(255*e),0,255)}function ke(e){return be(ve(e/2.55)/100,0,1)}function xe(e){return be(ve(100*e),0,100)}const Se={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},Ce=[..."0123456789ABCDEF"],Te=e=>Ce[15&e],Pe=e=>Ce[(240&e)>>4]+Ce[15&e],Ee=e=>(240&e)>>4==(15&e);const Ae=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Me(e,t,n){const a=t*Math.min(n,1-n),i=(t,i=(t+e/30)%12)=>n-a*Math.max(Math.min(i-3,9-i,1),-1);return[i(0),i(8),i(4)]}function Le(e,t,n){const a=(a,i=(a+e/60)%6)=>n-n*t*Math.max(Math.min(i,4-i,1),0);return[a(5),a(3),a(1)]}function Re(e,t,n){const a=Me(e,1,.5);let i;for(t+n>1&&(i=1/(t+n),t*=i,n*=i),i=0;i<3;i++)a[i]*=1-t-n,a[i]+=t;return a}function ze(e){const t=e.r/255,n=e.g/255,a=e.b/255,i=Math.max(t,n,a),r=Math.min(t,n,a),o=(i+r)/2;let s,l,u;return i!==r&&(u=i-r,l=o>.5?u/(2-i-r):u/(i+r),s=function(e,t,n,a,i){return e===i?(t-n)/a+(t<n?6:0):t===i?(n-e)/a+2:(e-t)/a+4}(t,n,a,u,i),s=60*s+.5),[0|s,l||0,o]}function Ne(e,t,n,a){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,a)).map(we)}function Oe(e,t,n){return Ne(Me,e,t,n)}function Ie(e){return(e%360+360)%360}const qe={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"},De={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};let je;const Be=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,Fe=e=>e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055,$e=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function Ve(e,t,n){if(e){let a=ze(e);a[t]=Math.max(0,Math.min(a[t]+a[t]*n,0===t?360:1)),a=Oe(a),e.r=a[0],e.g=a[1],e.b=a[2]}}function Ue(e,t){return e?Object.assign(t||{},e):e}function He(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=we(e[3]))):(t=Ue(e,{r:0,g:0,b:0,a:1})).a=we(t.a),t}function We(e){return"r"===e.charAt(0)?function(e){const t=Be.exec(e);let n,a,i,r=255;if(t){if(t[7]!==n){const e=+t[7];r=t[8]?ye(e):be(255*e,0,255)}return n=+t[1],a=+t[3],i=+t[5],n=255&(t[2]?ye(n):be(n,0,255)),a=255&(t[4]?ye(a):be(a,0,255)),i=255&(t[6]?ye(i):be(i,0,255)),{r:n,g:a,b:i,a:r}}}(e):function(e){const t=Ae.exec(e);let n,a=255;if(!t)return;t[5]!==n&&(a=t[6]?ye(+t[5]):we(+t[5]));const i=Ie(+t[2]),r=+t[3]/100,o=+t[4]/100;return n="hwb"===t[1]?function(e,t,n){return Ne(Re,e,t,n)}(i,r,o):"hsv"===t[1]?function(e,t,n){return Ne(Le,e,t,n)}(i,r,o):Oe(i,r,o),{r:n[0],g:n[1],b:n[2],a:a}}(e)}class Ge{constructor(e){if(e instanceof Ge)return e;const t=typeof e;let n;var a,i,r;"object"===t?n=He(e):"string"===t&&(r=(a=e).length,"#"===a[0]&&(4===r||5===r?i={r:255&17*Se[a[1]],g:255&17*Se[a[2]],b:255&17*Se[a[3]],a:5===r?17*Se[a[4]]:255}:7!==r&&9!==r||(i={r:Se[a[1]]<<4|Se[a[2]],g:Se[a[3]]<<4|Se[a[4]],b:Se[a[5]]<<4|Se[a[6]],a:9===r?Se[a[7]]<<4|Se[a[8]]:255})),n=i||function(e){je||(je=function(){const e={},t=Object.keys(De),n=Object.keys(qe);let a,i,r,o,s;for(a=0;a<t.length;a++){for(o=s=t[a],i=0;i<n.length;i++)r=n[i],s=s.replace(r,qe[r]);r=parseInt(De[o],16),e[s]=[r>>16&255,r>>8&255,255&r]}return e}(),je.transparent=[0,0,0,0]);const t=je[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:4===t.length?t[3]:255}}(e)||We(e)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var e=Ue(this._rgb);return e&&(e.a=ke(e.a)),e}set rgb(e){this._rgb=He(e)}rgbString(){return this._valid?(e=this._rgb)&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${ke(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`):void 0;var e}hexString(){return this._valid?function(e){var t=(e=>Ee(e.r)&&Ee(e.g)&&Ee(e.b)&&Ee(e.a))(e)?Te:Pe;return e?"#"+t(e.r)+t(e.g)+t(e.b)+((e,t)=>e<255?t(e):"")(e.a,t):void 0}(this._rgb):void 0}hslString(){return this._valid?function(e){if(!e)return;const t=ze(e),n=t[0],a=xe(t[1]),i=xe(t[2]);return e.a<255?`hsla(${n}, ${a}%, ${i}%, ${ke(e.a)})`:`hsl(${n}, ${a}%, ${i}%)`}(this._rgb):void 0}mix(e,t){if(e){const n=this.rgb,a=e.rgb;let i;const r=t===i?.5:t,o=2*r-1,s=n.a-a.a,l=((o*s==-1?o:(o+s)/(1+o*s))+1)/2;i=1-l,n.r=255&l*n.r+i*a.r+.5,n.g=255&l*n.g+i*a.g+.5,n.b=255&l*n.b+i*a.b+.5,n.a=r*n.a+(1-r)*a.a,this.rgb=n}return this}interpolate(e,t){return e&&(this._rgb=function(e,t,n){const a=$e(ke(e.r)),i=$e(ke(e.g)),r=$e(ke(e.b));return{r:we(Fe(a+n*($e(ke(t.r))-a))),g:we(Fe(i+n*($e(ke(t.g))-i))),b:we(Fe(r+n*($e(ke(t.b))-r))),a:e.a+n*(t.a-e.a)}}(this._rgb,e._rgb,t)),this}clone(){return new Ge(this.rgb)}alpha(e){return this._rgb.a=we(e),this}clearer(e){return this._rgb.a*=1-e,this}greyscale(){const e=this._rgb,t=ve(.3*e.r+.59*e.g+.11*e.b);return e.r=e.g=e.b=t,this}opaquer(e){return this._rgb.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Ve(this._rgb,2,e),this}darken(e){return Ve(this._rgb,2,-e),this}saturate(e){return Ve(this._rgb,1,e),this}desaturate(e){return Ve(this._rgb,1,-e),this}rotate(e){return function(e,t){var n=ze(e);n[0]=Ie(n[0]+t),n=Oe(n),e.r=n[0],e.g=n[1],e.b=n[2]}(this._rgb,e),this}}function Ye(e){if(e&&"object"==typeof e){const t=e.toString();return"[object CanvasPattern]"===t||"[object CanvasGradient]"===t}return!1}function Ke(e){return Ye(e)?e:new Ge(e)}function Qe(e){return Ye(e)?e:new Ge(e).saturate(.5).darken(.1).hexString()}const Ze=["x","y","borderWidth","radius","tension"],Je=["color","borderColor","backgroundColor"],Xe=new Map;function et(e,t,n){return function(e,t){t=t||{};const n=e+JSON.stringify(t);let a=Xe.get(n);return a||(a=new Intl.NumberFormat(e,t),Xe.set(n,a)),a}(t,n).format(e)}const tt={values:e=>i(e)?e:""+e,numeric(e,t,n){if(0===e)return"0";const a=this.chart.options.locale;let i,r=e;if(n.length>1){const t=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(t<1e-4||t>1e15)&&(i="scientific"),r=function(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}(e,n)}const o=I(Math.abs(r)),s=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:i,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(l,this.options.ticks.format),et(e,a,l)},logarithmic(e,t,n){if(0===e)return"0";const a=n[t].significand||e/Math.pow(10,Math.floor(I(e)));return[1,2,3,5,10,15].includes(a)||t>.8*n.length?tt.numeric.call(this,e,t,n):""}};var nt={formatters:tt};const at=Object.create(null),it=Object.create(null);function rt(e,t){if(!t)return e;const n=t.split(".");for(let t=0,a=n.length;t<a;++t){const a=n[t];e=e[a]||(e[a]=Object.create(null))}return e}function ot(e,t,n){return"string"==typeof t?_(rt(e,t),n):_(rt(e,""),t)}var st=new class{constructor(e,t){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=e=>e.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=(e,t)=>Qe(t.backgroundColor),this.hoverBorderColor=(e,t)=>Qe(t.borderColor),this.hoverColor=(e,t)=>Qe(t.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(e),this.apply(t)}set(e,t){return ot(this,e,t)}get(e){return rt(this,e)}describe(e,t){return ot(it,e,t)}override(e,t){return ot(at,e,t)}route(e,t,n,a){const i=rt(this,e),o=rt(this,n),s="_"+t;Object.defineProperties(i,{[s]:{value:i[t],writable:!0},[t]:{enumerable:!0,get(){const e=this[s],t=o[a];return r(e)?Object.assign({},t,e):l(e,t)},set(e){this[s]=e}}})}apply(e){e.forEach(e=>e(this))}}({_scriptable:e=>!e.startsWith("on"),_indexable:e=>"events"!==e,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>"onProgress"!==e&&"onComplete"!==e&&"fn"!==e}),e.set("animations",{colors:{type:"color",properties:Je},numbers:{type:"number",properties:Ze}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>0|e}}}})},function(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.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:nt.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&"callback"!==e&&"parser"!==e,_indexable:e=>"borderDash"!==e&&"tickBorderDash"!==e&&"dash"!==e}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:e=>"backdropPadding"!==e&&"callback"!==e,_indexable:e=>"backdropPadding"!==e})}]);function lt(){return"undefined"!=typeof window&&"undefined"!=typeof document}function ut(e){let t=e.parentNode;return t&&"[object ShadowRoot]"===t.toString()&&(t=t.host),t}function ct(e,t,n){let a;return"string"==typeof e?(a=parseInt(e,10),-1!==e.indexOf("%")&&(a=a/100*t.parentNode[n])):a=e,a}const dt=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function ht(e,t){return dt(e).getPropertyValue(t)}const pt=["top","right","bottom","left"];function ft(e,t,n){const a={};n=n?"-"+n:"";for(let i=0;i<4;i++){const r=pt[i];a[r]=parseFloat(e[t+"-"+r+n])||0}return a.width=a.left+a.right,a.height=a.top+a.bottom,a}function mt(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:a}=t,i=dt(n),r="border-box"===i.boxSizing,o=ft(i,"padding"),s=ft(i,"border","width"),{x:l,y:u,box:c}=function(e,t){const n=e.touches,a=n&&n.length?n[0]:e,{offsetX:i,offsetY:r}=a;let o,s,l=!1;if(((e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot))(i,r,e.target))o=i,s=r;else{const e=t.getBoundingClientRect();o=a.clientX-e.left,s=a.clientY-e.top,l=!0}return{x:o,y:s,box:l}}(e,n),d=o.left+(c&&s.left),h=o.top+(c&&s.top);let{width:p,height:f}=t;return r&&(p-=o.width+s.width,f-=o.height+s.height),{x:Math.round((l-d)/p*n.width/a),y:Math.round((u-h)/f*n.height/a)}}const gt=e=>Math.round(10*e)/10;function _t(e,t,n,a){const i=dt(e),r=ft(i,"margin"),o=ct(i.maxWidth,e,"clientWidth")||L,s=ct(i.maxHeight,e,"clientHeight")||L,l=function(e,t,n){let a,i;if(void 0===t||void 0===n){const r=e&&ut(e);if(r){const e=r.getBoundingClientRect(),o=dt(r),s=ft(o,"border","width"),l=ft(o,"padding");t=e.width-l.width-s.width,n=e.height-l.height-s.height,a=ct(o.maxWidth,r,"clientWidth"),i=ct(o.maxHeight,r,"clientHeight")}else t=e.clientWidth,n=e.clientHeight}return{width:t,height:n,maxWidth:a||L,maxHeight:i||L}}(e,t,n);let{width:u,height:c}=l;if("content-box"===i.boxSizing){const e=ft(i,"border","width"),t=ft(i,"padding");u-=t.width+e.width,c-=t.height+e.height}return u=Math.max(0,u-r.width),c=Math.max(0,a?u/a:c-r.height),u=gt(Math.min(u,o,l.maxWidth)),c=gt(Math.min(c,s,l.maxHeight)),u&&!c&&(c=gt(u/2)),(void 0!==t||void 0!==n)&&a&&l.height&&c>l.height&&(c=l.height,u=gt(Math.floor(c*a))),{width:u,height:c}}function vt(e,t,n){const a=t||1,i=gt(e.height*a),r=gt(e.width*a);e.height=gt(e.height),e.width=gt(e.width);const o=e.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${e.height}px`,o.style.width=`${e.width}px`),(e.currentDevicePixelRatio!==a||o.height!==i||o.width!==r)&&(e.currentDevicePixelRatio=a,o.height=i,o.width=r,e.ctx.setTransform(a,0,0,a,0,0),!0)}const bt=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};lt()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch(e){}return e}();function yt(e,t){const n=ht(e,t),a=n&&n.match(/^(\d+)(\.\d+)?px$/);return a?+a[1]:void 0}function wt(e){return!e||a(e.size)||a(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function kt(e,t,n,a,i){let r=t[i];return r||(r=t[i]=e.measureText(i).width,n.push(i)),r>a&&(a=r),a}function xt(e,t,n,a){let r=(a=a||{}).data=a.data||{},o=a.garbageCollect=a.garbageCollect||[];a.font!==t&&(r=a.data={},o=a.garbageCollect=[],a.font=t),e.save(),e.font=t;let s=0;const l=n.length;let u,c,d,h,p;for(u=0;u<l;u++)if(h=n[u],null==h||i(h)){if(i(h))for(c=0,d=h.length;c<d;c++)p=h[c],null==p||i(p)||(s=kt(e,r,o,s,p))}else s=kt(e,r,o,s,h);e.restore();const f=o.length/2;if(f>n.length){for(u=0;u<f;u++)delete r[o[u]];o.splice(0,f)}return s}function St(e,t,n){const a=e.currentDevicePixelRatio,i=0!==n?Math.max(n/2,.5):0;return Math.round((t-i)*a)/a+i}function Ct(e,t){(t||e)&&((t=t||e.getContext("2d")).save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Tt(e,t,n,a){Pt(e,t,n,a,null)}function Pt(e,t,n,a,i){let r,o,s,l,u,c,d,h;const p=t.pointStyle,f=t.rotation,m=t.radius;let g=(f||0)*R;if(p&&"object"==typeof p&&(r=p.toString(),"[object HTMLImageElement]"===r||"[object HTMLCanvasElement]"===r))return e.save(),e.translate(n,a),e.rotate(g),e.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),void e.restore();if(!(isNaN(m)||m<=0)){switch(e.beginPath(),p){default:i?e.ellipse(n,a,i/2,m,0,0,A):e.arc(n,a,m,0,A),e.closePath();break;case"triangle":c=i?i/2:m,e.moveTo(n+Math.sin(g)*c,a-Math.cos(g)*m),g+=O,e.lineTo(n+Math.sin(g)*c,a-Math.cos(g)*m),g+=O,e.lineTo(n+Math.sin(g)*c,a-Math.cos(g)*m),e.closePath();break;case"rectRounded":u=.516*m,l=m-u,o=Math.cos(g+N)*l,d=Math.cos(g+N)*(i?i/2-u:l),s=Math.sin(g+N)*l,h=Math.sin(g+N)*(i?i/2-u:l),e.arc(n-d,a-s,u,g-E,g-z),e.arc(n+h,a-o,u,g-z,g),e.arc(n+d,a+s,u,g,g+z),e.arc(n-h,a+o,u,g+z,g+E),e.closePath();break;case"rect":if(!f){l=Math.SQRT1_2*m,c=i?i/2:l,e.rect(n-c,a-l,2*c,2*l);break}g+=N;case"rectRot":d=Math.cos(g)*(i?i/2:m),o=Math.cos(g)*m,s=Math.sin(g)*m,h=Math.sin(g)*(i?i/2:m),e.moveTo(n-d,a-s),e.lineTo(n+h,a-o),e.lineTo(n+d,a+s),e.lineTo(n-h,a+o),e.closePath();break;case"crossRot":g+=N;case"cross":d=Math.cos(g)*(i?i/2:m),o=Math.cos(g)*m,s=Math.sin(g)*m,h=Math.sin(g)*(i?i/2:m),e.moveTo(n-d,a-s),e.lineTo(n+d,a+s),e.moveTo(n+h,a-o),e.lineTo(n-h,a+o);break;case"star":d=Math.cos(g)*(i?i/2:m),o=Math.cos(g)*m,s=Math.sin(g)*m,h=Math.sin(g)*(i?i/2:m),e.moveTo(n-d,a-s),e.lineTo(n+d,a+s),e.moveTo(n+h,a-o),e.lineTo(n-h,a+o),g+=N,d=Math.cos(g)*(i?i/2:m),o=Math.cos(g)*m,s=Math.sin(g)*m,h=Math.sin(g)*(i?i/2:m),e.moveTo(n-d,a-s),e.lineTo(n+d,a+s),e.moveTo(n+h,a-o),e.lineTo(n-h,a+o);break;case"line":o=i?i/2:Math.cos(g)*m,s=Math.sin(g)*m,e.moveTo(n-o,a-s),e.lineTo(n+o,a+s);break;case"dash":e.moveTo(n,a),e.lineTo(n+Math.cos(g)*(i?i/2:m),a+Math.sin(g)*m);break;case!1:e.closePath()}e.fill(),t.borderWidth>0&&e.stroke()}}function Et(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function At(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Mt(e){e.restore()}function Lt(e,t,n,a,i){if(!t)return e.lineTo(n.x,n.y);if("middle"===i){const a=(t.x+n.x)/2;e.lineTo(a,t.y),e.lineTo(a,n.y)}else"after"===i!=!!a?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function Rt(e,t,n,a){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(a?t.cp1x:t.cp2x,a?t.cp1y:t.cp2y,a?n.cp2x:n.cp1x,a?n.cp2y:n.cp1y,n.x,n.y)}function zt(e,t,n,a,i){if(i.strikethrough||i.underline){const r=e.measureText(a),o=t-r.actualBoundingBoxLeft,s=t+r.actualBoundingBoxRight,l=n-r.actualBoundingBoxAscent,u=n+r.actualBoundingBoxDescent,c=i.strikethrough?(l+u)/2:u;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(o,c),e.lineTo(s,c),e.stroke()}}function Nt(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Ot(e,t,n,r,o,s={}){const l=i(t)?t:[t],u=s.strokeWidth>0&&""!==s.strokeColor;let c,d;for(e.save(),e.font=o.string,function(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),a(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}(e,s),c=0;c<l.length;++c)d=l[c],s.backdrop&&Nt(e,s.backdrop),u&&(s.strokeColor&&(e.strokeStyle=s.strokeColor),a(s.strokeWidth)||(e.lineWidth=s.strokeWidth),e.strokeText(d,n,r,s.maxWidth)),e.fillText(d,n,r,s.maxWidth),zt(e,n,r,d,s),r+=Number(o.lineHeight);e.restore()}function It(e,t){const{x:n,y:a,w:i,h:r,radius:o}=t;e.arc(n+o.topLeft,a+o.topLeft,o.topLeft,1.5*E,E,!0),e.lineTo(n,a+r-o.bottomLeft),e.arc(n+o.bottomLeft,a+r-o.bottomLeft,o.bottomLeft,E,z,!0),e.lineTo(n+i-o.bottomRight,a+r),e.arc(n+i-o.bottomRight,a+r-o.bottomRight,o.bottomRight,z,0,!0),e.lineTo(n+i,a+o.topRight),e.arc(n+i-o.topRight,a+o.topRight,o.topRight,0,-z,!0),e.lineTo(n+o.topLeft,a)}function qt(e,t=[""],n,a,i=()=>e[0]){const r=n||e;void 0===a&&(a=Yt("_fallback",e));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:r,_fallback:a,_getTarget:i,override:n=>qt([n,...e],t,r,a)};return new Proxy(o,{deleteProperty:(t,n)=>(delete t[n],delete t._keys,delete e[0][n],!0),get:(n,a)=>$t(n,a,()=>function(e,t,n,a){let i;for(const r of t)if(i=Yt(Bt(r,e),n),void 0!==i)return Ft(e,i)?Wt(n,a,e,i):i}(a,t,e,n)),getOwnPropertyDescriptor:(e,t)=>Reflect.getOwnPropertyDescriptor(e._scopes[0],t),getPrototypeOf:()=>Reflect.getPrototypeOf(e[0]),has:(e,t)=>Kt(e).includes(t),ownKeys:e=>Kt(e),set(e,t,n){const a=e._storage||(e._storage=i());return e[t]=a[t]=n,delete e._keys,!0}})}function Dt(e,t,n,a){const o={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:jt(e,a),setContext:t=>Dt(e,t,n,a),override:i=>Dt(e.override(i),t,n,a)};return new Proxy(o,{deleteProperty:(t,n)=>(delete t[n],delete e[n],!0),get:(e,t,n)=>$t(e,t,()=>function(e,t,n){const{_proxy:a,_context:o,_subProxy:s,_descriptors:l}=e;let u=a[t];return C(u)&&l.isScriptable(t)&&(u=function(e,t,n,a){const{_proxy:i,_context:r,_subProxy:o,_stack:s}=n;if(s.has(e))throw new Error("Recursion detected: "+Array.from(s).join("->")+"->"+e);s.add(e);let l=t(r,o||a);return s.delete(e),Ft(e,l)&&(l=Wt(i._scopes,i,e,l)),l}(t,u,e,n)),i(u)&&u.length&&(u=function(e,t,n,a){const{_proxy:i,_context:o,_subProxy:s,_descriptors:l}=n;if(void 0!==o.index&&a(e))return t[o.index%t.length];if(r(t[0])){const n=t,a=i._scopes.filter(e=>e!==n);t=[];for(const r of n){const n=Wt(a,i,e,r);t.push(Dt(n,o,s&&s[e],l))}}return t}(t,u,e,l.isIndexable)),Ft(t,u)&&(u=Dt(u,o,s&&s[t],l)),u}(e,t,n)),getOwnPropertyDescriptor:(t,n)=>t._descriptors.allKeys?Reflect.has(e,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,n),getPrototypeOf:()=>Reflect.getPrototypeOf(e),has:(t,n)=>Reflect.has(e,n),ownKeys:()=>Reflect.ownKeys(e),set:(t,n,a)=>(e[n]=a,delete t[n],!0)})}function jt(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:a=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:a,isScriptable:C(n)?n:()=>n,isIndexable:C(a)?a:()=>a}}const Bt=(e,t)=>e?e+x(t):t,Ft=(e,t)=>r(t)&&"adapters"!==e&&(null===Object.getPrototypeOf(t)||t.constructor===Object);function $t(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||"constructor"===t)return e[t];const a=n();return e[t]=a,a}function Vt(e,t,n){return C(e)?e(t,n):e}const Ut=(e,t)=>!0===e?t:"string"==typeof e?k(t,e):void 0;function Ht(e,t,n,a,i){for(const r of t){const t=Ut(n,r);if(t){e.add(t);const r=Vt(t._fallback,n,i);if(void 0!==r&&r!==n&&r!==a)return r}else if(!1===t&&void 0!==a&&n!==a)return null}return!1}function Wt(e,t,n,a){const o=t._rootScopes,s=Vt(t._fallback,n,a),l=[...e,...o],u=new Set;u.add(a);let c=Gt(u,l,n,s||n,a);return null!==c&&(void 0===s||s===n||(c=Gt(u,l,s,c,a),null!==c))&&qt(Array.from(u),[""],o,s,()=>function(e,t,n){const a=e._getTarget();t in a||(a[t]={});const o=a[t];return i(o)&&r(n)?n:o||{}}(t,n,a))}function Gt(e,t,n,a,i){for(;n;)n=Ht(e,t,n,a,i);return n}function Yt(e,t){for(const n of t){if(!n)continue;const t=n[e];if(void 0!==t)return t}}function Kt(e){let t=e._keys;return t||(t=e._keys=function(e){const t=new Set;for(const n of e)for(const e of Object.keys(n).filter(e=>!e.startsWith("_")))t.add(e);return Array.from(t)}(e._scopes)),t}function Qt(e,t,n,a){const{iScale:i}=e,{key:r="r"}=this._parsing,o=new Array(a);let s,l,u,c;for(s=0,l=a;s<l;++s)u=s+n,c=t[u],o[s]={r:i.parse(k(c,r),u)};return o}const Zt=Number.EPSILON||1e-14,Jt=(e,t)=>t<e.length&&!e[t].skip&&e[t],Xt=e=>"x"===e?"y":"x";function en(e,t,n,a){const i=e.skip?t:e,r=t,o=n.skip?t:n,s=Y(r,i),l=Y(o,r);let u=s/(s+l),c=l/(s+l);u=isNaN(u)?0:u,c=isNaN(c)?0:c;const d=a*u,h=a*c;return{previous:{x:r.x-d*(o.x-i.x),y:r.y-d*(o.y-i.y)},next:{x:r.x+h*(o.x-i.x),y:r.y+h*(o.y-i.y)}}}function tn(e,t="x"){const n=Xt(t),a=e.length,i=Array(a).fill(0),r=Array(a);let o,s,l,u=Jt(e,0);for(o=0;o<a;++o)if(s=l,l=u,u=Jt(e,o+1),l){if(u){const e=u[t]-l[t];i[o]=0!==e?(u[n]-l[n])/e:0}r[o]=s?u?q(i[o-1])!==q(i[o])?0:(i[o-1]+i[o])/2:i[o-1]:i[o]}!function(e,t,n){const a=e.length;let i,r,o,s,l,u=Jt(e,0);for(let c=0;c<a-1;++c)l=u,u=Jt(e,c+1),l&&u&&(D(t[c],0,Zt)?n[c]=n[c+1]=0:(i=n[c]/t[c],r=n[c+1]/t[c],s=Math.pow(i,2)+Math.pow(r,2),s<=9||(o=3/Math.sqrt(s),n[c]=i*o*t[c],n[c+1]=r*o*t[c])))}(e,i,r),function(e,t,n="x"){const a=Xt(n),i=e.length;let r,o,s,l=Jt(e,0);for(let u=0;u<i;++u){if(o=s,s=l,l=Jt(e,u+1),!s)continue;const i=s[n],c=s[a];o&&(r=(i-o[n])/3,s[`cp1${n}`]=i-r,s[`cp1${a}`]=c-r*t[u]),l&&(r=(l[n]-i)/3,s[`cp2${n}`]=i+r,s[`cp2${a}`]=c+r*t[u])}}(e,r,t)}function nn(e,t,n){return Math.max(Math.min(e,n),t)}function an(e,t,n,a,i){let r,o,s,l;if(t.spanGaps&&(e=e.filter(e=>!e.skip)),"monotone"===t.cubicInterpolationMode)tn(e,i);else{let n=a?e[e.length-1]:e[0];for(r=0,o=e.length;r<o;++r)s=e[r],l=en(n,s,e[Math.min(r+1,o-(a?0:1))%o],t.tension),s.cp1x=l.previous.x,s.cp1y=l.previous.y,s.cp2x=l.next.x,s.cp2y=l.next.y,n=s}t.capBezierPoints&&function(e,t){let n,a,i,r,o,s=Et(e[0],t);for(n=0,a=e.length;n<a;++n)o=r,r=s,s=n<a-1&&Et(e[n+1],t),r&&(i=e[n],o&&(i.cp1x=nn(i.cp1x,t.left,t.right),i.cp1y=nn(i.cp1y,t.top,t.bottom)),s&&(i.cp2x=nn(i.cp2x,t.left,t.right),i.cp2y=nn(i.cp2y,t.top,t.bottom)))}(e,n)}const rn=e=>0===e||1===e,on=(e,t,n)=>-Math.pow(2,10*(e-=1))*Math.sin((e-t)*A/n),sn=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*A/n)+1,ln={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>1-Math.cos(e*z),easeOutSine:e=>Math.sin(e*z),easeInOutSine:e=>-.5*(Math.cos(E*e)-1),easeInExpo:e=>0===e?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>1===e?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>rn(e)?e:e<.5?.5*Math.pow(2,10*(2*e-1)):.5*(2-Math.pow(2,-10*(2*e-1))),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>rn(e)?e:on(e,.075,.3),easeOutElastic:e=>rn(e)?e:sn(e,.075,.3),easeInOutElastic(e){const t=.1125;return rn(e)?e:e<.5?.5*on(2*e,t,.45):.5+.5*sn(2*e-1,t,.45)},easeInBack(e){const t=1.70158;return e*e*((t+1)*e-t)},easeOutBack(e){const t=1.70158;return(e-=1)*e*((t+1)*e+t)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?e*e*((1+(t*=1.525))*e-t)*.5:.5*((e-=2)*e*((1+(t*=1.525))*e+t)+2)},easeInBounce:e=>1-ln.easeOutBounce(1-e),easeOutBounce(e){const t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},easeInOutBounce:e=>e<.5?.5*ln.easeInBounce(2*e):.5*ln.easeOutBounce(2*e-1)+.5};function un(e,t,n,a){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function cn(e,t,n,a){return{x:e.x+n*(t.x-e.x),y:"middle"===a?n<.5?e.y:t.y:"after"===a?n<1?e.y:t.y:n>0?t.y:e.y}}function dn(e,t,n,a){const i={x:e.cp2x,y:e.cp2y},r={x:t.cp1x,y:t.cp1y},o=un(e,i,n),s=un(i,r,n),l=un(r,t,n),u=un(o,s,n),c=un(s,l,n);return un(u,c,n)}const hn=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,pn=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function fn(e,t){const n=(""+e).match(hn);if(!n||"normal"===n[1])return 1.2*t;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100}return t*e}const mn=e=>+e||0;function gn(e,t){const n={},a=r(t),i=a?Object.keys(t):t,o=r(e)?a?n=>l(e[n],e[t[n]]):t=>e[t]:()=>e;for(const e of i)n[e]=mn(o(e));return n}function _n(e){return gn(e,{top:"y",right:"x",bottom:"y",left:"x"})}function vn(e){return gn(e,["topLeft","topRight","bottomLeft","bottomRight"])}function bn(e){const t=_n(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function yn(e,t){e=e||{},t=t||st.font;let n=l(e.size,t.size);"string"==typeof n&&(n=parseInt(n,10));let a=l(e.style,t.style);a&&!(""+a).match(pn)&&(console.warn('Invalid font style specified: "'+a+'"'),a=void 0);const i={family:l(e.family,t.family),lineHeight:fn(l(e.lineHeight,t.lineHeight),n),size:n,style:a,weight:l(e.weight,t.weight),string:""};return i.string=wt(i),i}function wn(e,t,n,a){let r,o,s,l=!0;for(r=0,o=e.length;r<o;++r)if(s=e[r],void 0!==s&&(void 0!==t&&"function"==typeof s&&(s=s(t),l=!1),void 0!==n&&i(s)&&(s=s[n%s.length],l=!1),void 0!==s))return a&&!l&&(a.cacheable=!1),s}function kn(e,t,n){const{min:a,max:i}=e,r=c(t,(i-a)/2),o=(e,t)=>n&&0===e?0:e+t;return{min:o(a,-Math.abs(r)),max:o(i,r)}}function xn(e,t){return Object.assign(Object.create(e),t)}function Sn(e,t,n){return e?function(e,t){return{x:n=>e+e+t-n,setWidth(e){t=e},textAlign:e=>"center"===e?e:"right"===e?"left":"right",xPlus:(e,t)=>e-t,leftForLtr:(e,t)=>e-t}}(t,n):{x:e=>e,setWidth(e){},textAlign:e=>e,xPlus:(e,t)=>e+t,leftForLtr:(e,t)=>e}}function Cn(e,t){let n,a;"ltr"!==t&&"rtl"!==t||(n=e.canvas.style,a=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=a)}function Tn(e,t){void 0!==t&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function Pn(e){return"angle"===e?{between:Z,compare:K,normalize:Q}:{between:ee,compare:(e,t)=>e-t,normalize:e=>e}}function En({start:e,end:t,count:n,loop:a,style:i}){return{start:e%n,end:t%n,loop:a&&(t-e+1)%n==0,style:i}}function An(e,t,n){if(!n)return[e];const{property:a,start:i,end:r}=n,o=t.length,{compare:s,between:l,normalize:u}=Pn(a),{start:c,end:d,loop:h,style:p}=function(e,t,n){const{property:a,start:i,end:r}=n,{between:o,normalize:s}=Pn(a),l=t.length;let u,c,{start:d,end:h,loop:p}=e;if(p){for(d+=l,h+=l,u=0,c=l;u<c&&o(s(t[d%l][a]),i,r);++u)d--,h--;d%=l,h%=l}return h<d&&(h+=l),{start:d,end:h,loop:p,style:e.style}}(e,t,n),f=[];let m,g,_,v=!1,b=null;const y=()=>v||l(i,_,m)&&0!==s(i,_),w=()=>!v||0===s(r,m)||l(r,_,m);for(let e=c,n=c;e<=d;++e)g=t[e%o],g.skip||(m=u(g[a]),m!==_&&(v=l(m,i,r),null===b&&y()&&(b=0===s(m,i)?e:n),null!==b&&w()&&(f.push(En({start:b,end:e,loop:h,count:o,style:p})),b=null),n=e,_=m));return null!==b&&f.push(En({start:b,end:d,loop:h,count:o,style:p})),f}function Mn(e,t){const n=[],a=e.segments;for(let i=0;i<a.length;i++){const r=An(a[i],e.points,t);r.length&&n.push(...r)}return n}function Ln(e,t){const n=e.points,a=e.options.spanGaps,i=n.length;if(!i)return[];const r=!!e._loop,{start:o,end:s}=function(e,t,n,a){let i=0,r=t-1;if(n&&!a)for(;i<t&&!e[i].skip;)i++;for(;i<t&&e[i].skip;)i++;for(i%=t,n&&(r+=i);r>i&&e[r%t].skip;)r--;return r%=t,{start:i,end:r}}(n,i,r,a);return Rn(e,!0===a?[{start:o,end:s,loop:r}]:function(e,t,n,a){const i=e.length,r=[];let o,s=t,l=e[t];for(o=t+1;o<=n;++o){const n=e[o%i];n.skip||n.stop?l.skip||(a=!1,r.push({start:t%i,end:(o-1)%i,loop:a}),t=s=n.stop?o:null):(s=o,l.skip&&(t=o)),l=n}return null!==s&&r.push({start:t%i,end:s%i,loop:a}),r}(n,o,s<o?s+i:s,!!e._fullLoop&&0===o&&s===i-1),n,t)}function Rn(e,t,n,a){return a&&a.setContext&&n?function(e,t,n,a){const i=e._chart.getContext(),r=zn(e.options),{_datasetIndex:o,options:{spanGaps:s}}=e,l=n.length,u=[];let c=r,d=t[0].start,h=d;function p(e,t,a,i){const r=s?-1:1;if(e!==t){for(e+=l;n[e%l].skip;)e-=r;for(;n[t%l].skip;)t+=r;e%l!=t%l&&(u.push({start:e%l,end:t%l,loop:a,style:i}),c=i,d=t%l)}}for(const e of t){d=s?d:e.start;let t,r=n[d%l];for(h=d+1;h<=e.end;h++){const s=n[h%l];t=zn(a.setContext(xn(i,{type:"segment",p0:r,p1:s,p0DataIndex:(h-1)%l,p1DataIndex:h%l,datasetIndex:o}))),Nn(t,c)&&p(d,h-1,e.loop,c),r=s,c=t}d<h-1&&p(d,h-1,e.loop,c)}return u}(e,t,n,a):t}function zn(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function Nn(e,t){if(!t)return!1;const n=[],a=function(e,t){return Ye(t)?(n.includes(t)||n.push(t),n.indexOf(t)):t};return JSON.stringify(e,a)!==JSON.stringify(t,a)}function On(e,t,n){return e.options.clip?e[n]:t[n]}function In(e,t){const n=t._clip;if(n.disabled)return!1;const a=function(e,t){const{xScale:n,yScale:a}=e;return n&&a?{left:On(n,t,"left"),right:On(n,t,"right"),top:On(a,t,"top"),bottom:On(a,t,"bottom")}:t}(t,e.chartArea);return{left:!1===n.left?0:a.left-(!0===n.left?0:n.left),right:!1===n.right?e.width:a.right+(!0===n.right?0:n.right),top:!1===n.top?0:a.top-(!0===n.top?0:n.top),bottom:!1===n.bottom?e.height:a.bottom+(!0===n.bottom?0:n.bottom)}}var qn=Object.freeze({__proto__:null,HALF_PI:z,INFINITY:L,PI:E,PITAU:M,QUARTER_PI:N,RAD_PER_DEG:R,TAU:A,TWO_THIRDS_PI:O,_addGrace:kn,_alignPixel:St,_alignStartEnd:pe,_angleBetween:Z,_angleDiff:K,_arrayUnique:le,_attachContext:Dt,_bezierCurveTo:Rt,_bezierInterpolation:dn,_boundSegment:An,_boundSegments:Mn,_capitalize:x,_computeSegments:Ln,_createResolver:qt,_decimalPlaces:W,_deprecated:function(e,t,n,a){void 0!==t&&console.warn(e+': "'+n+'" is deprecated. Please use "'+a+'" instead')},_descriptors:jt,_elementsEqual:p,_factorize:B,_filterBetween:ie,_getParentNode:ut,_getStartAndCountOfVisiblePoints:me,_int16Range:X,_isBetween:ee,_isClickEvent:P,_isDomSupported:lt,_isPointInArea:Et,_limitValue:J,_longestText:xt,_lookup:te,_lookupByKey:ne,_measureText:kt,_merger:g,_mergerIf:b,_normalizeAngle:Q,_parseObjectDataRadialScale:Qt,_pointInLine:un,_readValueToProps:gn,_rlookupByKey:ae,_scaleRangesChanged:ge,_setMinAndMaxByKey:V,_splitKey:w,_steppedInterpolation:cn,_steppedLineTo:Lt,_textX:fe,_toLeftRightCenter:he,_updateBezierControlPoints:an,addRoundedRectPath:It,almostEquals:D,almostWhole:$,callback:d,clearCanvas:Ct,clipArea:At,clone:f,color:Ke,createContext:xn,debounce:de,defined:S,distanceBetweenPoints:Y,drawPoint:Tt,drawPointLegend:Pt,each:h,easingEffects:ln,finiteOrDefault:s,fontString:function(e,t,n){return t+" "+e+"px "+n},formatNumber:et,getAngleFromPoint:G,getDatasetClipArea:In,getHoverColor:Qe,getMaximumSize:_t,getRelativePosition:mt,getRtlAdapter:Sn,getStyle:ht,isArray:i,isFinite:o,isFunction:C,isNullOrUndef:a,isNumber:F,isObject:r,isPatternOrGradient:Ye,listenArrayEvents:oe,log10:I,merge:_,mergeIf:v,niceNum:j,noop:t,overrideTextDirection:Cn,readUsedSize:yt,renderText:Ot,requestAnimFrame:ue,resolve:wn,resolveObjectKey:k,restoreTextDirection:Tn,retinaScale:vt,setsEqual:T,sign:q,splineCurve:en,splineCurveMonotone:tn,supportsEventListenerOptions:bt,throttled:ce,toDegrees:H,toDimension:c,toFont:yn,toFontString:wt,toLineHeight:fn,toPadding:bn,toPercentage:u,toRadians:U,toTRBL:_n,toTRBLCorners:vn,uid:n,unclipArea:Mt,unlistenArrayEvents:se,valueOrDefault:l});function Dn(e,t,n,i){const{controller:r,data:o,_sorted:s}=e,l=r._cachedMeta.iScale,u=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(l&&t===l.axis&&"r"!==t&&s&&o.length){const s=l._reversePixels?ae:ne;if(!i){const i=s(o,t,n);if(u){const{vScale:t}=r._cachedMeta,{_parsed:n}=e,o=n.slice(0,i.lo+1).reverse().findIndex(e=>!a(e[t.axis]));i.lo-=Math.max(0,o);const s=n.slice(i.hi).findIndex(e=>!a(e[t.axis]));i.hi+=Math.max(0,s)}return i}if(r._sharedOptions){const e=o[0],a="function"==typeof e.getRange&&e.getRange(t);if(a){const e=s(o,t,n-a),i=s(o,t,n+a);return{lo:e.lo,hi:i.hi}}}}return{lo:0,hi:o.length-1}}function jn(e,t,n,a,i){const r=e.getSortedVisibleDatasetMetas(),o=n[t];for(let e=0,n=r.length;e<n;++e){const{index:n,data:s}=r[e],{lo:l,hi:u}=Dn(r[e],t,o,i);for(let e=l;e<=u;++e){const t=s[e];t.skip||a(t,n,e)}}}function Bn(e,t,n,a,i){const r=[];return i||e.isPointInArea(t)?(jn(e,n,t,function(n,o,s){(i||Et(n,e.chartArea,0))&&n.inRange(t.x,t.y,a)&&r.push({element:n,datasetIndex:o,index:s})},!0),r):r}function Fn(e,t,n,a,i,r){return r||e.isPointInArea(t)?"r"!==n||a?function(e,t,n,a,i,r){let o=[];const s=function(e){const t=-1!==e.indexOf("x"),n=-1!==e.indexOf("y");return function(e,a){const i=t?Math.abs(e.x-a.x):0,r=n?Math.abs(e.y-a.y):0;return Math.sqrt(Math.pow(i,2)+Math.pow(r,2))}}(n);let l=Number.POSITIVE_INFINITY;return jn(e,n,t,function(n,u,c){const d=n.inRange(t.x,t.y,i);if(a&&!d)return;const h=n.getCenterPoint(i);if(!r&&!e.isPointInArea(h)&&!d)return;const p=s(t,h);p<l?(o=[{element:n,datasetIndex:u,index:c}],l=p):p===l&&o.push({element:n,datasetIndex:u,index:c})}),o}(e,t,n,a,i,r):function(e,t,n,a){let i=[];return jn(e,n,t,function(e,n,r){const{startAngle:o,endAngle:s}=e.getProps(["startAngle","endAngle"],a),{angle:l}=G(e,{x:t.x,y:t.y});Z(l,o,s)&&i.push({element:e,datasetIndex:n,index:r})}),i}(e,t,n,i):[]}function $n(e,t,n,a,i){const r=[],o="x"===n?"inXRange":"inYRange";let s=!1;return jn(e,n,t,(e,a,l)=>{e[o]&&e[o](t[n],i)&&(r.push({element:e,datasetIndex:a,index:l}),s=s||e.inRange(t.x,t.y,i))}),a&&!s?[]:r}var Vn={evaluateInteractionItems:jn,modes:{index(e,t,n,a){const i=mt(t,e),r=n.axis||"x",o=n.includeInvisible||!1,s=n.intersect?Bn(e,i,r,a,o):Fn(e,i,r,!1,a,o),l=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach(e=>{const t=s[0].index,n=e.data[t];n&&!n.skip&&l.push({element:n,datasetIndex:e.index,index:t})}),l):[]},dataset(e,t,n,a){const i=mt(t,e),r=n.axis||"xy",o=n.includeInvisible||!1;let s=n.intersect?Bn(e,i,r,a,o):Fn(e,i,r,!1,a,o);if(s.length>0){const t=s[0].datasetIndex,n=e.getDatasetMeta(t).data;s=[];for(let e=0;e<n.length;++e)s.push({element:n[e],datasetIndex:t,index:e})}return s},point:(e,t,n,a)=>Bn(e,mt(t,e),n.axis||"xy",a,n.includeInvisible||!1),nearest(e,t,n,a){const i=mt(t,e),r=n.axis||"xy",o=n.includeInvisible||!1;return Fn(e,i,r,n.intersect,a,o)},x:(e,t,n,a)=>$n(e,mt(t,e),"x",n.intersect,a),y:(e,t,n,a)=>$n(e,mt(t,e),"y",n.intersect,a)}};const Un=["left","top","right","bottom"];function Hn(e,t){return e.filter(e=>e.pos===t)}function Wn(e,t){return e.filter(e=>-1===Un.indexOf(e.pos)&&e.box.axis===t)}function Gn(e,t){return e.sort((e,n)=>{const a=t?n:e,i=t?e:n;return a.weight===i.weight?a.index-i.index:a.weight-i.weight})}function Yn(e,t,n,a){return Math.max(e[n],t[n])+Math.max(e[a],t[a])}function Kn(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Qn(e,t,n,a){const{pos:i,box:o}=n,s=e.maxPadding;if(!r(i)){n.size&&(e[i]-=n.size);const t=a[n.stack]||{size:0,count:1};t.size=Math.max(t.size,n.horizontal?o.height:o.width),n.size=t.size/t.count,e[i]+=n.size}o.getPadding&&Kn(s,o.getPadding());const l=Math.max(0,t.outerWidth-Yn(s,e,"left","right")),u=Math.max(0,t.outerHeight-Yn(s,e,"top","bottom")),c=l!==e.w,d=u!==e.h;return e.w=l,e.h=u,n.horizontal?{same:c,other:d}:{same:d,other:c}}function Zn(e,t){const n=t.maxPadding;return function(e){const a={left:0,top:0,right:0,bottom:0};return e.forEach(e=>{a[e]=Math.max(t[e],n[e])}),a}(e?["left","right"]:["top","bottom"])}function Jn(e,t,n,a){const i=[];let r,o,s,l,u,c;for(r=0,o=e.length,u=0;r<o;++r){s=e[r],l=s.box,l.update(s.width||t.w,s.height||t.h,Zn(s.horizontal,t));const{same:o,other:d}=Qn(t,n,s,a);u|=o&&i.length,c=c||d,l.fullSize||i.push(s)}return u&&Jn(i,t,n,a)||c}function Xn(e,t,n,a,i){e.top=n,e.left=t,e.right=t+a,e.bottom=n+i,e.width=a,e.height=i}function ea(e,t,n,a){const i=n.padding;let{x:r,y:o}=t;for(const s of e){const e=s.box,l=a[s.stack]||{count:1,placed:0,weight:1},u=s.stackWeight/l.weight||1;if(s.horizontal){const a=t.w*u,r=l.size||e.height;S(l.start)&&(o=l.start),e.fullSize?Xn(e,i.left,o,n.outerWidth-i.right-i.left,r):Xn(e,t.left+l.placed,o,a,r),l.start=o,l.placed+=a,o=e.bottom}else{const a=t.h*u,o=l.size||e.width;S(l.start)&&(r=l.start),e.fullSize?Xn(e,r,i.top,o,n.outerHeight-i.bottom-i.top):Xn(e,r,t.top+l.placed,o,a),l.start=r,l.placed+=a,r=e.right}}t.x=r,t.y=o}var ta={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;-1!==n&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,a){if(!e)return;const i=bn(e.options.layout.padding),r=Math.max(t-i.width,0),o=Math.max(n-i.height,0),s=function(e){const t=function(e){const t=[];let n,a,i,r,o,s;for(n=0,a=(e||[]).length;n<a;++n)i=e[n],({position:r,options:{stack:o,stackWeight:s=1}}=i),t.push({index:n,box:i,pos:r,horizontal:i.isHorizontal(),weight:i.weight,stack:o&&r+o,stackWeight:s});return t}(e),n=Gn(t.filter(e=>e.box.fullSize),!0),a=Gn(Hn(t,"left"),!0),i=Gn(Hn(t,"right")),r=Gn(Hn(t,"top"),!0),o=Gn(Hn(t,"bottom")),s=Wn(t,"x"),l=Wn(t,"y");return{fullSize:n,leftAndTop:a.concat(r),rightAndBottom:i.concat(l).concat(o).concat(s),chartArea:Hn(t,"chartArea"),vertical:a.concat(i).concat(l),horizontal:r.concat(o).concat(s)}}(e.boxes),l=s.vertical,u=s.horizontal;h(e.boxes,e=>{"function"==typeof e.beforeLayout&&e.beforeLayout()});const c=l.reduce((e,t)=>t.box.options&&!1===t.box.options.display?e:e+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/c,hBoxMaxHeight:o/2}),p=Object.assign({},i);Kn(p,bn(a));const f=Object.assign({maxPadding:p,w:r,h:o,x:i.left,y:i.top},i),m=function(e,t){const n=function(e){const t={};for(const n of e){const{stack:e,pos:a,stackWeight:i}=n;if(!e||!Un.includes(a))continue;const r=t[e]||(t[e]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=i}return t}(e),{vBoxMaxWidth:a,hBoxMaxHeight:i}=t;let r,o,s;for(r=0,o=e.length;r<o;++r){s=e[r];const{fullSize:o}=s.box,l=n[s.stack],u=l&&s.stackWeight/l.weight;s.horizontal?(s.width=u?u*a:o&&t.availableWidth,s.height=i):(s.width=a,s.height=u?u*i:o&&t.availableHeight)}return n}(l.concat(u),d);Jn(s.fullSize,f,d,m),Jn(l,f,d,m),Jn(u,f,d,m)&&Jn(l,f,d,m),function(e){const t=e.maxPadding;function n(n){const a=Math.max(t[n]-e[n],0);return e[n]+=a,a}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}(f),ea(s.leftAndTop,f,d,m),f.x+=f.w,f.y+=f.h,ea(s.rightAndBottom,f,d,m),e.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},h(s.chartArea,t=>{const n=t.box;Object.assign(n,e.chartArea),n.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class na{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,n){}removeEventListener(e,t,n){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,n,a){return t=Math.max(0,t||e.width),n=n||e.height,{width:t,height:Math.max(0,a?Math.floor(t/a):n)}}isAttached(e){return!0}updateConfig(e){}}class aa extends na{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const ia="$chartjs",ra={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},oa=e=>null===e||""===e,sa=!!bt&&{passive:!0};function la(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,sa)}function ua(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function ca(e,t,n){const a=e.canvas,i=new MutationObserver(e=>{let t=!1;for(const n of e)t=t||ua(n.addedNodes,a),t=t&&!ua(n.removedNodes,a);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function da(e,t,n){const a=e.canvas,i=new MutationObserver(e=>{let t=!1;for(const n of e)t=t||ua(n.removedNodes,a),t=t&&!ua(n.addedNodes,a);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const ha=new Map;let pa=0;function fa(){const e=window.devicePixelRatio;e!==pa&&(pa=e,ha.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function ma(e,t,n){const a=e.canvas,i=a&&ut(a);if(!i)return;const r=ce((e,t)=>{const a=i.clientWidth;n(e,t),a<i.clientWidth&&n()},window),o=new ResizeObserver(e=>{const t=e[0],n=t.contentRect.width,a=t.contentRect.height;0===n&&0===a||r(n,a)});return o.observe(i),function(e,t){ha.size||window.addEventListener("resize",fa),ha.set(e,t)}(e,r),o}function ga(e,t,n){n&&n.disconnect(),"resize"===t&&function(e){ha.delete(e),ha.size||window.removeEventListener("resize",fa)}(e)}function _a(e,t,n){const a=e.canvas,i=ce(t=>{null!==e.ctx&&n(function(e,t){const n=ra[e.type]||e.type,{x:a,y:i}=mt(e,t);return{type:n,chart:t,native:e,x:void 0!==a?a:null,y:void 0!==i?i:null}}(t,e))},e);return function(e,t,n){e&&e.addEventListener(t,n,sa)}(a,t,i),i}class va extends na{acquireContext(e,t){const n=e&&e.getContext&&e.getContext("2d");return n&&n.canvas===e?(function(e,t){const n=e.style,a=e.getAttribute("height"),i=e.getAttribute("width");if(e[ia]={initial:{height:a,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",oa(i)){const t=yt(e,"width");void 0!==t&&(e.width=t)}if(oa(a))if(""===e.style.height)e.height=e.width/(t||2);else{const t=yt(e,"height");void 0!==t&&(e.height=t)}}(e,t),n):null}releaseContext(e){const t=e.canvas;if(!t[ia])return!1;const n=t[ia].initial;["height","width"].forEach(e=>{const i=n[e];a(i)?t.removeAttribute(e):t.setAttribute(e,i)});const i=n.style||{};return Object.keys(i).forEach(e=>{t.style[e]=i[e]}),t.width=t.width,delete t[ia],!0}addEventListener(e,t,n){this.removeEventListener(e,t);const a=e.$proxies||(e.$proxies={}),i={attach:ca,detach:da,resize:ma}[t]||_a;a[t]=i(e,t,n)}removeEventListener(e,t){const n=e.$proxies||(e.$proxies={}),a=n[t];a&&(({attach:ga,detach:ga,resize:ga}[t]||la)(e,t,a),n[t]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,n,a){return _t(e,t,n,a)}isAttached(e){const t=e&&ut(e);return!(!t||!t.isConnected)}}function ba(e){return!lt()||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?aa:va}var ya=Object.freeze({__proto__:null,BasePlatform:na,BasicPlatform:aa,DomPlatform:va,_detectPlatform:ba});const wa="transparent",ka={boolean:(e,t,n)=>n>.5?t:e,color(e,t,n){const a=Ke(e||wa),i=a.valid&&Ke(t||wa);return i&&i.valid?i.mix(a,n).hexString():t},number:(e,t,n)=>e+(t-e)*n};class xa{constructor(e,t,n,a){const i=t[n];a=wn([e.to,a,i,e.from]);const r=wn([e.from,i,a]);this._active=!0,this._fn=e.fn||ka[e.type||typeof r],this._easing=ln[e.easing]||ln.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=n,this._from=r,this._to=a,this._promises=void 0}active(){return this._active}update(e,t,n){if(this._active){this._notify(!1);const a=this._target[this._prop],i=n-this._start,r=this._duration-i;this._start=n,this._duration=Math.floor(Math.max(r,e.duration)),this._total+=i,this._loop=!!e.loop,this._to=wn([e.to,t,a,e.from]),this._from=wn([e.from,a,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,n=this._duration,a=this._prop,i=this._from,r=this._loop,o=this._to;let s;if(this._active=i!==o&&(r||t<n),!this._active)return this._target[a]=o,void this._notify(!0);t<0?this._target[a]=i:(s=t/n%2,s=r&&s>1?2-s:s,s=this._easing(Math.min(1,Math.max(0,s))),this._target[a]=this._fn(i,o,s))}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,n)=>{e.push({res:t,rej:n})})}_notify(e){const t=e?"res":"rej",n=this._promises||[];for(let e=0;e<n.length;e++)n[e][t]()}}class Sa{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!r(e))return;const t=Object.keys(st.animation),n=this._properties;Object.getOwnPropertyNames(e).forEach(a=>{const o=e[a];if(!r(o))return;const s={};for(const e of t)s[e]=o[e];(i(o.properties)&&o.properties||[a]).forEach(e=>{e!==a&&n.has(e)||n.set(e,s)})})}_animateOptions(e,t){const n=t.options,a=function(e,t){if(!t)return;let n=e.options;if(n)return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n;e.options=t}(e,n);if(!a)return[];const i=this._createAnimations(a,n);return n.$shared&&function(e,t){const n=[],a=Object.keys(t);for(let t=0;t<a.length;t++){const i=e[a[t]];i&&i.active()&&n.push(i.wait())}return Promise.all(n)}(e.options.$animations,n).then(()=>{e.options=n},()=>{}),i}_createAnimations(e,t){const n=this._properties,a=[],i=e.$animations||(e.$animations={}),r=Object.keys(t),o=Date.now();let s;for(s=r.length-1;s>=0;--s){const l=r[s];if("$"===l.charAt(0))continue;if("options"===l){a.push(...this._animateOptions(e,t));continue}const u=t[l];let c=i[l];const d=n.get(l);if(c){if(d&&c.active()){c.update(d,u,o);continue}c.cancel()}d&&d.duration?(i[l]=c=new xa(d,e,l,u),a.push(c)):e[l]=u}return a}update(e,t){if(0===this._properties.size)return void Object.assign(e,t);const n=this._createAnimations(e,t);return n.length?(_e.add(this._chart,n),!0):void 0}}function Ca(e,t){const n=e&&e.options||{},a=n.reverse,i=void 0===n.min?t:0,r=void 0===n.max?t:0;return{start:a?r:i,end:a?i:r}}function Ta(e,t){const n=[],a=e._getSortedDatasetMetas(t);let i,r;for(i=0,r=a.length;i<r;++i)n.push(a[i].index);return n}function Pa(e,t,n,a={}){const i=e.keys,r="single"===a.mode;let s,l,u,c;if(null===t)return;let d=!1;for(s=0,l=i.length;s<l;++s){if(u=+i[s],u===n){if(d=!0,a.all)continue;break}c=e.values[u],o(c)&&(r||0===t||q(t)===q(c))&&(t+=c)}return d||a.all?t:0}function Ea(e,t){const n=e&&e.options.stacked;return n||void 0===n&&void 0!==t.stack}function Aa(e,t,n){const a=e[t]||(e[t]={});return a[n]||(a[n]={})}function Ma(e,t,n,a){for(const i of t.getMatchingVisibleMetas(a).reverse()){const t=e[i.index];if(n&&t>0||!n&&t<0)return i.index}return null}function La(e,t){const{chart:n,_cachedMeta:a}=e,i=n._stacks||(n._stacks={}),{iScale:r,vScale:o,index:s}=a,l=r.axis,u=o.axis,c=function(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}(r,o,a),d=t.length;let h;for(let e=0;e<d;++e){const n=t[e],{[l]:r,[u]:d}=n;h=(n._stacks||(n._stacks={}))[u]=Aa(i,c,r),h[s]=d,h._top=Ma(h,o,!0,a.type),h._bottom=Ma(h,o,!1,a.type),(h._visualValues||(h._visualValues={}))[s]=d}}function Ra(e,t){const n=e.scales;return Object.keys(n).filter(e=>n[e].axis===t).shift()}function za(e,t){const n=e.controller.index,a=e.vScale&&e.vScale.axis;if(a){t=t||e._parsed;for(const e of t){const t=e._stacks;if(!t||void 0===t[a]||void 0===t[a][n])return;delete t[a][n],void 0!==t[a]._visualValues&&void 0!==t[a]._visualValues[n]&&delete t[a]._visualValues[n]}}}const Na=e=>"reset"===e||"none"===e,Oa=(e,t)=>t?e:Object.assign({},e);class Ia{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,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 e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Ea(e.vScale,e),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(e){this.index!==e&&za(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,n=this.getDataset(),a=(e,t,n,a)=>"x"===e?t:"r"===e?a:n,i=t.xAxisID=l(n.xAxisID,Ra(e,"x")),r=t.yAxisID=l(n.yAxisID,Ra(e,"y")),o=t.rAxisID=l(n.rAxisID,Ra(e,"r")),s=t.indexAxis,u=t.iAxisID=a(s,i,r,o),c=t.vAxisID=a(s,r,i,o);t.xScale=this.getScaleForId(i),t.yScale=this.getScaleForId(r),t.rScale=this.getScaleForId(o),t.iScale=this.getScaleForId(u),t.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&se(this._data,this),e._stacked&&za(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),n=this._data;if(r(t)){const e=this._cachedMeta;this._data=function(e,t){const{iScale:n,vScale:a}=t,i="x"===n.axis?"x":"y",r="x"===a.axis?"x":"y",o=Object.keys(e),s=new Array(o.length);let l,u,c;for(l=0,u=o.length;l<u;++l)c=o[l],s[l]={[i]:c,[r]:e[c]};return s}(t,e)}else if(n!==t){if(n){se(n,this);const e=this._cachedMeta;za(e),e._parsed=[]}t&&Object.isExtensible(t)&&oe(t,this),this._syncList=[],this._data=t}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,n=this.getDataset();let a=!1;this._dataCheck();const i=t._stacked;t._stacked=Ea(t.vScale,t),t.stack!==n.stack&&(a=!0,za(t),t.stack=n.stack),this._resyncElements(e),(a||i!==t._stacked)&&(La(this,t._parsed),t._stacked=Ea(t.vScale,t))}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),n=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:n,_data:a}=this,{iScale:o,_stacked:s}=n,l=o.axis;let u,c,d,h=0===e&&t===a.length||n._sorted,p=e>0&&n._parsed[e-1];if(!1===this._parsing)n._parsed=a,n._sorted=!0,d=a;else{d=i(a[e])?this.parseArrayData(n,a,e,t):r(a[e])?this.parseObjectData(n,a,e,t):this.parsePrimitiveData(n,a,e,t);const o=()=>null===c[l]||p&&c[l]<p[l];for(u=0;u<t;++u)n._parsed[u+e]=c=d[u],h&&(o()&&(h=!1),p=c);n._sorted=h}s&&La(this,d)}parsePrimitiveData(e,t,n,a){const{iScale:i,vScale:r}=e,o=i.axis,s=r.axis,l=i.getLabels(),u=i===r,c=new Array(a);let d,h,p;for(d=0,h=a;d<h;++d)p=d+n,c[d]={[o]:u||i.parse(l[p],p),[s]:r.parse(t[p],p)};return c}parseArrayData(e,t,n,a){const{xScale:i,yScale:r}=e,o=new Array(a);let s,l,u,c;for(s=0,l=a;s<l;++s)u=s+n,c=t[u],o[s]={x:i.parse(c[0],u),y:r.parse(c[1],u)};return o}parseObjectData(e,t,n,a){const{xScale:i,yScale:r}=e,{xAxisKey:o="x",yAxisKey:s="y"}=this._parsing,l=new Array(a);let u,c,d,h;for(u=0,c=a;u<c;++u)d=u+n,h=t[d],l[u]={x:i.parse(k(h,o),d),y:r.parse(k(h,s),d)};return l}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,n){const a=this.chart,i=this._cachedMeta,r=t[e.axis];return Pa({keys:Ta(a,!0),values:t._stacks[e.axis]._visualValues},r,i.index,{mode:n})}updateRangeFromParsed(e,t,n,a){const i=n[t.axis];let r=null===i?NaN:i;const o=a&&n._stacks[t.axis];a&&o&&(a.values=o,r=Pa(a,i,this._cachedMeta.index)),e.min=Math.min(e.min,r),e.max=Math.max(e.max,r)}getMinMax(e,t){const n=this._cachedMeta,a=n._parsed,i=n._sorted&&e===n.iScale,r=a.length,s=this._getOtherScale(e),l=((e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Ta(n,!0),values:null})(t,n,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:d}=function(e){const{min:t,max:n,minDefined:a,maxDefined:i}=e.getUserBounds();return{min:a?t:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}(s);let h,p;function f(){p=a[h];const t=p[s.axis];return!o(p[e.axis])||c>t||d<t}for(h=0;h<r&&(f()||(this.updateRangeFromParsed(u,e,p,l),!i));++h);if(i)for(h=r-1;h>=0;--h)if(!f()){this.updateRangeFromParsed(u,e,p,l);break}return u}getAllParsedValues(e){const t=this._cachedMeta._parsed,n=[];let a,i,r;for(a=0,i=t.length;a<i;++a)r=t[a][e.axis],o(r)&&n.push(r);return n}getMaxOverflow(){return!1}getLabelAndValue(e){const t=this._cachedMeta,n=t.iScale,a=t.vScale,i=this.getParsed(e);return{label:n?""+n.getLabelForValue(i[n.axis]):"",value:a?""+a.getLabelForValue(i[a.axis]):""}}_update(e){const t=this._cachedMeta;this.update(e||"default"),t._clip=function(e){let t,n,a,i;return r(e)?(t=e.top,n=e.right,a=e.bottom,i=e.left):t=n=a=i=e,{top:t,right:n,bottom:a,left:i,disabled:!1===e}}(l(this.options.clip,function(e,t,n){if(!1===n)return!1;const a=Ca(e,n),i=Ca(t,n);return{top:i.end,right:a.end,bottom:i.start,left:a.start}}(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,t=this.chart,n=this._cachedMeta,a=n.data||[],i=t.chartArea,r=[],o=this._drawStart||0,s=this._drawCount||a.length-o,l=this.options.drawActiveElementsOnTop;let u;for(n.dataset&&n.dataset.draw(e,i,o,s),u=o;u<o+s;++u){const t=a[u];t.hidden||(t.active&&l?r.push(t):t.draw(e,i))}for(u=0;u<r.length;++u)r[u].draw(e,i)}getStyle(e,t){const n=t?"active":"default";return void 0===e&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(e||0,n)}getContext(e,t,n){const a=this.getDataset();let i;if(e>=0&&e<this._cachedMeta.data.length){const t=this._cachedMeta.data[e];i=t.$context||(t.$context=function(e,t,n){return xn(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}(this.getContext(),e,t)),i.parsed=this.getParsed(e),i.raw=a.data[e],i.index=i.dataIndex=e}else i=this.$context||(this.$context=function(e,t){return xn(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),i.dataset=a,i.index=i.datasetIndex=this.index;return i.active=!!t,i.mode=n,i}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t="default",n){const a="active"===t,i=this._cachedDataOpts,r=e+"-"+t,o=i[r],s=this.enableOptionSharing&&S(n);if(o)return Oa(o,s);const l=this.chart.config,u=l.datasetElementScopeKeys(this._type,e),c=a?[`${e}Hover`,"hover",e,""]:[e,""],d=l.getOptionScopes(this.getDataset(),u),h=Object.keys(st.elements[e]),p=l.resolveNamedOptions(d,h,()=>this.getContext(n,a,t),c);return p.$shared&&(p.$shared=s,i[r]=Object.freeze(Oa(p,s))),p}_resolveAnimations(e,t,n){const a=this.chart,i=this._cachedDataOpts,r=`animation-${t}`,o=i[r];if(o)return o;let s;if(!1!==a.options.animation){const a=this.chart.config,i=a.datasetAnimationScopeKeys(this._type,t),r=a.getOptionScopes(this.getDataset(),i);s=a.createResolver(r,this.getContext(e,n,t))}const l=new Sa(a,s&&s.animations);return s&&s._cacheable&&(i[r]=Object.freeze(l)),l}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||Na(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const n=this.resolveDataElementOptions(e,t),a=this._sharedOptions,i=this.getSharedOptions(n),r=this.includeOptions(t,i)||i!==a;return this.updateSharedOptions(i,t,n),{sharedOptions:i,includeOptions:r}}updateElement(e,t,n,a){Na(a)?Object.assign(e,n):this._resolveAnimations(t,a).update(e,n)}updateSharedOptions(e,t,n){e&&!Na(t)&&this._resolveAnimations(void 0,t).update(e,n)}_setStyle(e,t,n,a){e.active=a;const i=this.getStyle(t,a);this._resolveAnimations(t,n,a).update(e,{options:!a&&this.getSharedOptions(i)||i})}removeHoverStyle(e,t,n){this._setStyle(e,n,"active",!1)}setHoverStyle(e,t,n){this._setStyle(e,n,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,n=this._cachedMeta.data;for(const[e,t,n]of this._syncList)this[e](t,n);this._syncList=[];const a=n.length,i=t.length,r=Math.min(i,a);r&&this.parse(0,r),i>a?this._insertElements(a,i-a,e):i<a&&this._removeElements(i,a-i)}_insertElements(e,t,n=!0){const a=this._cachedMeta,i=a.data,r=e+t;let o;const s=e=>{for(e.length+=t,o=e.length-1;o>=r;o--)e[o]=e[o-t]};for(s(i),o=e;o<r;++o)i[o]=new this.dataElementType;this._parsing&&s(a._parsed),this.parse(e,t),n&&this.updateElements(i,e,t,"reset")}updateElements(e,t,n,a){}_removeElements(e,t){const n=this._cachedMeta;if(this._parsing){const a=n._parsed.splice(e,t);n._stacked&&za(n,a)}n.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[t,n,a]=e;this[t](n,a)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,t){t&&this._sync(["_removeElements",e,t]);const n=arguments.length-2;n&&this._sync(["_insertElements",e,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}class qa{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){const{x:t,y:n}=this.getProps(["x","y"],e);return{x:t,y:n}}hasValue(){return F(this.x)&&F(this.y)}getProps(e,t){const n=this.$animations;if(!t||!n)return this;const a={};return e.forEach(e=>{a[e]=n[e]&&n[e].active()?n[e]._to:this[e]}),a}}function Da(e,t){const n=e.options.ticks,i=function(e){const t=e.options.offset,n=e._tickSize(),a=e._length/n+(t?0:1),i=e._maxLength/n;return Math.floor(Math.min(a,i))}(e),r=Math.min(n.maxTicksLimit||i,i),o=n.major.enabled?function(e){const t=[];let n,a;for(n=0,a=e.length;n<a;n++)e[n].major&&t.push(n);return t}(t):[],s=o.length,l=o[0],u=o[s-1],c=[];if(s>r)return function(e,t,n,a){let i,r=0,o=n[0];for(a=Math.ceil(a),i=0;i<e.length;i++)i===o&&(t.push(e[i]),r++,o=n[r*a])}(t,c,o,s/r),c;const d=function(e,t,n){const a=function(e){const t=e.length;let n,a;if(t<2)return!1;for(a=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==a)return!1;return a}(e),i=t.length/n;if(!a)return Math.max(i,1);const r=B(a);for(let e=0,t=r.length-1;e<t;e++){const t=r[e];if(t>i)return t}return Math.max(i,1)}(o,t,r);if(s>0){let e,n;const i=s>1?Math.round((u-l)/(s-1)):null;for(ja(t,c,d,a(i)?0:l-i,l),e=0,n=s-1;e<n;e++)ja(t,c,d,o[e],o[e+1]);return ja(t,c,d,u,a(i)?t.length:u+i),c}return ja(t,c,d),c}function ja(e,t,n,a,i){const r=l(a,0),o=Math.min(l(i,e.length),e.length);let s,u,c,d=0;for(n=Math.ceil(n),i&&(s=i-a,n=s/Math.floor(s/n)),c=r;c<0;)d++,c=Math.round(r+d*n);for(u=Math.max(r,0);u<o;u++)u===c&&(t.push(e[u]),d++,c=Math.round(r+d*n))}const Ba=(e,t,n)=>"top"===t||"left"===t?e[t]+n:e[t]-n,Fa=(e,t)=>Math.min(t||e,e);function $a(e,t){const n=[],a=e.length/t,i=e.length;let r=0;for(;r<i;r+=a)n.push(e[Math.floor(r)]);return n}function Va(e,t,n){const a=e.ticks.length,i=Math.min(t,a-1),r=e._startPixel,o=e._endPixel,s=1e-6;let l,u=e.getPixelForTick(i);if(!(n&&(l=1===a?Math.max(u-r,o-u):0===t?(e.getPixelForTick(1)-u)/2:(u-e.getPixelForTick(i-1))/2,u+=i<t?l:-l,u<r-s||u>o+s)))return u}function Ua(e){return e.drawTicks?e.tickLength:0}function Ha(e,t){if(!e.display)return 0;const n=yn(e.font,t),a=bn(e.padding);return(i(e.text)?e.text.length:1)*n.lineHeight+a.height}function Wa(e,t,n){let a=he(e);return(n&&"right"!==t||!n&&"right"===t)&&(a=(e=>"left"===e?"right":"right"===e?"left":e)(a)),a}class Ga extends qa{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.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(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:n,_suggestedMax:a}=this;return e=s(e,Number.POSITIVE_INFINITY),t=s(t,Number.NEGATIVE_INFINITY),n=s(n,Number.POSITIVE_INFINITY),a=s(a,Number.NEGATIVE_INFINITY),{min:s(e,n),max:s(t,a),minDefined:o(e),maxDefined:o(t)}}getMinMax(e){let t,{min:n,max:a,minDefined:i,maxDefined:r}=this.getUserBounds();if(i&&r)return{min:n,max:a};const o=this.getMatchingVisibleMetas();for(let s=0,l=o.length;s<l;++s)t=o[s].controller.getMinMax(this,e),i||(n=Math.min(n,t.min)),r||(a=Math.max(a,t.max));return n=r&&n>a?a:n,a=i&&n>a?n:a,{min:s(n,s(a,n)),max:s(a,s(n,a))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){d(this.options.beforeUpdate,[this])}update(e,t,n){const{beginAtZero:a,grace:i,ticks:r}=this.options,o=r.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=kn(this,i,a),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const s=o<this.ticks.length;this._convertTicksToLabels(s?$a(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||"auto"===r.source)&&(this.ticks=Da(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),s&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e,t,n=this.options.reverse;this.isHorizontal()?(e=this.left,t=this.right):(e=this.top,t=this.bottom,n=!n),this._startPixel=e,this._endPixel=t,this._reversePixels=n,this._length=t-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){d(this.options.afterUpdate,[this])}beforeSetDimensions(){d(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(){d(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),d(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){d(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const t=this.options.ticks;let n,a,i;for(n=0,a=e.length;n<a;n++)i=e[n],i.label=d(t.callback,[i.value,n,e],this)}afterTickToLabelConversion(){d(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){d(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,t=e.ticks,n=Fa(this.ticks.length,e.ticks.maxTicksLimit),a=t.minRotation||0,i=t.maxRotation;let r,o,s,l=a;if(!this._isVisible()||!t.display||a>=i||n<=1||!this.isHorizontal())return void(this.labelRotation=a);const u=this._getLabelSizes(),c=u.widest.width,d=u.highest.height,h=J(this.chart.width-c,0,this.maxWidth);r=e.offset?this.maxWidth/n:h/(n-1),c+6>r&&(r=h/(n-(e.offset?.5:1)),o=this.maxHeight-Ua(e.grid)-t.padding-Ha(e.title,this.chart.options.font),s=Math.sqrt(c*c+d*d),l=H(Math.min(Math.asin(J((u.highest.height+6)/r,-1,1)),Math.asin(J(o/s,-1,1))-Math.asin(J(d/s,-1,1)))),l=Math.max(a,Math.min(i,l))),this.labelRotation=l}afterCalculateLabelRotation(){d(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){d(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:n,title:a,grid:i}}=this,r=this._isVisible(),o=this.isHorizontal();if(r){const r=Ha(a,t.options.font);if(o?(e.width=this.maxWidth,e.height=Ua(i)+r):(e.height=this.maxHeight,e.width=Ua(i)+r),n.display&&this.ticks.length){const{first:t,last:a,widest:i,highest:r}=this._getLabelSizes(),s=2*n.padding,l=U(this.labelRotation),u=Math.cos(l),c=Math.sin(l);if(o){const t=n.mirror?0:c*i.width+u*r.height;e.height=Math.min(this.maxHeight,e.height+t+s)}else{const t=n.mirror?0:u*i.width+c*r.height;e.width=Math.min(this.maxWidth,e.width+t+s)}this._calculatePadding(t,a,c,u)}}this._handleMargins(),o?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,n,a){const{ticks:{align:i,padding:r},position:o}=this.options,s=0!==this.labelRotation,l="top"!==o&&"x"===this.axis;if(this.isHorizontal()){const o=this.getPixelForTick(0)-this.left,u=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,d=0;s?l?(c=a*e.width,d=n*t.height):(c=n*e.height,d=a*t.width):"start"===i?d=t.width:"end"===i?c=e.width:"inner"!==i&&(c=e.width/2,d=t.width/2),this.paddingLeft=Math.max((c-o+r)*this.width/(this.width-o),0),this.paddingRight=Math.max((d-u+r)*this.width/(this.width-u),0)}else{let n=t.height/2,a=e.height/2;"start"===i?(n=0,a=e.height):"end"===i&&(n=t.height,a=0),this.paddingTop=n+r,this.paddingBottom=a+r}}_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(){d(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return"top"===t||"bottom"===t||"x"===e}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){let t,n;for(this.beforeTickToLabelConversion(),this.generateTickLabels(e),t=0,n=e.length;t<n;t++)a(e[t].label)&&(e.splice(t,1),n--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const t=this.options.ticks.sampleSize;let n=this.ticks;t<n.length&&(n=$a(n,t)),this._labelSizes=e=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,t,n){const{ctx:r,_longestTextCache:o}=this,s=[],l=[],u=Math.floor(t/Fa(t,n));let c,d,p,f,m,g,_,v,b,y,w,k=0,x=0;for(c=0;c<t;c+=u){if(f=e[c].label,m=this._resolveTickFontOptions(c),r.font=g=m.string,_=o[g]=o[g]||{data:{},gc:[]},v=m.lineHeight,b=y=0,a(f)||i(f)){if(i(f))for(d=0,p=f.length;d<p;++d)w=f[d],a(w)||i(w)||(b=kt(r,_.data,_.gc,b,w),y+=v)}else b=kt(r,_.data,_.gc,b,f),y=v;s.push(b),l.push(y),k=Math.max(b,k),x=Math.max(y,x)}!function(e,t){h(e,e=>{const n=e.gc,a=n.length/2;let i;if(a>t){for(i=0;i<a;++i)delete e.data[n[i]];n.splice(0,a)}})}(o,t);const S=s.indexOf(k),C=l.indexOf(x),T=e=>({width:s[e]||0,height:l[e]||0});return{first:T(0),last:T(t-1),widest:T(S),highest:T(C),widths:s,heights:l}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return X(this._alignToPixels?St(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&e<t.length){const n=t[e];return n.$context||(n.$context=function(e,t,n){return xn(e,{tick:n,index:t,type:"tick"})}(this.getContext(),e,n))}return this.$context||(this.$context=xn(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){const e=this.options.ticks,t=U(this.labelRotation),n=Math.abs(Math.cos(t)),a=Math.abs(Math.sin(t)),i=this._getLabelSizes(),r=e.autoSkipPadding||0,o=i?i.widest.width+r:0,s=i?i.highest.height+r:0;return this.isHorizontal()?s*n>o*a?o/n:s/a:s*a<o*n?s/n:o/a}_isVisible(){const e=this.options.display;return"auto"!==e?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const t=this.axis,n=this.chart,a=this.options,{grid:i,position:o,border:s}=a,u=i.offset,c=this.isHorizontal(),d=this.ticks.length+(u?1:0),h=Ua(i),p=[],f=s.setContext(this.getContext()),m=f.display?f.width:0,g=m/2,_=function(e){return St(n,e,m)};let v,b,y,w,k,x,S,C,T,P,E,A;if("top"===o)v=_(this.bottom),x=this.bottom-h,C=v-g,P=_(e.top)+g,A=e.bottom;else if("bottom"===o)v=_(this.top),P=e.top,A=_(e.bottom)-g,x=v+g,C=this.top+h;else if("left"===o)v=_(this.right),k=this.right-h,S=v-g,T=_(e.left)+g,E=e.right;else if("right"===o)v=_(this.left),T=e.left,E=_(e.right)-g,k=v+g,S=this.left+h;else if("x"===t){if("center"===o)v=_((e.top+e.bottom)/2+.5);else if(r(o)){const e=Object.keys(o)[0],t=o[e];v=_(this.chart.scales[e].getPixelForValue(t))}P=e.top,A=e.bottom,x=v+g,C=x+h}else if("y"===t){if("center"===o)v=_((e.left+e.right)/2);else if(r(o)){const e=Object.keys(o)[0],t=o[e];v=_(this.chart.scales[e].getPixelForValue(t))}k=v-g,S=k-h,T=e.left,E=e.right}const M=l(a.ticks.maxTicksLimit,d),L=Math.max(1,Math.ceil(d/M));for(b=0;b<d;b+=L){const e=this.getContext(b),t=i.setContext(e),a=s.setContext(e),r=t.lineWidth,o=t.color,l=a.dash||[],d=a.dashOffset,h=t.tickWidth,f=t.tickColor,m=t.tickBorderDash||[],g=t.tickBorderDashOffset;y=Va(this,b,u),void 0!==y&&(w=St(n,y,r),c?k=S=T=E=w:x=C=P=A=w,p.push({tx1:k,ty1:x,tx2:S,ty2:C,x1:T,y1:P,x2:E,y2:A,width:r,color:o,borderDash:l,borderDashOffset:d,tickWidth:h,tickColor:f,tickBorderDash:m,tickBorderDashOffset:g}))}return this._ticksLength=d,this._borderValue=v,p}_computeLabelItems(e){const t=this.axis,n=this.options,{position:a,ticks:o}=n,s=this.isHorizontal(),l=this.ticks,{align:u,crossAlign:c,padding:d,mirror:h}=o,p=Ua(n.grid),f=p+d,m=h?-d:f,g=-U(this.labelRotation),_=[];let v,b,y,w,k,x,S,C,T,P,E,A,M="middle";if("top"===a)x=this.bottom-m,S=this._getXAxisLabelAlignment();else if("bottom"===a)x=this.top+m,S=this._getXAxisLabelAlignment();else if("left"===a){const e=this._getYAxisLabelAlignment(p);S=e.textAlign,k=e.x}else if("right"===a){const e=this._getYAxisLabelAlignment(p);S=e.textAlign,k=e.x}else if("x"===t){if("center"===a)x=(e.top+e.bottom)/2+f;else if(r(a)){const e=Object.keys(a)[0],t=a[e];x=this.chart.scales[e].getPixelForValue(t)+f}S=this._getXAxisLabelAlignment()}else if("y"===t){if("center"===a)k=(e.left+e.right)/2-f;else if(r(a)){const e=Object.keys(a)[0],t=a[e];k=this.chart.scales[e].getPixelForValue(t)}S=this._getYAxisLabelAlignment(p).textAlign}"y"===t&&("start"===u?M="top":"end"===u&&(M="bottom"));const L=this._getLabelSizes();for(v=0,b=l.length;v<b;++v){y=l[v],w=y.label;const e=o.setContext(this.getContext(v));C=this.getPixelForTick(v)+o.labelOffset,T=this._resolveTickFontOptions(v),P=T.lineHeight,E=i(w)?w.length:1;const t=E/2,n=e.color,r=e.textStrokeColor,u=e.textStrokeWidth;let d,p=S;if(s?(k=C,"inner"===S&&(p=v===b-1?this.options.reverse?"left":"right":0===v?this.options.reverse?"right":"left":"center"),A="top"===a?"near"===c||0!==g?-E*P+P/2:"center"===c?-L.highest.height/2-t*P+P:-L.highest.height+P/2:"near"===c||0!==g?P/2:"center"===c?L.highest.height/2-t*P:L.highest.height-E*P,h&&(A*=-1),0===g||e.showLabelBackdrop||(k+=P/2*Math.sin(g))):(x=C,A=(1-E)*P/2),e.showLabelBackdrop){const t=bn(e.backdropPadding),n=L.heights[v],a=L.widths[v];let i=A-t.top,r=0-t.left;switch(M){case"middle":i-=n/2;break;case"bottom":i-=n}switch(S){case"center":r-=a/2;break;case"right":r-=a;break;case"inner":v===b-1?r-=a:v>0&&(r-=a/2)}d={left:r,top:i,width:a+t.width,height:n+t.height,color:e.backdropColor}}_.push({label:w,font:T,textOffset:A,options:{rotation:g,color:n,strokeColor:r,strokeWidth:u,textAlign:p,textBaseline:M,translation:[k,x],backdrop:d}})}return _}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-U(this.labelRotation))return"top"===e?"left":"right";let n="center";return"start"===t.align?n="left":"end"===t.align?n="right":"inner"===t.align&&(n="inner"),n}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:n,mirror:a,padding:i}}=this.options,r=e+i,o=this._getLabelSizes().widest.width;let s,l;return"left"===t?a?(l=this.right+i,"near"===n?s="left":"center"===n?(s="center",l+=o/2):(s="right",l+=o)):(l=this.right-r,"near"===n?s="right":"center"===n?(s="center",l-=o/2):(s="left",l=this.left)):"right"===t?a?(l=this.left+i,"near"===n?s="right":"center"===n?(s="center",l-=o/2):(s="left",l-=o)):(l=this.left+r,"near"===n?s="left":"center"===n?(s="center",l+=o/2):(s="right",l=this.right)):s="right",{textAlign:s,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,t=this.options.position;return"left"===t||"right"===t?{top:0,left:this.left,bottom:e.height,right:this.right}:"top"===t||"bottom"===t?{top:this.top,left:0,bottom:this.bottom,right:e.width}:void 0}drawBackground(){const{ctx:e,options:{backgroundColor:t},left:n,top:a,width:i,height:r}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(n,a,i,r),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const n=this.ticks.findIndex(t=>t.value===e);return n>=0?t.setContext(this.getContext(n)).lineWidth:0}drawGrid(e){const t=this.options.grid,n=this.ctx,a=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let i,r;const o=(e,t,a)=>{a.width&&a.color&&(n.save(),n.lineWidth=a.width,n.strokeStyle=a.color,n.setLineDash(a.borderDash||[]),n.lineDashOffset=a.borderDashOffset,n.beginPath(),n.moveTo(e.x,e.y),n.lineTo(t.x,t.y),n.stroke(),n.restore())};if(t.display)for(i=0,r=a.length;i<r;++i){const e=a[i];t.drawOnChartArea&&o({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},e),t.drawTicks&&o({x:e.tx1,y:e.ty1},{x:e.tx2,y:e.ty2},{color:e.tickColor,width:e.tickWidth,borderDash:e.tickBorderDash,borderDashOffset:e.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:t,options:{border:n,grid:a}}=this,i=n.setContext(this.getContext()),r=n.display?i.width:0;if(!r)return;const o=a.setContext(this.getContext(0)).lineWidth,s=this._borderValue;let l,u,c,d;this.isHorizontal()?(l=St(e,this.left,r)-r/2,u=St(e,this.right,o)+o/2,c=d=s):(c=St(e,this.top,r)-r/2,d=St(e,this.bottom,o)+o/2,l=u=s),t.save(),t.lineWidth=i.width,t.strokeStyle=i.color,t.beginPath(),t.moveTo(l,c),t.lineTo(u,d),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;const t=this.ctx,n=this._computeLabelArea();n&&At(t,n);const a=this.getLabelItems(e);for(const e of a){const n=e.options,a=e.font;Ot(t,e.label,0,e.textOffset,a,n)}n&&Mt(t)}drawTitle(){const{ctx:e,options:{position:t,title:n,reverse:a}}=this;if(!n.display)return;const o=yn(n.font),s=bn(n.padding),l=n.align;let u=o.lineHeight/2;"bottom"===t||"center"===t||r(t)?(u+=s.bottom,i(n.text)&&(u+=o.lineHeight*(n.text.length-1))):u+=s.top;const{titleX:c,titleY:d,maxWidth:h,rotation:p}=function(e,t,n,a){const{top:i,left:o,bottom:s,right:l,chart:u}=e,{chartArea:c,scales:d}=u;let h,p,f,m=0;const g=s-i,_=l-o;if(e.isHorizontal()){if(p=pe(a,o,l),r(n)){const e=Object.keys(n)[0],a=n[e];f=d[e].getPixelForValue(a)+g-t}else f="center"===n?(c.bottom+c.top)/2+g-t:Ba(e,n,t);h=l-o}else{if(r(n)){const e=Object.keys(n)[0],a=n[e];p=d[e].getPixelForValue(a)-_+t}else p="center"===n?(c.left+c.right)/2-_+t:Ba(e,n,t);f=pe(a,s,i),m="left"===n?-z:z}return{titleX:p,titleY:f,maxWidth:h,rotation:m}}(this,u,t,l);Ot(e,n.text,0,0,o,{color:n.color,maxWidth:h,rotation:p,textAlign:Wa(l,t,a),textBaseline:"middle",translation:[c,d]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,t=e.ticks&&e.ticks.z||0,n=l(e.grid&&e.grid.z,-1),a=l(e.border&&e.border.z,0);return this._isVisible()&&this.draw===Ga.prototype.draw?[{z:n,draw:e=>{this.drawBackground(),this.drawGrid(e),this.drawTitle()}},{z:a,draw:()=>{this.drawBorder()}},{z:t,draw:e=>{this.drawLabels(e)}}]:[{z:t,draw:e=>{this.draw(e)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",a=[];let i,r;for(i=0,r=t.length;i<r;++i){const r=t[i];r[n]!==this.id||e&&r.type!==e||a.push(r)}return a}_resolveTickFontOptions(e){return yn(this.options.ticks.setContext(this.getContext(e)).font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class Ya{constructor(e,t,n){this.type=e,this.scope=t,this.override=n,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const t=Object.getPrototypeOf(e);let n;(function(e){return"id"in e&&"defaults"in e})(t)&&(n=this.register(t));const a=this.items,i=e.id,r=this.scope+"."+i;if(!i)throw new Error("class does not have id: "+e);return i in a||(a[i]=e,function(e,t,n){const a=_(Object.create(null),[n?st.get(n):{},st.get(t),e.defaults]);st.set(t,a),e.defaultRoutes&&function(e,t){Object.keys(t).forEach(n=>{const a=n.split("."),i=a.pop(),r=[e].concat(a).join("."),o=t[n].split("."),s=o.pop(),l=o.join(".");st.route(r,i,l,s)})}(t,e.defaultRoutes),e.descriptors&&st.describe(t,e.descriptors)}(e,r,n),this.override&&st.override(e.id,e.overrides)),r}get(e){return this.items[e]}unregister(e){const t=this.items,n=e.id,a=this.scope;n in t&&delete t[n],a&&n in st[a]&&(delete st[a][n],this.override&&delete at[n])}}var Ka=new class{constructor(){this.controllers=new Ya(Ia,"datasets",!0),this.elements=new Ya(qa,"elements"),this.plugins=new Ya(Object,"plugins"),this.scales=new Ya(Ga,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,n){[...t].forEach(t=>{const a=n||this._getRegistryForType(t);n||a.isForType(t)||a===this.plugins&&t.id?this._exec(e,a,t):h(t,t=>{const a=n||this._getRegistryForType(t);this._exec(e,a,t)})})}_exec(e,t,n){const a=x(e);d(n["before"+a],[],n),t[e](n),d(n["after"+a],[],n)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){const n=this._typedRegistries[t];if(n.isForType(e))return n}return this.plugins}_get(e,t,n){const a=t.get(e);if(void 0===a)throw new Error('"'+e+'" is not a registered '+n+".");return a}};class Qa{constructor(){this._init=void 0}notify(e,t,n,a){if("beforeInit"===t&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install")),void 0===this._init)return;const i=a?this._descriptors(e).filter(a):this._descriptors(e),r=this._notify(i,e,t,n);return"afterDestroy"===t&&(this._notify(i,e,"stop"),this._notify(this._init,e,"uninstall"),this._init=void 0),r}_notify(e,t,n,a){a=a||{};for(const i of e){const e=i.plugin;if(!1===d(e[n],[t,a,i.options],e)&&a.cancelable)return!1}return!0}invalidate(){a(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){const n=e&&e.config,a=l(n.options&&n.options.plugins,{}),i=function(e){const t={},n=[],a=Object.keys(Ka.plugins.items);for(let e=0;e<a.length;e++)n.push(Ka.getPlugin(a[e]));const i=e.plugins||[];for(let e=0;e<i.length;e++){const a=i[e];-1===n.indexOf(a)&&(n.push(a),t[a.id]=!0)}return{plugins:n,localIds:t}}(n);return!1!==a||t?function(e,{plugins:t,localIds:n},a,i){const r=[],o=e.getContext();for(const s of t){const t=s.id,l=Za(a[t],i);null!==l&&r.push({plugin:s,options:Ja(e.config,{plugin:s,local:n[t]},l,o)})}return r}(e,i,a,t):[]}_notifyStateChanges(e){const t=this._oldCache||[],n=this._cache,a=(e,t)=>e.filter(e=>!t.some(t=>e.plugin.id===t.plugin.id));this._notify(a(t,n),e,"stop"),this._notify(a(n,t),e,"start")}}function Za(e,t){return t||!1!==e?!0===e?{}:e:null}function Ja(e,{plugin:t,local:n},a,i){const r=e.pluginScopeKeys(t),o=e.getOptionScopes(a,r);return n&&t.defaults&&o.push(t.defaults),e.createResolver(o,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Xa(e,t){const n=st.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function ei(e){if("x"===e||"y"===e||"r"===e)return e}function ti(e,...t){if(ei(e))return e;for(const a of t){const t=a.axis||("top"===(n=a.position)||"bottom"===n?"x":"left"===n||"right"===n?"y":void 0)||e.length>1&&ei(e[0].toLowerCase());if(t)return t}var n;throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function ni(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function ai(e){const t=e.options||(e.options={});t.plugins=l(t.plugins,{}),t.scales=function(e,t){const n=at[e.type]||{scales:{}},a=t.scales||{},i=Xa(e.type,t),o=Object.create(null);return Object.keys(a).forEach(t=>{const s=a[t];if(!r(s))return console.error(`Invalid scale configuration for scale: ${t}`);if(s._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);const l=ti(t,s,function(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(t=>t.xAxisID===e||t.yAxisID===e);if(n.length)return ni(e,"x",n[0])||ni(e,"y",n[0])}return{}}(t,e),st.scales[s.type]),u=function(e,t){return e===t?"_index_":"_value_"}(l,i),c=n.scales||{};o[t]=v(Object.create(null),[{axis:l},s,c[l],c[u]])}),e.data.datasets.forEach(n=>{const i=n.type||e.type,r=n.indexAxis||Xa(i,t),s=(at[i]||{}).scales||{};Object.keys(s).forEach(e=>{const t=function(e,t){let n=e;return"_index_"===e?n=t:"_value_"===e&&(n="x"===t?"y":"x"),n}(e,r),i=n[t+"AxisID"]||t;o[i]=o[i]||Object.create(null),v(o[i],[{axis:t},a[i],s[e]])})}),Object.keys(o).forEach(e=>{const t=o[e];v(t,[st.scales[t.type],st.scale])}),o}(e,t)}function ii(e){return(e=e||{}).datasets=e.datasets||[],e.labels=e.labels||[],e}const ri=new Map,oi=new Set;function si(e,t){let n=ri.get(e);return n||(n=t(),ri.set(e,n),oi.add(n)),n}const li=(e,t,n)=>{const a=k(t,n);void 0!==a&&e.add(a)};class ui{constructor(e){this._config=function(e){return(e=e||{}).data=ii(e.data),ai(e),e}(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=ii(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),ai(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return si(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return si(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return si(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id;return si(`${this.type}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const n=this._scopeCache;let a=n.get(e);return a&&!t||(a=new Map,n.set(e,a)),a}getOptionScopes(e,t,n){const{options:a,type:i}=this,r=this._cachedScopes(e,n),o=r.get(t);if(o)return o;const s=new Set;t.forEach(t=>{e&&(s.add(e),t.forEach(t=>li(s,e,t))),t.forEach(e=>li(s,a,e)),t.forEach(e=>li(s,at[i]||{},e)),t.forEach(e=>li(s,st,e)),t.forEach(e=>li(s,it,e))});const l=Array.from(s);return 0===l.length&&l.push(Object.create(null)),oi.has(t)&&r.set(t,l),l}chartOptionScopes(){const{options:e,type:t}=this;return[e,at[t]||{},st.datasets[t]||{},{type:t},st,it]}resolveNamedOptions(e,t,n,a=[""]){const r={$shared:!0},{resolver:o,subPrefixes:s}=ci(this._resolverCache,e,a);let l=o;(function(e,t){const{isScriptable:n,isIndexable:a}=jt(e);for(const r of t){const t=n(r),o=a(r),s=(o||t)&&e[r];if(t&&(C(s)||di(s))||o&&i(s))return!0}return!1})(o,t)&&(r.$shared=!1,l=Dt(o,n=C(n)?n():n,this.createResolver(e,n,s)));for(const e of t)r[e]=l[e];return r}createResolver(e,t,n=[""],a){const{resolver:i}=ci(this._resolverCache,e,n);return r(t)?Dt(i,t,void 0,a):i}}function ci(e,t,n){let a=e.get(t);a||(a=new Map,e.set(t,a));const i=n.join();let r=a.get(i);return r||(r={resolver:qt(t,n),subPrefixes:n.filter(e=>!e.toLowerCase().includes("hover"))},a.set(i,r)),r}const di=e=>r(e)&&Object.getOwnPropertyNames(e).some(t=>C(e[t])),hi=["top","bottom","left","right","chartArea"];function pi(e,t){return"top"===e||"bottom"===e||-1===hi.indexOf(e)&&"x"===t}function fi(e,t){return function(n,a){return n[e]===a[e]?n[t]-a[t]:n[e]-a[e]}}function mi(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),d(n&&n.onComplete,[e],t)}function gi(e){const t=e.chart,n=t.options.animation;d(n&&n.onProgress,[e],t)}function _i(e){return lt()&&"string"==typeof e?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const vi={},bi=e=>{const t=_i(e);return Object.values(vi).filter(e=>e.canvas===t).pop()};function yi(e,t,n){const a=Object.keys(e);for(const i of a){const a=+i;if(a>=t){const r=e[i];delete e[i],(n>0||a>t)&&(e[a+n]=r)}}}class wi{static defaults=st;static instances=vi;static overrides=at;static registry=Ka;static version="4.5.1";static getChart=bi;static register(...e){Ka.add(...e),ki()}static unregister(...e){Ka.remove(...e),ki()}constructor(e,t){const a=this.config=new ui(t),i=_i(e),r=bi(i);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=a.createResolver(a.chartOptionScopes(),this.getContext());this.platform=new(a.platform||ba(i)),this.platform.updateConfig(a);const s=this.platform.acquireContext(i,o.aspectRatio),l=s&&s.canvas,u=l&&l.height,c=l&&l.width;this.id=n(),this.ctx=s,this.canvas=l,this.width=c,this.height=u,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Qa,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=de(e=>this.update(e),o.resizeDelay||0),this._dataChanges=[],vi[this.id]=this,s&&l?(_e.listen(this,"complete",mi),_e.listen(this,"progress",gi),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:n,height:i,_aspectRatio:r}=this;return a(e)?t&&r?r:i?n/i:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return Ka}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():vt(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Ct(this.canvas,this.ctx),this}stop(){return _e.stop(this),this}resize(e,t){_e.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const n=this.options,a=this.canvas,i=n.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(a,e,t,i),o=n.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,vt(this,o,!0)&&(this.notifyPlugins("resize",{size:r}),d(n.onResize,[this,r],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){h(this.options.scales||{},(e,t)=>{e.id=t})}buildOrUpdateScales(){const e=this.options,t=e.scales,n=this.scales,a=Object.keys(n).reduce((e,t)=>(e[t]=!1,e),{});let i=[];t&&(i=i.concat(Object.keys(t).map(e=>{const n=t[e],a=ti(e,n),i="r"===a,r="x"===a;return{options:n,dposition:i?"chartArea":r?"bottom":"left",dtype:i?"radialLinear":r?"category":"linear"}}))),h(i,t=>{const i=t.options,r=i.id,o=ti(r,i),s=l(i.type,t.dtype);void 0!==i.position&&pi(i.position,o)===pi(t.dposition)||(i.position=t.dposition),a[r]=!0;let u=null;r in n&&n[r].type===s?u=n[r]:(u=new(Ka.getScale(s))({id:r,type:s,ctx:this.ctx,chart:this}),n[u.id]=u),u.init(i,e)}),h(a,(e,t)=>{e||delete n[t]}),h(n,e=>{ta.configure(this,e,e.options),ta.addBox(this,e)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,n=e.length;if(e.sort((e,t)=>e.index-t.index),n>t){for(let e=t;e<n;++e)this._destroyDatasetMeta(e);e.splice(t,n-t)}this._sortedMetasets=e.slice(0).sort(fi("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:t}}=this;e.length>t.length&&delete this._stacks,e.forEach((e,n)=>{0===t.filter(t=>t===e._dataset).length&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let n,a;for(this._removeUnreferencedMetasets(),n=0,a=t.length;n<a;n++){const a=t[n];let i=this.getDatasetMeta(n);const r=a.type||this.config.type;if(i.type&&i.type!==r&&(this._destroyDatasetMeta(n),i=this.getDatasetMeta(n)),i.type=r,i.indexAxis=a.indexAxis||Xa(r,this.options),i.order=a.order||0,i.index=n,i.label=""+a.label,i.visible=this.isDatasetVisible(n),i.controller)i.controller.updateIndex(n),i.controller.linkScales();else{const t=Ka.getController(r),{datasetElementType:a,dataElementType:o}=st.datasets[r];Object.assign(t,{dataElementType:Ka.getElement(o),datasetElementType:a&&Ka.getElement(a)}),i.controller=new t(this,n),e.push(i.controller)}}return this._updateMetasets(),e}_resetElements(){h(this.data.datasets,(e,t)=>{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const n=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),a=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0}))return;const i=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let e=0,t=this.data.datasets.length;e<t;e++){const{controller:t}=this.getDatasetMeta(e),n=!a&&-1===i.indexOf(t);t.buildOrUpdateElements(n),r=Math.max(+t.getMaxOverflow(),r)}r=this._minPadding=n.layout.autoPadding?r:0,this._updateLayout(r),a||h(i,e=>{e.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(fi("z","_idx"));const{_active:o,_lastEvent:s}=this;s?this._eventHandler(s,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){h(this.scales,e=>{ta.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),n=new Set(e.events);T(t,n)&&!!this._responsiveListeners===e.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:n,start:a,count:i}of t)yi(e,a,"_removeElements"===n?-i:i)}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,n=t=>new Set(e.filter(e=>e[0]===t).map((e,t)=>t+","+e.splice(1).join(","))),a=n(0);for(let e=1;e<t;e++)if(!T(a,n(e)))return;return Array.from(a).map(e=>e.split(",")).map(e=>({method:e[1],start:+e[2],count:+e[3]}))}_updateLayout(e){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;ta.update(this,this.width,this.height,e);const t=this.chartArea,n=t.width<=0||t.height<=0;this._layers=[],h(this.boxes,e=>{n&&"chartArea"===e.position||(e.configure&&e.configure(),this._layers.push(...e._layers()))},this),this._layers.forEach((e,t)=>{e._idx=t}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})){for(let e=0,t=this.data.datasets.length;e<t;++e)this.getDatasetMeta(e).controller.configure();for(let t=0,n=this.data.datasets.length;t<n;++t)this._updateDataset(t,C(e)?e({datasetIndex:t}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,t){const n=this.getDatasetMeta(e),a={meta:n,index:e,mode:t,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",a)&&(n.controller._update(t),a.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",a))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(_e.has(this)?this.attached&&!_e.running(this)&&_e.start(this):(this.draw(),mi({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:e,height:t}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(e,t)}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const t=this._sortedMetasets,n=[];let a,i;for(a=0,i=t.length;a<i;++a){const i=t[a];e&&!i.visible||n.push(i)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,n={meta:e,index:e.index,cancelable:!0},a=In(this,e);!1!==this.notifyPlugins("beforeDatasetDraw",n)&&(a&&At(t,a),e.controller.draw(),a&&Mt(t),n.cancelable=!1,this.notifyPlugins("afterDatasetDraw",n))}isPointInArea(e){return Et(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,n,a){const i=Vn.modes[t];return"function"==typeof i?i(this,e,n,a):[]}getDatasetMeta(e){const t=this.data.datasets[e],n=this._metasets;let a=n.filter(e=>e&&e._dataset===t).pop();return a||(a={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},n.push(a)),a}getContext(){return this.$context||(this.$context=xn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const n=this.getDatasetMeta(e);return"boolean"==typeof n.hidden?!n.hidden:!t.hidden}setDatasetVisibility(e,t){this.getDatasetMeta(e).hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,n){const a=n?"show":"hide",i=this.getDatasetMeta(e),r=i.controller._resolveAnimations(void 0,a);S(t)?(i.data[t].hidden=!n,this.update()):(this.setDatasetVisibility(e,n),r.update(i,{visible:n}),this.update(t=>t.datasetIndex===e?a:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),_e.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Ct(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),delete vi[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,t=this.platform,n=(n,a)=>{t.addEventListener(this,n,a),e[n]=a},a=(e,t,n)=>{e.offsetX=t,e.offsetY=n,this._eventHandler(e)};h(this.options.events,e=>n(e,a))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,n=(n,a)=>{t.addEventListener(this,n,a),e[n]=a},a=(n,a)=>{e[n]&&(t.removeEventListener(this,n,a),delete e[n])},i=(e,t)=>{this.canvas&&this.resize(e,t)};let r;const o=()=>{a("attach",o),this.attached=!0,this.resize(),n("resize",i),n("detach",r)};r=()=>{this.attached=!1,a("resize",i),this._stop(),this._resize(0,0),n("attach",o)},t.isAttached(this.canvas)?o():r()}unbindEvents(){h(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},h(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,n){const a=n?"set":"remove";let i,r,o,s;for("dataset"===t&&(i=this.getDatasetMeta(e[0].datasetIndex),i.controller["_"+a+"DatasetHoverStyle"]()),o=0,s=e.length;o<s;++o){r=e[o];const t=r&&this.getDatasetMeta(r.datasetIndex).controller;t&&t[a+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const t=this._active||[],n=e.map(({datasetIndex:e,index:t})=>{const n=this.getDatasetMeta(e);if(!n)throw new Error("No dataset found at index "+e);return{datasetIndex:e,element:n.data[t],index:t}});!p(n,t)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,t))}notifyPlugins(e,t,n){return this._plugins.notify(this,e,t,n)}isPluginEnabled(e){return 1===this._plugins._cache.filter(t=>t.plugin.id===e).length}_updateHoverStyles(e,t,n){const a=this.options.hover,i=(e,t)=>e.filter(e=>!t.some(t=>e.datasetIndex===t.datasetIndex&&e.index===t.index)),r=i(t,e),o=n?e:i(e,t);r.length&&this.updateHoverStyle(r,a.mode,!1),o.length&&a.mode&&this.updateHoverStyle(o,a.mode,!0)}_eventHandler(e,t){const n={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},a=t=>(t.options.events||this.options.events).includes(e.native.type);if(!1===this.notifyPlugins("beforeEvent",n,a))return;const i=this._handleEvent(e,t,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,a),(i||n.changed)&&this.render(),this}_handleEvent(e,t,n){const{_active:a=[],options:i}=this,r=t,o=this._getActiveElements(e,a,n,r),s=P(e),l=function(e,t,n,a){return n&&"mouseout"!==e.type?a?t:e:null}(e,this._lastEvent,n,s);n&&(this._lastEvent=null,d(i.onHover,[e,o,this],this),s&&d(i.onClick,[e,o,this],this));const u=!p(o,a);return(u||t)&&(this._active=o,this._updateHoverStyles(o,a,t)),this._lastEvent=l,u}_getActiveElements(e,t,n,a){if("mouseout"===e.type)return[];if(!n)return t;const i=this.options.hover;return this.getElementsAtEventForMode(e,i.mode,i,a)}}function ki(){return h(wi.instances,e=>e._plugins.invalidate())}function xi(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Si{static override(e){Object.assign(Si.prototype,e)}options;constructor(e){this.options=e||{}}init(){}formats(){return xi()}parse(){return xi()}format(){return xi()}add(){return xi()}diff(){return xi()}startOf(){return xi()}endOf(){return xi()}}var Ci={_date:Si};function Ti(e){const t=e.iScale,n=function(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let a=[];for(let t=0,i=n.length;t<i;t++)a=a.concat(n[t].controller.getAllParsedValues(e));e._cache.$bar=le(a.sort((e,t)=>e-t))}return e._cache.$bar}(t,e.type);let a,i,r,o,s=t._length;const l=()=>{32767!==r&&-32768!==r&&(S(o)&&(s=Math.min(s,Math.abs(r-o)||s)),o=r)};for(a=0,i=n.length;a<i;++a)r=t.getPixelForValue(n[a]),l();for(o=void 0,a=0,i=t.ticks.length;a<i;++a)r=t.getPixelForTick(a),l();return s}function Pi(e,t,n,a){return i(e)?function(e,t,n,a){const i=n.parse(e[0],a),r=n.parse(e[1],a),o=Math.min(i,r),s=Math.max(i,r);let l=o,u=s;Math.abs(o)>Math.abs(s)&&(l=s,u=o),t[n.axis]=u,t._custom={barStart:l,barEnd:u,start:i,end:r,min:o,max:s}}(e,t,n,a):t[n.axis]=n.parse(e,a),t}function Ei(e,t,n,a){const i=e.iScale,r=e.vScale,o=i.getLabels(),s=i===r,l=[];let u,c,d,h;for(u=n,c=n+a;u<c;++u)h=t[u],d={},d[i.axis]=s||i.parse(o[u],u),l.push(Pi(h,d,r,u));return l}function Ai(e){return e&&void 0!==e.barStart&&void 0!==e.barEnd}function Mi(e,t,n,a){let i=t.borderSkipped;const r={};if(!i)return void(e.borderSkipped=r);if(!0===i)return void(e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:o,end:s,reverse:l,top:u,bottom:c}=function(e){let t,n,a,i,r;return e.horizontal?(t=e.base>e.x,n="left",a="right"):(t=e.base<e.y,n="bottom",a="top"),t?(i="end",r="start"):(i="start",r="end"),{start:n,end:a,reverse:t,top:i,bottom:r}}(e);"middle"===i&&n&&(e.enableBorderRadius=!0,(n._top||0)===a?i=u:(n._bottom||0)===a?i=c:(r[Li(c,o,s,l)]=!0,i=u)),r[Li(i,o,s,l)]=!0,e.borderSkipped=r}function Li(e,t,n,a){var i,r,o;return a?(o=n,e=Ri(e=(i=e)===(r=t)?o:i===o?r:i,n,t)):e=Ri(e,t,n),e}function Ri(e,t,n){return"start"===e?t:"end"===e?n:e}function zi(e,{inflateAmount:t},n){e.inflateAmount="auto"===t?1===n?.33:0:t}class Ni extends Ia{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:e=>"spacing"!==e,_indexable:e=>"spacing"!==e&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data,{labels:{pointStyle:n,textAlign:a,color:i,useBorderRadius:r,borderRadius:o}}=e.legend.options;return t.labels.length&&t.datasets.length?t.labels.map((t,s)=>{const l=e.getDatasetMeta(0).controller.getStyle(s);return{text:t,fillStyle:l.backgroundColor,fontColor:i,hidden:!e.getDataVisibility(s),lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:l.borderWidth,strokeStyle:l.borderColor,textAlign:a,pointStyle:n,borderRadius:r&&(o||l.borderRadius),index:s}}):[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}}}};constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){const n=this.getDataset().data,a=this._cachedMeta;if(!1===this._parsing)a._parsed=n;else{let i,o,s=e=>+n[e];if(r(n[e])){const{key:e="value"}=this._parsing;s=t=>+k(n[t],e)}for(i=e,o=e+t;i<o;++i)a._parsed[i]=s(i)}}_getRotation(){return U(this.options.rotation-90)}_getCircumference(){return U(this.options.circumference)}_getRotationExtents(){let e=A,t=-A;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){const a=this.chart.getDatasetMeta(n).controller,i=a._getRotation(),r=a._getCircumference();e=Math.min(e,i),t=Math.max(t,i+r)}return{rotation:e,circumference:t-e}}update(e){const t=this.chart,{chartArea:n}=t,a=this._cachedMeta,i=a.data,r=this.getMaxBorderWidth()+this.getMaxOffset(i)+this.options.spacing,o=Math.max((Math.min(n.width,n.height)-r)/2,0),s=Math.min(u(this.options.cutout,o),1),l=this._getRingWeight(this.index),{circumference:d,rotation:h}=this._getRotationExtents(),{ratioX:p,ratioY:f,offsetX:m,offsetY:g}=function(e,t,n){let a=1,i=1,r=0,o=0;if(t<A){const s=e,l=s+t,u=Math.cos(s),c=Math.sin(s),d=Math.cos(l),h=Math.sin(l),p=(e,t,a)=>Z(e,s,l,!0)?1:Math.max(t,t*n,a,a*n),f=(e,t,a)=>Z(e,s,l,!0)?-1:Math.min(t,t*n,a,a*n),m=p(0,u,d),g=p(z,c,h),_=f(E,u,d),v=f(E+z,c,h);a=(m-_)/2,i=(g-v)/2,r=-(m+_)/2,o=-(g+v)/2}return{ratioX:a,ratioY:i,offsetX:r,offsetY:o}}(h,d,s),_=(n.width-r)/p,v=(n.height-r)/f,b=Math.max(Math.min(_,v)/2,0),y=c(this.options.radius,b),w=(y-Math.max(y*s,0))/this._getVisibleDatasetWeightTotal();this.offsetX=m*y,this.offsetY=g*y,a.total=this.calculateTotal(),this.outerRadius=y-w*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-w*l,0),this.updateElements(i,0,i.length,e)}_circumference(e,t){const n=this.options,a=this._cachedMeta,i=this._getCircumference();return t&&n.animation.animateRotate||!this.chart.getDataVisibility(e)||null===a._parsed[e]||a.data[e].hidden?0:this.calculateCircumference(a._parsed[e]*i/A)}updateElements(e,t,n,a){const i="reset"===a,r=this.chart,o=r.chartArea,s=r.options.animation,l=(o.left+o.right)/2,u=(o.top+o.bottom)/2,c=i&&s.animateScale,d=c?0:this.innerRadius,h=c?0:this.outerRadius,{sharedOptions:p,includeOptions:f}=this._getSharedOptions(t,a);let m,g=this._getRotation();for(m=0;m<t;++m)g+=this._circumference(m,i);for(m=t;m<t+n;++m){const t=this._circumference(m,i),n=e[m],r={x:l+this.offsetX,y:u+this.offsetY,startAngle:g,endAngle:g+t,circumference:t,outerRadius:h,innerRadius:d};f&&(r.options=p||this.resolveDataElementOptions(m,n.active?"active":a)),g+=t,this.updateElement(n,m,r,a)}}calculateTotal(){const e=this._cachedMeta,t=e.data;let n,a=0;for(n=0;n<t.length;n++){const i=e._parsed[n];null===i||isNaN(i)||!this.chart.getDataVisibility(n)||t[n].hidden||(a+=Math.abs(i))}return a}calculateCircumference(e){const t=this._cachedMeta.total;return t>0&&!isNaN(e)?A*(Math.abs(e)/t):0}getLabelAndValue(e){const t=this._cachedMeta,n=this.chart,a=n.data.labels||[],i=et(t._parsed[e],n.options.locale);return{label:a[e]||"",value:i}}getMaxBorderWidth(e){let t=0;const n=this.chart;let a,i,r,o,s;if(!e)for(a=0,i=n.data.datasets.length;a<i;++a)if(n.isDatasetVisible(a)){r=n.getDatasetMeta(a),e=r.data,o=r.controller;break}if(!e)return 0;for(a=0,i=e.length;a<i;++a)s=o.resolveDataElementOptions(a),"inner"!==s.borderAlign&&(t=Math.max(t,s.borderWidth||0,s.hoverBorderWidth||0));return t}getMaxOffset(e){let t=0;for(let n=0,a=e.length;n<a;++n){const e=this.resolveDataElementOptions(n);t=Math.max(t,e.offset||0,e.hoverOffset||0)}return t}_getRingWeightOffset(e){let t=0;for(let n=0;n<e;++n)this.chart.isDatasetVisible(n)&&(t+=this._getRingWeight(n));return t}_getRingWeight(e){return Math.max(l(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class Oi extends Ia{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:n,color:a}}=e.legend.options;return t.labels.map((t,i)=>{const r=e.getDatasetMeta(0).controller.getStyle(i);return{text:t,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,fontColor:a,lineWidth:r.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(i),index:i}})}return[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(e,t){super(e,t),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const t=this._cachedMeta,n=this.chart,a=n.data.labels||[],i=et(t._parsed[e].r,n.options.locale);return{label:a[e]||"",value:i}}parseObjectData(e,t,n,a){return Qt.bind(this)(e,t,n,a)}update(e){const t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}getMinMax(){const e=this._cachedMeta,t={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((e,n)=>{const a=this.getParsed(n).r;!isNaN(a)&&this.chart.getDataVisibility(n)&&(a<t.min&&(t.min=a),a>t.max&&(t.max=a))}),t}_updateRadius(){const e=this.chart,t=e.chartArea,n=e.options,a=Math.min(t.right-t.left,t.bottom-t.top),i=Math.max(a/2,0),r=(i-Math.max(n.cutoutPercentage?i/100*n.cutoutPercentage:1,0))/e.getVisibleDatasetCount();this.outerRadius=i-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(e,t,n,a){const i="reset"===a,r=this.chart,o=r.options.animation,s=this._cachedMeta.rScale,l=s.xCenter,u=s.yCenter,c=s.getIndexAngle(0)-.5*E;let d,h=c;const p=360/this.countVisibleElements();for(d=0;d<t;++d)h+=this._computeAngle(d,a,p);for(d=t;d<t+n;d++){const t=e[d];let n=h,f=h+this._computeAngle(d,a,p),m=r.getDataVisibility(d)?s.getDistanceFromCenterForValue(this.getParsed(d).r):0;h=f,i&&(o.animateScale&&(m=0),o.animateRotate&&(n=f=c));const g={x:l,y:u,innerRadius:0,outerRadius:m,startAngle:n,endAngle:f,options:this.resolveDataElementOptions(d,t.active?"active":a)};this.updateElement(t,d,g,a)}}countVisibleElements(){const e=this._cachedMeta;let t=0;return e.data.forEach((e,n)=>{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&t++}),t}_computeAngle(e,t,n){return this.chart.getDataVisibility(e)?U(this.resolveDataElementOptions(e,t).angle||n):0}}var Ii=Object.freeze({__proto__:null,BarController:class extends Ia{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(e,t,n,a){return Ei(e,t,n,a)}parseArrayData(e,t,n,a){return Ei(e,t,n,a)}parseObjectData(e,t,n,a){const{iScale:i,vScale:r}=e,{xAxisKey:o="x",yAxisKey:s="y"}=this._parsing,l="x"===i.axis?o:s,u="x"===r.axis?o:s,c=[];let d,h,p,f;for(d=n,h=n+a;d<h;++d)f=t[d],p={},p[i.axis]=i.parse(k(f,l),d),c.push(Pi(k(f,u),p,r,d));return c}updateRangeFromParsed(e,t,n,a){super.updateRangeFromParsed(e,t,n,a);const i=n._custom;i&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,i.min),e.max=Math.max(e.max,i.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const t=this._cachedMeta,{iScale:n,vScale:a}=t,i=this.getParsed(e),r=i._custom,o=Ai(r)?"["+r.start+", "+r.end+"]":""+a.getLabelForValue(i[a.axis]);return{label:""+n.getLabelForValue(i[n.axis]),value:o}}initialize(){this.enableOptionSharing=!0,super.initialize(),this._cachedMeta.stack=this.getDataset().stack}update(e){const t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}updateElements(e,t,n,i){const r="reset"===i,{index:o,_cachedMeta:{vScale:s}}=this,l=s.getBasePixel(),u=s.isHorizontal(),c=this._getRuler(),{sharedOptions:d,includeOptions:h}=this._getSharedOptions(t,i);for(let p=t;p<t+n;p++){const t=this.getParsed(p),n=r||a(t[s.axis])?{base:l,head:l}:this._calculateBarValuePixels(p),f=this._calculateBarIndexPixels(p,c),m=(t._stacks||{})[s.axis],g={horizontal:u,base:n.base,enableBorderRadius:!m||Ai(t._custom)||o===m._top||o===m._bottom,x:u?n.head:f.center,y:u?f.center:n.head,height:u?f.size:Math.abs(n.size),width:u?Math.abs(n.size):f.size};h&&(g.options=d||this.resolveDataElementOptions(p,e[p].active?"active":i));const _=g.options||e[p].options;Mi(g,_,m,o),zi(g,_,c.ratio),this.updateElement(e[p],p,g,i)}}_getStacks(e,t){const{iScale:n}=this._cachedMeta,i=n.getMatchingVisibleMetas(this._type).filter(e=>e.controller.options.grouped),r=n.options.stacked,o=[],s=this._cachedMeta.controller.getParsed(t),l=s&&s[n.axis],u=e=>{const t=e._parsed.find(e=>e[n.axis]===l),i=t&&t[e.vScale.axis];if(a(i)||isNaN(i))return!0};for(const n of i)if((void 0===t||!u(n))&&((!1===r||-1===o.indexOf(n.stack)||void 0===r&&void 0===n.stack)&&o.push(n.stack),n.index===e))break;return o.length||o.push(void 0),o}_getStackCount(e){return this._getStacks(void 0,e).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const e=this.chart.scales,t=this.chart.options.indexAxis;return Object.keys(e).filter(n=>e[n].axis===t).shift()}_getAxis(){const e={},t=this.getFirstScaleIdForIndexAxis();for(const n of this.chart.data.datasets)e[l("x"===this.chart.options.indexAxis?n.xAxisID:n.yAxisID,t)]=!0;return Object.keys(e)}_getStackIndex(e,t,n){const a=this._getStacks(e,n),i=void 0!==t?a.indexOf(t):-1;return-1===i?a.length-1:i}_getRuler(){const e=this.options,t=this._cachedMeta,n=t.iScale,a=[];let i,r;for(i=0,r=t.data.length;i<r;++i)a.push(n.getPixelForValue(this.getParsed(i)[n.axis],i));const o=e.barThickness;return{min:o||Ti(t),pixels:a,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:e.grouped,ratio:o?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:t,_stacked:n,index:i},options:{base:r,minBarLength:o}}=this,s=r||0,l=this.getParsed(e),u=l._custom,c=Ai(u);let d,h,p=l[t.axis],f=0,m=n?this.applyStack(t,l,n):p;m!==p&&(f=m-p,m=p),c&&(p=u.barStart,m=u.barEnd-u.barStart,0!==p&&q(p)!==q(u.barEnd)&&(f=0),f+=p);const g=a(r)||c?f:r;let _=t.getPixelForValue(g);if(d=this.chart.getDataVisibility(e)?t.getPixelForValue(f+m):_,h=d-_,Math.abs(h)<o){h=function(e,t,n){return 0!==e?q(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}(h,t,s)*o,p===s&&(_-=h/2);const e=t.getPixelForDecimal(0),a=t.getPixelForDecimal(1),r=Math.min(e,a),u=Math.max(e,a);_=Math.max(Math.min(_,u),r),d=_+h,n&&!c&&(l._stacks[t.axis]._visualValues[i]=t.getValueForPixel(d)-t.getValueForPixel(_))}if(_===t.getPixelForValue(s)){const e=q(h)*t.getLineWidthForValue(s)/2;_+=e,h-=e}return{size:h,base:_,head:d,center:d+h/2}}_calculateBarIndexPixels(e,t){const n=t.scale,i=this.options,r=i.skipNull,o=l(i.maxBarThickness,1/0);let s,u;const c=this._getAxisCount();if(t.grouped){const n=r?this._getStackCount(e):t.stackCount,d="flex"===i.barThickness?function(e,t,n,a){const i=t.pixels,r=i[e];let o=e>0?i[e-1]:null,s=e<i.length-1?i[e+1]:null;const l=n.categoryPercentage;null===o&&(o=r-(null===s?t.end-t.start:s-r)),null===s&&(s=r+r-o);const u=r-(r-Math.min(o,s))/2*l;return{chunk:Math.abs(s-o)/2*l/a,ratio:n.barPercentage,start:u}}(e,t,i,n*c):function(e,t,n,i){const r=n.barThickness;let o,s;return a(r)?(o=t.min*n.categoryPercentage,s=n.barPercentage):(o=r*i,s=1),{chunk:o/i,ratio:s,start:t.pixels[e]-o/2}}(e,t,i,n*c),h="x"===this.chart.options.indexAxis?this.getDataset().xAxisID:this.getDataset().yAxisID,p=this._getAxis().indexOf(l(h,this.getFirstScaleIdForIndexAxis())),f=this._getStackIndex(this.index,this._cachedMeta.stack,r?e:void 0)+p;s=d.start+d.chunk*f+d.chunk/2,u=Math.min(o,d.chunk*d.ratio)}else s=n.getPixelForValue(this.getParsed(e)[n.axis],e),u=Math.min(o,t.min*t.ratio);return{base:s-u/2,head:s+u/2,center:s,size:u}}draw(){const e=this._cachedMeta,t=e.vScale,n=e.data,a=n.length;let i=0;for(;i<a;++i)null===this.getParsed(i)[t.axis]||n[i].hidden||n[i].draw(this._ctx)}},BubbleController:class extends Ia{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(e,t,n,a){const i=super.parsePrimitiveData(e,t,n,a);for(let e=0;e<i.length;e++)i[e]._custom=this.resolveDataElementOptions(e+n).radius;return i}parseArrayData(e,t,n,a){const i=super.parseArrayData(e,t,n,a);for(let e=0;e<i.length;e++){const a=t[n+e];i[e]._custom=l(a[2],this.resolveDataElementOptions(e+n).radius)}return i}parseObjectData(e,t,n,a){const i=super.parseObjectData(e,t,n,a);for(let e=0;e<i.length;e++){const a=t[n+e];i[e]._custom=l(a&&a.r&&+a.r,this.resolveDataElementOptions(e+n).radius)}return i}getMaxOverflow(){const e=this._cachedMeta.data;let t=0;for(let n=e.length-1;n>=0;--n)t=Math.max(t,e[n].size(this.resolveDataElementOptions(n))/2);return t>0&&t}getLabelAndValue(e){const t=this._cachedMeta,n=this.chart.data.labels||[],{xScale:a,yScale:i}=t,r=this.getParsed(e),o=a.getLabelForValue(r.x),s=i.getLabelForValue(r.y),l=r._custom;return{label:n[e]||"",value:"("+o+", "+s+(l?", "+l:"")+")"}}update(e){const t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}updateElements(e,t,n,a){const i="reset"===a,{iScale:r,vScale:o}=this._cachedMeta,{sharedOptions:s,includeOptions:l}=this._getSharedOptions(t,a),u=r.axis,c=o.axis;for(let d=t;d<t+n;d++){const t=e[d],n=!i&&this.getParsed(d),h={},p=h[u]=i?r.getPixelForDecimal(.5):r.getPixelForValue(n[u]),f=h[c]=i?o.getBasePixel():o.getPixelForValue(n[c]);h.skip=isNaN(p)||isNaN(f),l&&(h.options=s||this.resolveDataElementOptions(d,t.active?"active":a),i&&(h.options.radius=0)),this.updateElement(t,d,h,a)}}resolveDataElementOptions(e,t){const n=this.getParsed(e);let a=super.resolveDataElementOptions(e,t);a.$shared&&(a=Object.assign({},a,{$shared:!1}));const i=a.radius;return"active"!==t&&(a.radius=0),a.radius+=l(n&&n._custom,i),a}},DoughnutController:Ni,LineController:class extends Ia{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const t=this._cachedMeta,{dataset:n,data:a=[],_dataset:i}=t,r=this.chart._animationsDisabled;let{start:o,count:s}=me(t,a,r);this._drawStart=o,this._drawCount=s,ge(t)&&(o=0,s=a.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!i._decimated,n.points=a;const l=this.resolveDatasetElementOptions(e);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(n,void 0,{animated:!r,options:l},e),this.updateElements(a,o,s,e)}updateElements(e,t,n,i){const r="reset"===i,{iScale:o,vScale:s,_stacked:l,_dataset:u}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(t,i),h=o.axis,p=s.axis,{spanGaps:f,segment:m}=this.options,g=F(f)?f:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||r||"none"===i,v=t+n,b=e.length;let y=t>0&&this.getParsed(t-1);for(let n=0;n<b;++n){const f=e[n],b=_?f:{};if(n<t||n>=v){b.skip=!0;continue}const w=this.getParsed(n),k=a(w[p]),x=b[h]=o.getPixelForValue(w[h],n),S=b[p]=r||k?s.getBasePixel():s.getPixelForValue(l?this.applyStack(s,w,l):w[p],n);b.skip=isNaN(x)||isNaN(S)||k,b.stop=n>0&&Math.abs(w[h]-y[h])>g,m&&(b.parsed=w,b.raw=u.data[n]),d&&(b.options=c||this.resolveDataElementOptions(n,f.active?"active":i)),_||this.updateElement(f,n,b,i),y=w}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,n=t.options&&t.options.borderWidth||0,a=e.data||[];if(!a.length)return n;const i=a[0].size(this.resolveDataElementOptions(0)),r=a[a.length-1].size(this.resolveDataElementOptions(a.length-1));return Math.max(n,i,r)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}},PieController:class extends Ni{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}},PolarAreaController:Oi,RadarController:class extends Ia{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(e){const t=this._cachedMeta.vScale,n=this.getParsed(e);return{label:t.getLabels()[e],value:""+t.getLabelForValue(n[t.axis])}}parseObjectData(e,t,n,a){return Qt.bind(this)(e,t,n,a)}update(e){const t=this._cachedMeta,n=t.dataset,a=t.data||[],i=t.iScale.getLabels();if(n.points=a,"resize"!==e){const t=this.resolveDatasetElementOptions(e);this.options.showLine||(t.borderWidth=0);const r={_loop:!0,_fullLoop:i.length===a.length,options:t};this.updateElement(n,void 0,r,e)}this.updateElements(a,0,a.length,e)}updateElements(e,t,n,a){const i=this._cachedMeta.rScale,r="reset"===a;for(let o=t;o<t+n;o++){const t=e[o],n=this.resolveDataElementOptions(o,t.active?"active":a),s=i.getPointPositionForValue(o,this.getParsed(o).r),l=r?i.xCenter:s.x,u=r?i.yCenter:s.y,c={x:l,y:u,angle:s.angle,skip:isNaN(l)||isNaN(u),options:n};this.updateElement(t,o,c,a)}}},ScatterController:class extends Ia{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(e){const t=this._cachedMeta,n=this.chart.data.labels||[],{xScale:a,yScale:i}=t,r=this.getParsed(e),o=a.getLabelForValue(r.x),s=i.getLabelForValue(r.y);return{label:n[e]||"",value:"("+o+", "+s+")"}}update(e){const t=this._cachedMeta,{data:n=[]}=t,a=this.chart._animationsDisabled;let{start:i,count:r}=me(t,n,a);if(this._drawStart=i,this._drawCount=r,ge(t)&&(i=0,r=n.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:i,_dataset:r}=t;i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=n;const o=this.resolveDatasetElementOptions(e);o.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:o},e)}else this.datasetElementType&&(delete t.dataset,this.datasetElementType=!1);this.updateElements(n,i,r,e)}addElements(){const{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(e,t,n,i){const r="reset"===i,{iScale:o,vScale:s,_stacked:l,_dataset:u}=this._cachedMeta,c=this.resolveDataElementOptions(t,i),d=this.getSharedOptions(c),h=this.includeOptions(i,d),p=o.axis,f=s.axis,{spanGaps:m,segment:g}=this.options,_=F(m)?m:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||r||"none"===i;let b=t>0&&this.getParsed(t-1);for(let c=t;c<t+n;++c){const t=e[c],n=this.getParsed(c),m=v?t:{},y=a(n[f]),w=m[p]=o.getPixelForValue(n[p],c),k=m[f]=r||y?s.getBasePixel():s.getPixelForValue(l?this.applyStack(s,n,l):n[f],c);m.skip=isNaN(w)||isNaN(k)||y,m.stop=c>0&&Math.abs(n[p]-b[p])>_,g&&(m.parsed=n,m.raw=u.data[c]),h&&(m.options=d||this.resolveDataElementOptions(c,t.active?"active":i)),v||this.updateElement(t,c,m,i),b=n}this.updateSharedOptions(d,i,c)}getMaxOverflow(){const e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){let e=0;for(let n=t.length-1;n>=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}const n=e.dataset,a=n.options&&n.options.borderWidth||0;if(!t.length)return a;const i=t[0].size(this.resolveDataElementOptions(0)),r=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(a,i,r)/2}}});function qi(e,t,n,a){return{x:n+e*Math.cos(t),y:a+e*Math.sin(t)}}function Di(e,t,n,a,i,r){const{x:o,y:s,startAngle:l,pixelMargin:u,innerRadius:c}=t,d=Math.max(t.outerRadius+a+n-u,0),h=c>0?c+a+n+u:0;let p=0;const f=i-l;if(a){const e=((c>0?c-a:0)+(d>0?d-a:0))/2;p=(f-(0!==e?f*e/(e+a):f))/2}const m=(f-Math.max(.001,f*d-n/E)/d)/2,g=l+m+p,_=i-m-p,{outerStart:v,outerEnd:b,innerStart:y,innerEnd:w}=function(e,t,n,a){const i=gn(e.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),r=(n-t)/2,o=Math.min(r,a*t/2),s=e=>{const t=(n-Math.min(r,e))*a/2;return J(e,0,Math.min(r,t))};return{outerStart:s(i.outerStart),outerEnd:s(i.outerEnd),innerStart:J(i.innerStart,0,o),innerEnd:J(i.innerEnd,0,o)}}(t,h,d,_-g),k=d-v,x=d-b,S=g+v/k,C=_-b/x,T=h+y,P=h+w,A=g+y/T,M=_-w/P;if(e.beginPath(),r){const t=(S+C)/2;if(e.arc(o,s,d,S,t),e.arc(o,s,d,t,C),b>0){const t=qi(x,C,o,s);e.arc(t.x,t.y,b,C,_+z)}const n=qi(P,_,o,s);if(e.lineTo(n.x,n.y),w>0){const t=qi(P,M,o,s);e.arc(t.x,t.y,w,_+z,M+Math.PI)}const a=(_-w/h+(g+y/h))/2;if(e.arc(o,s,h,_-w/h,a,!0),e.arc(o,s,h,a,g+y/h,!0),y>0){const t=qi(T,A,o,s);e.arc(t.x,t.y,y,A+Math.PI,g-z)}const i=qi(k,g,o,s);if(e.lineTo(i.x,i.y),v>0){const t=qi(k,S,o,s);e.arc(t.x,t.y,v,g-z,S)}}else{e.moveTo(o,s);const t=Math.cos(S)*d+o,n=Math.sin(S)*d+s;e.lineTo(t,n);const a=Math.cos(C)*d+o,i=Math.sin(C)*d+s;e.lineTo(a,i)}e.closePath()}function ji(e,t,n=t){e.lineCap=l(n.borderCapStyle,t.borderCapStyle),e.setLineDash(l(n.borderDash,t.borderDash)),e.lineDashOffset=l(n.borderDashOffset,t.borderDashOffset),e.lineJoin=l(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=l(n.borderWidth,t.borderWidth),e.strokeStyle=l(n.borderColor,t.borderColor)}function Bi(e,t,n){e.lineTo(n.x,n.y)}function Fi(e,t,n={}){const a=e.length,{start:i=0,end:r=a-1}=n,{start:o,end:s}=t,l=Math.max(i,o),u=Math.min(r,s),c=i<o&&r<o||i>s&&r>s;return{count:a,start:l,loop:t.loop,ilen:u<l&&!c?a+u-l:u-l}}function $i(e,t,n,a){const{points:i,options:r}=t,{count:o,start:s,loop:l,ilen:u}=Fi(i,n,a),c=function(e){return e.stepped?Lt:e.tension||"monotone"===e.cubicInterpolationMode?Rt:Bi}(r);let d,h,p,{move:f=!0,reverse:m}=a||{};for(d=0;d<=u;++d)h=i[(s+(m?u-d:d))%o],h.skip||(f?(e.moveTo(h.x,h.y),f=!1):c(e,p,h,m,r.stepped),p=h);return l&&(h=i[(s+(m?u:0))%o],c(e,p,h,m,r.stepped)),!!l}function Vi(e,t,n,a){const i=t.points,{count:r,start:o,ilen:s}=Fi(i,n,a),{move:l=!0,reverse:u}=a||{};let c,d,h,p,f,m,g=0,_=0;const v=e=>(o+(u?s-e:e))%r,b=()=>{p!==f&&(e.lineTo(g,f),e.lineTo(g,p),e.lineTo(g,m))};for(l&&(d=i[v(0)],e.moveTo(d.x,d.y)),c=0;c<=s;++c){if(d=i[v(c)],d.skip)continue;const t=d.x,n=d.y,a=0|t;a===h?(n<p?p=n:n>f&&(f=n),g=(_*g+t)/++_):(b(),e.lineTo(t,n),h=a,_=0,p=f=n),m=n}b()}function Ui(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return e._decimated||e._loop||t.tension||"monotone"===t.cubicInterpolationMode||t.stepped||n?$i:Vi}const Hi="function"==typeof Path2D;class Wi extends qa{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:e=>"borderDash"!==e&&"fill"!==e};constructor(e){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,e&&Object.assign(this,e)}updateControlPoints(e,t){const n=this.options;if((n.tension||"monotone"===n.cubicInterpolationMode)&&!n.stepped&&!this._pointsUpdated){const a=n.spanGaps?this._loop:this._fullLoop;an(this._points,n,e,a,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Ln(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,n=e.length;return n&&t[e[n-1].end]}interpolate(e,t){const n=this.options,a=e[t],i=this.points,r=Mn(this,{property:t,start:a,end:a});if(!r.length)return;const o=[],s=function(e){return e.stepped?cn:e.tension||"monotone"===e.cubicInterpolationMode?dn:un}(n);let l,u;for(l=0,u=r.length;l<u;++l){const{start:u,end:c}=r[l],d=i[u],h=i[c];if(d===h){o.push(d);continue}const p=s(d,h,Math.abs((a-d[t])/(h[t]-d[t])),n.stepped);p[t]=e[t],o.push(p)}return 1===o.length?o[0]:o}pathSegment(e,t,n){return Ui(this)(e,this,t,n)}path(e,t,n){const a=this.segments,i=Ui(this);let r=this._loop;t=t||0,n=n||this.points.length-t;for(const o of a)r&=i(e,this,o,{start:t,end:t+n-1});return!!r}draw(e,t,n,a){const i=this.options||{};(this.points||[]).length&&i.borderWidth&&(e.save(),function(e,t,n,a){Hi&&!t.options.segment?function(e,t,n,a){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,a)&&i.closePath()),ji(e,t.options),e.stroke(i)}(e,t,n,a):function(e,t,n,a){const{segments:i,options:r}=t,o=Ui(t);for(const s of i)ji(e,r,s.style),e.beginPath(),o(e,t,s,{start:n,end:n+a-1})&&e.closePath(),e.stroke()}(e,t,n,a)}(e,this,n,a),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Gi(e,t,n,a){const i=e.options,{[n]:r}=e.getProps([n],a);return Math.abs(t-r)<i.radius+i.hitRadius}function Yi(e,t){const{x:n,y:a,base:i,width:r,height:o}=e.getProps(["x","y","base","width","height"],t);let s,l,u,c,d;return e.horizontal?(d=o/2,s=Math.min(n,i),l=Math.max(n,i),u=a-d,c=a+d):(d=r/2,s=n-d,l=n+d,u=Math.min(a,i),c=Math.max(a,i)),{left:s,top:u,right:l,bottom:c}}function Ki(e,t,n,a){return e?0:J(t,n,a)}function Qi(e){const t=Yi(e),n=t.right-t.left,a=t.bottom-t.top,i=function(e,t,n){const a=e.options.borderWidth,i=e.borderSkipped,r=_n(a);return{t:Ki(i.top,r.top,0,n),r:Ki(i.right,r.right,0,t),b:Ki(i.bottom,r.bottom,0,n),l:Ki(i.left,r.left,0,t)}}(e,n/2,a/2),o=function(e,t,n){const{enableBorderRadius:a}=e.getProps(["enableBorderRadius"]),i=e.options.borderRadius,o=vn(i),s=Math.min(t,n),l=e.borderSkipped,u=a||r(i);return{topLeft:Ki(!u||l.top||l.left,o.topLeft,0,s),topRight:Ki(!u||l.top||l.right,o.topRight,0,s),bottomLeft:Ki(!u||l.bottom||l.left,o.bottomLeft,0,s),bottomRight:Ki(!u||l.bottom||l.right,o.bottomRight,0,s)}}(e,n/2,a/2);return{outer:{x:t.left,y:t.top,w:n,h:a,radius:o},inner:{x:t.left+i.l,y:t.top+i.t,w:n-i.l-i.r,h:a-i.t-i.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,o.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(i.b,i.r))}}}}function Zi(e,t,n,a){const i=null===t,r=null===n,o=e&&!(i&&r)&&Yi(e,a);return o&&(i||ee(t,o.left,o.right))&&(r||ee(n,o.top,o.bottom))}function Ji(e,t){e.rect(t.x,t.y,t.w,t.h)}function Xi(e,t,n={}){const a=e.x!==n.x?-t:0,i=e.y!==n.y?-t:0,r=(e.x+e.w!==n.x+n.w?t:0)-a,o=(e.y+e.h!==n.y+n.h?t:0)-i;return{x:e.x+a,y:e.y+i,w:e.w+r,h:e.h+o,radius:e.radius}}var er=Object.freeze({__proto__:null,ArcElement:class extends qa{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:e=>"borderDash"!==e};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(e){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,e&&Object.assign(this,e)}inRange(e,t,n){const a=this.getProps(["x","y"],n),{angle:i,distance:r}=G(a,{x:e,y:t}),{startAngle:o,endAngle:s,innerRadius:u,outerRadius:c,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),h=(this.options.spacing+this.options.borderWidth)/2,p=l(d,s-o),f=Z(i,o,s)&&o!==s,m=p>=A||f,g=ee(r,u+h,c+h);return m&&g}getCenterPoint(e){const{x:t,y:n,startAngle:a,endAngle:i,innerRadius:r,outerRadius:o}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:s,spacing:l}=this.options,u=(a+i)/2,c=(r+o+l+s)/2;return{x:t+Math.cos(u)*c,y:n+Math.sin(u)*c}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:t,circumference:n}=this,a=(t.offset||0)/4,i=(t.spacing||0)/2,r=t.circular;if(this.pixelMargin="inner"===t.borderAlign?.33:0,this.fullCircles=n>A?Math.floor(n/A):0,0===n||this.innerRadius<0||this.outerRadius<0)return;e.save();const o=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(o)*a,Math.sin(o)*a);const s=a*(1-Math.sin(Math.min(E,n||0)));e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor,function(e,t,n,a,i){const{fullCircles:r,startAngle:o,circumference:s}=t;let l=t.endAngle;if(r){Di(e,t,n,a,l,i);for(let t=0;t<r;++t)e.fill();isNaN(s)||(l=o+(s%A||A))}Di(e,t,n,a,l,i),e.fill()}(e,this,s,i,r),function(e,t,n,a,i){const{fullCircles:r,startAngle:o,circumference:s,options:l}=t,{borderWidth:u,borderJoinStyle:c,borderDash:d,borderDashOffset:h,borderRadius:p}=l,f="inner"===l.borderAlign;if(!u)return;e.setLineDash(d||[]),e.lineDashOffset=h,f?(e.lineWidth=2*u,e.lineJoin=c||"round"):(e.lineWidth=u,e.lineJoin=c||"bevel");let m=t.endAngle;if(r){Di(e,t,n,a,m,i);for(let t=0;t<r;++t)e.stroke();isNaN(s)||(m=o+(s%A||A))}f&&function(e,t,n){const{startAngle:a,pixelMargin:i,x:r,y:o,outerRadius:s,innerRadius:l}=t;let u=i/s;e.beginPath(),e.arc(r,o,s,a-u,n+u),l>i?(u=i/l,e.arc(r,o,l,n+u,a-u,!0)):e.arc(r,o,i,n+z,a-z),e.closePath(),e.clip()}(e,t,m),l.selfJoin&&m-o>=E&&0===p&&"miter"!==c&&function(e,t,n){const{startAngle:a,x:i,y:r,outerRadius:o,innerRadius:s,options:l}=t,{borderWidth:u,borderJoinStyle:c}=l,d=Math.min(u/o,Q(a-n));if(e.beginPath(),e.arc(i,r,o-u/2,a+d/2,n-d/2),s>0){const t=Math.min(u/s,Q(a-n));e.arc(i,r,s+u/2,n-t/2,a+t/2,!0)}else{const t=Math.min(u/2,o*Q(a-n));if("round"===c)e.arc(i,r,t,n-E/2,a+E/2,!0);else if("bevel"===c){const o=2*t*t,s=-o*Math.cos(n+E/2)+i,l=-o*Math.sin(n+E/2)+r,u=o*Math.cos(a+E/2)+i,c=o*Math.sin(a+E/2)+r;e.lineTo(s,l),e.lineTo(u,c)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}(e,t,m),r||(Di(e,t,n,a,m,i),e.stroke())}(e,this,s,i,r),e.restore()}},BarElement:class extends qa{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(e){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,e&&Object.assign(this,e)}draw(e){const{inflateAmount:t,options:{borderColor:n,backgroundColor:a}}=this,{inner:i,outer:r}=Qi(this),o=(s=r.radius).topLeft||s.topRight||s.bottomLeft||s.bottomRight?It:Ji;var s;e.save(),r.w===i.w&&r.h===i.h||(e.beginPath(),o(e,Xi(r,t,i)),e.clip(),o(e,Xi(i,-t,r)),e.fillStyle=n,e.fill("evenodd")),e.beginPath(),o(e,Xi(i,t)),e.fillStyle=a,e.fill(),e.restore()}inRange(e,t,n){return Zi(this,e,t,n)}inXRange(e,t){return Zi(this,e,null,t)}inYRange(e,t){return Zi(this,null,e,t)}getCenterPoint(e){const{x:t,y:n,base:a,horizontal:i}=this.getProps(["x","y","base","horizontal"],e);return{x:i?(t+a)/2:t,y:i?n:(n+a)/2}}getRange(e){return"x"===e?this.width/2:this.height/2}},LineElement:Wi,PointElement:class extends qa{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(e){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,t,n){const a=this.options,{x:i,y:r}=this.getProps(["x","y"],n);return Math.pow(e-i,2)+Math.pow(t-r,2)<Math.pow(a.hitRadius+a.radius,2)}inXRange(e,t){return Gi(this,e,"x",t)}inYRange(e,t){return Gi(this,e,"y",t)}getCenterPoint(e){const{x:t,y:n}=this.getProps(["x","y"],e);return{x:t,y:n}}size(e){let t=(e=e||this.options||{}).radius||0;return t=Math.max(t,t&&e.hoverRadius||0),2*(t+(t&&e.borderWidth||0))}draw(e,t){const n=this.options;this.skip||n.radius<.1||!Et(this,t,this.size(n)/2)||(e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.fillStyle=n.backgroundColor,Tt(e,n,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}});function tr(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}function nr(e,t,{horizontal:n,minRotation:a}){const i=U(a),r=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(""+e).length;return Math.min(t/r,o)}class ar extends Ga{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return a(e)||("number"==typeof e||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:a,max:i}=this;const r=e=>a=t?a:e,o=e=>i=n?i:e;if(e){const e=q(a),t=q(i);e<0&&t<0?o(0):e>0&&t>0&&r(0)}if(a===i){let t=0===i?1:Math.abs(.05*i);o(i+t),e||r(a-t)}this.min=a,this.max=i}getTickLimit(){const e=this.options.ticks;let t,{maxTicksLimit:n,stepSize:a}=e;return a?(t=Math.ceil(this.max/a)-Math.floor(this.min/a)+1,t>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${a} would result generating up to ${t} ticks. Limiting to 1000.`),t=1e3)):(t=this.computeTickLimit(),n=n||11),n&&(t=Math.min(n,t)),t}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let n=this.getTickLimit();n=Math.max(2,n);const i=function(e,t){const n=[],{bounds:i,step:r,min:o,max:s,precision:l,count:u,maxTicks:c,maxDigits:d,includeBounds:h}=e,p=r||1,f=c-1,{min:m,max:g}=t,_=!a(o),v=!a(s),b=!a(u),y=(g-m)/(d+1);let w,k,x,S,C=j((g-m)/f/p)*p;if(C<1e-14&&!_&&!v)return[{value:m},{value:g}];S=Math.ceil(g/C)-Math.floor(m/C),S>f&&(C=j(S*C/f/p)*p),a(l)||(w=Math.pow(10,l),C=Math.ceil(C*w)/w),"ticks"===i?(k=Math.floor(m/C)*C,x=Math.ceil(g/C)*C):(k=m,x=g),_&&v&&r&&$((s-o)/r,C/1e3)?(S=Math.round(Math.min((s-o)/C,c)),C=(s-o)/S,k=o,x=s):b?(k=_?o:k,x=v?s:x,S=u-1,C=(x-k)/S):(S=(x-k)/C,S=D(S,Math.round(S),C/1e3)?Math.round(S):Math.ceil(S));const T=Math.max(W(C),W(k));w=Math.pow(10,a(l)?T:l),k=Math.round(k*w)/w,x=Math.round(x*w)/w;let P=0;for(_&&(h&&k!==o?(n.push({value:o}),k<o&&P++,D(Math.round((k+P*C)*w)/w,o,nr(o,y,e))&&P++):k<o&&P++);P<S;++P){const e=Math.round((k+P*C)*w)/w;if(v&&e>s)break;n.push({value:e})}return v&&h&&x!==s?n.length&&D(n[n.length-1].value,s,nr(s,y,e))?n[n.length-1].value=s:n.push({value:s}):v&&x!==s||n.push({value:x}),n}({maxTicks:n,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:!1!==t.includeBounds},this._range||this);return"ticks"===e.bounds&&V(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){const e=this.ticks;let t=this.min,n=this.max;if(super.configure(),this.options.offset&&e.length){const a=(n-t)/Math.max(e.length-1,1)/2;t-=a,n+=a}this._startValue=t,this._endValue=n,this._valueRange=n-t}getLabelForValue(e){return et(e,this.chart.options.locale,this.options.ticks.format)}}class ir extends ar{static id="linear";static defaults={ticks:{callback:nt.formatters.numeric}};determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=o(e)?e:0,this.max=o(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,n=U(this.options.ticks.minRotation),a=(e?Math.sin(n):Math.cos(n))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,i.lineHeight/a))}getPixelForValue(e){return null===e?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}const rr=e=>Math.floor(I(e)),or=(e,t)=>Math.pow(10,rr(e)+t);function sr(e){return 1===e/Math.pow(10,rr(e))}function lr(e,t,n){const a=Math.pow(10,n),i=Math.floor(e/a);return Math.ceil(t/a)-i}class ur extends Ga{static id="logarithmic";static defaults={ticks:{callback:nt.formatters.logarithmic,major:{enabled:!0}}};constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){const n=ar.prototype.parse.apply(this,[e,t]);if(0!==n)return o(n)&&n>0?n:null;this._zero=!0}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=o(e)?Math.max(0,e):null,this.max=o(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!o(this._userMin)&&(this.min=e===or(this.min,0)?or(this.min,-1):or(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let n=this.min,a=this.max;const i=t=>n=e?n:t,r=e=>a=t?a:e;n===a&&(n<=0?(i(1),r(10)):(i(or(n,-1)),r(or(a,1)))),n<=0&&i(or(a,-1)),a<=0&&r(or(n,1)),this.min=n,this.max=a}buildTicks(){const e=this.options,t=function(e,{min:t,max:n}){t=s(e.min,t);const a=[],i=rr(t);let r=function(e,t){let n=rr(t-e);for(;lr(e,t,n)>10;)n++;for(;lr(e,t,n)<10;)n--;return Math.min(n,rr(e))}(t,n),o=r<0?Math.pow(10,Math.abs(r)):1;const l=Math.pow(10,r),u=i>r?Math.pow(10,i):0,c=Math.round((t-u)*o)/o,d=Math.floor((t-u)/l/10)*l*10;let h=Math.floor((c-d)/Math.pow(10,r)),p=s(e.min,Math.round((u+d+h*Math.pow(10,r))*o)/o);for(;p<n;)a.push({value:p,major:sr(p),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(r++,h=2,o=r>=0?1:o),p=Math.round((u+d+h*Math.pow(10,r))*o)/o;const f=s(e.max,p);return a.push({value:f,major:sr(f),significand:h}),a}({min:this._userMin,max:this._userMax},this);return"ticks"===e.bounds&&V(t,this,"value"),e.reverse?(t.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),t}getLabelForValue(e){return void 0===e?"0":et(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=I(e),this._valueRange=I(this.max)-I(e)}getPixelForValue(e){return void 0!==e&&0!==e||(e=this.min),null===e||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(I(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}function cr(e){const t=e.ticks;if(t.display&&e.display){const e=bn(t.backdropPadding);return l(t.font&&t.font.size,st.font.size)+e.height}return 0}function dr(e,t,n,a,i){return e===a||e===i?{start:t-n/2,end:t+n/2}:e<a||e>i?{start:t-n,end:t}:{start:t,end:t+n}}function hr(e,t,n,a,i){const r=Math.abs(Math.sin(n)),o=Math.abs(Math.cos(n));let s=0,l=0;a.start<t.l?(s=(t.l-a.start)/r,e.l=Math.min(e.l,t.l-s)):a.end>t.r&&(s=(a.end-t.r)/r,e.r=Math.max(e.r,t.r+s)),i.start<t.t?(l=(t.t-i.start)/o,e.t=Math.min(e.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/o,e.b=Math.max(e.b,t.b+l))}function pr(e,t,n){const a=e.drawingArea,{extra:i,additionalAngle:r,padding:o,size:s}=n,l=e.getPointPosition(t,a+i+o,r),u=Math.round(H(Q(l.angle+z))),c=function(e,t,n){return 90===n||270===n?e-=t/2:(n>270||n<90)&&(e-=t),e}(l.y,s.h,u),d=function(e){return 0===e||180===e?"center":e<180?"left":"right"}(u),h=function(e,t,n){return"right"===n?e-=t:"center"===n&&(e-=t/2),e}(l.x,s.w,d);return{visible:!0,x:l.x,y:c,textAlign:d,left:h,top:c,right:h+s.w,bottom:c+s.h}}function fr(e,t){if(!t)return!0;const{left:n,top:a,right:i,bottom:r}=e;return!(Et({x:n,y:a},t)||Et({x:n,y:r},t)||Et({x:i,y:a},t)||Et({x:i,y:r},t))}function mr(e,t,n){const{left:i,top:r,right:o,bottom:s}=n,{backdropColor:l}=t;if(!a(l)){const n=vn(t.borderRadius),a=bn(t.backdropPadding);e.fillStyle=l;const u=i-a.left,c=r-a.top,d=o-i+a.width,h=s-r+a.height;Object.values(n).some(e=>0!==e)?(e.beginPath(),It(e,{x:u,y:c,w:d,h:h,radius:n}),e.fill()):e.fillRect(u,c,d,h)}}function gr(e,t,n,a){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,A);else{let n=e.getPointPosition(0,t);i.moveTo(n.x,n.y);for(let r=1;r<a;r++)n=e.getPointPosition(r,t),i.lineTo(n.x,n.y)}}class _r extends ar{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:nt.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:e=>e,padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const e=this._padding=bn(cr(this.options)/2),t=this.width=this.maxWidth-e.width,n=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+n/2+e.top),this.drawingArea=Math.floor(Math.min(t,n)/2)}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!1);this.min=o(e)&&!isNaN(e)?e:0,this.max=o(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/cr(this.options))}generateTickLabels(e){ar.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((e,t)=>{const n=d(this.options.pointLabels.callback,[e,t],this);return n||0===n?n:""}).filter((e,t)=>this.chart.getDataVisibility(t))}fit(){const e=this.options;e.display&&e.pointLabels.display?function(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),a=[],r=[],o=e._pointLabels.length,s=e.options.pointLabels,l=s.centerPointLabels?E/o:0;for(let h=0;h<o;h++){const o=s.setContext(e.getPointLabelContext(h));r[h]=o.padding;const p=e.getPointPosition(h,e.drawingArea+r[h],l),f=yn(o.font),m=(u=e.ctx,c=f,d=i(d=e._pointLabels[h])?d:[d],{w:xt(u,c.string,d),h:d.length*c.lineHeight});a[h]=m;const g=Q(e.getIndexAngle(h)+l),_=Math.round(H(g));hr(n,t,g,dr(_,p.x,m.w,0,180),dr(_,p.y,m.h,90,270))}var u,c,d;e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=function(e,t,n){const a=[],i=e._pointLabels.length,r=e.options,{centerPointLabels:o,display:s}=r.pointLabels,l={extra:cr(r)/2,additionalAngle:o?E/i:0};let u;for(let r=0;r<i;r++){l.padding=n[r],l.size=t[r];const i=pr(e,r,l);a.push(i),"auto"===s&&(i.visible=fr(i,u),i.visible&&(u=i))}return a}(e,a,r)}(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,n,a){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((n-a)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,n,a))}getIndexAngle(e){return Q(e*(A/(this._pointLabels.length||1))+U(this.options.startAngle||0))}getDistanceFromCenterForValue(e){if(a(e))return NaN;const t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(a(e))return NaN;const t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){const t=this._pointLabels||[];if(e>=0&&e<t.length){const n=t[e];return function(e,t,n){return xn(e,{label:n,index:t,type:"pointLabel"})}(this.getContext(),e,n)}}getPointPosition(e,t,n=0){const a=this.getIndexAngle(e)-z+n;return{x:Math.cos(a)*t+this.xCenter,y:Math.sin(a)*t+this.yCenter,angle:a}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:t,top:n,right:a,bottom:i}=this._pointLabelItems[e];return{left:t,top:n,right:a,bottom:i}}drawBackground(){const{backgroundColor:e,grid:{circular:t}}=this.options;if(e){const n=this.ctx;n.save(),n.beginPath(),gr(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),n.closePath(),n.fillStyle=e,n.fill(),n.restore()}}drawGrid(){const e=this.ctx,t=this.options,{angleLines:n,grid:a,border:i}=t,r=this._pointLabels.length;let o,s,l;if(t.pointLabels.display&&function(e,t){const{ctx:n,options:{pointLabels:a}}=e;for(let i=t-1;i>=0;i--){const t=e._pointLabelItems[i];if(!t.visible)continue;const r=a.setContext(e.getPointLabelContext(i));mr(n,r,t);const o=yn(r.font),{x:s,y:l,textAlign:u}=t;Ot(n,e._pointLabels[i],s,l+o.lineHeight/2,o,{color:r.color,textAlign:u,textBaseline:"middle"})}}(this,r),a.display&&this.ticks.forEach((e,t)=>{if(0!==t||0===t&&this.min<0){s=this.getDistanceFromCenterForValue(e.value);const n=this.getContext(t),o=a.setContext(n),l=i.setContext(n);!function(e,t,n,a,i){const r=e.ctx,o=t.circular,{color:s,lineWidth:l}=t;!o&&!a||!s||!l||n<0||(r.save(),r.strokeStyle=s,r.lineWidth=l,r.setLineDash(i.dash||[]),r.lineDashOffset=i.dashOffset,r.beginPath(),gr(e,n,o,a),r.closePath(),r.stroke(),r.restore())}(this,o,s,r,l)}}),n.display){for(e.save(),o=r-1;o>=0;o--){const a=n.setContext(this.getPointLabelContext(o)),{color:i,lineWidth:r}=a;r&&i&&(e.lineWidth=r,e.strokeStyle=i,e.setLineDash(a.borderDash),e.lineDashOffset=a.borderDashOffset,s=this.getDistanceFromCenterForValue(t.reverse?this.min:this.max),l=this.getPointPosition(o,s),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(l.x,l.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,t=this.options,n=t.ticks;if(!n.display)return;const a=this.getIndexAngle(0);let i,r;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(a),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((a,o)=>{if(0===o&&this.min>=0&&!t.reverse)return;const s=n.setContext(this.getContext(o)),l=yn(s.font);if(i=this.getDistanceFromCenterForValue(this.ticks[o].value),s.showLabelBackdrop){e.font=l.string,r=e.measureText(a.label).width,e.fillStyle=s.backdropColor;const t=bn(s.backdropPadding);e.fillRect(-r/2-t.left,-i-l.size/2-t.top,r+t.width,l.size+t.height)}Ot(e,a.label,0,-i,l,{color:s.color,strokeColor:s.textStrokeColor,strokeWidth:s.textStrokeWidth})}),e.restore()}drawTitle(){}}const vr={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}},br=Object.keys(vr);function yr(e,t){return e-t}function wr(e,t){if(a(t))return null;const n=e._adapter,{parser:i,round:r,isoWeekday:s}=e._parseOpts;let l=t;return"function"==typeof i&&(l=i(l)),o(l)||(l="string"==typeof i?n.parse(l,i):n.parse(l)),null===l?null:(r&&(l="week"!==r||!F(s)&&!0!==s?n.startOf(l,r):n.startOf(l,"isoWeek",s)),+l)}function kr(e,t,n,a){const i=br.length;for(let r=br.indexOf(e);r<i-1;++r){const e=vr[br[r]],i=e.steps?e.steps:Number.MAX_SAFE_INTEGER;if(e.common&&Math.ceil((n-t)/(i*e.size))<=a)return br[r]}return br[i-1]}function xr(e,t,n){if(n){if(n.length){const{lo:a,hi:i}=te(n,t);e[n[a]>=t?n[a]:n[i]]=!0}}else e[t]=!0}function Sr(e,t,n){const a=[],i={},r=t.length;let o,s;for(o=0;o<r;++o)s=t[o],i[s]=o,a.push({value:s,major:!1});return 0!==r&&n?function(e,t,n,a){const i=e._adapter,r=+i.startOf(t[0].value,a),o=t[t.length-1].value;let s,l;for(s=r;s<=o;s=+i.add(s,1,a))l=n[s],l>=0&&(t[l].major=!0);return t}(e,a,i,n):a}class Cr extends Ga{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,t={}){const n=e.time||(e.time={}),a=this._adapter=new Ci._date(e.adapters.date);a.init(t),v(n.displayFormats,a.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return void 0===e?null:wr(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,t=this._adapter,n=e.time.unit||"day";let{min:a,max:i,minDefined:r,maxDefined:s}=this.getUserBounds();function l(e){r||isNaN(e.min)||(a=Math.min(a,e.min)),s||isNaN(e.max)||(i=Math.max(i,e.max))}r&&s||(l(this._getLabelBounds()),"ticks"===e.bounds&&"labels"===e.ticks.source||l(this.getMinMax(!1))),a=o(a)&&!isNaN(a)?a:+t.startOf(Date.now(),n),i=o(i)&&!isNaN(i)?i:+t.endOf(Date.now(),n)+1,this.min=Math.min(a,i-1),this.max=Math.max(a+1,i)}_getLabelBounds(){const e=this.getLabelTimestamps();let t=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return e.length&&(t=e[0],n=e[e.length-1]),{min:t,max:n}}buildTicks(){const e=this.options,t=e.time,n=e.ticks,a="labels"===n.source?this.getLabelTimestamps():this._generate();"ticks"===e.bounds&&a.length&&(this.min=this._userMin||a[0],this.max=this._userMax||a[a.length-1]);const i=this.min,r=ie(a,i,this.max);return this._unit=t.unit||(n.autoSkip?kr(t.minUnit,this.min,this.max,this._getLabelCapacity(i)):function(e,t,n,a,i){for(let r=br.length-1;r>=br.indexOf(n);r--){const n=br[r];if(vr[n].common&&e._adapter.diff(i,a,n)>=t-1)return n}return br[n?br.indexOf(n):0]}(this,r.length,t.minUnit,this.min,this.max)),this._majorUnit=n.major.enabled&&"year"!==this._unit?function(e){for(let t=br.indexOf(e)+1,n=br.length;t<n;++t)if(vr[br[t]].common)return br[t]}(this._unit):void 0,this.initOffsets(a),e.reverse&&r.reverse(),Sr(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let t,n,a=0,i=0;this.options.offset&&e.length&&(t=this.getDecimalForValue(e[0]),a=1===e.length?1-t:(this.getDecimalForValue(e[1])-t)/2,n=this.getDecimalForValue(e[e.length-1]),i=1===e.length?n:(n-this.getDecimalForValue(e[e.length-2]))/2);const r=e.length<3?.5:.25;a=J(a,0,r),i=J(i,0,r),this._offsets={start:a,end:i,factor:1/(a+1+i)}}_generate(){const e=this._adapter,t=this.min,n=this.max,a=this.options,i=a.time,r=i.unit||kr(i.minUnit,t,n,this._getLabelCapacity(t)),o=l(a.ticks.stepSize,1),s="week"===r&&i.isoWeekday,u=F(s)||!0===s,c={};let d,h,p=t;if(u&&(p=+e.startOf(p,"isoWeek",s)),p=+e.startOf(p,u?"day":r),e.diff(n,t,r)>1e5*o)throw new Error(t+" and "+n+" are too far apart with stepSize of "+o+" "+r);const f="data"===a.ticks.source&&this.getDataTimestamps();for(d=p,h=0;d<n;d=+e.add(d,o,r),h++)xr(c,d,f);return d!==n&&"ticks"!==a.bounds&&1!==h||xr(c,d,f),Object.keys(c).sort(yr).map(e=>+e)}getLabelForValue(e){const t=this._adapter,n=this.options.time;return n.tooltipFormat?t.format(e,n.tooltipFormat):t.format(e,n.displayFormats.datetime)}format(e,t){const n=this.options.time.displayFormats,a=this._unit,i=t||n[a];return this._adapter.format(e,i)}_tickFormatFunction(e,t,n,a){const i=this.options,r=i.ticks.callback;if(r)return d(r,[e,t,n],this);const o=i.time.displayFormats,s=this._unit,l=this._majorUnit,u=s&&o[s],c=l&&o[l],h=n[t],p=l&&c&&h&&h.major;return this._adapter.format(e,a||(p?c:u))}generateTickLabels(e){let t,n,a;for(t=0,n=e.length;t<n;++t)a=e[t],a.label=this._tickFormatFunction(a.value,t,e)}getDecimalForValue(e){return null===e?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const t=this._offsets,n=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+n)*t.factor)}getValueForPixel(e){const t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+n*(this.max-this.min)}_getLabelSize(e){const t=this.options.ticks,n=this.ctx.measureText(e).width,a=U(this.isHorizontal()?t.maxRotation:t.minRotation),i=Math.cos(a),r=Math.sin(a),o=this._resolveTickFontOptions(0).size;return{w:n*i+o*r,h:n*r+o*i}}_getLabelCapacity(e){const t=this.options.time,n=t.displayFormats,a=n[t.unit]||n.millisecond,i=this._tickFormatFunction(e,0,Sr(this,[e],this._majorUnit),a),r=this._getLabelSize(i),o=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return o>0?o:1}getDataTimestamps(){let e,t,n=this._cache.data||[];if(n.length)return n;const a=this.getMatchingVisibleMetas();if(this._normalized&&a.length)return this._cache.data=a[0].controller.getAllParsedValues(this);for(e=0,t=a.length;e<t;++e)n=n.concat(a[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(n)}getLabelTimestamps(){const e=this._cache.labels||[];let t,n;if(e.length)return e;const a=this.getLabels();for(t=0,n=a.length;t<n;++t)e.push(wr(this,a[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return le(e.sort(yr))}}function Tr(e,t,n){let a,i,r,o,s=0,l=e.length-1;n?(t>=e[s].pos&&t<=e[l].pos&&({lo:s,hi:l}=ne(e,"pos",t)),({pos:a,time:r}=e[s]),({pos:i,time:o}=e[l])):(t>=e[s].time&&t<=e[l].time&&({lo:s,hi:l}=ne(e,"time",t)),({time:a,pos:r}=e[s]),({time:i,pos:o}=e[l]));const u=i-a;return u?r+(o-r)*(t-a)/u:r}var Pr=Object.freeze({__proto__:null,CategoryScale:class extends Ga{static id="category";static defaults={ticks:{callback:tr}};constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const t=this._addedLabels;if(t.length){const e=this.getLabels();for(const{index:n,label:a}of t)e[n]===a&&e.splice(n,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(a(e))return null;const n=this.getLabels();return((e,t)=>null===e?null:J(Math.round(e),0,t))(t=isFinite(t)&&n[t]===e?t:function(e,t,n,a){const i=e.indexOf(t);return-1===i?((e,t,n,a)=>("string"==typeof t?(n=e.push(t)-1,a.unshift({index:n,label:t})):isNaN(t)&&(n=null),n))(e,t,n,a):i!==e.lastIndexOf(t)?n:i}(n,e,l(t,e),this._addedLabels),n.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let{min:n,max:a}=this.getMinMax(!0);"ticks"===this.options.bounds&&(e||(n=0),t||(a=this.getLabels().length-1)),this.min=n,this.max=a}buildTicks(){const e=this.min,t=this.max,n=this.options.offset,a=[];let i=this.getLabels();i=0===e&&t===i.length-1?i:i.slice(e,t+1),this._valueRange=Math.max(i.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let n=e;n<=t;n++)a.push({value:n});return a}getLabelForValue(e){return tr.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return"number"!=typeof e&&(e=this.parse(e)),null===e?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}},LinearScale:ir,LogarithmicScale:ur,RadialLinearScale:_r,TimeScale:Cr,TimeSeriesScale:class extends Cr{static id="timeseries";static defaults=Cr.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=Tr(t,this.min),this._tableRange=Tr(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:n}=this,a=[],i=[];let r,o,s,l,u;for(r=0,o=e.length;r<o;++r)l=e[r],l>=t&&l<=n&&a.push(l);if(a.length<2)return[{time:t,pos:0},{time:n,pos:1}];for(r=0,o=a.length;r<o;++r)u=a[r+1],s=a[r-1],l=a[r],Math.round((u+s)/2)!==l&&i.push({time:l,pos:r/(o-1)});return i}_generate(){const e=this.min,t=this.max;let n=super.getDataTimestamps();return n.includes(e)&&n.length||n.splice(0,0,e),n.includes(t)&&1!==n.length||n.push(t),n.sort((e,t)=>e-t)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),n=this.getLabelTimestamps();return e=t.length&&n.length?this.normalize(t.concat(n)):t.length?t:n,e=this._cache.all=e,e}getDecimalForValue(e){return(Tr(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return Tr(this._table,n*this._tableRange+this._minPos,!0)}}});const Er=["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)"],Ar=Er.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function Mr(e){return Er[e%Er.length]}function Lr(e){return Ar[e%Ar.length]}function Rr(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}var zr={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:a},options:i}=e.config,{elements:r}=i,o=Rr(a)||(s=i)&&(s.borderColor||s.backgroundColor)||r&&Rr(r)||"rgba(0,0,0,0.1)"!==st.borderColor||"rgba(0,0,0,0.1)"!==st.backgroundColor;var s;if(!n.forceOverride&&o)return;const l=function(e){let t=0;return(n,a)=>{const i=e.getDatasetMeta(a).controller;i instanceof Ni?t=function(e,t){return e.backgroundColor=e.data.map(()=>Mr(t++)),t}(n,t):i instanceof Oi?t=function(e,t){return e.backgroundColor=e.data.map(()=>Lr(t++)),t}(n,t):i&&(t=function(e,t){return e.borderColor=Mr(t),e.backgroundColor=Lr(t),++t}(n,t))}}(e);a.forEach(l)}};function Nr(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Or(e){e.data.datasets.forEach(e=>{Nr(e)})}var Ir={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled)return void Or(e);const i=e.width;e.data.datasets.forEach((t,r)=>{const{_data:o,indexAxis:s}=t,l=e.getDatasetMeta(r),u=o||t.data;if("y"===wn([s,e.options.indexAxis]))return;if(!l.controller.supportsDecimation)return;const c=e.scales[l.xAxisID];if("linear"!==c.type&&"time"!==c.type)return;if(e.options.parsing)return;let d,{start:h,count:p}=function(e,t){const n=t.length;let a,i=0;const{iScale:r}=e,{min:o,max:s,minDefined:l,maxDefined:u}=r.getUserBounds();return l&&(i=J(ne(t,r.axis,o).lo,0,n-1)),a=u?J(ne(t,r.axis,s).hi+1,i,n)-i:n-i,{start:i,count:a}}(l,u);if(p<=(n.threshold||4*i))Nr(t);else{switch(a(o)&&(t._data=u,delete t.data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(e){this._data=e}})),n.algorithm){case"lttb":d=function(e,t,n,a,i){const r=i.samples||a;if(r>=n)return e.slice(t,t+n);const o=[],s=(n-2)/(r-2);let l=0;const u=t+n-1;let c,d,h,p,f,m=t;for(o[l++]=e[m],c=0;c<r-2;c++){let a,i=0,r=0;const u=Math.floor((c+1)*s)+1+t,g=Math.min(Math.floor((c+2)*s)+1,n)+t,_=g-u;for(a=u;a<g;a++)i+=e[a].x,r+=e[a].y;i/=_,r/=_;const v=Math.floor(c*s)+1+t,b=Math.min(Math.floor((c+1)*s)+1,n)+t,{x:y,y:w}=e[m];for(h=p=-1,a=v;a<b;a++)p=.5*Math.abs((y-i)*(e[a].y-w)-(y-e[a].x)*(r-w)),p>h&&(h=p,d=e[a],f=a);o[l++]=d,m=f}return o[l++]=e[u],o}(u,h,p,i,n);break;case"min-max":d=function(e,t,n,i){let r,o,s,l,u,c,d,h,p,f,m=0,g=0;const _=[],v=t+n-1,b=e[t].x,y=e[v].x-b;for(r=t;r<t+n;++r){o=e[r],s=(o.x-b)/y*i,l=o.y;const t=0|s;if(t===u)l<p?(p=l,c=r):l>f&&(f=l,d=r),m=(g*m+o.x)/++g;else{const n=r-1;if(!a(c)&&!a(d)){const t=Math.min(c,d),a=Math.max(c,d);t!==h&&t!==n&&_.push({...e[t],x:m}),a!==h&&a!==n&&_.push({...e[a],x:m})}r>0&&n!==h&&_.push(e[n]),_.push(o),u=t,g=0,p=f=l,c=d=h=r}}return _}(u,h,p,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}t._decimated=d}})},destroy(e){Or(e)}};function qr(e,t,n,a){if(a)return;let i=t[e],r=n[e];return"angle"===e&&(i=Q(i),r=Q(r)),{property:e,start:i,end:r}}function Dr(e,t,n){for(;t>e;t--){const e=n[t];if(!isNaN(e.x)&&!isNaN(e.y))break}return t}function jr(e,t,n,a){return e&&t?a(e[n],t[n]):e?e[n]:t?t[n]:0}function Br(e,t){let n=[],a=!1;return i(e)?(a=!0,n=e):n=function(e,t){const{x:n=null,y:a=null}=e||{},i=t.points,r=[];return t.segments.forEach(({start:e,end:t})=>{t=Dr(e,t,i);const o=i[e],s=i[t];null!==a?(r.push({x:o.x,y:a}),r.push({x:s.x,y:a})):null!==n&&(r.push({x:n,y:o.y}),r.push({x:n,y:s.y}))}),r}(e,t),n.length?new Wi({points:n,options:{tension:0},_loop:a,_fullLoop:a}):null}function Fr(e){return e&&!1!==e.fill}function $r(e,t,n){let a=e[t].fill;const i=[t];let r;if(!n)return a;for(;!1!==a&&-1===i.indexOf(a);){if(!o(a))return a;if(r=e[a],!r)return!1;if(r.visible)return a;i.push(a),a=r.fill}return!1}function Vr(e,t,n){const a=function(e){const t=e.options,n=t.fill;let a=l(n&&n.target,n);return void 0===a&&(a=!!t.backgroundColor),!1!==a&&null!==a&&(!0===a?"origin":a)}(e);if(r(a))return!isNaN(a.value)&&a;let i=parseFloat(a);return o(i)&&Math.floor(i)===i?function(e,t,n,a){return"-"!==e&&"+"!==e||(n=t+n),!(n===t||n<0||n>=a)&&n}(a[0],t,i,n):["origin","start","end","stack","shape"].indexOf(a)>=0&&a}function Ur(e,t,n){const a=[];for(let i=0;i<n.length;i++){const r=n[i],{first:o,last:s,point:l}=Hr(r,t,"x");if(!(!l||o&&s))if(o)a.unshift(l);else if(e.push(l),!s)break}e.push(...a)}function Hr(e,t,n){const a=e.interpolate(t,n);if(!a)return{};const i=a[n],r=e.segments,o=e.points;let s=!1,l=!1;for(let e=0;e<r.length;e++){const t=r[e],a=o[t.start][n],u=o[t.end][n];if(ee(i,a,u)){s=i===a,l=i===u;break}}return{first:s,last:l,point:a}}class Wr{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,n){const{x:a,y:i,radius:r}=this;return t=t||{start:0,end:A},e.arc(a,i,r,t.end,t.start,!0),!n.bounds}interpolate(e){const{x:t,y:n,radius:a}=this,i=e.angle;return{x:t+Math.cos(i)*a,y:n+Math.sin(i)*a,angle:i}}}function Gr(e){const{chart:t,fill:n,line:a}=e;if(o(n))return function(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}(t,n);if("stack"===n)return function(e){const{scale:t,index:n,line:a}=e,i=[],r=a.segments,o=a.points,s=function(e,t){const n=[],a=e.getMatchingVisibleMetas("line");for(let e=0;e<a.length;e++){const i=a[e];if(i.index===t)break;i.hidden||n.unshift(i.dataset)}return n}(t,n);s.push(Br({x:null,y:t.bottom},a));for(let e=0;e<r.length;e++){const t=r[e];for(let e=t.start;e<=t.end;e++)Ur(i,o[e],s)}return new Wi({points:i,options:{}})}(e);if("shape"===n)return!0;const i=function(e){return(e.scale||{}).getPointPositionForValue?function(e){const{scale:t,fill:n}=e,a=t.options,i=t.getLabels().length,o=a.reverse?t.max:t.min,s=function(e,t,n){let a;return a="start"===e?n:"end"===e?t.options.reverse?t.min:t.max:r(e)?e.value:t.getBaseValue(),a}(n,t,o),l=[];if(a.grid.circular){const e=t.getPointPositionForValue(0,o);return new Wr({x:e.x,y:e.y,radius:t.getDistanceFromCenterForValue(s)})}for(let e=0;e<i;++e)l.push(t.getPointPositionForValue(e,s));return l}(e):function(e){const{scale:t={},fill:n}=e,a=function(e,t){let n=null;return"start"===e?n=t.bottom:"end"===e?n=t.top:r(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}(n,t);if(o(a)){const e=t.isHorizontal();return{x:e?a:null,y:e?null:a}}return null}(e)}(e);return i instanceof Wr?i:Br(i,a)}function Yr(e,t,n){const a=Gr(t),{chart:i,index:r,line:o,scale:s,axis:l}=t,u=o.options,c=u.fill,d=u.backgroundColor,{above:h=d,below:p=d}=c||{},f=i.getDatasetMeta(r),m=In(i,f);a&&o.points.length&&(At(e,n),function(e,t){const{line:n,target:a,above:i,below:r,area:o,scale:s,clip:l}=t,u=n._loop?"angle":t.axis;e.save();let c=r;r!==i&&("x"===u?(Kr(e,a,o.top),Zr(e,{line:n,target:a,color:i,scale:s,property:u,clip:l}),e.restore(),e.save(),Kr(e,a,o.bottom)):"y"===u&&(Qr(e,a,o.left),Zr(e,{line:n,target:a,color:r,scale:s,property:u,clip:l}),e.restore(),e.save(),Qr(e,a,o.right),c=i)),Zr(e,{line:n,target:a,color:c,scale:s,property:u,clip:l}),e.restore()}(e,{line:o,target:a,above:h,below:p,area:n,scale:s,axis:l,clip:m}),Mt(e))}function Kr(e,t,n){const{segments:a,points:i}=t;let r=!0,o=!1;e.beginPath();for(const s of a){const{start:a,end:l}=s,u=i[a],c=i[Dr(a,l,i)];r?(e.moveTo(u.x,u.y),r=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),o=!!t.pathSegment(e,s,{move:o}),o?e.closePath():e.lineTo(c.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function Qr(e,t,n){const{segments:a,points:i}=t;let r=!0,o=!1;e.beginPath();for(const s of a){const{start:a,end:l}=s,u=i[a],c=i[Dr(a,l,i)];r?(e.moveTo(u.x,u.y),r=!1):(e.lineTo(n,u.y),e.lineTo(u.x,u.y)),o=!!t.pathSegment(e,s,{move:o}),o?e.closePath():e.lineTo(n,c.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function Zr(e,t){const{line:n,target:a,property:i,color:r,scale:o,clip:s}=t,l=function(e,t,n){const a=e.segments,i=e.points,r=t.points,o=[];for(const e of a){let{start:a,end:s}=e;s=Dr(a,s,i);const l=qr(n,i[a],i[s],e.loop);if(!t.segments){o.push({source:e,target:l,start:i[a],end:i[s]});continue}const u=Mn(t,l);for(const t of u){const a=qr(n,r[t.start],r[t.end],t.loop),s=An(e,i,a);for(const e of s)o.push({source:e,target:t,start:{[n]:jr(l,a,"start",Math.max)},end:{[n]:jr(l,a,"end",Math.min)}})}}return o}(n,a,i);for(const{source:t,target:u,start:c,end:d}of l){const{style:{backgroundColor:l=r}={}}=t,h=!0!==a;e.save(),e.fillStyle=l,Jr(e,o,s,h&&qr(i,c,d)),e.beginPath();const p=!!n.pathSegment(e,t);let f;if(h){p?e.closePath():Xr(e,a,d,i);const t=!!a.pathSegment(e,u,{move:p,reverse:!0});f=p&&t,f||Xr(e,a,c,i)}e.closePath(),e.fill(f?"evenodd":"nonzero"),e.restore()}}function Jr(e,t,n,a){const i=t.chart.chartArea,{property:r,start:o,end:s}=a||{};if("x"===r||"y"===r){let t,a,l,u;"x"===r?(t=o,a=i.top,l=s,u=i.bottom):(t=i.left,a=o,l=i.right,u=s),e.beginPath(),n&&(t=Math.max(t,n.left),l=Math.min(l,n.right),a=Math.max(a,n.top),u=Math.min(u,n.bottom)),e.rect(t,a,l-t,u-a),e.clip()}}function Xr(e,t,n,a){const i=t.interpolate(n,a);i&&e.lineTo(i.x,i.y)}var eo={id:"filler",afterDatasetsUpdate(e,t,n){const a=(e.data.datasets||[]).length,i=[];let r,o,s,l;for(o=0;o<a;++o)r=e.getDatasetMeta(o),s=r.dataset,l=null,s&&s.options&&s instanceof Wi&&(l={visible:e.isDatasetVisible(o),index:o,fill:Vr(s,o,a),chart:e,axis:r.controller.options.indexAxis,scale:r.vScale,line:s}),r.$filler=l,i.push(l);for(o=0;o<a;++o)l=i[o],l&&!1!==l.fill&&(l.fill=$r(i,o,n.propagate))},beforeDraw(e,t,n){const a="beforeDraw"===n.drawTime,i=e.getSortedVisibleDatasetMetas(),r=e.chartArea;for(let t=i.length-1;t>=0;--t){const n=i[t].$filler;n&&(n.line.updateControlPoints(r,n.axis),a&&n.fill&&Yr(e.ctx,n,r))}},beforeDatasetsDraw(e,t,n){if("beforeDatasetsDraw"!==n.drawTime)return;const a=e.getSortedVisibleDatasetMetas();for(let t=a.length-1;t>=0;--t){const n=a[t].$filler;Fr(n)&&Yr(e.ctx,n,e.chartArea)}},beforeDatasetDraw(e,t,n){const a=t.meta.$filler;Fr(a)&&"beforeDatasetDraw"===n.drawTime&&Yr(e.ctx,a,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const to=(e,t)=>{let{boxHeight:n=t,boxWidth:a=t}=e;return e.usePointStyle&&(n=Math.min(n,t),a=e.pointStyleWidth||Math.min(a,t)),{boxWidth:a,boxHeight:n,itemHeight:Math.max(t,n)}};class no extends qa{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,t,n){this.maxWidth=e,this.maxHeight=t,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const e=this.options.labels||{};let t=d(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter(t=>e.filter(t,this.chart.data))),e.sort&&(t=t.sort((t,n)=>e.sort(t,n,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){const{options:e,ctx:t}=this;if(!e.display)return void(this.width=this.height=0);const n=e.labels,a=yn(n.font),i=a.size,r=this._computeTitleHeight(),{boxWidth:o,itemHeight:s}=to(n,i);let l,u;t.font=a.string,this.isHorizontal()?(l=this.maxWidth,u=this._fitRows(r,i,o,s)+10):(u=this.maxHeight,l=this._fitCols(r,a,o,s)+10),this.width=Math.min(l,e.maxWidth||this.maxWidth),this.height=Math.min(u,e.maxHeight||this.maxHeight)}_fitRows(e,t,n,a){const{ctx:i,maxWidth:r,options:{labels:{padding:o}}}=this,s=this.legendHitBoxes=[],l=this.lineWidths=[0],u=a+o;let c=e;i.textAlign="left",i.textBaseline="middle";let d=-1,h=-u;return this.legendItems.forEach((e,p)=>{const f=n+t/2+i.measureText(e.text).width;(0===p||l[l.length-1]+f+2*o>r)&&(c+=u,l[l.length-(p>0?0:1)]=0,h+=u,d++),s[p]={left:0,top:h,row:d,width:f,height:a},l[l.length-1]+=f+o}),c}_fitCols(e,t,n,a){const{ctx:i,maxHeight:r,options:{labels:{padding:o}}}=this,s=this.legendHitBoxes=[],l=this.columnSizes=[],u=r-e;let c=o,d=0,h=0,p=0,f=0;return this.legendItems.forEach((e,r)=>{const{itemWidth:m,itemHeight:g}=function(e,t,n,a,i){const r=function(e,t,n,a){let i=e.text;return i&&"string"!=typeof i&&(i=i.reduce((e,t)=>e.length>t.length?e:t)),t+n.size/2+a.measureText(i).width}(a,e,t,n),o=function(e,t,n){let a=e;return"string"!=typeof t.text&&(a=ao(t,n)),a}(i,a,t.lineHeight);return{itemWidth:r,itemHeight:o}}(n,t,i,e,a);r>0&&h+g+2*o>u&&(c+=d+o,l.push({width:d,height:h}),p+=d+o,f++,d=h=0),s[r]={left:p,top:h,col:f,width:m,height:g},d=Math.max(d,m),h+=g+o}),c+=d,l.push({width:d,height:h}),c}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:n,labels:{padding:a},rtl:i}}=this,r=Sn(i,this.left,this.width);if(this.isHorizontal()){let i=0,o=pe(n,this.left+a,this.right-this.lineWidths[i]);for(const s of t)i!==s.row&&(i=s.row,o=pe(n,this.left+a,this.right-this.lineWidths[i])),s.top+=this.top+e+a,s.left=r.leftForLtr(r.x(o),s.width),o+=s.width+a}else{let i=0,o=pe(n,this.top+e+a,this.bottom-this.columnSizes[i].height);for(const s of t)s.col!==i&&(i=s.col,o=pe(n,this.top+e+a,this.bottom-this.columnSizes[i].height)),s.top=o,s.left+=this.left+a,s.left=r.leftForLtr(r.x(s.left),s.width),o+=s.height+a}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const e=this.ctx;At(e,this),this._draw(),Mt(e)}}_draw(){const{options:e,columnSizes:t,lineWidths:n,ctx:a}=this,{align:i,labels:r}=e,o=st.color,s=Sn(e.rtl,this.left,this.width),u=yn(r.font),{padding:c}=r,d=u.size,h=d/2;let p;this.drawTitle(),a.textAlign=s.textAlign("left"),a.textBaseline="middle",a.lineWidth=.5,a.font=u.string;const{boxWidth:f,boxHeight:m,itemHeight:g}=to(r,d),_=this.isHorizontal(),v=this._computeTitleHeight();p=_?{x:pe(i,this.left+c,this.right-n[0]),y:this.top+c+v,line:0}:{x:this.left+c,y:pe(i,this.top+v+c,this.bottom-t[0].height),line:0},Cn(this.ctx,e.textDirection);const b=g+c;this.legendItems.forEach((y,w)=>{a.strokeStyle=y.fontColor,a.fillStyle=y.fontColor;const k=a.measureText(y.text).width,x=s.textAlign(y.textAlign||(y.textAlign=r.textAlign)),S=f+h+k;let C=p.x,T=p.y;if(s.setWidth(this.width),_?w>0&&C+S+c>this.right&&(T=p.y+=b,p.line++,C=p.x=pe(i,this.left+c,this.right-n[p.line])):w>0&&T+b>this.bottom&&(C=p.x=C+t[p.line].width+c,p.line++,T=p.y=pe(i,this.top+v+c,this.bottom-t[p.line].height)),function(e,t,n){if(isNaN(f)||f<=0||isNaN(m)||m<0)return;a.save();const i=l(n.lineWidth,1);if(a.fillStyle=l(n.fillStyle,o),a.lineCap=l(n.lineCap,"butt"),a.lineDashOffset=l(n.lineDashOffset,0),a.lineJoin=l(n.lineJoin,"miter"),a.lineWidth=i,a.strokeStyle=l(n.strokeStyle,o),a.setLineDash(l(n.lineDash,[])),r.usePointStyle){const o={radius:m*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:i},l=s.xPlus(e,f/2);Pt(a,o,l,t+h,r.pointStyleWidth&&f)}else{const r=t+Math.max((d-m)/2,0),o=s.leftForLtr(e,f),l=vn(n.borderRadius);a.beginPath(),Object.values(l).some(e=>0!==e)?It(a,{x:o,y:r,w:f,h:m,radius:l}):a.rect(o,r,f,m),a.fill(),0!==i&&a.stroke()}a.restore()}(s.x(C),T,y),C=fe(x,C+f+h,_?C+S:this.right,e.rtl),function(e,t,n){Ot(a,n.text,e,t+g/2,u,{strikethrough:n.hidden,textAlign:s.textAlign(n.textAlign)})}(s.x(C),T,y),_)p.x+=S+c;else if("string"!=typeof y.text){const e=u.lineHeight;p.y+=ao(y,e)+c}else p.y+=b}),Tn(this.ctx,e.textDirection)}drawTitle(){const e=this.options,t=e.title,n=yn(t.font),a=bn(t.padding);if(!t.display)return;const i=Sn(e.rtl,this.left,this.width),r=this.ctx,o=t.position,s=n.size/2,l=a.top+s;let u,c=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),u=this.top+l,c=pe(e.align,c,this.right-d);else{const t=this.columnSizes.reduce((e,t)=>Math.max(e,t.height),0);u=l+pe(e.align,this.top,this.bottom-t-e.labels.padding-this._computeTitleHeight())}const h=pe(o,c,c+d);r.textAlign=i.textAlign(he(o)),r.textBaseline="middle",r.strokeStyle=t.color,r.fillStyle=t.color,r.font=n.string,Ot(r,t.text,h,u,n)}_computeTitleHeight(){const e=this.options.title,t=yn(e.font),n=bn(e.padding);return e.display?t.lineHeight+n.height:0}_getLegendItemAt(e,t){let n,a,i;if(ee(e,this.left,this.right)&&ee(t,this.top,this.bottom))for(i=this.legendHitBoxes,n=0;n<i.length;++n)if(a=i[n],ee(e,a.left,a.left+a.width)&&ee(t,a.top,a.top+a.height))return this.legendItems[n];return null}handleEvent(e){const t=this.options;if(!function(e,t){return!("mousemove"!==e&&"mouseout"!==e||!t.onHover&&!t.onLeave)||!(!t.onClick||"click"!==e&&"mouseup"!==e)}(e.type,t))return;const n=this._getLegendItemAt(e.x,e.y);if("mousemove"===e.type||"mouseout"===e.type){const r=this._hoveredItem,o=(i=n,null!==(a=r)&&null!==i&&a.datasetIndex===i.datasetIndex&&a.index===i.index);r&&!o&&d(t.onLeave,[e,r,this],this),this._hoveredItem=n,n&&!o&&d(t.onHover,[e,n,this],this)}else n&&d(t.onClick,[e,n,this],this);var a,i}}function ao(e,t){return t*(e.text?e.text.length:0)}var io={id:"legend",_element:no,start(e,t,n){const a=e.legend=new no({ctx:e.ctx,options:n,chart:e});ta.configure(e,a,n),ta.addBox(e,a)},stop(e){ta.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const a=e.legend;ta.configure(e,a,n),a.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const a=t.datasetIndex,i=n.chart;i.isDatasetVisible(a)?(i.hide(a),t.hidden=!0):(i.show(a),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:a,textAlign:i,color:r,useBorderRadius:o,borderRadius:s}}=e.legend.options;return e._getSortedDatasetMetas().map(e=>{const l=e.controller.getStyle(n?0:void 0),u=bn(l.borderWidth);return{text:t[e.index].label,fillStyle:l.backgroundColor,fontColor:r,hidden:!e.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:l.borderColor,pointStyle:a||l.pointStyle,rotation:l.rotation,textAlign:i||l.textAlign,borderRadius:o&&(s||l.borderRadius),datasetIndex:e.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class ro extends qa{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,t){const n=this.options;if(this.left=0,this.top=0,!n.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=e,this.height=this.bottom=t;const a=i(n.text)?n.text.length:1;this._padding=bn(n.padding);const r=a*yn(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const e=this.options.position;return"top"===e||"bottom"===e}_drawArgs(e){const{top:t,left:n,bottom:a,right:i,options:r}=this,o=r.align;let s,l,u,c=0;return this.isHorizontal()?(l=pe(o,n,i),u=t+e,s=i-n):("left"===r.position?(l=n+e,u=pe(o,a,t),c=-.5*E):(l=i-e,u=pe(o,t,a),c=.5*E),s=a-t),{titleX:l,titleY:u,maxWidth:s,rotation:c}}draw(){const e=this.ctx,t=this.options;if(!t.display)return;const n=yn(t.font),a=n.lineHeight/2+this._padding.top,{titleX:i,titleY:r,maxWidth:o,rotation:s}=this._drawArgs(a);Ot(e,t.text,0,0,n,{color:t.color,maxWidth:o,rotation:s,textAlign:he(t.align),textBaseline:"middle",translation:[i,r]})}}var oo={id:"title",_element:ro,start(e,t,n){!function(e,t){const n=new ro({ctx:e.ctx,options:t,chart:e});ta.configure(e,n,t),ta.addBox(e,n),e.titleBlock=n}(e,n)},stop(e){const t=e.titleBlock;ta.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const a=e.titleBlock;ta.configure(e,a,n),a.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const so=new WeakMap;var lo={id:"subtitle",start(e,t,n){const a=new ro({ctx:e.ctx,options:n,chart:e});ta.configure(e,a,n),ta.addBox(e,a),so.set(e,a)},stop(e){ta.removeBox(e,so.get(e)),so.delete(e)},beforeUpdate(e,t,n){const a=so.get(e);ta.configure(e,a,n),a.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const uo={average(e){if(!e.length)return!1;let t,n,a=new Set,i=0,r=0;for(t=0,n=e.length;t<n;++t){const n=e[t].element;if(n&&n.hasValue()){const e=n.tooltipPosition();a.add(e.x),i+=e.y,++r}}return 0!==r&&0!==a.size&&{x:[...a].reduce((e,t)=>e+t)/a.size,y:i/r}},nearest(e,t){if(!e.length)return!1;let n,a,i,r=t.x,o=t.y,s=Number.POSITIVE_INFINITY;for(n=0,a=e.length;n<a;++n){const a=e[n].element;if(a&&a.hasValue()){const e=Y(t,a.getCenterPoint());e<s&&(s=e,i=a)}}if(i){const e=i.tooltipPosition();r=e.x,o=e.y}return{x:r,y:o}}};function co(e,t){return t&&(i(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function ho(e){return("string"==typeof e||e instanceof String)&&e.indexOf("\n")>-1?e.split("\n"):e}function po(e,t){const{element:n,datasetIndex:a,index:i}=t,r=e.getDatasetMeta(a).controller,{label:o,value:s}=r.getLabelAndValue(i);return{chart:e,label:o,parsed:r.getParsed(i),raw:e.data.datasets[a].data[i],formattedValue:s,dataset:r.getDataset(),dataIndex:i,datasetIndex:a,element:n}}function fo(e,t){const n=e.chart.ctx,{body:a,footer:i,title:r}=e,{boxWidth:o,boxHeight:s}=t,l=yn(t.bodyFont),u=yn(t.titleFont),c=yn(t.footerFont),d=r.length,p=i.length,f=a.length,m=bn(t.padding);let g=m.height,_=0,v=a.reduce((e,t)=>e+t.before.length+t.lines.length+t.after.length,0);v+=e.beforeBody.length+e.afterBody.length,d&&(g+=d*u.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),v&&(g+=f*(t.displayColors?Math.max(s,l.lineHeight):l.lineHeight)+(v-f)*l.lineHeight+(v-1)*t.bodySpacing),p&&(g+=t.footerMarginTop+p*c.lineHeight+(p-1)*t.footerSpacing);let b=0;const y=function(e){_=Math.max(_,n.measureText(e).width+b)};return n.save(),n.font=u.string,h(e.title,y),n.font=l.string,h(e.beforeBody.concat(e.afterBody),y),b=t.displayColors?o+2+t.boxPadding:0,h(a,e=>{h(e.before,y),h(e.lines,y),h(e.after,y)}),b=0,n.font=c.string,h(e.footer,y),n.restore(),_+=m.width,{width:_,height:g}}function mo(e,t,n,a){const{x:i,width:r}=n,{width:o,chartArea:{left:s,right:l}}=e;let u="center";return"center"===a?u=i<=(s+l)/2?"left":"right":i<=r/2?u="left":i>=o-r/2&&(u="right"),function(e,t,n,a){const{x:i,width:r}=a,o=n.caretSize+n.caretPadding;return"left"===e&&i+r+o>t.width||"right"===e&&i-r-o<0||void 0}(u,e,t,n)&&(u="center"),u}function go(e,t,n){const a=n.yAlign||t.yAlign||function(e,t){const{y:n,height:a}=t;return n<a/2?"top":n>e.height-a/2?"bottom":"center"}(e,n);return{xAlign:n.xAlign||t.xAlign||mo(e,t,n,a),yAlign:a}}function _o(e,t,n,a){const{caretSize:i,caretPadding:r,cornerRadius:o}=e,{xAlign:s,yAlign:l}=n,u=i+r,{topLeft:c,topRight:d,bottomLeft:h,bottomRight:p}=vn(o);let f=function(e,t){let{x:n,width:a}=e;return"right"===t?n-=a:"center"===t&&(n-=a/2),n}(t,s);const m=function(e,t,n){let{y:a,height:i}=e;return"top"===t?a+=n:a-="bottom"===t?i+n:i/2,a}(t,l,u);return"center"===l?"left"===s?f+=u:"right"===s&&(f-=u):"left"===s?f-=Math.max(c,h)+i:"right"===s&&(f+=Math.max(d,p)+i),{x:J(f,0,a.width-t.width),y:J(m,0,a.height-t.height)}}function vo(e,t,n){const a=bn(n.padding);return"center"===t?e.x+e.width/2:"right"===t?e.x+e.width-a.right:e.x+a.left}function bo(e){return co([],ho(e))}function yo(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const wo={beforeTitle:t,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,a=n?n.length:0;if(this&&this.options&&"dataset"===this.options.mode)return t.dataset.label||"";if(t.label)return t.label;if(a>0&&t.dataIndex<a)return n[t.dataIndex]}return""},afterTitle:t,beforeBody:t,beforeLabel:t,label(e){if(this&&this.options&&"dataset"===this.options.mode)return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return a(n)||(t+=n),t},labelColor(e){const t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:t,afterBody:t,beforeFooter:t,footer:t,afterFooter:t};function ko(e,t,n,a){const i=e[t].call(n,a);return void 0===i?wo[t].call(n,a):i}class xo extends qa{static positioners=uo;constructor(e){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=e.chart,this.options=e.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(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,n=this.options.setContext(this.getContext()),a=n.enabled&&t.options.animation&&n.animations,i=new Sa(this.chart,a);return a._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=xn(this.chart.getContext(),{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"}))}getTitle(e,t){const{callbacks:n}=t,a=ko(n,"beforeTitle",this,e),i=ko(n,"title",this,e),r=ko(n,"afterTitle",this,e);let o=[];return o=co(o,ho(a)),o=co(o,ho(i)),o=co(o,ho(r)),o}getBeforeBody(e,t){return bo(ko(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:n}=t,a=[];return h(e,e=>{const t={before:[],lines:[],after:[]},i=yo(n,e);co(t.before,ho(ko(i,"beforeLabel",this,e))),co(t.lines,ko(i,"label",this,e)),co(t.after,ho(ko(i,"afterLabel",this,e))),a.push(t)}),a}getAfterBody(e,t){return bo(ko(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:n}=t,a=ko(n,"beforeFooter",this,e),i=ko(n,"footer",this,e),r=ko(n,"afterFooter",this,e);let o=[];return o=co(o,ho(a)),o=co(o,ho(i)),o=co(o,ho(r)),o}_createItems(e){const t=this._active,n=this.chart.data,a=[],i=[],r=[];let o,s,l=[];for(o=0,s=t.length;o<s;++o)l.push(po(this.chart,t[o]));return e.filter&&(l=l.filter((t,a,i)=>e.filter(t,a,i,n))),e.itemSort&&(l=l.sort((t,a)=>e.itemSort(t,a,n))),h(l,t=>{const n=yo(e.callbacks,t);a.push(ko(n,"labelColor",this,t)),i.push(ko(n,"labelPointStyle",this,t)),r.push(ko(n,"labelTextColor",this,t))}),this.labelColors=a,this.labelPointStyles=i,this.labelTextColors=r,this.dataPoints=l,l}update(e,t){const n=this.options.setContext(this.getContext()),a=this._active;let i,r=[];if(a.length){const e=uo[n.position].call(this,a,this._eventPosition);r=this._createItems(n),this.title=this.getTitle(r,n),this.beforeBody=this.getBeforeBody(r,n),this.body=this.getBody(r,n),this.afterBody=this.getAfterBody(r,n),this.footer=this.getFooter(r,n);const t=this._size=fo(this,n),o=Object.assign({},e,t),s=go(this.chart,n,o),l=_o(n,o,s,this.chart);this.xAlign=s.xAlign,this.yAlign=s.yAlign,i={opacity:1,x:l.x,y:l.y,width:t.width,height:t.height,caretX:e.x,caretY:e.y}}else 0!==this.opacity&&(i={opacity:0});this._tooltipItems=r,this.$context=void 0,i&&this._resolveAnimations().update(this,i),e&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,n,a){const i=this.getCaretPosition(e,n,a);t.lineTo(i.x1,i.y1),t.lineTo(i.x2,i.y2),t.lineTo(i.x3,i.y3)}getCaretPosition(e,t,n){const{xAlign:a,yAlign:i}=this,{caretSize:r,cornerRadius:o}=n,{topLeft:s,topRight:l,bottomLeft:u,bottomRight:c}=vn(o),{x:d,y:h}=e,{width:p,height:f}=t;let m,g,_,v,b,y;return"center"===i?(b=h+f/2,"left"===a?(m=d,g=m-r,v=b+r,y=b-r):(m=d+p,g=m+r,v=b-r,y=b+r),_=m):(g="left"===a?d+Math.max(s,u)+r:"right"===a?d+p-Math.max(l,c)-r:this.caretX,"top"===i?(v=h,b=v-r,m=g-r,_=g+r):(v=h+f,b=v+r,m=g+r,_=g-r),y=v),{x1:m,x2:g,x3:_,y1:v,y2:b,y3:y}}drawTitle(e,t,n){const a=this.title,i=a.length;let r,o,s;if(i){const l=Sn(n.rtl,this.x,this.width);for(e.x=vo(this,n.titleAlign,n),t.textAlign=l.textAlign(n.titleAlign),t.textBaseline="middle",r=yn(n.titleFont),o=n.titleSpacing,t.fillStyle=n.titleColor,t.font=r.string,s=0;s<i;++s)t.fillText(a[s],l.x(e.x),e.y+r.lineHeight/2),e.y+=r.lineHeight+o,s+1===i&&(e.y+=n.titleMarginBottom-o)}}_drawColorBox(e,t,n,a,i){const o=this.labelColors[n],s=this.labelPointStyles[n],{boxHeight:l,boxWidth:u}=i,c=yn(i.bodyFont),d=vo(this,"left",i),h=a.x(d),p=l<c.lineHeight?(c.lineHeight-l)/2:0,f=t.y+p;if(i.usePointStyle){const t={radius:Math.min(u,l)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},n=a.leftForLtr(h,u)+u/2,r=f+l/2;e.strokeStyle=i.multiKeyBackground,e.fillStyle=i.multiKeyBackground,Tt(e,t,n,r),e.strokeStyle=o.borderColor,e.fillStyle=o.backgroundColor,Tt(e,t,n,r)}else{e.lineWidth=r(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,e.strokeStyle=o.borderColor,e.setLineDash(o.borderDash||[]),e.lineDashOffset=o.borderDashOffset||0;const t=a.leftForLtr(h,u),n=a.leftForLtr(a.xPlus(h,1),u-2),s=vn(o.borderRadius);Object.values(s).some(e=>0!==e)?(e.beginPath(),e.fillStyle=i.multiKeyBackground,It(e,{x:t,y:f,w:u,h:l,radius:s}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),It(e,{x:n,y:f+1,w:u-2,h:l-2,radius:s}),e.fill()):(e.fillStyle=i.multiKeyBackground,e.fillRect(t,f,u,l),e.strokeRect(t,f,u,l),e.fillStyle=o.backgroundColor,e.fillRect(n,f+1,u-2,l-2))}e.fillStyle=this.labelTextColors[n]}drawBody(e,t,n){const{body:a}=this,{bodySpacing:i,bodyAlign:r,displayColors:o,boxHeight:s,boxWidth:l,boxPadding:u}=n,c=yn(n.bodyFont);let d=c.lineHeight,p=0;const f=Sn(n.rtl,this.x,this.width),m=function(n){t.fillText(n,f.x(e.x+p),e.y+d/2),e.y+=d+i},g=f.textAlign(r);let _,v,b,y,w,k,x;for(t.textAlign=r,t.textBaseline="middle",t.font=c.string,e.x=vo(this,g,n),t.fillStyle=n.bodyColor,h(this.beforeBody,m),p=o&&"right"!==g?"center"===r?l/2+u:l+2+u:0,y=0,k=a.length;y<k;++y){for(_=a[y],v=this.labelTextColors[y],t.fillStyle=v,h(_.before,m),b=_.lines,o&&b.length&&(this._drawColorBox(t,e,y,f,n),d=Math.max(c.lineHeight,s)),w=0,x=b.length;w<x;++w)m(b[w]),d=c.lineHeight;h(_.after,m)}p=0,d=c.lineHeight,h(this.afterBody,m),e.y-=i}drawFooter(e,t,n){const a=this.footer,i=a.length;let r,o;if(i){const s=Sn(n.rtl,this.x,this.width);for(e.x=vo(this,n.footerAlign,n),e.y+=n.footerMarginTop,t.textAlign=s.textAlign(n.footerAlign),t.textBaseline="middle",r=yn(n.footerFont),t.fillStyle=n.footerColor,t.font=r.string,o=0;o<i;++o)t.fillText(a[o],s.x(e.x),e.y+r.lineHeight/2),e.y+=r.lineHeight+n.footerSpacing}}drawBackground(e,t,n,a){const{xAlign:i,yAlign:r}=this,{x:o,y:s}=e,{width:l,height:u}=n,{topLeft:c,topRight:d,bottomLeft:h,bottomRight:p}=vn(a.cornerRadius);t.fillStyle=a.backgroundColor,t.strokeStyle=a.borderColor,t.lineWidth=a.borderWidth,t.beginPath(),t.moveTo(o+c,s),"top"===r&&this.drawCaret(e,t,n,a),t.lineTo(o+l-d,s),t.quadraticCurveTo(o+l,s,o+l,s+d),"center"===r&&"right"===i&&this.drawCaret(e,t,n,a),t.lineTo(o+l,s+u-p),t.quadraticCurveTo(o+l,s+u,o+l-p,s+u),"bottom"===r&&this.drawCaret(e,t,n,a),t.lineTo(o+h,s+u),t.quadraticCurveTo(o,s+u,o,s+u-h),"center"===r&&"left"===i&&this.drawCaret(e,t,n,a),t.lineTo(o,s+c),t.quadraticCurveTo(o,s,o+c,s),t.closePath(),t.fill(),a.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,n=this.$animations,a=n&&n.x,i=n&&n.y;if(a||i){const n=uo[e.position].call(this,this._active,this._eventPosition);if(!n)return;const r=this._size=fo(this,e),o=Object.assign({},n,this._size),s=go(t,e,o),l=_o(e,o,s,t);a._to===l.x&&i._to===l.y||(this.xAlign=s.xAlign,this.yAlign=s.yAlign,this.width=r.width,this.height=r.height,this.caretX=n.x,this.caretY=n.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(t);const a={width:this.width,height:this.height},i={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const r=bn(t.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&o&&(e.save(),e.globalAlpha=n,this.drawBackground(i,e,a,t),Cn(e,t.textDirection),i.y+=r.top,this.drawTitle(i,e,t),this.drawBody(i,e,t),this.drawFooter(i,e,t),Tn(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const n=this._active,a=e.map(({datasetIndex:e,index:t})=>{const n=this.chart.getDatasetMeta(e);if(!n)throw new Error("Cannot find a dataset at index "+e);return{datasetIndex:e,element:n.data[t],index:t}}),i=!p(n,a),r=this._positionChanged(a,t);(i||r)&&(this._active=a,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,n=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const a=this.options,i=this._active||[],r=this._getActiveElements(e,i,t,n),o=this._positionChanged(r,e),s=t||!p(r,i)||o;return s&&(this._active=r,(a.enabled||a.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),s}_getActiveElements(e,t,n,a){const i=this.options;if("mouseout"===e.type)return[];if(!a)return t.filter(e=>this.chart.data.datasets[e.datasetIndex]&&void 0!==this.chart.getDatasetMeta(e.datasetIndex).controller.getParsed(e.index));const r=this.chart.getElementsAtEventForMode(e,i.mode,i,n);return i.reverse&&r.reverse(),r}_positionChanged(e,t){const{caretX:n,caretY:a,options:i}=this,r=uo[i.position].call(this,e,t);return!1!==r&&(n!==r.x||a!==r.y)}}var So={id:"tooltip",_element:xo,positioners:uo,afterInit(e,t,n){n&&(e.tooltip=new xo({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(!1===e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0}))return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:wo},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>"filter"!==e&&"itemSort"!==e&&"external"!==e,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};return wi.register(Ii,Pr,er,e),wi.helpers={...qn},wi._adapters=Ci,wi.Animation=xa,wi.Animations=Sa,wi.animator=_e,wi.controllers=Ka.controllers.items,wi.DatasetController=Ia,wi.Element=qa,wi.elements=er,wi.Interaction=Vn,wi.layouts=ta,wi.platforms=ya,wi.Scale=Ga,wi.Ticks=nt,Object.assign(wi,Ii,Pr,er,e,ya),wi.Chart=wi,"undefined"!=typeof window&&(window.Chart=wi),wi}),/*! showdown v 2.1.0 - 21-04-2022 */
-function(){function e(e){"use strict";var t={omitExtraWLInCodeBlocks:{defaultValue:!1,describe:"Omit the default extra whiteline added to code blocks",type:"boolean"},noHeaderId:{defaultValue:!1,describe:"Turn on/off generated header id",type:"boolean"},prefixHeaderId:{defaultValue:!1,describe:"Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix",type:"string"},rawPrefixHeaderId:{defaultValue:!1,describe:'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',type:"boolean"},ghCompatibleHeaderId:{defaultValue:!1,describe:"Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",type:"boolean"},rawHeaderId:{defaultValue:!1,describe:"Remove only spaces, ' and \" from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids",type:"boolean"},headerLevelStart:{defaultValue:!1,describe:"The header blocks level start",type:"integer"},parseImgDimensions:{defaultValue:!1,describe:"Turn on/off image dimension parsing",type:"boolean"},simplifiedAutoLink:{defaultValue:!1,describe:"Turn on/off GFM autolink style",type:"boolean"},excludeTrailingPunctuationFromURLs:{defaultValue:!1,describe:"Excludes trailing punctuation from links generated with autoLinking",type:"boolean"},literalMidWordUnderscores:{defaultValue:!1,describe:"Parse midword underscores as literal underscores",type:"boolean"},literalMidWordAsterisks:{defaultValue:!1,describe:"Parse midword asterisks as literal asterisks",type:"boolean"},strikethrough:{defaultValue:!1,describe:"Turn on/off strikethrough support",type:"boolean"},tables:{defaultValue:!1,describe:"Turn on/off tables support",type:"boolean"},tablesHeaderId:{defaultValue:!1,describe:"Add an id to table headers",type:"boolean"},ghCodeBlocks:{defaultValue:!0,describe:"Turn on/off GFM fenced code blocks support",type:"boolean"},tasklists:{defaultValue:!1,describe:"Turn on/off GFM tasklist support",type:"boolean"},smoothLivePreview:{defaultValue:!1,describe:"Prevents weird effects in live previews due to incomplete input",type:"boolean"},smartIndentationFix:{defaultValue:!1,describe:"Tries to smartly fix indentation in es6 strings",type:"boolean"},disableForced4SpacesIndentedSublists:{defaultValue:!1,describe:"Disables the requirement of indenting nested sublists by 4 spaces",type:"boolean"},simpleLineBreaks:{defaultValue:!1,describe:"Parses simple line breaks as <br> (GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,describe:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,describe:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",describe:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,describe:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,describe:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,describe:"Support for HTML Tag escaping. ex: <div>foo</div>",type:"boolean"},emoji:{defaultValue:!1,describe:"Enable emoji support. Ex: `this is a :smile: emoji`",type:"boolean"},underline:{defaultValue:!1,describe:"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `<em>` and `<strong>`",type:"boolean"},ellipsis:{defaultValue:!0,describe:"Replaces three dots with the ellipsis unicode character",type:"boolean"},completeHTMLDocument:{defaultValue:!1,describe:"Outputs a complete html document, including `<html>`, `<head>` and `<body>` tags",type:"boolean"},metadata:{defaultValue:!1,describe:"Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).",type:"boolean"},splitAdjacentBlockquotes:{defaultValue:!1,describe:"Split adjacent blockquote blocks",type:"boolean"}};if(!1===e)return JSON.parse(JSON.stringify(t));var n={};for(var a in t)t.hasOwnProperty(a)&&(n[a]=t[a].defaultValue);return n}var t={},n={},a={},i=e(!0),r="vanilla",o={github:{omitExtraWLInCodeBlocks:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,disableForced4SpacesIndentedSublists:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghCompatibleHeaderId:!0,ghMentions:!0,backslashEscapesHTMLTags:!0,emoji:!0,splitAdjacentBlockquotes:!0},original:{noHeaderId:!0,ghCodeBlocks:!1},ghost:{omitExtraWLInCodeBlocks:!0,parseImgDimensions:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,smoothLivePreview:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghMentions:!1,encodeEmails:!0},vanilla:e(!0),allOn:function(){"use strict";var t=e(!0),n={};for(var a in t)t.hasOwnProperty(a)&&(n[a]=!0);return n}()};function s(e,n){"use strict";var a=n?"Error in "+n+" extension->":"Error in unnamed extension",i={valid:!0,error:""};t.helper.isArray(e)||(e=[e]);for(var r=0;r<e.length;++r){var o=a+" sub-extension "+r+": ",s=e[r];if("object"!=typeof s)return i.valid=!1,i.error=o+"must be an object, but "+typeof s+" given",i;if(!t.helper.isString(s.type))return i.valid=!1,i.error=o+'property "type" must be a string, but '+typeof s.type+" given",i;var l=s.type=s.type.toLowerCase();if("language"===l&&(l=s.type="lang"),"html"===l&&(l=s.type="output"),"lang"!==l&&"output"!==l&&"listener"!==l)return i.valid=!1,i.error=o+"type "+l+' is not recognized. Valid values: "lang/language", "output/html" or "listener"',i;if("listener"===l){if(t.helper.isUndefined(s.listeners))return i.valid=!1,i.error=o+'. Extensions of type "listener" must have a property called "listeners"',i}else if(t.helper.isUndefined(s.filter)&&t.helper.isUndefined(s.regex))return i.valid=!1,i.error=o+l+' extensions must define either a "regex" property or a "filter" method',i;if(s.listeners){if("object"!=typeof s.listeners)return i.valid=!1,i.error=o+'"listeners" property must be an object but '+typeof s.listeners+" given",i;for(var u in s.listeners)if(s.listeners.hasOwnProperty(u)&&"function"!=typeof s.listeners[u])return i.valid=!1,i.error=o+'"listeners" property must be an hash of [event name]: [callback]. listeners.'+u+" must be a function but "+typeof s.listeners[u]+" given",i}if(s.filter){if("function"!=typeof s.filter)return i.valid=!1,i.error=o+'"filter" must be a function, but '+typeof s.filter+" given",i}else if(s.regex){if(t.helper.isString(s.regex)&&(s.regex=new RegExp(s.regex,"g")),!(s.regex instanceof RegExp))return i.valid=!1,i.error=o+'"regex" property must either be a string or a RegExp object, but '+typeof s.regex+" given",i;if(t.helper.isUndefined(s.replace))return i.valid=!1,i.error=o+'"regex" extensions must implement a replace string or function',i}}return i}function l(e,t){"use strict";return"¨E"+t.charCodeAt(0)+"E"}t.helper={},t.extensions={},t.setOption=function(e,t){"use strict";return i[e]=t,this},t.getOption=function(e){"use strict";return i[e]},t.getOptions=function(){"use strict";return i},t.resetOptions=function(){"use strict";i=e(!0)},t.setFlavor=function(e){"use strict";if(!o.hasOwnProperty(e))throw Error(e+" flavor was not found");t.resetOptions();var n=o[e];for(var a in r=e,n)n.hasOwnProperty(a)&&(i[a]=n[a])},t.getFlavor=function(){"use strict";return r},t.getFlavorOptions=function(e){"use strict";if(o.hasOwnProperty(e))return o[e]},t.getDefaultOptions=function(t){"use strict";return e(t)},t.subParser=function(e,a){"use strict";if(t.helper.isString(e)){if(void 0===a){if(n.hasOwnProperty(e))return n[e];throw Error("SubParser named "+e+" not registered!")}n[e]=a}},t.extension=function(e,n){"use strict";if(!t.helper.isString(e))throw Error("Extension 'name' must be a string");if(e=t.helper.stdExtName(e),t.helper.isUndefined(n)){if(!a.hasOwnProperty(e))throw Error("Extension named "+e+" is not registered!");return a[e]}"function"==typeof n&&(n=n()),t.helper.isArray(n)||(n=[n]);var i=s(n,e);if(!i.valid)throw Error(i.error);a[e]=n},t.getAllExtensions=function(){"use strict";return a},t.removeExtension=function(e){"use strict";delete a[e]},t.resetExtensions=function(){"use strict";a={}},t.validateExtension=function(e){"use strict";var t=s(e,null);return!!t.valid||(console.warn(t.error),!1)},t.hasOwnProperty("helper")||(t.helper={}),t.helper.isString=function(e){"use strict";return"string"==typeof e||e instanceof String},t.helper.isFunction=function(e){"use strict";return e&&"[object Function]"==={}.toString.call(e)},t.helper.isArray=function(e){"use strict";return Array.isArray(e)},t.helper.isUndefined=function(e){"use strict";return void 0===e},t.helper.forEach=function(e,n){"use strict";if(t.helper.isUndefined(e))throw new Error("obj param is required");if(t.helper.isUndefined(n))throw new Error("callback param is required");if(!t.helper.isFunction(n))throw new Error("callback param must be a function/closure");if("function"==typeof e.forEach)e.forEach(n);else if(t.helper.isArray(e))for(var a=0;a<e.length;a++)n(e[a],a,e);else{if("object"!=typeof e)throw new Error("obj does not seem to be an array or an iterable object");for(var i in e)e.hasOwnProperty(i)&&n(e[i],i,e)}},t.helper.stdExtName=function(e){"use strict";return e.replace(/[_?*+\/\\.^-]/g,"").replace(/\s/g,"").toLowerCase()},t.helper.escapeCharactersCallback=l,t.helper.escapeCharacters=function(e,t,n){"use strict";var a="(["+t.replace(/([\[\]\\])/g,"\\$1")+"])";n&&(a="\\\\"+a);var i=new RegExp(a,"g");return e=e.replace(i,l)},t.helper.unescapeHTMLEntities=function(e){"use strict";return e.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")};var u=function(e,t,n,a){"use strict";var i,r,o,s,l,u=a||"",c=u.indexOf("g")>-1,d=new RegExp(t+"|"+n,"g"+u.replace(/g/g,"")),h=new RegExp(t,u.replace(/g/g,"")),p=[];do{for(i=0;o=d.exec(e);)if(h.test(o[0]))i++||(s=(r=d.lastIndex)-o[0].length);else if(i&&! --i){l=o.index+o[0].length;var f={left:{start:s,end:r},match:{start:r,end:o.index},right:{start:o.index,end:l},wholeMatch:{start:s,end:l}};if(p.push(f),!c)return p}}while(i&&(d.lastIndex=r));return p};t.helper.matchRecursiveRegExp=function(e,t,n,a){"use strict";for(var i=u(e,t,n,a),r=[],o=0;o<i.length;++o)r.push([e.slice(i[o].wholeMatch.start,i[o].wholeMatch.end),e.slice(i[o].match.start,i[o].match.end),e.slice(i[o].left.start,i[o].left.end),e.slice(i[o].right.start,i[o].right.end)]);return r},t.helper.replaceRecursiveRegExp=function(e,n,a,i,r){"use strict";if(!t.helper.isFunction(n)){var o=n;n=function(){return o}}var s=u(e,a,i,r),l=e,c=s.length;if(c>0){var d=[];0!==s[0].wholeMatch.start&&d.push(e.slice(0,s[0].wholeMatch.start));for(var h=0;h<c;++h)d.push(n(e.slice(s[h].wholeMatch.start,s[h].wholeMatch.end),e.slice(s[h].match.start,s[h].match.end),e.slice(s[h].left.start,s[h].left.end),e.slice(s[h].right.start,s[h].right.end))),h<c-1&&d.push(e.slice(s[h].wholeMatch.end,s[h+1].wholeMatch.start));s[c-1].wholeMatch.end<e.length&&d.push(e.slice(s[c-1].wholeMatch.end)),l=d.join("")}return l},t.helper.regexIndexOf=function(e,n,a){"use strict";if(!t.helper.isString(e))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";if(n instanceof RegExp==!1)throw"InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp";var i=e.substring(a||0).search(n);return i>=0?i+(a||0):i},t.helper.splitAtIndex=function(e,n){"use strict";if(!t.helper.isString(e))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[e.substring(0,n),e.substring(n)]},t.helper.encodeEmailAddress=function(e){"use strict";var t=[function(e){return"&#"+e.charCodeAt(0)+";"},function(e){return"&#x"+e.charCodeAt(0).toString(16)+";"},function(e){return e}];return e=e.replace(/./g,function(e){if("@"===e)e=t[Math.floor(2*Math.random())](e);else{var n=Math.random();e=n>.9?t[2](e):n>.45?t[1](e):t[0](e)}return e})},t.helper.padEnd=function(e,t,n){"use strict";return t|=0,n=String(n||" "),e.length>t?String(e):((t-=e.length)>n.length&&(n+=n.repeat(t/n.length)),String(e)+n.slice(0,t))},"undefined"==typeof console&&(console={warn:function(e){"use strict";alert(e)},log:function(e){"use strict";alert(e)},error:function(e){"use strict";throw e}}),t.helper.regexes={asteriskDashAndColon:/([*_:~])/g},t.helper.emojis={"+1":"👍","-1":"👎",100:"💯",1234:"🔢","1st_place_medal":"🥇","2nd_place_medal":"🥈","3rd_place_medal":"🥉","8ball":"🎱",a:"🅰️",ab:"🆎",abc:"🔤",abcd:"🔡",accept:"🉑",aerial_tramway:"🚡",airplane:"✈️",alarm_clock:"⏰",alembic:"⚗️",alien:"👽",ambulance:"🚑",amphora:"🏺",anchor:"⚓️",angel:"👼",anger:"💢",angry:"😠",anguished:"😧",ant:"🐜",apple:"🍎",aquarius:"♒️",aries:"♈️",arrow_backward:"◀️",arrow_double_down:"⏬",arrow_double_up:"⏫",arrow_down:"⬇️",arrow_down_small:"🔽",arrow_forward:"▶️",arrow_heading_down:"⤵️",arrow_heading_up:"⤴️",arrow_left:"⬅️",arrow_lower_left:"↙️",arrow_lower_right:"↘️",arrow_right:"➡️",arrow_right_hook:"↪️",arrow_up:"⬆️",arrow_up_down:"↕️",arrow_up_small:"🔼",arrow_upper_left:"↖️",arrow_upper_right:"↗️",arrows_clockwise:"🔃",arrows_counterclockwise:"🔄",art:"🎨",articulated_lorry:"🚛",artificial_satellite:"🛰",astonished:"😲",athletic_shoe:"👟",atm:"🏧",atom_symbol:"⚛️",avocado:"🥑",b:"🅱️",baby:"👶",baby_bottle:"🍼",baby_chick:"🐤",baby_symbol:"🚼",back:"🔙",bacon:"🥓",badminton:"🏸",baggage_claim:"🛄",baguette_bread:"🥖",balance_scale:"⚖️",balloon:"🎈",ballot_box:"🗳",ballot_box_with_check:"☑️",bamboo:"🎍",banana:"🍌",bangbang:"‼️",bank:"🏦",bar_chart:"📊",barber:"💈",baseball:"⚾️",basketball:"🏀",basketball_man:"⛹️",basketball_woman:"⛹️‍♀️",bat:"🦇",bath:"🛀",bathtub:"🛁",battery:"🔋",beach_umbrella:"🏖",bear:"🐻",bed:"🛏",bee:"🐝",beer:"🍺",beers:"🍻",beetle:"🐞",beginner:"🔰",bell:"🔔",bellhop_bell:"🛎",bento:"🍱",biking_man:"🚴",bike:"🚲",biking_woman:"🚴‍♀️",bikini:"👙",biohazard:"☣️",bird:"🐦",birthday:"🎂",black_circle:"⚫️",black_flag:"🏴",black_heart:"🖤",black_joker:"🃏",black_large_square:"⬛️",black_medium_small_square:"◾️",black_medium_square:"◼️",black_nib:"✒️",black_small_square:"▪️",black_square_button:"🔲",blonde_man:"👱",blonde_woman:"👱‍♀️",blossom:"🌼",blowfish:"🐡",blue_book:"📘",blue_car:"🚙",blue_heart:"💙",blush:"😊",boar:"🐗",boat:"⛵️",bomb:"💣",book:"📖",bookmark:"🔖",bookmark_tabs:"📑",books:"📚",boom:"💥",boot:"👢",bouquet:"💐",bowing_man:"🙇",bow_and_arrow:"🏹",bowing_woman:"🙇‍♀️",bowling:"🎳",boxing_glove:"🥊",boy:"👦",bread:"🍞",bride_with_veil:"👰",bridge_at_night:"🌉",briefcase:"💼",broken_heart:"💔",bug:"🐛",building_construction:"🏗",bulb:"💡",bullettrain_front:"🚅",bullettrain_side:"🚄",burrito:"🌯",bus:"🚌",business_suit_levitating:"🕴",busstop:"🚏",bust_in_silhouette:"👤",busts_in_silhouette:"👥",butterfly:"🦋",cactus:"🌵",cake:"🍰",calendar:"📆",call_me_hand:"🤙",calling:"📲",camel:"🐫",camera:"📷",camera_flash:"📸",camping:"🏕",cancer:"♋️",candle:"🕯",candy:"🍬",canoe:"🛶",capital_abcd:"🔠",capricorn:"♑️",car:"🚗",card_file_box:"🗃",card_index:"📇",card_index_dividers:"🗂",carousel_horse:"🎠",carrot:"🥕",cat:"🐱",cat2:"🐈",cd:"💿",chains:"⛓",champagne:"🍾",chart:"💹",chart_with_downwards_trend:"📉",chart_with_upwards_trend:"📈",checkered_flag:"🏁",cheese:"🧀",cherries:"🍒",cherry_blossom:"🌸",chestnut:"🌰",chicken:"🐔",children_crossing:"🚸",chipmunk:"🐿",chocolate_bar:"🍫",christmas_tree:"🎄",church:"⛪️",cinema:"🎦",circus_tent:"🎪",city_sunrise:"🌇",city_sunset:"🌆",cityscape:"🏙",cl:"🆑",clamp:"🗜",clap:"👏",clapper:"🎬",classical_building:"🏛",clinking_glasses:"🥂",clipboard:"📋",clock1:"🕐",clock10:"🕙",clock1030:"🕥",clock11:"🕚",clock1130:"🕦",clock12:"🕛",clock1230:"🕧",clock130:"🕜",clock2:"🕑",clock230:"🕝",clock3:"🕒",clock330:"🕞",clock4:"🕓",clock430:"🕟",clock5:"🕔",clock530:"🕠",clock6:"🕕",clock630:"🕡",clock7:"🕖",clock730:"🕢",clock8:"🕗",clock830:"🕣",clock9:"🕘",clock930:"🕤",closed_book:"📕",closed_lock_with_key:"🔐",closed_umbrella:"🌂",cloud:"☁️",cloud_with_lightning:"🌩",cloud_with_lightning_and_rain:"⛈",cloud_with_rain:"🌧",cloud_with_snow:"🌨",clown_face:"🤡",clubs:"♣️",cocktail:"🍸",coffee:"☕️",coffin:"⚰️",cold_sweat:"😰",comet:"☄️",computer:"💻",computer_mouse:"🖱",confetti_ball:"🎊",confounded:"😖",confused:"😕",congratulations:"㊗️",construction:"🚧",construction_worker_man:"👷",construction_worker_woman:"👷‍♀️",control_knobs:"🎛",convenience_store:"🏪",cookie:"🍪",cool:"🆒",policeman:"👮",copyright:"©️",corn:"🌽",couch_and_lamp:"🛋",couple:"👫",couple_with_heart_woman_man:"💑",couple_with_heart_man_man:"👨‍❤️‍👨",couple_with_heart_woman_woman:"👩‍❤️‍👩",couplekiss_man_man:"👨‍❤️‍💋‍👨",couplekiss_man_woman:"💏",couplekiss_woman_woman:"👩‍❤️‍💋‍👩",cow:"🐮",cow2:"🐄",cowboy_hat_face:"🤠",crab:"🦀",crayon:"🖍",credit_card:"💳",crescent_moon:"🌙",cricket:"🏏",crocodile:"🐊",croissant:"🥐",crossed_fingers:"🤞",crossed_flags:"🎌",crossed_swords:"⚔️",crown:"👑",cry:"😢",crying_cat_face:"😿",crystal_ball:"🔮",cucumber:"🥒",cupid:"💘",curly_loop:"➰",currency_exchange:"💱",curry:"🍛",custard:"🍮",customs:"🛃",cyclone:"🌀",dagger:"🗡",dancer:"💃",dancing_women:"👯",dancing_men:"👯‍♂️",dango:"🍡",dark_sunglasses:"🕶",dart:"🎯",dash:"💨",date:"📅",deciduous_tree:"🌳",deer:"🦌",department_store:"🏬",derelict_house:"🏚",desert:"🏜",desert_island:"🏝",desktop_computer:"🖥",male_detective:"🕵️",diamond_shape_with_a_dot_inside:"💠",diamonds:"♦️",disappointed:"😞",disappointed_relieved:"😥",dizzy:"💫",dizzy_face:"😵",do_not_litter:"🚯",dog:"🐶",dog2:"🐕",dollar:"💵",dolls:"🎎",dolphin:"🐬",door:"🚪",doughnut:"🍩",dove:"🕊",dragon:"🐉",dragon_face:"🐲",dress:"👗",dromedary_camel:"🐪",drooling_face:"🤤",droplet:"💧",drum:"🥁",duck:"🦆",dvd:"📀","e-mail":"📧",eagle:"🦅",ear:"👂",ear_of_rice:"🌾",earth_africa:"🌍",earth_americas:"🌎",earth_asia:"🌏",egg:"🥚",eggplant:"🍆",eight_pointed_black_star:"✴️",eight_spoked_asterisk:"✳️",electric_plug:"🔌",elephant:"🐘",email:"✉️",end:"🔚",envelope_with_arrow:"📩",euro:"💶",european_castle:"🏰",european_post_office:"🏤",evergreen_tree:"🌲",exclamation:"❗️",expressionless:"😑",eye:"👁",eye_speech_bubble:"👁‍🗨",eyeglasses:"👓",eyes:"👀",face_with_head_bandage:"🤕",face_with_thermometer:"🤒",fist_oncoming:"👊",factory:"🏭",fallen_leaf:"🍂",family_man_woman_boy:"👪",family_man_boy:"👨‍👦",family_man_boy_boy:"👨‍👦‍👦",family_man_girl:"👨‍👧",family_man_girl_boy:"👨‍👧‍👦",family_man_girl_girl:"👨‍👧‍👧",family_man_man_boy:"👨‍👨‍👦",family_man_man_boy_boy:"👨‍👨‍👦‍👦",family_man_man_girl:"👨‍👨‍👧",family_man_man_girl_boy:"👨‍👨‍👧‍👦",family_man_man_girl_girl:"👨‍👨‍👧‍👧",family_man_woman_boy_boy:"👨‍👩‍👦‍👦",family_man_woman_girl:"👨‍👩‍👧",family_man_woman_girl_boy:"👨‍👩‍👧‍👦",family_man_woman_girl_girl:"👨‍👩‍👧‍👧",family_woman_boy:"👩‍👦",family_woman_boy_boy:"👩‍👦‍👦",family_woman_girl:"👩‍👧",family_woman_girl_boy:"👩‍👧‍👦",family_woman_girl_girl:"👩‍👧‍👧",family_woman_woman_boy:"👩‍👩‍👦",family_woman_woman_boy_boy:"👩‍👩‍👦‍👦",family_woman_woman_girl:"👩‍👩‍👧",family_woman_woman_girl_boy:"👩‍👩‍👧‍👦",family_woman_woman_girl_girl:"👩‍👩‍👧‍👧",fast_forward:"⏩",fax:"📠",fearful:"😨",feet:"🐾",female_detective:"🕵️‍♀️",ferris_wheel:"🎡",ferry:"⛴",field_hockey:"🏑",file_cabinet:"🗄",file_folder:"📁",film_projector:"📽",film_strip:"🎞",fire:"🔥",fire_engine:"🚒",fireworks:"🎆",first_quarter_moon:"🌓",first_quarter_moon_with_face:"🌛",fish:"🐟",fish_cake:"🍥",fishing_pole_and_fish:"🎣",fist_raised:"✊",fist_left:"🤛",fist_right:"🤜",flags:"🎏",flashlight:"🔦",fleur_de_lis:"⚜️",flight_arrival:"🛬",flight_departure:"🛫",floppy_disk:"💾",flower_playing_cards:"🎴",flushed:"😳",fog:"🌫",foggy:"🌁",football:"🏈",footprints:"👣",fork_and_knife:"🍴",fountain:"⛲️",fountain_pen:"🖋",four_leaf_clover:"🍀",fox_face:"🦊",framed_picture:"🖼",free:"🆓",fried_egg:"🍳",fried_shrimp:"🍤",fries:"🍟",frog:"🐸",frowning:"😦",frowning_face:"☹️",frowning_man:"🙍‍♂️",frowning_woman:"🙍",middle_finger:"🖕",fuelpump:"⛽️",full_moon:"🌕",full_moon_with_face:"🌝",funeral_urn:"⚱️",game_die:"🎲",gear:"⚙️",gem:"💎",gemini:"♊️",ghost:"👻",gift:"🎁",gift_heart:"💝",girl:"👧",globe_with_meridians:"🌐",goal_net:"🥅",goat:"🐐",golf:"⛳️",golfing_man:"🏌️",golfing_woman:"🏌️‍♀️",gorilla:"🦍",grapes:"🍇",green_apple:"🍏",green_book:"📗",green_heart:"💚",green_salad:"🥗",grey_exclamation:"❕",grey_question:"❔",grimacing:"😬",grin:"😁",grinning:"😀",guardsman:"💂",guardswoman:"💂‍♀️",guitar:"🎸",gun:"🔫",haircut_woman:"💇",haircut_man:"💇‍♂️",hamburger:"🍔",hammer:"🔨",hammer_and_pick:"⚒",hammer_and_wrench:"🛠",hamster:"🐹",hand:"✋",handbag:"👜",handshake:"🤝",hankey:"💩",hatched_chick:"🐥",hatching_chick:"🐣",headphones:"🎧",hear_no_evil:"🙉",heart:"❤️",heart_decoration:"💟",heart_eyes:"😍",heart_eyes_cat:"😻",heartbeat:"💓",heartpulse:"💗",hearts:"♥️",heavy_check_mark:"✔️",heavy_division_sign:"➗",heavy_dollar_sign:"💲",heavy_heart_exclamation:"❣️",heavy_minus_sign:"➖",heavy_multiplication_x:"✖️",heavy_plus_sign:"➕",helicopter:"🚁",herb:"🌿",hibiscus:"🌺",high_brightness:"🔆",high_heel:"👠",hocho:"🔪",hole:"🕳",honey_pot:"🍯",horse:"🐴",horse_racing:"🏇",hospital:"🏥",hot_pepper:"🌶",hotdog:"🌭",hotel:"🏨",hotsprings:"♨️",hourglass:"⌛️",hourglass_flowing_sand:"⏳",house:"🏠",house_with_garden:"🏡",houses:"🏘",hugs:"🤗",hushed:"😯",ice_cream:"🍨",ice_hockey:"🏒",ice_skate:"⛸",icecream:"🍦",id:"🆔",ideograph_advantage:"🉐",imp:"👿",inbox_tray:"📥",incoming_envelope:"📨",tipping_hand_woman:"💁",information_source:"ℹ️",innocent:"😇",interrobang:"⁉️",iphone:"📱",izakaya_lantern:"🏮",jack_o_lantern:"🎃",japan:"🗾",japanese_castle:"🏯",japanese_goblin:"👺",japanese_ogre:"👹",jeans:"👖",joy:"😂",joy_cat:"😹",joystick:"🕹",kaaba:"🕋",key:"🔑",keyboard:"⌨️",keycap_ten:"🔟",kick_scooter:"🛴",kimono:"👘",kiss:"💋",kissing:"😗",kissing_cat:"😽",kissing_closed_eyes:"😚",kissing_heart:"😘",kissing_smiling_eyes:"😙",kiwi_fruit:"🥝",koala:"🐨",koko:"🈁",label:"🏷",large_blue_circle:"🔵",large_blue_diamond:"🔷",large_orange_diamond:"🔶",last_quarter_moon:"🌗",last_quarter_moon_with_face:"🌜",latin_cross:"✝️",laughing:"😆",leaves:"🍃",ledger:"📒",left_luggage:"🛅",left_right_arrow:"↔️",leftwards_arrow_with_hook:"↩️",lemon:"🍋",leo:"♌️",leopard:"🐆",level_slider:"🎚",libra:"♎️",light_rail:"🚈",link:"🔗",lion:"🦁",lips:"👄",lipstick:"💄",lizard:"🦎",lock:"🔒",lock_with_ink_pen:"🔏",lollipop:"🍭",loop:"➿",loud_sound:"🔊",loudspeaker:"📢",love_hotel:"🏩",love_letter:"💌",low_brightness:"🔅",lying_face:"🤥",m:"Ⓜ️",mag:"🔍",mag_right:"🔎",mahjong:"🀄️",mailbox:"📫",mailbox_closed:"📪",mailbox_with_mail:"📬",mailbox_with_no_mail:"📭",man:"👨",man_artist:"👨‍🎨",man_astronaut:"👨‍🚀",man_cartwheeling:"🤸‍♂️",man_cook:"👨‍🍳",man_dancing:"🕺",man_facepalming:"🤦‍♂️",man_factory_worker:"👨‍🏭",man_farmer:"👨‍🌾",man_firefighter:"👨‍🚒",man_health_worker:"👨‍⚕️",man_in_tuxedo:"🤵",man_judge:"👨‍⚖️",man_juggling:"🤹‍♂️",man_mechanic:"👨‍🔧",man_office_worker:"👨‍💼",man_pilot:"👨‍✈️",man_playing_handball:"🤾‍♂️",man_playing_water_polo:"🤽‍♂️",man_scientist:"👨‍🔬",man_shrugging:"🤷‍♂️",man_singer:"👨‍🎤",man_student:"👨‍🎓",man_teacher:"👨‍🏫",man_technologist:"👨‍💻",man_with_gua_pi_mao:"👲",man_with_turban:"👳",tangerine:"🍊",mans_shoe:"👞",mantelpiece_clock:"🕰",maple_leaf:"🍁",martial_arts_uniform:"🥋",mask:"😷",massage_woman:"💆",massage_man:"💆‍♂️",meat_on_bone:"🍖",medal_military:"🎖",medal_sports:"🏅",mega:"📣",melon:"🍈",memo:"📝",men_wrestling:"🤼‍♂️",menorah:"🕎",mens:"🚹",metal:"🤘",metro:"🚇",microphone:"🎤",microscope:"🔬",milk_glass:"🥛",milky_way:"🌌",minibus:"🚐",minidisc:"💽",mobile_phone_off:"📴",money_mouth_face:"🤑",money_with_wings:"💸",moneybag:"💰",monkey:"🐒",monkey_face:"🐵",monorail:"🚝",moon:"🌔",mortar_board:"🎓",mosque:"🕌",motor_boat:"🛥",motor_scooter:"🛵",motorcycle:"🏍",motorway:"🛣",mount_fuji:"🗻",mountain:"⛰",mountain_biking_man:"🚵",mountain_biking_woman:"🚵‍♀️",mountain_cableway:"🚠",mountain_railway:"🚞",mountain_snow:"🏔",mouse:"🐭",mouse2:"🐁",movie_camera:"🎥",moyai:"🗿",mrs_claus:"🤶",muscle:"💪",mushroom:"🍄",musical_keyboard:"🎹",musical_note:"🎵",musical_score:"🎼",mute:"🔇",nail_care:"💅",name_badge:"📛",national_park:"🏞",nauseated_face:"🤢",necktie:"👔",negative_squared_cross_mark:"❎",nerd_face:"🤓",neutral_face:"😐",new:"🆕",new_moon:"🌑",new_moon_with_face:"🌚",newspaper:"📰",newspaper_roll:"🗞",next_track_button:"⏭",ng:"🆖",no_good_man:"🙅‍♂️",no_good_woman:"🙅",night_with_stars:"🌃",no_bell:"🔕",no_bicycles:"🚳",no_entry:"⛔️",no_entry_sign:"🚫",no_mobile_phones:"📵",no_mouth:"😶",no_pedestrians:"🚷",no_smoking:"🚭","non-potable_water":"🚱",nose:"👃",notebook:"📓",notebook_with_decorative_cover:"📔",notes:"🎶",nut_and_bolt:"🔩",o:"⭕️",o2:"🅾️",ocean:"🌊",octopus:"🐙",oden:"🍢",office:"🏢",oil_drum:"🛢",ok:"🆗",ok_hand:"👌",ok_man:"🙆‍♂️",ok_woman:"🙆",old_key:"🗝",older_man:"👴",older_woman:"👵",om:"🕉",on:"🔛",oncoming_automobile:"🚘",oncoming_bus:"🚍",oncoming_police_car:"🚔",oncoming_taxi:"🚖",open_file_folder:"📂",open_hands:"👐",open_mouth:"😮",open_umbrella:"☂️",ophiuchus:"⛎",orange_book:"📙",orthodox_cross:"☦️",outbox_tray:"📤",owl:"🦉",ox:"🐂",package:"📦",page_facing_up:"📄",page_with_curl:"📃",pager:"📟",paintbrush:"🖌",palm_tree:"🌴",pancakes:"🥞",panda_face:"🐼",paperclip:"📎",paperclips:"🖇",parasol_on_ground:"⛱",parking:"🅿️",part_alternation_mark:"〽️",partly_sunny:"⛅️",passenger_ship:"🛳",passport_control:"🛂",pause_button:"⏸",peace_symbol:"☮️",peach:"🍑",peanuts:"🥜",pear:"🍐",pen:"🖊",pencil2:"✏️",penguin:"🐧",pensive:"😔",performing_arts:"🎭",persevere:"😣",person_fencing:"🤺",pouting_woman:"🙎",phone:"☎️",pick:"⛏",pig:"🐷",pig2:"🐖",pig_nose:"🐽",pill:"💊",pineapple:"🍍",ping_pong:"🏓",pisces:"♓️",pizza:"🍕",place_of_worship:"🛐",plate_with_cutlery:"🍽",play_or_pause_button:"⏯",point_down:"👇",point_left:"👈",point_right:"👉",point_up:"☝️",point_up_2:"👆",police_car:"🚓",policewoman:"👮‍♀️",poodle:"🐩",popcorn:"🍿",post_office:"🏣",postal_horn:"📯",postbox:"📮",potable_water:"🚰",potato:"🥔",pouch:"👝",poultry_leg:"🍗",pound:"💷",rage:"😡",pouting_cat:"😾",pouting_man:"🙎‍♂️",pray:"🙏",prayer_beads:"📿",pregnant_woman:"🤰",previous_track_button:"⏮",prince:"🤴",princess:"👸",printer:"🖨",purple_heart:"💜",purse:"👛",pushpin:"📌",put_litter_in_its_place:"🚮",question:"❓",rabbit:"🐰",rabbit2:"🐇",racehorse:"🐎",racing_car:"🏎",radio:"📻",radio_button:"🔘",radioactive:"☢️",railway_car:"🚃",railway_track:"🛤",rainbow:"🌈",rainbow_flag:"🏳️‍🌈",raised_back_of_hand:"🤚",raised_hand_with_fingers_splayed:"🖐",raised_hands:"🙌",raising_hand_woman:"🙋",raising_hand_man:"🙋‍♂️",ram:"🐏",ramen:"🍜",rat:"🐀",record_button:"⏺",recycle:"♻️",red_circle:"🔴",registered:"®️",relaxed:"☺️",relieved:"😌",reminder_ribbon:"🎗",repeat:"🔁",repeat_one:"🔂",rescue_worker_helmet:"⛑",restroom:"🚻",revolving_hearts:"💞",rewind:"⏪",rhinoceros:"🦏",ribbon:"🎀",rice:"🍚",rice_ball:"🍙",rice_cracker:"🍘",rice_scene:"🎑",right_anger_bubble:"🗯",ring:"💍",robot:"🤖",rocket:"🚀",rofl:"🤣",roll_eyes:"🙄",roller_coaster:"🎢",rooster:"🐓",rose:"🌹",rosette:"🏵",rotating_light:"🚨",round_pushpin:"📍",rowing_man:"🚣",rowing_woman:"🚣‍♀️",rugby_football:"🏉",running_man:"🏃",running_shirt_with_sash:"🎽",running_woman:"🏃‍♀️",sa:"🈂️",sagittarius:"♐️",sake:"🍶",sandal:"👡",santa:"🎅",satellite:"📡",saxophone:"🎷",school:"🏫",school_satchel:"🎒",scissors:"✂️",scorpion:"🦂",scorpius:"♏️",scream:"😱",scream_cat:"🙀",scroll:"📜",seat:"💺",secret:"㊙️",see_no_evil:"🙈",seedling:"🌱",selfie:"🤳",shallow_pan_of_food:"🥘",shamrock:"☘️",shark:"🦈",shaved_ice:"🍧",sheep:"🐑",shell:"🐚",shield:"🛡",shinto_shrine:"⛩",ship:"🚢",shirt:"👕",shopping:"🛍",shopping_cart:"🛒",shower:"🚿",shrimp:"🦐",signal_strength:"📶",six_pointed_star:"🔯",ski:"🎿",skier:"⛷",skull:"💀",skull_and_crossbones:"☠️",sleeping:"😴",sleeping_bed:"🛌",sleepy:"😪",slightly_frowning_face:"🙁",slightly_smiling_face:"🙂",slot_machine:"🎰",small_airplane:"🛩",small_blue_diamond:"🔹",small_orange_diamond:"🔸",small_red_triangle:"🔺",small_red_triangle_down:"🔻",smile:"😄",smile_cat:"😸",smiley:"😃",smiley_cat:"😺",smiling_imp:"😈",smirk:"😏",smirk_cat:"😼",smoking:"🚬",snail:"🐌",snake:"🐍",sneezing_face:"🤧",snowboarder:"🏂",snowflake:"❄️",snowman:"⛄️",snowman_with_snow:"☃️",sob:"😭",soccer:"⚽️",soon:"🔜",sos:"🆘",sound:"🔉",space_invader:"👾",spades:"♠️",spaghetti:"🍝",sparkle:"❇️",sparkler:"🎇",sparkles:"✨",sparkling_heart:"💖",speak_no_evil:"🙊",speaker:"🔈",speaking_head:"🗣",speech_balloon:"💬",speedboat:"🚤",spider:"🕷",spider_web:"🕸",spiral_calendar:"🗓",spiral_notepad:"🗒",spoon:"🥄",squid:"🦑",stadium:"🏟",star:"⭐️",star2:"🌟",star_and_crescent:"☪️",star_of_david:"✡️",stars:"🌠",station:"🚉",statue_of_liberty:"🗽",steam_locomotive:"🚂",stew:"🍲",stop_button:"⏹",stop_sign:"🛑",stopwatch:"⏱",straight_ruler:"📏",strawberry:"🍓",stuck_out_tongue:"😛",stuck_out_tongue_closed_eyes:"😝",stuck_out_tongue_winking_eye:"😜",studio_microphone:"🎙",stuffed_flatbread:"🥙",sun_behind_large_cloud:"🌥",sun_behind_rain_cloud:"🌦",sun_behind_small_cloud:"🌤",sun_with_face:"🌞",sunflower:"🌻",sunglasses:"😎",sunny:"☀️",sunrise:"🌅",sunrise_over_mountains:"🌄",surfing_man:"🏄",surfing_woman:"🏄‍♀️",sushi:"🍣",suspension_railway:"🚟",sweat:"😓",sweat_drops:"💦",sweat_smile:"😅",sweet_potato:"🍠",swimming_man:"🏊",swimming_woman:"🏊‍♀️",symbols:"🔣",synagogue:"🕍",syringe:"💉",taco:"🌮",tada:"🎉",tanabata_tree:"🎋",taurus:"♉️",taxi:"🚕",tea:"🍵",telephone_receiver:"📞",telescope:"🔭",tennis:"🎾",tent:"⛺️",thermometer:"🌡",thinking:"🤔",thought_balloon:"💭",ticket:"🎫",tickets:"🎟",tiger:"🐯",tiger2:"🐅",timer_clock:"⏲",tipping_hand_man:"💁‍♂️",tired_face:"😫",tm:"™️",toilet:"🚽",tokyo_tower:"🗼",tomato:"🍅",tongue:"👅",top:"🔝",tophat:"🎩",tornado:"🌪",trackball:"🖲",tractor:"🚜",traffic_light:"🚥",train:"🚋",train2:"🚆",tram:"🚊",triangular_flag_on_post:"🚩",triangular_ruler:"📐",trident:"🔱",triumph:"😤",trolleybus:"🚎",trophy:"🏆",tropical_drink:"🍹",tropical_fish:"🐠",truck:"🚚",trumpet:"🎺",tulip:"🌷",tumbler_glass:"🥃",turkey:"🦃",turtle:"🐢",tv:"📺",twisted_rightwards_arrows:"🔀",two_hearts:"💕",two_men_holding_hands:"👬",two_women_holding_hands:"👭",u5272:"🈹",u5408:"🈴",u55b6:"🈺",u6307:"🈯️",u6708:"🈷️",u6709:"🈶",u6e80:"🈵",u7121:"🈚️",u7533:"🈸",u7981:"🈲",u7a7a:"🈳",umbrella:"☔️",unamused:"😒",underage:"🔞",unicorn:"🦄",unlock:"🔓",up:"🆙",upside_down_face:"🙃",v:"✌️",vertical_traffic_light:"🚦",vhs:"📼",vibration_mode:"📳",video_camera:"📹",video_game:"🎮",violin:"🎻",virgo:"♍️",volcano:"🌋",volleyball:"🏐",vs:"🆚",vulcan_salute:"🖖",walking_man:"🚶",walking_woman:"🚶‍♀️",waning_crescent_moon:"🌘",waning_gibbous_moon:"🌖",warning:"⚠️",wastebasket:"🗑",watch:"⌚️",water_buffalo:"🐃",watermelon:"🍉",wave:"👋",wavy_dash:"〰️",waxing_crescent_moon:"🌒",wc:"🚾",weary:"😩",wedding:"💒",weight_lifting_man:"🏋️",weight_lifting_woman:"🏋️‍♀️",whale:"🐳",whale2:"🐋",wheel_of_dharma:"☸️",wheelchair:"♿️",white_check_mark:"✅",white_circle:"⚪️",white_flag:"🏳️",white_flower:"💮",white_large_square:"⬜️",white_medium_small_square:"◽️",white_medium_square:"◻️",white_small_square:"▫️",white_square_button:"🔳",wilted_flower:"🥀",wind_chime:"🎐",wind_face:"🌬",wine_glass:"🍷",wink:"😉",wolf:"🐺",woman:"👩",woman_artist:"👩‍🎨",woman_astronaut:"👩‍🚀",woman_cartwheeling:"🤸‍♀️",woman_cook:"👩‍🍳",woman_facepalming:"🤦‍♀️",woman_factory_worker:"👩‍🏭",woman_farmer:"👩‍🌾",woman_firefighter:"👩‍🚒",woman_health_worker:"👩‍⚕️",woman_judge:"👩‍⚖️",woman_juggling:"🤹‍♀️",woman_mechanic:"👩‍🔧",woman_office_worker:"👩‍💼",woman_pilot:"👩‍✈️",woman_playing_handball:"🤾‍♀️",woman_playing_water_polo:"🤽‍♀️",woman_scientist:"👩‍🔬",woman_shrugging:"🤷‍♀️",woman_singer:"👩‍🎤",woman_student:"👩‍🎓",woman_teacher:"👩‍🏫",woman_technologist:"👩‍💻",woman_with_turban:"👳‍♀️",womans_clothes:"👚",womans_hat:"👒",women_wrestling:"🤼‍♀️",womens:"🚺",world_map:"🗺",worried:"😟",wrench:"🔧",writing_hand:"✍️",x:"❌",yellow_heart:"💛",yen:"💴",yin_yang:"☯️",yum:"😋",zap:"⚡️",zipper_mouth_face:"🤐",zzz:"💤",octocat:'<img alt=":octocat:" height="20" width="20" align="absmiddle" src="https://assets-cdn.github.com/images/icons/emoji/octocat.png">',showdown:"<span style=\"font-family: 'Anonymous Pro', monospace; text-decoration: underline; text-decoration-style: dashed; text-decoration-color: #3e8b8a;text-underline-position: under;\">S</span>"},t.Converter=function(e){"use strict";var n={},l=[],u=[],c={},d=r,h={parsed:{},raw:"",format:""};function p(e,n){if(n=n||null,t.helper.isString(e)){if(n=e=t.helper.stdExtName(e),t.extensions[e])return console.warn("DEPRECATION WARNING: "+e+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),void function(e,n){"function"==typeof e&&(e=e(new t.Converter));t.helper.isArray(e)||(e=[e]);var a=s(e,n);if(!a.valid)throw Error(a.error);for(var i=0;i<e.length;++i)switch(e[i].type){case"lang":l.push(e[i]);break;case"output":u.push(e[i]);break;default:throw Error("Extension loader error: Type unrecognized!!!")}}(t.extensions[e],e);if(t.helper.isUndefined(a[e]))throw Error('Extension "'+e+'" could not be loaded. It was either not found or is not a valid extension.');e=a[e]}"function"==typeof e&&(e=e()),t.helper.isArray(e)||(e=[e]);var i=s(e,n);if(!i.valid)throw Error(i.error);for(var r=0;r<e.length;++r){switch(e[r].type){case"lang":l.push(e[r]);break;case"output":u.push(e[r])}if(e[r].hasOwnProperty("listeners"))for(var o in e[r].listeners)e[r].listeners.hasOwnProperty(o)&&f(o,e[r].listeners[o])}}function f(e,n){if(!t.helper.isString(e))throw Error("Invalid argument in converter.listen() method: name must be a string, but "+typeof e+" given");if("function"!=typeof n)throw Error("Invalid argument in converter.listen() method: callback must be a function, but "+typeof n+" given");c.hasOwnProperty(e)||(c[e]=[]),c[e].push(n)}!function(){for(var a in e=e||{},i)i.hasOwnProperty(a)&&(n[a]=i[a]);if("object"!=typeof e)throw Error("Converter expects the passed parameter to be an object, but "+typeof e+" was passed instead.");for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);n.extensions&&t.helper.forEach(n.extensions,p)}(),this._dispatch=function(e,t,n,a){if(c.hasOwnProperty(e))for(var i=0;i<c[e].length;++i){var r=c[e][i](e,t,this,n,a);r&&void 0!==r&&(t=r)}return t},this.listen=function(e,t){return f(e,t),this},this.makeHtml=function(e){if(!e)return e;var a={gHtmlBlocks:[],gHtmlMdBlocks:[],gHtmlSpans:[],gUrls:{},gTitles:{},gDimensions:{},gListLevel:0,hashLinkCounts:{},langExtensions:l,outputModifiers:u,converter:this,ghCodeBlocks:[],metadata:{parsed:{},raw:"",format:""}};return e=(e=(e=(e=(e=e.replace(/¨/g,"¨T")).replace(/\$/g,"¨D")).replace(/\r\n/g,"\n")).replace(/\r/g,"\n")).replace(/\u00A0/g," "),n.smartIndentationFix&&(e=function(e){var t=e.match(/^\s*/)[0].length,n=new RegExp("^\\s{0,"+t+"}","gm");return e.replace(n,"")}(e)),e="\n\n"+e+"\n\n",e=(e=t.subParser("detab")(e,n,a)).replace(/^[ \t]+$/gm,""),t.helper.forEach(l,function(i){e=t.subParser("runExtension")(i,e,n,a)}),e=t.subParser("metadata")(e,n,a),e=t.subParser("hashPreCodeTags")(e,n,a),e=t.subParser("githubCodeBlocks")(e,n,a),e=t.subParser("hashHTMLBlocks")(e,n,a),e=t.subParser("hashCodeTags")(e,n,a),e=t.subParser("stripLinkDefinitions")(e,n,a),e=t.subParser("blockGamut")(e,n,a),e=t.subParser("unhashHTMLSpans")(e,n,a),e=(e=(e=t.subParser("unescapeSpecialChars")(e,n,a)).replace(/¨D/g,"$$")).replace(/¨T/g,"¨"),e=t.subParser("completeHTMLDocument")(e,n,a),t.helper.forEach(u,function(i){e=t.subParser("runExtension")(i,e,n,a)}),h=a.metadata,e},this.makeMarkdown=this.makeMd=function(e,n){if(e=(e=(e=e.replace(/\r\n/g,"\n")).replace(/\r/g,"\n")).replace(/>[ \t]+</,">¨NBSP;<"),!n){if(!window||!window.document)throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM");n=window.document}var a=n.createElement("div");a.innerHTML=e;var i={preList:function(e){for(var n=e.querySelectorAll("pre"),a=[],i=0;i<n.length;++i)if(1===n[i].childElementCount&&"code"===n[i].firstChild.tagName.toLowerCase()){var r=n[i].firstChild.innerHTML.trim(),o=n[i].firstChild.getAttribute("data-language")||"";if(""===o)for(var s=n[i].firstChild.className.split(" "),l=0;l<s.length;++l){var u=s[l].match(/^language-(.+)$/);if(null!==u){o=u[1];break}}r=t.helper.unescapeHTMLEntities(r),a.push(r),n[i].outerHTML='<precode language="'+o+'" precodenum="'+i.toString()+'"></precode>'}else a.push(n[i].innerHTML),n[i].innerHTML="",n[i].setAttribute("prenum",i.toString());return a}(a)};!function e(t){for(var n=0;n<t.childNodes.length;++n){var a=t.childNodes[n];3===a.nodeType?/\S/.test(a.nodeValue)||/^[ ]+$/.test(a.nodeValue)?(a.nodeValue=a.nodeValue.split("\n").join(" "),a.nodeValue=a.nodeValue.replace(/(\s)+/g,"$1")):(t.removeChild(a),--n):1===a.nodeType&&e(a)}}(a);for(var r=a.childNodes,o="",s=0;s<r.length;s++)o+=t.subParser("makeMarkdown.node")(r[s],i);return o},this.setOption=function(e,t){n[e]=t},this.getOption=function(e){return n[e]},this.getOptions=function(){return n},this.addExtension=function(e,t){p(e,t=t||null)},this.useExtension=function(e){p(e)},this.setFlavor=function(e){if(!o.hasOwnProperty(e))throw Error(e+" flavor was not found");var t=o[e];for(var a in d=e,t)t.hasOwnProperty(a)&&(n[a]=t[a])},this.getFlavor=function(){return d},this.removeExtension=function(e){t.helper.isArray(e)||(e=[e]);for(var n=0;n<e.length;++n){for(var a=e[n],i=0;i<l.length;++i)l[i]===a&&l.splice(i,1);for(var r=0;r<u.length;++r)u[r]===a&&u.splice(r,1)}},this.getAllExtensions=function(){return{language:l,output:u}},this.getMetadata=function(e){return e?h.raw:h.parsed},this.getMetadataFormat=function(){return h.format},this._setMetadataPair=function(e,t){h.parsed[e]=t},this._setMetadataFormat=function(e){h.format=e},this._setMetadataRaw=function(e){h.raw=e}},t.subParser("anchors",function(e,n,a){"use strict";var i=function(e,i,r,o,s,l,u){if(t.helper.isUndefined(u)&&(u=""),r=r.toLowerCase(),e.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1)o="";else if(!o){if(r||(r=i.toLowerCase().replace(/ ?\n/g," ")),o="#"+r,t.helper.isUndefined(a.gUrls[r]))return e;o=a.gUrls[r],t.helper.isUndefined(a.gTitles[r])||(u=a.gTitles[r])}var c='<a href="'+(o=o.replace(t.helper.regexes.asteriskDashAndColon,t.helper.escapeCharactersCallback))+'"';return""!==u&&null!==u&&(c+=' title="'+(u=(u=u.replace(/"/g,""")).replace(t.helper.regexes.asteriskDashAndColon,t.helper.escapeCharactersCallback))+'"'),n.openLinksInNewWindow&&!/^#/.test(o)&&(c+=' rel="noopener noreferrer" target="¨E95Eblank"'),c+=">"+i+"</a>"};return e=(e=(e=(e=(e=a.converter._dispatch("anchors.before",e,n,a)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g,i)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,i)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,i)).replace(/\[([^\[\]]+)]()()()()()/g,i),n.ghMentions&&(e=e.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gim,function(e,a,i,r,o){if("\\"===i)return a+r;if(!t.helper.isString(n.ghMentionsLink))throw new Error("ghMentionsLink option must be a string");var s=n.ghMentionsLink.replace(/\{u}/g,o),l="";return n.openLinksInNewWindow&&(l=' rel="noopener noreferrer" target="¨E95Eblank"'),a+'<a href="'+s+'"'+l+">"+r+"</a>"})),e=a.converter._dispatch("anchors.after",e,n,a)});var c=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,d=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,h=/()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,p=/(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gim,f=/<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,m=function(e){"use strict";return function(n,a,i,r,o,s,l){var u=i=i.replace(t.helper.regexes.asteriskDashAndColon,t.helper.escapeCharactersCallback),c="",d="",h=a||"",p=l||"";return/^www\./i.test(i)&&(i=i.replace(/^www\./i,"http://www.")),e.excludeTrailingPunctuationFromURLs&&s&&(c=s),e.openLinksInNewWindow&&(d=' rel="noopener noreferrer" target="¨E95Eblank"'),h+'<a href="'+i+'"'+d+">"+u+"</a>"+c+p}},g=function(e,n){"use strict";return function(a,i,r){var o="mailto:";return i=i||"",r=t.subParser("unescapeSpecialChars")(r,e,n),e.encodeEmails?(o=t.helper.encodeEmailAddress(o+r),r=t.helper.encodeEmailAddress(r)):o+=r,i+'<a href="'+o+'">'+r+"</a>"}};t.subParser("autoLinks",function(e,t,n){"use strict";return e=(e=(e=n.converter._dispatch("autoLinks.before",e,t,n)).replace(h,m(t))).replace(f,g(t,n)),e=n.converter._dispatch("autoLinks.after",e,t,n)}),t.subParser("simplifiedAutoLinks",function(e,t,n){"use strict";return t.simplifiedAutoLink?(e=n.converter._dispatch("simplifiedAutoLinks.before",e,t,n),e=(e=t.excludeTrailingPunctuationFromURLs?e.replace(d,m(t)):e.replace(c,m(t))).replace(p,g(t,n)),e=n.converter._dispatch("simplifiedAutoLinks.after",e,t,n)):e}),t.subParser("blockGamut",function(e,n,a){"use strict";return e=a.converter._dispatch("blockGamut.before",e,n,a),e=t.subParser("blockQuotes")(e,n,a),e=t.subParser("headers")(e,n,a),e=t.subParser("horizontalRule")(e,n,a),e=t.subParser("lists")(e,n,a),e=t.subParser("codeBlocks")(e,n,a),e=t.subParser("tables")(e,n,a),e=t.subParser("hashHTMLBlocks")(e,n,a),e=t.subParser("paragraphs")(e,n,a),e=a.converter._dispatch("blockGamut.after",e,n,a)}),t.subParser("blockQuotes",function(e,n,a){"use strict";e=a.converter._dispatch("blockQuotes.before",e,n,a),e+="\n\n";var i=/(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;return n.splitAdjacentBlockquotes&&(i=/^ {0,3}>[\s\S]*?(?:\n\n)/gm),e=e.replace(i,function(e){return e=(e=(e=e.replace(/^[ \t]*>[ \t]?/gm,"")).replace(/¨0/g,"")).replace(/^[ \t]+$/gm,""),e=t.subParser("githubCodeBlocks")(e,n,a),e=(e=(e=t.subParser("blockGamut")(e,n,a)).replace(/(^|\n)/g,"$1 ")).replace(/(\s*<pre>[^\r]+?<\/pre>)/gm,function(e,t){var n=t;return n=(n=n.replace(/^ /gm,"¨0")).replace(/¨0/g,"")}),t.subParser("hashBlock")("<blockquote>\n"+e+"\n</blockquote>",n,a)}),e=a.converter._dispatch("blockQuotes.after",e,n,a)}),t.subParser("codeBlocks",function(e,n,a){"use strict";e=a.converter._dispatch("codeBlocks.before",e,n,a);return e=(e=(e+="¨0").replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g,function(e,i,r){var o=i,s=r,l="\n";return o=t.subParser("outdent")(o,n,a),o=t.subParser("encodeCode")(o,n,a),o=(o=(o=t.subParser("detab")(o,n,a)).replace(/^\n+/g,"")).replace(/\n+$/g,""),n.omitExtraWLInCodeBlocks&&(l=""),o="<pre><code>"+o+l+"</code></pre>",t.subParser("hashBlock")(o,n,a)+s})).replace(/¨0/,""),e=a.converter._dispatch("codeBlocks.after",e,n,a)}),t.subParser("codeSpans",function(e,n,a){"use strict";return void 0===(e=a.converter._dispatch("codeSpans.before",e,n,a))&&(e=""),e=e.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(e,i,r,o){var s=o;return s=(s=s.replace(/^([ \t]*)/g,"")).replace(/[ \t]*$/g,""),s=i+"<code>"+(s=t.subParser("encodeCode")(s,n,a))+"</code>",s=t.subParser("hashHTMLSpans")(s,n,a)}),e=a.converter._dispatch("codeSpans.after",e,n,a)}),t.subParser("completeHTMLDocument",function(e,t,n){"use strict";if(!t.completeHTMLDocument)return e;e=n.converter._dispatch("completeHTMLDocument.before",e,t,n);var a="html",i="<!DOCTYPE HTML>\n",r="",o='<meta charset="utf-8">\n',s="",l="";for(var u in void 0!==n.metadata.parsed.doctype&&(i="<!DOCTYPE "+n.metadata.parsed.doctype+">\n","html"!==(a=n.metadata.parsed.doctype.toString().toLowerCase())&&"html5"!==a||(o='<meta charset="utf-8">')),n.metadata.parsed)if(n.metadata.parsed.hasOwnProperty(u))switch(u.toLowerCase()){case"doctype":break;case"title":r="<title>"+n.metadata.parsed.title+"</title>\n";break;case"charset":o="html"===a||"html5"===a?'<meta charset="'+n.metadata.parsed.charset+'">\n':'<meta name="charset" content="'+n.metadata.parsed.charset+'">\n';break;case"language":case"lang":s=' lang="'+n.metadata.parsed[u]+'"',l+='<meta name="'+u+'" content="'+n.metadata.parsed[u]+'">\n';break;default:l+='<meta name="'+u+'" content="'+n.metadata.parsed[u]+'">\n'}return e=i+"<html"+s+">\n<head>\n"+r+o+l+"</head>\n<body>\n"+e.trim()+"\n</body>\n</html>",e=n.converter._dispatch("completeHTMLDocument.after",e,t,n)}),t.subParser("detab",function(e,t,n){"use strict";return e=(e=(e=(e=(e=(e=n.converter._dispatch("detab.before",e,t,n)).replace(/\t(?=\t)/g," ")).replace(/\t/g,"¨A¨B")).replace(/¨B(.+?)¨A/g,function(e,t){for(var n=t,a=4-n.length%4,i=0;i<a;i++)n+=" ";return n})).replace(/¨A/g," ")).replace(/¨B/g,""),e=n.converter._dispatch("detab.after",e,t,n)}),t.subParser("ellipsis",function(e,t,n){"use strict";return t.ellipsis?(e=(e=n.converter._dispatch("ellipsis.before",e,t,n)).replace(/\.\.\./g,"…"),e=n.converter._dispatch("ellipsis.after",e,t,n)):e}),t.subParser("emoji",function(e,n,a){"use strict";if(!n.emoji)return e;return e=(e=a.converter._dispatch("emoji.before",e,n,a)).replace(/:([\S]+?):/g,function(e,n){return t.helper.emojis.hasOwnProperty(n)?t.helper.emojis[n]:e}),e=a.converter._dispatch("emoji.after",e,n,a)}),t.subParser("encodeAmpsAndAngles",function(e,t,n){"use strict";return e=(e=(e=(e=(e=n.converter._dispatch("encodeAmpsAndAngles.before",e,t,n)).replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&")).replace(/<(?![a-z\/?$!])/gi,"<")).replace(/</g,"<")).replace(/>/g,">"),e=n.converter._dispatch("encodeAmpsAndAngles.after",e,t,n)}),t.subParser("encodeBackslashEscapes",function(e,n,a){"use strict";return e=(e=(e=a.converter._dispatch("encodeBackslashEscapes.before",e,n,a)).replace(/\\(\\)/g,t.helper.escapeCharactersCallback)).replace(/\\([`*_{}\[\]()>#+.!~=|:-])/g,t.helper.escapeCharactersCallback),e=a.converter._dispatch("encodeBackslashEscapes.after",e,n,a)}),t.subParser("encodeCode",function(e,n,a){"use strict";return e=(e=a.converter._dispatch("encodeCode.before",e,n,a)).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/([*_{}\[\]\\=~-])/g,t.helper.escapeCharactersCallback),e=a.converter._dispatch("encodeCode.after",e,n,a)}),t.subParser("escapeSpecialCharsWithinTagAttributes",function(e,n,a){"use strict";return e=(e=(e=a.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before",e,n,a)).replace(/<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,function(e){return e.replace(/(.)<\/?code>(?=.)/g,"$1`").replace(/([\\`*_~=|])/g,t.helper.escapeCharactersCallback)})).replace(/<!(--(?:(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>/gi,function(e){return e.replace(/([\\`*_~=|])/g,t.helper.escapeCharactersCallback)}),e=a.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after",e,n,a)}),t.subParser("githubCodeBlocks",function(e,n,a){"use strict";return n.ghCodeBlocks?(e=a.converter._dispatch("githubCodeBlocks.before",e,n,a),e=(e=(e+="¨0").replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g,function(e,i,r,o){var s=n.omitExtraWLInCodeBlocks?"":"\n";return o=t.subParser("encodeCode")(o,n,a),o="<pre><code"+(r?' class="'+r+" language-"+r+'"':"")+">"+(o=(o=(o=t.subParser("detab")(o,n,a)).replace(/^\n+/g,"")).replace(/\n+$/g,""))+s+"</code></pre>",o=t.subParser("hashBlock")(o,n,a),"\n\n¨G"+(a.ghCodeBlocks.push({text:e,codeblock:o})-1)+"G\n\n"})).replace(/¨0/,""),a.converter._dispatch("githubCodeBlocks.after",e,n,a)):e}),t.subParser("hashBlock",function(e,t,n){"use strict";return e=(e=n.converter._dispatch("hashBlock.before",e,t,n)).replace(/(^\n+|\n+$)/g,""),e="\n\n¨K"+(n.gHtmlBlocks.push(e)-1)+"K\n\n",e=n.converter._dispatch("hashBlock.after",e,t,n)}),t.subParser("hashCodeTags",function(e,n,a){"use strict";e=a.converter._dispatch("hashCodeTags.before",e,n,a);return e=t.helper.replaceRecursiveRegExp(e,function(e,i,r,o){var s=r+t.subParser("encodeCode")(i,n,a)+o;return"¨C"+(a.gHtmlSpans.push(s)-1)+"C"},"<code\\b[^>]*>","</code>","gim"),e=a.converter._dispatch("hashCodeTags.after",e,n,a)}),t.subParser("hashElement",function(e,t,n){"use strict";return function(e,t){var a=t;return a=(a=(a=a.replace(/\n\n/g,"\n")).replace(/^\n/,"")).replace(/\n+$/g,""),a="\n\n¨K"+(n.gHtmlBlocks.push(a)-1)+"K\n\n"}}),t.subParser("hashHTMLBlocks",function(e,n,a){"use strict";e=a.converter._dispatch("hashHTMLBlocks.before",e,n,a);var i=["pre","div","h1","h2","h3","h4","h5","h6","blockquote","table","dl","ol","ul","script","noscript","form","fieldset","iframe","math","style","section","header","footer","nav","article","aside","address","audio","canvas","figure","hgroup","output","video","p"],r=function(e,t,n,i){var r=e;return-1!==n.search(/\bmarkdown\b/)&&(r=n+a.converter.makeHtml(t)+i),"\n\n¨K"+(a.gHtmlBlocks.push(r)-1)+"K\n\n"};n.backslashEscapesHTMLTags&&(e=e.replace(/\\<(\/?[^>]+?)>/g,function(e,t){return"<"+t+">"}));for(var o=0;o<i.length;++o)for(var s,l=new RegExp("^ {0,3}(<"+i[o]+"\\b[^>]*>)","im"),u="<"+i[o]+"\\b[^>]*>",c="</"+i[o]+">";-1!==(s=t.helper.regexIndexOf(e,l));){var d=t.helper.splitAtIndex(e,s),h=t.helper.replaceRecursiveRegExp(d[1],r,u,c,"im");if(h===d[1])break;e=d[0].concat(h)}return e=e.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,t.subParser("hashElement")(e,n,a)),e=(e=t.helper.replaceRecursiveRegExp(e,function(e){return"\n\n¨K"+(a.gHtmlBlocks.push(e)-1)+"K\n\n"},"^ {0,3}\x3c!--","--\x3e","gm")).replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,t.subParser("hashElement")(e,n,a)),e=a.converter._dispatch("hashHTMLBlocks.after",e,n,a)}),t.subParser("hashHTMLSpans",function(e,t,n){"use strict";function a(e){return"¨C"+(n.gHtmlSpans.push(e)-1)+"C"}return e=(e=(e=(e=(e=n.converter._dispatch("hashHTMLSpans.before",e,t,n)).replace(/<[^>]+?\/>/gi,function(e){return a(e)})).replace(/<([^>]+?)>[\s\S]*?<\/\1>/g,function(e){return a(e)})).replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g,function(e){return a(e)})).replace(/<[^>]+?>/gi,function(e){return a(e)}),e=n.converter._dispatch("hashHTMLSpansWhy this scored 19/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.