vendor/assets/javascripts/bundle.js in iruby-chartkick-0.3.0 vs vendor/assets/javascripts/bundle.js in iruby-chartkick-0.3.1
- old
+ new
@@ -1,2 +1,2 @@
/*! For license information please see bundle.js.LICENSE.txt */
-(()=>{var t={616:function(t){t.exports=function(){"use strict";function t(t){return"[object Array]"===Object.prototype.toString.call(t)}function e(t){return t instanceof Function}function n(t){return"[object Object]"===Object.prototype.toString.call(t)&&!e(t)&&t instanceof Object}function i(e,r){var o;for(o in r)"__proto__"!==o&&(n(r[o])||t(r[o])?(n(r[o])&&!n(e[o])&&(e[o]={}),t(r[o])&&!t(e[o])&&(e[o]=[]),i(e[o],r[o])):void 0!==r[o]&&(e[o]=r[o]))}function r(t,e){var n={};return i(n,t),i(n,e),n}var o=/^(\d\d\d\d)(-)?(\d\d)(-)?(\d\d)$/i;function a(t){return""+t}function s(t){return parseFloat(t)}function l(t){var e,n,i,r;if("object"!=typeof t)if("number"==typeof t)t=new Date(1e3*t);else{if(e=(t=a(t)).match(o))return n=parseInt(e[1],10),i=parseInt(e[3],10)-1,r=parseInt(e[5],10),new Date(n,i,r);var s=t.replace(/ /,"T").replace(" ","").replace("UTC","Z");t=new Date(Date.parse(s)||t)}return t}function c(e){if(!t(e)){var n,i=[];for(n in e)e.hasOwnProperty(n)&&i.push([n,e[n]]);e=i}return e}function u(t,e,n,i,o,a,s,l){return function(c,u,d){var h=c.data,f=r({},t);return f=r(f,d||{}),(c.singleSeriesFormat||"legend"in u)&&e(f,u.legend,c.singleSeriesFormat),u.title&&n(f,u.title),"min"in u?i(f,u.min):function(t){var e,n,i;for(e=0;e<t.length;e++)for(i=t[e].data,n=0;n<i.length;n++)if(i[n][1]<0)return!0;return!1}(h)||i(f,0),u.max&&o(f,u.max),"stacked"in u&&a(f,u.stacked),u.colors&&(f.colors=u.colors),u.xtitle&&s(f,u.xtitle),u.ytitle&&l(f,u.ytitle),r(f,u.library||{})}}function d(t,e){return t[0].getTime()-e[0].getTime()}function h(t,e){return t[0]-e[0]}function f(t,e){return t-e}function g(t){return 0===t.getMilliseconds()&&0===t.getSeconds()}function p(t){return g(t)&&0===t.getMinutes()}function m(t){return p(t)&&0===t.getHours()}function b(t,e){return m(t)&&t.getDay()===e}function x(t){return m(t)&&1===t.getDate()}function y(t){return x(t)&&0===t.getMonth()}function v(t){return!isNaN(l(t))&&a(t).length>=6}function w(t){return"number"==typeof t}var _=["bytes","KB","MB","GB","TB","PB","EB"];function M(t,e,n,i){t=t||"",n.prefix&&(e<0&&(e*=-1,t+="-"),t+=n.prefix);var r=n.suffix||"",o=n.precision,s=n.round;if(n.byteScale){var l,c=i?n.byteScale:e;c>=0x1000000000000000?(e/=0x1000000000000000,l=6):c>=0x4000000000000?(e/=0x4000000000000,l=5):c>=1099511627776?(e/=1099511627776,l=4):c>=1073741824?(e/=1073741824,l=3):c>=1048576?(e/=1048576,l=2):c>=1024?(e/=1024,l=1):l=0,void 0===o&&void 0===s&&(e>=1023.5&&l<_.length-1&&(e=1,l+=1),o=e>=1e3?4:3),r=" "+_[l]}if(void 0!==o&&void 0!==s)throw Error("Use either round or precision, not both");if(!i&&(void 0!==o&&(e=e.toPrecision(o),n.zeros||(e=parseFloat(e))),void 0!==s))if(s<0){var u=Math.pow(10,-1*s);e=parseInt((1*e/u).toFixed(0))*u}else e=e.toFixed(s),n.zeros||(e=parseFloat(e));if(n.thousands||n.decimal){var d=(e=a(e)).split(".");e=d[0],n.thousands&&(e=e.replace(/\B(?=(\d{3})+(?!\d))/g,n.thousands)),d.length>1&&(e+=(n.decimal||".")+d[1])}return t+e+r}function k(t,e,n){return n in e?e[n]:n in t.options?t.options[n]:null}var C={maintainAspectRatio:!1,animation:!1,plugins:{legend:{},tooltip:{displayColors:!1,callbacks:{}},title:{font:{size:20},color:"#333"}},interaction:{}},T={scales:{y:{ticks:{maxTicksLimit:4},title:{font:{size:16},color:"#333"},grid:{}},x:{grid:{drawOnChartArea:!1},title:{font:{size:16},color:"#333"},time:{},ticks:{}}}},S=["#3366CC","#DC3912","#FF9900","#109618","#990099","#3B3EAC","#0099C6","#DD4477","#66AA00","#B82E2E","#316395","#994499","#22AA99","#AAAA11","#6633CC","#E67300","#8B0707","#329262","#5574A6","#651067"],D=function(t,e,n){void 0!==e?(t.plugins.legend.display=!!e,e&&!0!==e&&(t.plugins.legend.position=e)):n&&(t.plugins.legend.display=!1)},P=function(t,e){t.plugins.title.display=!0,t.plugins.title.text=e},z=function(t,e){null!==e&&(t.scales.x.min=s(e))},O=function(t,e){t.scales.x.max=s(e)},A=function(t,e){t.scales.x.stacked=!!e,t.scales.y.stacked=!!e},E=function(t,e){t.scales.x.title.display=!0,t.scales.x.title.text=e},L=function(t,e){t.scales.y.title.display=!0,t.scales.y.title.text=e},R=function(t,e){var n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return n?"rgba("+parseInt(n[1],16)+", "+parseInt(n[2],16)+", "+parseInt(n[3],16)+", "+e+")":t},F=function(t){return null!=t},I=function(e,n,i){var r={prefix:e.options.prefix,suffix:e.options.suffix,thousands:e.options.thousands,decimal:e.options.decimal,precision:e.options.precision,round:e.options.round,zeros:e.options.zeros};if(e.options.bytes){var o=e.data;"pie"===i&&(o=[{data:o}]);for(var a=0,s=0;s<o.length;s++)for(var l=o[s],c=0;c<l.data.length;c++)l.data[c][1]>a&&(a=l.data[c][1]);for(var u=1;a>=1024;)u*=1024,a/=1024;r.byteScale=u}if("pie"!==i){var d=n.scales.y;"bar"===i&&(d=n.scales.x),r.byteScale&&(d.ticks.stepSize||(d.ticks.stepSize=r.byteScale/2),d.ticks.maxTicksLimit||(d.ticks.maxTicksLimit=4)),d.ticks.callback||(d.ticks.callback=function(t){return M("",t,r,!0)})}if(!n.plugins.tooltip.callbacks.label)if("scatter"===i)n.plugins.tooltip.callbacks.label=function(t){var e=t.dataset.label||"";return e&&(e+=": "),e+"("+t.label+", "+t.formattedValue+")"};else if("bubble"===i)n.plugins.tooltip.callbacks.label=function(t){var e=t.dataset.label||"";e&&(e+=": ");var n=t.raw;return e+"("+n.x+", "+n.y+", "+n.v+")"};else if("pie"===i)n.plugins.tooltip.callbacks.label=function(e){var n=e.label;return t(n)?(n=n.slice())[0]+=": ":n+=": ",M(n,e.parsed,r)};else{var h="bar"===i?"x":"y";n.plugins.tooltip.callbacks.label=function(t){if(null!==t.parsed[h]){var e=t.dataset.label||"";return e&&(e+=": "),M(e,t.parsed[h],r)}}}},N=u(r(C,T),D,P,(function(t,e){null!==e&&(t.scales.y.min=s(e))}),(function(t,e){t.scales.y.max=s(e)}),A,E,L),H=function(e,n,i){var o,a=[],c=[],u=e.options.colors||S,d=!0,h=!0,v=!0,w=!0,_=!0,M=!0,C=e.data,T=0;if("bubble"===i)for(var D=0;D<C.length;D++)for(var P=C[D],z=0;z<P.data.length;z++)P.data[z][2]>T&&(T=P.data[z][2]);var O,A,E,L,I,N,H,B=[],W=[];if("bar"===i||"column"===i||"number"!==e.xtype&&"bubble"!==e.xtype){var U,V,j=[];for(O=0;O<C.length;O++)for(E=C[O],A=0;A<E.data.length;A++)L=E.data[A],B[I="datetime"==e.xtype?L[0].getTime():L[0]]||(B[I]=new Array(C.length)),B[I][O]=s(L[1]),-1===j.indexOf(I)&&j.push(I);for("datetime"!==e.xtype&&"number"!==e.xtype||j.sort(f),A=0;A<C.length;A++)W.push([]);for(V=0;V<j.length;V++)for(O=j[V],"datetime"===e.xtype?(U=new Date(s(O)),d=d&&m(U),o||(o=U.getDay()),h=h&&b(U,o),v=v&&x(U),w=w&&y(U),_=_&&p(U),M=M&&g(U)):U=O,c.push(U),A=0;A<C.length;A++)W[A].push(void 0===B[O][A]?null:B[O][A])}else for(var Y=0;Y<C.length;Y++){for(var q=C[Y],$=[],X=0;X<q.data.length;X++){var Q={x:s(q.data[X][0]),y:s(q.data[X][1])};"bubble"===i&&(Q.r=20*s(q.data[X][2])/T,Q.v=q.data[X][2]),$.push(Q)}W.push($)}for(O=0;O<C.length;O++){if(E=C[O],!e.options.colors||!e.singleSeriesFormat||"bar"!==i&&"column"!==i||E.color||!t(e.options.colors)||t(e.options.colors[0]))N=E.color||u[O],H="line"!==i?R(N,.5):N;else{N=u,H=[];for(var G=0;G<u.length;G++)H[G]=R(N[G],.5)}var K={label:E.name||"",data:W[O],fill:"area"===i,borderColor:N,backgroundColor:H,borderWidth:2},J="line"===i||"area"===i||"scatter"===i||"bubble"===i;J&&(K.pointBackgroundColor=N,K.pointHoverBackgroundColor=N,K.pointHitRadius=50),"bubble"===i&&(K.pointBackgroundColor=H,K.pointHoverBackgroundColor=H,K.pointHoverBorderWidth=2),E.stack&&(K.stack=E.stack),!1===k(e,E,"curve")?K.tension=0:J&&(K.tension=.4),!1===k(e,E,"points")&&(K.pointRadius=0,K.pointHoverRadius=0),K=r(K,e.options.dataset||{}),K=r(K,E.library||{}),K=r(K,E.dataset||{}),a.push(K)}var Z=e.options.xmin,tt=e.options.xmax;if("datetime"===e.xtype?(F(Z)&&(n.scales.x.ticks.min=l(Z).getTime()),F(tt)&&(n.scales.x.ticks.max=l(tt).getTime())):"number"===e.xtype&&(F(Z)&&(n.scales.x.ticks.min=Z),F(tt)&&(n.scales.x.ticks.max=tt)),"datetime"===e.xtype&&0===c.length&&(F(Z)&&c.push(l(Z)),F(tt)&&c.push(l(tt)),d=!1,h=!1,v=!1,w=!1,_=!1,M=!1),"datetime"===e.xtype&&c.length>0){var et=(F(Z)?l(Z):c[0]).getTime(),nt=(F(tt)?l(tt):c[0]).getTime();for(O=1;O<c.length;O++){var it=c[O].getTime();it<et&&(et=it),it>nt&&(nt=it)}var rt,ot=(nt-et)/864e5;if(!n.scales.x.time.unit&&(w||ot>3650?(n.scales.x.time.unit="year",rt=365):v||ot>300?(n.scales.x.time.unit="month",rt=30):d||ot>10?(n.scales.x.time.unit="day",rt=1):_||ot>.5?(n.scales.x.time.displayFormats={hour:"MMM d, h a"},n.scales.x.time.unit="hour",rt=1/24):M&&(n.scales.x.time.displayFormats={minute:"h:mm a"},n.scales.x.time.unit="minute",rt=1/24/60),rt&&ot>0)){var at=e.element.offsetWidth;if(at>0){var st=Math.ceil(ot/rt/(at/100));h&&1===rt&&(st=7*Math.ceil(st/7)),n.scales.x.time.stepSize=st}}n.scales.x.time.tooltipFormat||(d?n.scales.x.time.tooltipFormat="PP":_?n.scales.x.time.tooltipFormat="MMM d, h a":M&&(n.scales.x.time.tooltipFormat="h:mm a"))}return{labels:c,datasets:a}},B=function(t){this.name="chartjs",this.library=t};B.prototype.renderLineChart=function(t,e){var n={};!t.options.max&&function(t){var e,n,i;for(e=0;e<t.length;e++)for(i=t[e].data,n=0;n<i.length;n++)if(0!=i[n][1])return!1;return!0}(t.data)&&(n.max=1);var i=N(t,r(n,t.options));I(t,i,e);var o=H(t,i,e||"line");"number"===t.xtype?(i.scales.x.type=i.scales.x.type||"linear",i.scales.x.position=i.scales.x.position||"bottom"):i.scales.x.type="string"===t.xtype?"category":"time",this.drawChart(t,"line",o,i)},B.prototype.renderPieChart=function(t){var e=r({},C);t.options.donut&&(e.cutout="50%"),"legend"in t.options&&D(e,t.options.legend),t.options.title&&P(e,t.options.title),e=r(e,t.options.library||{}),I(t,e,"pie");for(var n=[],i=[],o=0;o<t.data.length;o++){var a=t.data[o];n.push(a[0]),i.push(a[1])}var s={data:i,backgroundColor:t.options.colors||S},l={labels:n,datasets:[s=r(s,t.options.dataset||{})]};this.drawChart(t,"pie",l,e)},B.prototype.renderColumnChart=function(t,e){var n;if("bar"===e){var i=r(C,T);i.indexAxis="y",i.scales.x.grid.drawOnChartArea=!0,i.scales.y.grid.drawOnChartArea=!1,delete i.scales.y.ticks.maxTicksLimit,n=u(i,D,P,z,O,A,E,L)(t,t.options)}else n=N(t,t.options);I(t,n,e);var o=H(t,n,"column");"bar"!==e&&function(t,e,n){var i=Math.ceil(t.element.offsetWidth/4/e.labels.length);i>25?i=25:i<10&&(i=10),n.scales.x.ticks.callback||(n.scales.x.ticks.callback=function(t){return(t=a(this.getLabelForValue(t))).length>i?t.substring(0,i-2)+"...":t})}(t,o,n),this.drawChart(t,"bar",o,n)},B.prototype.renderAreaChart=function(t){this.renderLineChart(t,"area")},B.prototype.renderBarChart=function(t){this.renderColumnChart(t,"bar")},B.prototype.renderScatterChart=function(t,e){e=e||"scatter";var n=N(t,t.options);I(t,n,e),"showLine"in n||(n.showLine=!1);var i=H(t,n,e);n.scales.x.type=n.scales.x.type||"linear",n.scales.x.position=n.scales.x.position||"bottom","mode"in n.interaction||(n.interaction.mode="nearest"),this.drawChart(t,e,i,n)},B.prototype.renderBubbleChart=function(t){this.renderScatterChart(t,"bubble")},B.prototype.destroy=function(t){t.chart&&t.chart.destroy()},B.prototype.drawChart=function(t,e,n,i){if(this.destroy(t),!t.destroyed){var r={type:e,data:n,options:i};t.options.code&&window.console.log("new Chart(ctx, "+JSON.stringify(r)+");"),t.element.innerHTML="<canvas></canvas>";var o=t.element.getElementsByTagName("CANVAS")[0];t.chart=new this.library(o,r)}};var W={chart:{},xAxis:{title:{text:null},labels:{style:{fontSize:"12px"}}},yAxis:{title:{text:null},labels:{style:{fontSize:"12px"}}},title:{text:null},credits:{enabled:!1},legend:{borderWidth:0},tooltip:{style:{fontSize:"12px"}},plotOptions:{areaspline:{},area:{},series:{marker:{}}},time:{useUTC:!1}},U=function(t,e,n){void 0!==e?(t.legend.enabled=!!e,e&&!0!==e&&("top"===e||"bottom"===e?t.legend.verticalAlign=e:(t.legend.layout="vertical",t.legend.verticalAlign="middle",t.legend.align=e))):n&&(t.legend.enabled=!1)},V=function(t,e){t.title.text=e},j=u(W,U,V,(function(t,e){t.yAxis.min=e}),(function(t,e){t.yAxis.max=e}),(function(t,e){var n=e?!0===e?"normal":e:null;t.plotOptions.series.stacking=n,t.plotOptions.area.stacking=n,t.plotOptions.areaspline.stacking=n}),(function(t,e){t.xAxis.title.text=e}),(function(t,e){t.yAxis.title.text=e})),Y=function(t,e,n){var i={prefix:t.options.prefix,suffix:t.options.suffix,thousands:t.options.thousands,decimal:t.options.decimal,precision:t.options.precision,round:t.options.round,zeros:t.options.zeros};"pie"===n||e.yAxis.labels.formatter||(e.yAxis.labels.formatter=function(){return M("",this.value,i)}),e.tooltip.pointFormatter||e.tooltip.pointFormat||(e.tooltip.pointFormatter=function(){return'<span style="color:'+this.color+'">●</span> '+M(this.series.name+": <b>",this.y,i)+"</b><br/>"})},q=function(t){this.name="highcharts",this.library=t};q.prototype.renderLineChart=function(t,e){var n={};"areaspline"===(e=e||"spline")&&(n={plotOptions:{areaspline:{stacking:"normal"},area:{stacking:"normal"},series:{marker:{enabled:!1}}}}),!1===t.options.curve&&("areaspline"===e?e="area":"spline"===e&&(e="line"));var i,r,o,a=j(t,t.options,n);"number"===t.xtype?a.xAxis.type=a.xAxis.type||"linear":a.xAxis.type="string"===t.xtype?"category":"datetime",a.chart.type||(a.chart.type=e),Y(t,a,e);var s=t.data;for(r=0;r<s.length;r++){if(s[r].name=s[r].name||"Value",i=s[r].data,"datetime"===t.xtype)for(o=0;o<i.length;o++)i[o][0]=i[o][0].getTime();s[r].marker={symbol:"circle"},!1===t.options.points&&(s[r].marker.enabled=!1)}this.drawChart(t,s,a)},q.prototype.renderScatterChart=function(t){var e=j(t,t.options,{});e.chart.type="scatter",this.drawChart(t,t.data,e)},q.prototype.renderPieChart=function(t){var e=r(W,{});t.options.colors&&(e.colors=t.options.colors),t.options.donut&&(e.plotOptions={pie:{innerSize:"50%"}}),"legend"in t.options&&U(e,t.options.legend),t.options.title&&V(e,t.options.title);var n=r(e,t.options.library||{});Y(t,n,"pie");var i=[{type:"pie",name:t.options.label||"Value",data:t.data}];this.drawChart(t,i,n)},q.prototype.renderColumnChart=function(t,e){e=e||"column";var n,i,r,o,a=t.data,s=j(t,t.options),l=[],c=[];for(s.chart.type=e,Y(t,s,e),n=0;n<a.length;n++)for(r=a[n],i=0;i<r.data.length;i++)l[(o=r.data[i])[0]]||(l[o[0]]=new Array(a.length),c.push(o[0])),l[o[0]][n]=o[1];"number"===t.xtype&&c.sort(f),s.xAxis.categories=c;var u,d=[];for(n=0;n<a.length;n++){for(o=[],i=0;i<c.length;i++)o.push(l[c[i]][n]||0);u={name:a[n].name||"Value",data:o},a[n].stack&&(u.stack=a[n].stack),d.push(u)}this.drawChart(t,d,s)},q.prototype.renderBarChart=function(t){this.renderColumnChart(t,"bar")},q.prototype.renderAreaChart=function(t){this.renderLineChart(t,"areaspline")},q.prototype.destroy=function(t){t.chart&&t.chart.destroy()},q.prototype.drawChart=function(t,e,n){this.destroy(t),t.destroyed||(n.chart.renderTo=t.element.id,n.series=e,t.options.code&&window.console.log("new Highcharts.Chart("+JSON.stringify(n)+");"),t.chart=new this.library.Chart(n))};var $={},X=[],Q={chartArea:{},fontName:"'Lucida Grande', 'Lucida Sans Unicode', Verdana, Arial, Helvetica, sans-serif",pointSize:6,legend:{textStyle:{fontSize:12,color:"#444"},alignment:"center",position:"right"},curveType:"function",hAxis:{textStyle:{color:"#666",fontSize:12},titleTextStyle:{},gridlines:{color:"transparent"},baselineColor:"#ccc",viewWindow:{}},vAxis:{textStyle:{color:"#666",fontSize:12},titleTextStyle:{},baselineColor:"#ccc",viewWindow:{}},tooltip:{textStyle:{color:"#666",fontSize:12}}},G=function(t,e,n){var i;void 0!==e?(i=e?!0===e?"right":e:"none",t.legend.position=i):n&&(t.legend.position="none")},K=function(t,e){t.title=e,t.titleTextStyle={color:"#333",fontSize:"20px"}},J=function(t,e){t.hAxis.viewWindow.min=e},Z=function(t,e){t.hAxis.viewWindow.max=e},tt=function(t,e){t.isStacked=e||!1},et=function(t,e){t.hAxis.title=e,t.hAxis.titleTextStyle.italic=!1},nt=function(t,e){t.vAxis.title=e,t.vAxis.titleTextStyle.italic=!1},it=u(Q,G,K,(function(t,e){t.vAxis.viewWindow.min=e}),(function(t,e){t.vAxis.viewWindow.max=e}),tt,et,nt),rt=function(t){this.name="google",this.library=t};function ot(t,e){var n,i,r=[];if(i="number"===e?s:"datetime"===e?l:a,"bubble"===e)for(n=0;n<t.length;n++)r.push([s(t[n][0]),s(t[n][1]),s(t[n][2])]);else for(n=0;n<t.length;n++)r.push([i(t[n][0]),s(t[n][1])]);return"datetime"===e?r.sort(d):"number"===e&&r.sort(h),r}function at(t,e){var n,i,r;for(n=0;n<t.length;n++)for(r=c(t[n].data),i=0;i<r.length;i++)if(!e(r[i][0]))return!1;return!0}function st(e,n,i){var r,o=e.options,a=e.rawData;for(e.singleSeriesFormat=!t(a)||"object"!=typeof a[0]||t(a[0]),e.singleSeriesFormat&&(a=[{name:o.label,data:a}]),a=function(t){var e,n,i=[];for(e=0;e<t.length;e++){var r={};for(n in t[e])t[e].hasOwnProperty(n)&&(r[n]=t[e][n]);i.push(r)}return i}(a),r=0;r<a.length;r++)a[r].data=c(a[r].data);for(e.xtype=n||(o.discrete?"string":function(t,e,n){return ct(t)?!n.xmin&&!n.xmax||n.xmin&&!v(n.xmin)||n.xmax&&!v(n.xmax)?"number":"datetime":at(t,w)?"number":!e&&at(t,v)?"datetime":"string"}(a,i,o)),r=0;r<a.length;r++)a[r].data=ot(a[r].data,e.xtype);return a}function lt(t){var e,n=c(t.rawData);for(e=0;e<n.length;e++)n[e]=[a(n[e][0]),s(n[e][1])];return n}function ct(t,e){if("PieChart"===e||"GeoChart"===e||"Timeline"===e)return 0===t.length;for(var n=0;n<t.length;n++)if(t[n].data.length>0)return!1;return!0}function ut(t,e,n){if(t.addEventListener)return t.addEventListener(e,n,!1),n;var i=function(){return n.call(t,window.event)};return t.attachEvent("on"+e,i),i}function dt(t,e,n){t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent("on"+e,n)}function ht(t,e){if(t===e)return!1;for(;e&&e!==t;)e=e.parentNode;return e===t}rt.prototype.renderLineChart=function(t){var e=this;this.waitForLoaded(t,(function(){var n={};!1===t.options.curve&&(n.curveType="none"),!1===t.options.points&&(n.pointSize=0);var i=it(t,t.options,n),r=e.createDataTable(t.data,t.xtype);e.drawChart(t,"LineChart",r,i)}))},rt.prototype.renderPieChart=function(t){var e=this;this.waitForLoaded(t,(function(){var n={chartArea:{top:"10%",height:"80%"},legend:{}};t.options.colors&&(n.colors=t.options.colors),t.options.donut&&(n.pieHole=.5),"legend"in t.options&&G(n,t.options.legend),t.options.title&&K(n,t.options.title);var i=r(r(Q,n),t.options.library||{}),o=new e.library.visualization.DataTable;o.addColumn("string",""),o.addColumn("number","Value"),o.addRows(t.data),e.drawChart(t,"PieChart",o,i)}))},rt.prototype.renderColumnChart=function(t){var e=this;this.waitForLoaded(t,(function(){var n=it(t,t.options),i=e.createDataTable(t.data,t.xtype);e.drawChart(t,"ColumnChart",i,n)}))},rt.prototype.renderBarChart=function(t){var e=this;this.waitForLoaded(t,(function(){var n=u(Q,G,K,J,Z,tt,et,nt)(t,t.options,{hAxis:{gridlines:{color:"#ccc"}}}),i=e.createDataTable(t.data,t.xtype);e.drawChart(t,"BarChart",i,n)}))},rt.prototype.renderAreaChart=function(t){var e=this;this.waitForLoaded(t,(function(){var n=it(t,t.options,{isStacked:!0,pointSize:0,areaOpacity:.5}),i=e.createDataTable(t.data,t.xtype);e.drawChart(t,"AreaChart",i,n)}))},rt.prototype.renderGeoChart=function(t){var e=this;this.waitForLoaded(t,"geochart",(function(){var n={legend:"none",colorAxis:{colors:t.options.colors||["#f6c7b6","#ce502d"]}},i=r(r(Q,n),t.options.library||{}),o=new e.library.visualization.DataTable;o.addColumn("string",""),o.addColumn("number",t.options.label||"Value"),o.addRows(t.data),e.drawChart(t,"GeoChart",o,i)}))},rt.prototype.renderScatterChart=function(t){var e=this;this.waitForLoaded(t,(function(){var n,i,r,o,a=it(t,t.options,{}),s=t.data,l=[];for(n=0;n<s.length;n++)for(s[n].name=s[n].name||"Value",o=s[n].data,i=0;i<o.length;i++){var c=new Array(s.length+1);c[0]=o[i][0],c[n+1]=o[i][1],l.push(c)}for((r=new e.library.visualization.DataTable).addColumn("number",""),n=0;n<s.length;n++)r.addColumn("number",s[n].name);r.addRows(l),e.drawChart(t,"ScatterChart",r,a)}))},rt.prototype.renderTimeline=function(t){var e=this;this.waitForLoaded(t,"timeline",(function(){var n={legend:"none"};t.options.colors&&(n.colors=t.options.colors);var i=r(r(Q,n),t.options.library||{}),o=new e.library.visualization.DataTable;o.addColumn({type:"string",id:"Name"}),o.addColumn({type:"date",id:"Start"}),o.addColumn({type:"date",id:"End"}),o.addRows(t.data),t.element.style.lineHeight="normal",e.drawChart(t,"Timeline",o,i)}))},rt.prototype.destroy=function(t){t.chart&&t.chart.clearChart()},rt.prototype.drawChart=function(t,e,n,i){var r;this.destroy(t),t.destroyed||(t.options.code&&window.console.log("var data = new google.visualization.DataTable("+n.toJSON()+");\nvar chart = new google.visualization."+e+"(element);\nchart.draw(data, "+JSON.stringify(i)+");"),t.chart=new this.library.visualization[e](t.element),r=function(){t.chart.draw(n,i)},window.attachEvent?window.attachEvent("onresize",r):window.addEventListener&&window.addEventListener("resize",r,!0),r())},rt.prototype.waitForLoaded=function(t,e,n){var i=this;if(n||(n=e,e="corechart"),X.push({pack:e,callback:n}),$[e])this.runCallbacks();else{$[e]=!0;var r={packages:[e],callback:function(){i.runCallbacks()}},o=t.__config();o.language&&(r.language=o.language),"geochart"===e&&o.mapsApiKey&&(r.mapsApiKey=o.mapsApiKey),this.library.charts.load("current",r)}},rt.prototype.runCallbacks=function(){for(var t,e=0;e<X.length;e++)t=X[e],this.library.visualization&&("corechart"===t.pack&&this.library.visualization.LineChart||"timeline"===t.pack&&this.library.visualization.Timeline||"geochart"===t.pack&&this.library.visualization.GeoChart)&&(t.callback(),X.splice(e,1),e--)},rt.prototype.createDataTable=function(t,e){var n,i,r,o,l,c=[],u=[];for(n=0;n<t.length;n++)for(r=t[n],t[n].name=t[n].name||"Value",i=0;i<r.data.length;i++)o=r.data[i],c[l="datetime"===e?o[0].getTime():o[0]]||(c[l]=new Array(t.length),u.push(l)),c[l][n]=s(o[1]);var f,g=[],p=!0;for(i=0;i<u.length;i++)n=u[i],"datetime"===e?(f=new Date(s(n)),p=p&&m(f)):f="number"===e?s(n):n,g.push([f].concat(c[n]));if("datetime"===e)g.sort(d);else if("number"===e){for(g.sort(h),n=0;n<g.length;n++)g[n][0]=a(g[n][0]);e="string"}var b=new this.library.visualization.DataTable;for(e="datetime"===e&&p?"date":e,b.addColumn(e,""),n=0;n<t.length;n++)b.addColumn("number",t[n].name);return b.addRows(g),b};var ft=[],gt=0;function pt(){if(gt<4){var t=ft.shift();t&&(gt++,e=t[0],n=t[1],i=t[2],function(t,e,n){var i=window.jQuery||window.Zepto||window.$;if(i&&i.ajax)i.ajax({dataType:"json",url:t,success:e,error:n,complete:mt});else{var r=new XMLHttpRequest;r.open("GET",t,!0),r.setRequestHeader("Content-Type","application/json"),r.onload=function(){mt(),200===r.status?e(JSON.parse(r.responseText),r.statusText,r):n(r,"error",r.statusText)},r.send()}}(e,n,(function(t,e,n){var r="string"==typeof n?n:n.message;i(r)})),pt())}var e,n,i}function mt(){gt--,pt()}var bt={},xt=[];function yt(t,e){document.body.innerText?t.innerText=e:t.textContent=e}function vt(t,e,n){n||(e="Error Loading Chart: "+e),yt(t,e),t.style.color="#ff0000"}function wt(t){try{t.__render()}catch(e){throw vt(t.element,e.message),e}}function _t(t,e,n){if(n&&t.options.loading&&("string"==typeof e||"function"==typeof e)&&yt(t.element,t.options.loading),"string"==typeof e)i=e,r=function(e){t.rawData=e,wt(t)},o=function(e){vt(t.element,e)},ft.push([i,r,o]),pt();else if("function"==typeof e)try{e((function(e){t.rawData=e,wt(t)}),(function(e){vt(t.element,e,!0)}))}catch(e){vt(t.element,e,!0)}else t.rawData=e,wt(t);var i,r,o}function Mt(t){var n=new(function(t){if(t){if("Highcharts"===t.product)return q;if(t.charts)return rt;if(e(t))return B}throw new Error("Unknown adapter")}(t))(t);-1===xt.indexOf(n)&&xt.push(n)}function kt(t,n){if(ct(n.data,t)){var i=n.options.empty||n.options.messages&&n.options.messages.empty||"No data";yt(n.element,i)}else(function(t,n){var i,r,o,a;for((o="render"+t,a=n.options.adapter,"Chart"in window&&Mt(window.Chart),"Highcharts"in window&&Mt(window.Highcharts),window.google&&window.google.charts&&Mt(window.google),i=0);i<xt.length;i++)if(r=xt[i],(!a||a===r.name)&&e(r[o]))return n.adapter=r.name,n.__adapterObject=r,r[o](n);throw xt.length>0?new Error("No charting library found for "+t):new Error("No charting libraries found - be sure to include one before your charts")})(t,n),n.options.download&&!n.__downloadAttached&&"chartjs"===n.adapter&&function(t){var e=t.element,n=document.createElement("a"),i=t.options.download;!0===i?i={}:"string"==typeof i&&(i={filename:i}),n.download=i.filename||"chart.png",n.style.position="absolute",n.style.top="20px",n.style.right="20px",n.style.zIndex=1e3,n.style.lineHeight="20px",n.target="_blank";var r=document.createElement("img");r.alt="Download",r.style.border="none",r.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAABCFBMVEUAAADMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMywEsqxAAAAV3RSTlMAAQIDBggJCgsMDQ4PERQaHB0eISIjJCouLzE0OTo/QUJHSUpLTU5PUllhYmltcHh5foWLjI+SlaCio6atr7S1t7m6vsHHyM7R2tze5Obo7fHz9ff5+/1hlxK2AAAA30lEQVQYGUXBhVYCQQBA0TdYWAt2d3d3YWAHyur7/z9xgD16Lw0DW+XKx+1GgX+FRzM3HWQWrHl5N/oapW5RPe0PkBu+UYeICvozTWZVK23Ao04B79oJrOsJDOoxkZoQPWgX29pHpCZEk7rEvQYiNSFq1UMqvlCjJkRBS1R8hb00Vb/TajtBL7nTHE1X1vyMQF732dQhyF2o6SAwrzP06iUQzvwsArlnzcOdrgBhJyHa1QOgO9U1GsKuvjUTjavliZYQ8nNPapG6sap/3nrIdJ6bOWzmX/fy0XVpfzZP3S8OJT3g9EEiJwAAAABJRU5ErkJggg==",n.appendChild(r),e.style.position="relative",t.__downloadAttached=!0,t.__enterEvent=ut(e,"mouseover",(function(r){var o=r.relatedTarget;o&&(o===this||ht(this,o))||!t.options.download||(n.href=t.toImage(i),e.appendChild(n))})),t.__leaveEvent=ut(e,"mouseout",(function(t){var e=t.relatedTarget;e&&(e===this||ht(this,e))||n.parentNode&&n.parentNode.removeChild(n)}))}(n)}var Ct=function(t,e,n){var i;if("string"==typeof t&&(i=t,!(t=document.getElementById(t))))throw new Error("No element with id "+i);this.element=t,this.options=r(Rt.options,n||{}),this.dataSource=e,Rt.charts[t.id]=this,_t(this,e,!0),this.options.refresh&&this.startRefresh()};Ct.prototype.getElement=function(){return this.element},Ct.prototype.getDataSource=function(){return this.dataSource},Ct.prototype.getData=function(){return this.data},Ct.prototype.getOptions=function(){return this.options},Ct.prototype.getChartObject=function(){return this.chart},Ct.prototype.getAdapter=function(){return this.adapter},Ct.prototype.updateData=function(t,e){this.dataSource=t,e&&this.__updateOptions(e),_t(this,t,!0)},Ct.prototype.setOptions=function(t){this.__updateOptions(t),this.redraw()},Ct.prototype.redraw=function(){_t(this,this.rawData)},Ct.prototype.refreshData=function(){if("string"==typeof this.dataSource){var t=-1===this.dataSource.indexOf("?")?"?":"&";_t(this,this.dataSource+t+"_="+(new Date).getTime())}else"function"==typeof this.dataSource&&_t(this,this.dataSource)},Ct.prototype.startRefresh=function(){var t=this,e=this.options.refresh;if(e&&"string"!=typeof this.dataSource&&"function"!=typeof this.dataSource)throw new Error("Data source must be a URL or callback for refresh");if(!this.intervalId){if(!e)throw new Error("No refresh interval");this.intervalId=setInterval((function(){t.refreshData()}),1e3*e)}},Ct.prototype.stopRefresh=function(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)},Ct.prototype.toImage=function(t){if("chartjs"===this.adapter){if(t&&t.background&&"transparent"!==t.background){var e=this.chart.canvas,n=this.chart.ctx,i=document.createElement("canvas"),r=i.getContext("2d");return i.width=n.canvas.width,i.height=n.canvas.height,r.fillStyle=t.background,r.fillRect(0,0,i.width,i.height),r.drawImage(e,0,0),i.toDataURL("image/png")}return this.chart.toBase64Image()}throw new Error("Feature only available for Chart.js")},Ct.prototype.destroy=function(){this.destroyed=!0,this.stopRefresh(),this.__adapterObject&&this.__adapterObject.destroy(this),this.__enterEvent&&dt(this.element,"mouseover",this.__enterEvent),this.__leaveEvent&&dt(this.element,"mouseout",this.__leaveEvent)},Ct.prototype.__updateOptions=function(t){var e=t.refresh&&t.refresh!==this.options.refresh;this.options=r(Rt.options,t),e&&(this.stopRefresh(),this.startRefresh())},Ct.prototype.__render=function(){this.data=this.__processData(),kt(this.__chartName(),this)},Ct.prototype.__config=function(){return bt};var Tt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return st(this)},e.prototype.__chartName=function(){return"LineChart"},e}(Ct),St=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return lt(this)},e.prototype.__chartName=function(){return"PieChart"},e}(Ct),Dt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return st(this,null,!0)},e.prototype.__chartName=function(){return"ColumnChart"},e}(Ct),Pt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return st(this,null,!0)},e.prototype.__chartName=function(){return"BarChart"},e}(Ct),zt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return st(this)},e.prototype.__chartName=function(){return"AreaChart"},e}(Ct),Ot=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return lt(this)},e.prototype.__chartName=function(){return"GeoChart"},e}(Ct),At=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return st(this,"number")},e.prototype.__chartName=function(){return"ScatterChart"},e}(Ct),Et=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return st(this,"bubble")},e.prototype.__chartName=function(){return"BubbleChart"},e}(Ct),Lt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){var t,e=this.rawData;for(t=0;t<e.length;t++)e[t][1]=l(e[t][1]),e[t][2]=l(e[t][2]);return e},e.prototype.__chartName=function(){return"Timeline"},e}(Ct),Rt={LineChart:Tt,PieChart:St,ColumnChart:Dt,BarChart:Pt,AreaChart:zt,GeoChart:Ot,ScatterChart:At,BubbleChart:Et,Timeline:Lt,charts:{},configure:function(t){for(var e in t)t.hasOwnProperty(e)&&(bt[e]=t[e])},setDefaultOptions:function(t){Rt.options=t},eachChart:function(t){for(var e in Rt.charts)Rt.charts.hasOwnProperty(e)&&t(Rt.charts[e])},destroyAll:function(){for(var t in Rt.charts)Rt.charts.hasOwnProperty(t)&&(Rt.charts[t].destroy(),delete Rt.charts[t])},config:bt,options:{},adapters:xt,addAdapter:Mt,use:function(t){return Mt(t),Rt}};return"undefined"==typeof window||window.Chartkick||(window.Chartkick=Rt,document.addEventListener("turbolinks:before-render",(function(){Rt.destroyAll()})),setTimeout((function(){window.dispatchEvent(new Event("chartkick:load"))}),0)),Rt.default=Rt,Rt}()}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var o=e[i]={exports:{}};return t[i].call(o.exports,o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=n(616),e=n.n(t);const i="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function r(t,e,n){const r=n||(t=>Array.prototype.slice.call(t));let o=!1,a=[];return function(...n){a=r(n),o||(o=!0,i.call(window,(()=>{o=!1,t.apply(e,a)})))}}const o=t=>"start"===t?"left":"end"===t?"right":"center",a=(t,e,n)=>"start"===t?e:"end"===t?n:(e+n)/2;function s(){}const l=function(){let t=0;return function(){return t++}}();function c(t){return null==t}function u(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)}function d(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}const h=t=>("number"==typeof t||t instanceof Number)&&isFinite(+t);function f(t,e){return h(t)?t:e}function g(t,e){return void 0===t?e:t}const p=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function m(t,e,n){if(t&&"function"==typeof t.call)return t.apply(n,e)}function b(t,e,n,i){let r,o,a;if(u(t))if(o=t.length,i)for(r=o-1;r>=0;r--)e.call(n,t[r],r);else for(r=0;r<o;r++)e.call(n,t[r],r);else if(d(t))for(a=Object.keys(t),o=a.length,r=0;r<o;r++)e.call(n,t[a[r]],a[r])}function x(t,e){let n,i,r,o;if(!t||!e||t.length!==e.length)return!1;for(n=0,i=t.length;n<i;++n)if(r=t[n],o=e[n],r.datasetIndex!==o.datasetIndex||r.index!==o.index)return!1;return!0}function y(t){if(u(t))return t.map(y);if(d(t)){const e=Object.create(null),n=Object.keys(t),i=n.length;let r=0;for(;r<i;++r)e[n[r]]=y(t[n[r]]);return e}return t}function v(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function w(t,e,n,i){if(!v(t))return;const r=e[t],o=n[t];d(r)&&d(o)?_(r,o,i):e[t]=y(o)}function _(t,e,n){const i=u(e)?e:[e],r=i.length;if(!d(t))return t;const o=(n=n||{}).merger||w;for(let a=0;a<r;++a){if(!d(e=i[a]))continue;const r=Object.keys(e);for(let i=0,a=r.length;i<a;++i)o(r[i],t,e,n)}return t}function M(t,e){return _(t,e,{merger:k})}function k(t,e,n){if(!v(t))return;const i=e[t],r=n[t];d(i)&&d(r)?M(i,r):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=y(r))}function C(t,e){const n=t.indexOf(".",e);return-1===n?t.length:n}function T(t,e){if(""===e)return t;let n=0,i=C(e,n);for(;t&&i>n;)t=t[e.substr(n,i-n)],n=i+1,i=C(e,n);return t}function S(t){return t.charAt(0).toUpperCase()+t.slice(1)}const D=t=>void 0!==t,P=t=>"function"==typeof t,z=Math.PI,O=2*z,A=O+z,E=Number.POSITIVE_INFINITY,L=z/180,R=z/2,F=z/4,I=2*z/3,N=Math.log10,H=Math.sign;function B(t){const e=Math.round(t);t=U(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(N(t))),i=t/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function W(t){return!isNaN(parseFloat(t))&&isFinite(t)}function U(t,e,n){return Math.abs(t-e)<n}function V(t,e,n){let i,r,o;for(i=0,r=t.length;i<r;i++)o=t[i][n],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}function j(t){return t*(z/180)}function Y(t){return t*(180/z)}function q(t){if(!h(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function $(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function X(t,e){return(t-e+A)%O-z}function Q(t){return(t%O+O)%O}function G(t,e,n,i){const r=Q(t),o=Q(e),a=Q(n),s=Q(o-r),l=Q(a-r),c=Q(r-o),u=Q(r-a);return r===o||r===a||i&&o===a||s>l&&c<u}function K(t,e,n){return Math.max(e,Math.min(n,t))}const J=t=>0===t||1===t,Z=(t,e,n)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*O/n),tt=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*O/n)+1,et={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*R),easeOutSine:t=>Math.sin(t*R),easeInOutSine:t=>-.5*(Math.cos(z*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>J(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>J(t)?t:Z(t,.075,.3),easeOutElastic:t=>J(t)?t:tt(t,.075,.3),easeInOutElastic(t){const e=.1125;return J(t)?t:t<.5?.5*Z(2*t,e,.45):.5+.5*tt(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-et.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,n=2.75;return t<1/n?e*t*t:t<2/n?e*(t-=1.5/n)*t+.75:t<2.5/n?e*(t-=2.25/n)*t+.9375:e*(t-=2.625/n)*t+.984375},easeInOutBounce:t=>t<.5?.5*et.easeInBounce(2*t):.5*et.easeOutBounce(2*t-1)+.5},nt={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},it="0123456789ABCDEF",rt=t=>it[15&t],ot=t=>it[(240&t)>>4]+it[15&t],at=t=>(240&t)>>4==(15&t);function st(t){return t+.5|0}const lt=(t,e,n)=>Math.max(Math.min(t,n),e);function ct(t){return lt(st(2.55*t),0,255)}function ut(t){return lt(st(255*t),0,255)}function dt(t){return lt(st(t/2.55)/100,0,1)}function ht(t){return lt(st(100*t),0,100)}const ft=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,gt=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function pt(t,e,n){const i=e*Math.min(n,1-n),r=(e,r=(e+t/30)%12)=>n-i*Math.max(Math.min(r-3,9-r,1),-1);return[r(0),r(8),r(4)]}function mt(t,e,n){const i=(i,r=(i+t/60)%6)=>n-n*e*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function bt(t,e,n){const i=pt(t,1,.5);let r;for(e+n>1&&(r=1/(e+n),e*=r,n*=r),r=0;r<3;r++)i[r]*=1-e-n,i[r]+=e;return i}function xt(t){const e=t.r/255,n=t.g/255,i=t.b/255,r=Math.max(e,n,i),o=Math.min(e,n,i),a=(r+o)/2;let s,l,c;return r!==o&&(c=r-o,l=a>.5?c/(2-r-o):c/(r+o),s=r===e?(n-i)/c+(n<i?6:0):r===n?(i-e)/c+2:(e-n)/c+4,s=60*s+.5),[0|s,l||0,a]}function yt(t,e,n,i){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,i)).map(ut)}function vt(t,e,n){return yt(pt,t,e,n)}function wt(t){return(t%360+360)%360}const _t={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"},Mt={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 kt;function Ct(t,e,n){if(t){let i=xt(t);i[e]=Math.max(0,Math.min(i[e]+i[e]*n,0===e?360:1)),i=vt(i),t.r=i[0],t.g=i[1],t.b=i[2]}}function Tt(t,e){return t?Object.assign(e||{},t):t}function St(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=ut(t[3]))):(e=Tt(t,{r:0,g:0,b:0,a:1})).a=ut(e.a),e}function Dt(t){return"r"===t.charAt(0)?function(t){const e=ft.exec(t);let n,i,r,o=255;if(e){if(e[7]!==n){const t=+e[7];o=255&(e[8]?ct(t):255*t)}return n=+e[1],i=+e[3],r=+e[5],n=255&(e[2]?ct(n):n),i=255&(e[4]?ct(i):i),r=255&(e[6]?ct(r):r),{r:n,g:i,b:r,a:o}}}(t):function(t){const e=gt.exec(t);let n,i=255;if(!e)return;e[5]!==n&&(i=e[6]?ct(+e[5]):ut(+e[5]));const r=wt(+e[2]),o=+e[3]/100,a=+e[4]/100;return n="hwb"===e[1]?function(t,e,n){return yt(bt,t,e,n)}(r,o,a):"hsv"===e[1]?function(t,e,n){return yt(mt,t,e,n)}(r,o,a):vt(r,o,a),{r:n[0],g:n[1],b:n[2],a:i}}(t)}class Pt{constructor(t){if(t instanceof Pt)return t;const e=typeof t;let n;var i,r,o;"object"===e?n=St(t):"string"===e&&(o=(i=t).length,"#"===i[0]&&(4===o||5===o?r={r:255&17*nt[i[1]],g:255&17*nt[i[2]],b:255&17*nt[i[3]],a:5===o?17*nt[i[4]]:255}:7!==o&&9!==o||(r={r:nt[i[1]]<<4|nt[i[2]],g:nt[i[3]]<<4|nt[i[4]],b:nt[i[5]]<<4|nt[i[6]],a:9===o?nt[i[7]]<<4|nt[i[8]]:255})),n=r||function(t){kt||(kt=function(){const t={},e=Object.keys(Mt),n=Object.keys(_t);let i,r,o,a,s;for(i=0;i<e.length;i++){for(a=s=e[i],r=0;r<n.length;r++)o=n[r],s=s.replace(o,_t[o]);o=parseInt(Mt[a],16),t[s]=[o>>16&255,o>>8&255,255&o]}return t}(),kt.transparent=[0,0,0,0]);const e=kt[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}(t)||Dt(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=Tt(this._rgb);return t&&(t.a=dt(t.a)),t}set rgb(t){this._rgb=St(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${dt(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):this._rgb;var t}hexString(){return this._valid?(t=this._rgb,e=function(t){return at(t.r)&&at(t.g)&&at(t.b)&&at(t.a)}(t)?rt:ot,t?"#"+e(t.r)+e(t.g)+e(t.b)+(t.a<255?e(t.a):""):t):this._rgb;var t,e}hslString(){return this._valid?function(t){if(!t)return;const e=xt(t),n=e[0],i=ht(e[1]),r=ht(e[2]);return t.a<255?`hsla(${n}, ${i}%, ${r}%, ${dt(t.a)})`:`hsl(${n}, ${i}%, ${r}%)`}(this._rgb):this._rgb}mix(t,e){const n=this;if(t){const i=n.rgb,r=t.rgb;let o;const a=e===o?.5:e,s=2*a-1,l=i.a-r.a,c=((s*l==-1?s:(s+l)/(1+s*l))+1)/2;o=1-c,i.r=255&c*i.r+o*r.r+.5,i.g=255&c*i.g+o*r.g+.5,i.b=255&c*i.b+o*r.b+.5,i.a=a*i.a+(1-a)*r.a,n.rgb=i}return n}clone(){return new Pt(this.rgb)}alpha(t){return this._rgb.a=ut(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=st(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Ct(this._rgb,2,t),this}darken(t){return Ct(this._rgb,2,-t),this}saturate(t){return Ct(this._rgb,1,t),this}desaturate(t){return Ct(this._rgb,1,-t),this}rotate(t){return function(t,e){var n=xt(t);n[0]=wt(n[0]+e),n=vt(n),t.r=n[0],t.g=n[1],t.b=n[2]}(this._rgb,t),this}}function zt(t){return new Pt(t)}const Ot=t=>t instanceof CanvasGradient||t instanceof CanvasPattern;function At(t){return Ot(t)?t:zt(t)}function Et(t){return Ot(t)?t:zt(t).saturate(.5).darken(.1).hexString()}const Lt=Object.create(null),Rt=Object.create(null);function Ft(t,e){if(!e)return t;const n=e.split(".");for(let e=0,i=n.length;e<i;++e){const i=n[e];t=t[i]||(t[i]=Object.create(null))}return t}function It(t,e,n){return"string"==typeof e?_(Ft(t,e),n):_(Ft(t,""),e)}var Nt=new class{constructor(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=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>Et(e.backgroundColor),this.hoverBorderColor=(t,e)=>Et(e.borderColor),this.hoverColor=(t,e)=>Et(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0},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.describe(t)}set(t,e){return It(this,t,e)}get(t){return Ft(this,t)}describe(t,e){return It(Rt,t,e)}override(t,e){return It(Lt,t,e)}route(t,e,n,i){const r=Ft(this,t),o=Ft(this,n),a="_"+e;Object.defineProperties(r,{[a]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[a],e=o[i];return d(t)?Object.assign({},e,t):g(t,e)},set(t){this[a]=t}}})}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function Ht(t,e,n,i,r){let o=e[r];return o||(o=e[r]=t.measureText(r).width,n.push(r)),o>i&&(i=o),i}function Bt(t,e,n,i){let r=(i=i||{}).data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(r=i.data={},o=i.garbageCollect=[],i.font=e),t.save(),t.font=e;let a=0;const s=n.length;let l,c,d,h,f;for(l=0;l<s;l++)if(h=n[l],null!=h&&!0!==u(h))a=Ht(t,r,o,a,h);else if(u(h))for(c=0,d=h.length;c<d;c++)f=h[c],null==f||u(f)||(a=Ht(t,r,o,a,f));t.restore();const g=o.length/2;if(g>n.length){for(l=0;l<g;l++)delete r[o[l]];o.splice(0,g)}return a}function Wt(t,e,n){const i=t.currentDevicePixelRatio,r=0!==n?Math.max(n/2,.5):0;return Math.round((e-r)*i)/i+r}function Ut(t,e){(e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function Vt(t,e,n,i){let r,o,a,s,l;const c=e.pointStyle,u=e.rotation,d=e.radius;let h=(u||0)*L;if(c&&"object"==typeof c&&(r=c.toString(),"[object HTMLImageElement]"===r||"[object HTMLCanvasElement]"===r))return t.save(),t.translate(n,i),t.rotate(h),t.drawImage(c,-c.width/2,-c.height/2,c.width,c.height),void t.restore();if(!(isNaN(d)||d<=0)){switch(t.beginPath(),c){default:t.arc(n,i,d,0,O),t.closePath();break;case"triangle":t.moveTo(n+Math.sin(h)*d,i-Math.cos(h)*d),h+=I,t.lineTo(n+Math.sin(h)*d,i-Math.cos(h)*d),h+=I,t.lineTo(n+Math.sin(h)*d,i-Math.cos(h)*d),t.closePath();break;case"rectRounded":l=.516*d,s=d-l,o=Math.cos(h+F)*s,a=Math.sin(h+F)*s,t.arc(n-o,i-a,l,h-z,h-R),t.arc(n+a,i-o,l,h-R,h),t.arc(n+o,i+a,l,h,h+R),t.arc(n-a,i+o,l,h+R,h+z),t.closePath();break;case"rect":if(!u){s=Math.SQRT1_2*d,t.rect(n-s,i-s,2*s,2*s);break}h+=F;case"rectRot":o=Math.cos(h)*d,a=Math.sin(h)*d,t.moveTo(n-o,i-a),t.lineTo(n+a,i-o),t.lineTo(n+o,i+a),t.lineTo(n-a,i+o),t.closePath();break;case"crossRot":h+=F;case"cross":o=Math.cos(h)*d,a=Math.sin(h)*d,t.moveTo(n-o,i-a),t.lineTo(n+o,i+a),t.moveTo(n+a,i-o),t.lineTo(n-a,i+o);break;case"star":o=Math.cos(h)*d,a=Math.sin(h)*d,t.moveTo(n-o,i-a),t.lineTo(n+o,i+a),t.moveTo(n+a,i-o),t.lineTo(n-a,i+o),h+=F,o=Math.cos(h)*d,a=Math.sin(h)*d,t.moveTo(n-o,i-a),t.lineTo(n+o,i+a),t.moveTo(n+a,i-o),t.lineTo(n-a,i+o);break;case"line":o=Math.cos(h)*d,a=Math.sin(h)*d,t.moveTo(n-o,i-a),t.lineTo(n+o,i+a);break;case"dash":t.moveTo(n,i),t.lineTo(n+Math.cos(h)*d,i+Math.sin(h)*d)}t.fill(),e.borderWidth>0&&t.stroke()}}function jt(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.x<e.right+n&&t.y>e.top-n&&t.y<e.bottom+n}function Yt(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function qt(t){t.restore()}function $t(t,e,n,i,r){if(!e)return t.lineTo(n.x,n.y);if("middle"===r){const i=(e.x+n.x)/2;t.lineTo(i,e.y),t.lineTo(i,n.y)}else"after"===r!=!!i?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y);t.lineTo(n.x,n.y)}function Xt(t,e,n,i){if(!e)return t.lineTo(n.x,n.y);t.bezierCurveTo(i?e.cp1x:e.cp2x,i?e.cp1y:e.cp2y,i?n.cp2x:n.cp1x,i?n.cp2y:n.cp1y,n.x,n.y)}function Qt(t,e,n,i,r,o={}){const a=u(e)?e:[e],s=o.strokeWidth>0&&""!==o.strokeColor;let l,d;for(t.save(),t.font=r.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),c(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,o),l=0;l<a.length;++l)d=a[l],s&&(o.strokeColor&&(t.strokeStyle=o.strokeColor),c(o.strokeWidth)||(t.lineWidth=o.strokeWidth),t.strokeText(d,n,i,o.maxWidth)),t.fillText(d,n,i,o.maxWidth),Gt(t,n,i,d,o),i+=r.lineHeight;t.restore()}function Gt(t,e,n,i,r){if(r.strikethrough||r.underline){const o=t.measureText(i),a=e-o.actualBoundingBoxLeft,s=e+o.actualBoundingBoxRight,l=n-o.actualBoundingBoxAscent,c=n+o.actualBoundingBoxDescent,u=r.strikethrough?(l+c)/2:c;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=r.decorationWidth||2,t.moveTo(a,u),t.lineTo(s,u),t.stroke()}}function Kt(t,e){const{x:n,y:i,w:r,h:o,radius:a}=e;t.arc(n+a.topLeft,i+a.topLeft,a.topLeft,-R,z,!0),t.lineTo(n,i+o-a.bottomLeft),t.arc(n+a.bottomLeft,i+o-a.bottomLeft,a.bottomLeft,z,R,!0),t.lineTo(n+r-a.bottomRight,i+o),t.arc(n+r-a.bottomRight,i+o-a.bottomRight,a.bottomRight,R,0,!0),t.lineTo(n+r,i+a.topRight),t.arc(n+r-a.topRight,i+a.topRight,a.topRight,0,-R,!0),t.lineTo(n+a.topLeft,i)}const Jt=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),Zt=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function te(t,e){const n=(""+t).match(Jt);if(!n||"normal"===n[1])return 1.2*e;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100}return e*t}function ee(t,e){const n={},i=d(e),r=i?Object.keys(e):e,o=d(t)?i?n=>g(t[n],t[e[n]]):e=>t[e]:()=>t;for(const t of r)n[t]=+o(t)||0;return n}function ne(t){return ee(t,{top:"y",right:"x",bottom:"y",left:"x"})}function ie(t){return ee(t,["topLeft","topRight","bottomLeft","bottomRight"])}function re(t){const e=ne(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function oe(t,e){t=t||{},e=e||Nt.font;let n=g(t.size,e.size);"string"==typeof n&&(n=parseInt(n,10));let i=g(t.style,e.style);i&&!(""+i).match(Zt)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");const r={family:g(t.family,e.family),lineHeight:te(g(t.lineHeight,e.lineHeight),n),size:n,style:i,weight:g(t.weight,e.weight),string:""};return r.string=function(t){return!t||c(t.size)||c(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(r),r}function ae(t,e,n,i){let r,o,a,s=!0;for(r=0,o=t.length;r<o;++r)if(a=t[r],void 0!==a&&(void 0!==e&&"function"==typeof a&&(a=a(e),s=!1),void 0!==n&&u(a)&&(a=a[n%a.length],s=!1),void 0!==a))return i&&!s&&(i.cacheable=!1),a}function se(t,e,n){n=n||(n=>t[n]<e);let i,r=t.length-1,o=0;for(;r-o>1;)i=o+r>>1,n(i)?o=i:r=i;return{lo:o,hi:r}}const le=(t,e,n)=>se(t,n,(i=>t[i][e]<n)),ce=(t,e,n)=>se(t,n,(i=>t[i][e]>=n)),ue=["push","pop","shift","splice","unshift"];function de(t,e){const n=t._chartjs;if(!n)return;const i=n.listeners,r=i.indexOf(e);-1!==r&&i.splice(r,1),i.length>0||(ue.forEach((e=>{delete t[e]})),delete t._chartjs)}function he(t){const e=new Set;let n,i;for(n=0,i=t.length;n<i;++n)e.add(t[n]);return e.size===i?t:Array.from(e)}function fe(t,e=[""],n=t,i,r=(()=>t[0])){D(i)||(i=ke("_fallback",t));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:n,_fallback:i,_getTarget:r,override:r=>fe([r,...t],e,n,i)};return new Proxy(o,{deleteProperty:(e,n)=>(delete e[n],delete e._keys,delete t[0][n],!0),get:(n,i)=>xe(n,i,(()=>function(t,e,n,i){let r;for(const o of e)if(r=ke(me(o,t),n),D(r))return be(t,r)?_e(n,i,t,r):r}(i,e,t,n))),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>Ce(t).includes(e),ownKeys:t=>Ce(t),set:(t,e,n)=>((t._storage||(t._storage=r()))[e]=n,delete t[e],delete t._keys,!0)})}function ge(t,e,n,i){const r={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:pe(t,i),setContext:e=>ge(t,e,n,i),override:r=>ge(t.override(r),e,n,i)};return new Proxy(r,{deleteProperty:(e,n)=>(delete e[n],delete t[n],!0),get:(t,e,n)=>xe(t,e,(()=>function(t,e,n){const{_proxy:i,_context:r,_subProxy:o,_descriptors:a}=t;let s=i[e];return P(s)&&a.isScriptable(e)&&(s=function(t,e,n,i){const{_proxy:r,_context:o,_subProxy:a,_stack:s}=n;if(s.has(t))throw new Error("Recursion detected: "+Array.from(s).join("->")+"->"+t);return s.add(t),e=e(o,a||i),s.delete(t),d(e)&&(e=_e(r._scopes,r,t,e)),e}(e,s,t,n)),u(s)&&s.length&&(s=function(t,e,n,i){const{_proxy:r,_context:o,_subProxy:a,_descriptors:s}=n;if(D(o.index)&&i(t))e=e[o.index%e.length];else if(d(e[0])){const n=e,i=r._scopes.filter((t=>t!==n));e=[];for(const l of n){const n=_e(i,r,t,l);e.push(ge(n,o,a&&a[t],s))}}return e}(e,s,t,a.isIndexable)),be(e,s)&&(s=ge(s,r,o&&o[e],a)),s}(t,e,n))),getOwnPropertyDescriptor:(e,n)=>e._descriptors.allKeys?Reflect.has(t,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,n),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,n)=>Reflect.has(t,n),ownKeys:()=>Reflect.ownKeys(t),set:(e,n,i)=>(t[n]=i,delete e[n],!0)})}function pe(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:i=e.indexable,_allKeys:r=e.allKeys}=t;return{allKeys:r,scriptable:n,indexable:i,isScriptable:P(n)?n:()=>n,isIndexable:P(i)?i:()=>i}}const me=(t,e)=>t?t+S(e):e,be=(t,e)=>d(e)&&"adapters"!==t;function xe(t,e,n){let i=t[e];return D(i)||(i=n(),D(i)&&(t[e]=i)),i}function ye(t,e,n){return P(t)?t(e,n):t}const ve=(t,e)=>!0===t?e:"string"==typeof t?T(e,t):void 0;function we(t,e,n,i){for(const r of e){const e=ve(n,r);if(e){t.add(e);const r=ye(e._fallback,n,e);if(D(r)&&r!==n&&r!==i)return r}else if(!1===e&&D(i)&&n!==i)return null}return!1}function _e(t,e,n,i){const r=e._rootScopes,o=ye(e._fallback,n,i),a=[...t,...r],s=new Set;s.add(i);let l=Me(s,a,n,o||n);return null!==l&&(!D(o)||o===n||(l=Me(s,a,o,l),null!==l))&&fe(Array.from(s),[""],r,o,(()=>function(t,e,n){const i=t._getTarget();e in i||(i[e]={});const r=i[e];return u(r)&&d(n)?n:r}(e,n,i)))}function Me(t,e,n,i){for(;n;)n=we(t,e,n,i);return n}function ke(t,e){for(const n of e){if(!n)continue;const e=n[t];if(D(e))return e}}function Ce(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const n of t)for(const t of Object.keys(n).filter((t=>!t.startsWith("_"))))e.add(t);return Array.from(e)}(t._scopes)),e}const Te=Number.EPSILON||1e-14,Se=(t,e)=>e<t.length&&!t[e].skip&&t[e],De=t=>"x"===t?"y":"x";function Pe(t,e,n,i){const r=t.skip?e:t,o=e,a=n.skip?e:n,s=$(o,r),l=$(a,o);let c=s/(s+l),u=l/(s+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=i*c,h=i*u;return{previous:{x:o.x-d*(a.x-r.x),y:o.y-d*(a.y-r.y)},next:{x:o.x+h*(a.x-r.x),y:o.y+h*(a.y-r.y)}}}function ze(t,e,n){return Math.max(Math.min(t,n),e)}function Oe(t,e,n,i,r){let o,a,s,l;if(e.spanGaps&&(t=t.filter((t=>!t.skip))),"monotone"===e.cubicInterpolationMode)!function(t,e="x"){const n=De(e),i=t.length,r=Array(i).fill(0),o=Array(i);let a,s,l,c=Se(t,0);for(a=0;a<i;++a)if(s=l,l=c,c=Se(t,a+1),l){if(c){const t=c[e]-l[e];r[a]=0!==t?(c[n]-l[n])/t:0}o[a]=s?c?H(r[a-1])!==H(r[a])?0:(r[a-1]+r[a])/2:r[a-1]:r[a]}!function(t,e,n){const i=t.length;let r,o,a,s,l,c=Se(t,0);for(let u=0;u<i-1;++u)l=c,c=Se(t,u+1),l&&c&&(U(e[u],0,Te)?n[u]=n[u+1]=0:(r=n[u]/e[u],o=n[u+1]/e[u],s=Math.pow(r,2)+Math.pow(o,2),s<=9||(a=3/Math.sqrt(s),n[u]=r*a*e[u],n[u+1]=o*a*e[u])))}(t,r,o),function(t,e,n="x"){const i=De(n),r=t.length;let o,a,s,l=Se(t,0);for(let c=0;c<r;++c){if(a=s,s=l,l=Se(t,c+1),!s)continue;const r=s[n],u=s[i];a&&(o=(r-a[n])/3,s[`cp1${n}`]=r-o,s[`cp1${i}`]=u-o*e[c]),l&&(o=(l[n]-r)/3,s[`cp2${n}`]=r+o,s[`cp2${i}`]=u+o*e[c])}}(t,o,e)}(t,r);else{let n=i?t[t.length-1]:t[0];for(o=0,a=t.length;o<a;++o)s=t[o],l=Pe(n,s,t[Math.min(o+1,a-(i?0:1))%a],e.tension),s.cp1x=l.previous.x,s.cp1y=l.previous.y,s.cp2x=l.next.x,s.cp2y=l.next.y,n=s}e.capBezierPoints&&function(t,e){let n,i,r,o,a,s=jt(t[0],e);for(n=0,i=t.length;n<i;++n)a=o,o=s,s=n<i-1&&jt(t[n+1],e),o&&(r=t[n],a&&(r.cp1x=ze(r.cp1x,e.left,e.right),r.cp1y=ze(r.cp1y,e.top,e.bottom)),s&&(r.cp2x=ze(r.cp2x,e.left,e.right),r.cp2y=ze(r.cp2y,e.top,e.bottom)))}(t,n)}function Ae(){return"undefined"!=typeof window&&"undefined"!=typeof document}function Ee(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function Le(t,e,n){let i;return"string"==typeof t?(i=parseInt(t,10),-1!==t.indexOf("%")&&(i=i/100*e.parentNode[n])):i=t,i}const Re=t=>window.getComputedStyle(t,null),Fe=["top","right","bottom","left"];function Ie(t,e,n){const i={};n=n?"-"+n:"";for(let r=0;r<4;r++){const o=Fe[r];i[o]=parseFloat(t[e+"-"+o+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}function Ne(t,e){const{canvas:n,currentDevicePixelRatio:i}=e,r=Re(n),o="border-box"===r.boxSizing,a=Ie(r,"padding"),s=Ie(r,"border","width"),{x:l,y:c,box:u}=function(t,e){const n=t.native||t,i=n.touches,r=i&&i.length?i[0]:n,{offsetX:o,offsetY:a}=r;let s,l,c=!1;if(((t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot))(o,a,n.target))s=o,l=a;else{const t=e.getBoundingClientRect();s=r.clientX-t.left,l=r.clientY-t.top,c=!0}return{x:s,y:l,box:c}}(t,n),d=a.left+(u&&s.left),h=a.top+(u&&s.top);let{width:f,height:g}=e;return o&&(f-=a.width+s.width,g-=a.height+s.height),{x:Math.round((l-d)/f*n.width/i),y:Math.round((c-h)/g*n.height/i)}}const He=t=>Math.round(10*t)/10;function Be(t,e,n){const i=e||1,r=Math.floor(t.height*i),o=Math.floor(t.width*i);t.height=r/i,t.width=o/i;const a=t.canvas;return a.style&&(n||!a.style.height&&!a.style.width)&&(a.style.height=`${t.height}px`,a.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==i||a.height!==r||a.width!==o)&&(t.currentDevicePixelRatio=i,a.height=r,a.width=o,t.ctx.setTransform(i,0,0,i,0,0),!0)}const We=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function Ue(t,e){const n=function(t,e){return Re(t).getPropertyValue(e)}(t,e),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Ve(t,e,n,i){return{x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}}function je(t,e,n,i){return{x:t.x+n*(e.x-t.x),y:"middle"===i?n<.5?t.y:e.y:"after"===i?n<1?t.y:e.y:n>0?e.y:t.y}}function Ye(t,e,n,i){const r={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},a=Ve(t,r,n),s=Ve(r,o,n),l=Ve(o,e,n),c=Ve(a,s,n),u=Ve(s,l,n);return Ve(c,u,n)}const qe=new Map;function $e(t,e,n){return function(t,e){e=e||{};const n=t+JSON.stringify(e);let i=qe.get(n);return i||(i=new Intl.NumberFormat(t,e),qe.set(n,i)),i}(e,n).format(t)}function Xe(t,e,n){return t?function(t,e){return{x:n=>t+t+e-n,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,n):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function Qe(t,e){let n,i;"ltr"!==e&&"rtl"!==e||(n=t.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=i)}function Ge(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Ke(t){return"angle"===t?{between:G,compare:X,normalize:Q}:{between:(t,e,n)=>t>=Math.min(e,n)&&t<=Math.max(n,e),compare:(t,e)=>t-e,normalize:t=>t}}function Je({start:t,end:e,count:n,loop:i,style:r}){return{start:t%n,end:e%n,loop:i&&(e-t+1)%n==0,style:r}}function Ze(t,e,n){if(!n)return[t];const{property:i,start:r,end:o}=n,a=e.length,{compare:s,between:l,normalize:c}=Ke(i),{start:u,end:d,loop:h,style:f}=function(t,e,n){const{property:i,start:r,end:o}=n,{between:a,normalize:s}=Ke(i),l=e.length;let c,u,{start:d,end:h,loop:f}=t;if(f){for(d+=l,h+=l,c=0,u=l;c<u&&a(s(e[d%l][i]),r,o);++c)d--,h--;d%=l,h%=l}return h<d&&(h+=l),{start:d,end:h,loop:f,style:t.style}}(t,e,n),g=[];let p,m,b,x=!1,y=null;for(let t=u,n=u;t<=d;++t)m=e[t%a],m.skip||(p=c(m[i]),p!==b&&(x=l(p,r,o),null===y&&(x||l(r,b,p)&&0!==s(r,b))&&(y=0===s(p,r)?t:n),null!==y&&(!x||0===s(o,p)||l(o,b,p))&&(g.push(Je({start:y,end:t,loop:h,count:a,style:f})),y=null),n=t,b=p));return null!==y&&g.push(Je({start:y,end:d,loop:h,count:a,style:f})),g}function tn(t,e){const n=[],i=t.segments;for(let r=0;r<i.length;r++){const o=Ze(i[r],t.points,e);o.length&&n.push(...o)}return n}function en(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function nn(t,e){return e&&JSON.stringify(t)!==JSON.stringify(e)}var rn=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,n,i){const r=e.listeners[i],o=e.duration;r.forEach((i=>i({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(n-e.start,o)})))}_refresh(){const t=this;t._request||(t._running=!0,t._request=i.call(window,(()=>{t._update(),t._request=null,t._running&&t._refresh()})))}_update(t=Date.now()){const e=this;let n=0;e._charts.forEach(((i,r)=>{if(!i.running||!i.items.length)return;const o=i.items;let a,s=o.length-1,l=!1;for(;s>=0;--s)a=o[s],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(t),l=!0):(o[s]=o[o.length-1],o.pop());l&&(r.draw(),e._notify(r,i,t,"progress")),o.length||(i.running=!1,e._notify(r,i,t,"complete"),i.initial=!1),n+=o.length})),e._lastDate=t,0===n&&(e._running=!1)}_getAnims(t){const e=this._charts;let n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}listen(t,e,n){this._getAnims(t).listeners[e].push(n)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce(((t,e)=>Math.max(t,e._duration)),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const n=e.items;let i=n.length-1;for(;i>=0;--i)n[i].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};const on="transparent",an={boolean:(t,e,n)=>n>.5?e:t,color(t,e,n){const i=At(t||on),r=i.valid&&At(e||on);return r&&r.valid?r.mix(i,n).hexString():e},number:(t,e,n)=>t+(e-t)*n};class sn{constructor(t,e,n,i){const r=e[n];i=ae([t.to,i,r,t.from]);const o=ae([t.from,r,i]);this._active=!0,this._fn=t.fn||an[t.type||typeof o],this._easing=et[t.easing]||et.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=n,this._from=o,this._to=i,this._promises=void 0}active(){return this._active}update(t,e,n){const i=this;if(i._active){i._notify(!1);const r=i._target[i._prop],o=n-i._start,a=i._duration-o;i._start=n,i._duration=Math.floor(Math.max(a,t.duration)),i._total+=o,i._loop=!!t.loop,i._to=ae([t.to,e,r,t.from]),i._from=ae([t.from,r,e])}}cancel(){const t=this;t._active&&(t.tick(Date.now()),t._active=!1,t._notify(!1))}tick(t){const e=this,n=t-e._start,i=e._duration,r=e._prop,o=e._from,a=e._loop,s=e._to;let l;if(e._active=o!==s&&(a||n<i),!e._active)return e._target[r]=s,void e._notify(!0);n<0?e._target[r]=o:(l=n/i%2,l=a&&l>1?2-l:l,l=e._easing(Math.min(1,Math.max(0,l))),e._target[r]=e._fn(o,s,l))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,n)=>{t.push({res:e,rej:n})}))}_notify(t){const e=t?"res":"rej",n=this._promises||[];for(let t=0;t<n.length;t++)n[t][e]()}}Nt.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const ln=Object.keys(Nt.animation);Nt.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),Nt.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),Nt.describe("animations",{_fallback:"animation"}),Nt.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}});class cn{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!d(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach((n=>{const i=t[n];if(!d(i))return;const r={};for(const t of ln)r[t]=i[t];(u(i.properties)&&i.properties||[n]).forEach((t=>{t!==n&&e.has(t)||e.set(t,r)}))}))}_animateOptions(t,e){const n=e.options,i=function(t,e){if(!e)return;let n=t.options;if(n)return n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n;t.options=e}(t,n);if(!i)return[];const r=this._createAnimations(i,n);return n.$shared&&function(t,e){const n=[],i=Object.keys(e);for(let e=0;e<i.length;e++){const r=t[i[e]];r&&r.active()&&n.push(r.wait())}return Promise.all(n)}(t.options.$animations,n).then((()=>{t.options=n}),(()=>{})),r}_createAnimations(t,e){const n=this._properties,i=[],r=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let s;for(s=o.length-1;s>=0;--s){const l=o[s];if("$"===l.charAt(0))continue;if("options"===l){i.push(...this._animateOptions(t,e));continue}const c=e[l];let u=r[l];const d=n.get(l);if(u){if(d&&u.active()){u.update(d,c,a);continue}u.cancel()}d&&d.duration?(r[l]=u=new sn(d,t,l,c),i.push(u)):t[l]=c}return i}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const n=this._createAnimations(t,e);return n.length?(rn.add(this._chart,n),!0):void 0}}function un(t,e){const n=t&&t.options||{},i=n.reverse,r=void 0===n.min?e:0,o=void 0===n.max?e:0;return{start:i?o:r,end:i?r:o}}function dn(t,e){const n=[],i=t._getSortedDatasetMetas(e);let r,o;for(r=0,o=i.length;r<o;++r)n.push(i[r].index);return n}function hn(t,e,n,i){const r=t.keys,o="single"===i.mode;let a,s,l,c;if(null!==e){for(a=0,s=r.length;a<s;++a){if(l=+r[a],l===n){if(i.all)continue;break}c=t.values[l],h(c)&&(o||0===e||H(e)===H(c))&&(e+=c)}return e}}function fn(t,e){const n=t&&t.options.stacked;return n||void 0===n&&void 0!==e.stack}function gn(t,e,n){const i=t[e]||(t[e]={});return i[n]||(i[n]={})}function pn(t,e,n){for(const i of e.getMatchingVisibleMetas("bar").reverse()){const e=t[i.index];if(n&&e>0||!n&&e<0)return i.index}return null}function mn(t,e){const{chart:n,_cachedMeta:i}=t,r=n._stacks||(n._stacks={}),{iScale:o,vScale:a,index:s}=i,l=o.axis,c=a.axis,u=function(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}(o,a,i),d=e.length;let h;for(let t=0;t<d;++t){const n=e[t],{[l]:i,[c]:o}=n;h=(n._stacks||(n._stacks={}))[c]=gn(r,u,i),h[s]=o,h._top=pn(h,a,!0),h._bottom=pn(h,a,!1)}}function bn(t,e){const n=t.scales;return Object.keys(n).filter((t=>n[t].axis===e)).shift()}function xn(t,e){const n=t.controller.index,i=t.vScale&&t.vScale.axis;if(i){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[i]||void 0===e[i][n])return;delete e[i][n]}}}const yn=t=>"reset"===t||"none"===t,vn=(t,e)=>e?t:Object.assign({},t);class wn{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this,e=t._cachedMeta;t.configure(),t.linkScales(),e._stacked=fn(e.vScale,e),t.addElements()}updateIndex(t){this.index!==t&&xn(this._cachedMeta),this.index=t}linkScales(){const t=this,e=t.chart,n=t._cachedMeta,i=t.getDataset(),r=(t,e,n,i)=>"x"===t?e:"r"===t?i:n,o=n.xAxisID=g(i.xAxisID,bn(e,"x")),a=n.yAxisID=g(i.yAxisID,bn(e,"y")),s=n.rAxisID=g(i.rAxisID,bn(e,"r")),l=n.indexAxis,c=n.iAxisID=r(l,o,a,s),u=n.vAxisID=r(l,a,o,s);n.xScale=t.getScaleForId(o),n.yScale=t.getScaleForId(a),n.rScale=t.getScaleForId(s),n.iScale=t.getScaleForId(c),n.vScale=t.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&de(this._data,this),t._stacked&&xn(t)}_dataCheck(){const t=this,e=t.getDataset(),n=e.data||(e.data=[]),i=t._data;if(d(n))t._data=function(t){const e=Object.keys(t),n=new Array(e.length);let i,r,o;for(i=0,r=e.length;i<r;++i)o=e[i],n[i]={x:o,y:t[o]};return n}(n);else if(i!==n){if(i){de(i,t);const e=t._cachedMeta;xn(e),e._parsed=[]}n&&Object.isExtensible(n)&&(o=t,(r=n)._chartjs?r._chartjs.listeners.push(o):(Object.defineProperty(r,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[o]}}),ue.forEach((t=>{const e="_onData"+S(t),n=r[t];Object.defineProperty(r,t,{configurable:!0,enumerable:!1,value(...t){const i=n.apply(this,t);return r._chartjs.listeners.forEach((n=>{"function"==typeof n[e]&&n[e](...t)})),i}})})))),t._syncList=[],t._data=n}var r,o}addElements(){const t=this,e=t._cachedMeta;t._dataCheck(),t.datasetElementType&&(e.dataset=new t.datasetElementType)}buildOrUpdateElements(t){const e=this,n=e._cachedMeta,i=e.getDataset();let r=!1;e._dataCheck();const o=n._stacked;n._stacked=fn(n.vScale,n),n.stack!==i.stack&&(r=!0,xn(n),n.stack=i.stack),e._resyncElements(t),(r||o!==n._stacked)&&mn(e,n._parsed)}configure(){const t=this,e=t.chart.config,n=e.datasetScopeKeys(t._type),i=e.getOptionScopes(t.getDataset(),n,!0);t.options=e.createResolver(i,t.getContext()),t._parsing=t.options.parsing}parse(t,e){const n=this,{_cachedMeta:i,_data:r}=n,{iScale:o,_stacked:a}=i,s=o.axis;let l,c,h,f=0===t&&e===r.length||i._sorted,g=t>0&&i._parsed[t-1];if(!1===n._parsing)i._parsed=r,i._sorted=!0,h=r;else{h=u(r[t])?n.parseArrayData(i,r,t,e):d(r[t])?n.parseObjectData(i,r,t,e):n.parsePrimitiveData(i,r,t,e);const o=()=>null===c[s]||g&&c[s]<g[s];for(l=0;l<e;++l)i._parsed[l+t]=c=h[l],f&&(o()&&(f=!1),g=c);i._sorted=f}a&&mn(n,h)}parsePrimitiveData(t,e,n,i){const{iScale:r,vScale:o}=t,a=r.axis,s=o.axis,l=r.getLabels(),c=r===o,u=new Array(i);let d,h,f;for(d=0,h=i;d<h;++d)f=d+n,u[d]={[a]:c||r.parse(l[f],f),[s]:o.parse(e[f],f)};return u}parseArrayData(t,e,n,i){const{xScale:r,yScale:o}=t,a=new Array(i);let s,l,c,u;for(s=0,l=i;s<l;++s)c=s+n,u=e[c],a[s]={x:r.parse(u[0],c),y:o.parse(u[1],c)};return a}parseObjectData(t,e,n,i){const{xScale:r,yScale:o}=t,{xAxisKey:a="x",yAxisKey:s="y"}=this._parsing,l=new Array(i);let c,u,d,h;for(c=0,u=i;c<u;++c)d=c+n,h=e[d],l[c]={x:r.parse(T(h,a),d),y:o.parse(T(h,s),d)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,n){const i=this.chart,r=this._cachedMeta,o=e[t.axis];return hn({keys:dn(i,!0),values:e._stacks[t.axis]},o,r.index,{mode:n})}updateRangeFromParsed(t,e,n,i){const r=n[e.axis];let o=null===r?NaN:r;const a=i&&n._stacks[e.axis];i&&a&&(i.values=a,t.min=Math.min(t.min,o),t.max=Math.max(t.max,o),o=hn(i,r,this._cachedMeta.index,{all:!0})),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const n=this,i=n._cachedMeta,r=i._parsed,o=i._sorted&&t===i.iScale,a=r.length,s=n._getOtherScale(t),l=e&&i._stacked&&{keys:dn(n.chart,!0),values:null},c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=function(t){const{min:e,max:n,minDefined:i,maxDefined:r}=t.getUserBounds();return{min:i?e:Number.NEGATIVE_INFINITY,max:r?n:Number.POSITIVE_INFINITY}}(s);let f,g,p,m;function b(){return p=r[f],g=p[t.axis],m=p[s.axis],!h(g)||u>m||d<m}for(f=0;f<a&&(b()||(n.updateRangeFromParsed(c,t,p,l),!o));++f);if(o)for(f=a-1;f>=0;--f)if(!b()){n.updateRangeFromParsed(c,t,p,l);break}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,n=[];let i,r,o;for(i=0,r=e.length;i<r;++i)o=e[i][t.axis],h(o)&&n.push(o);return n}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,n=e.iScale,i=e.vScale,r=this.getParsed(t);return{label:n?""+n.getLabelForValue(r[n.axis]):"",value:i?""+i.getLabelForValue(r[i.axis]):""}}_update(t){const e=this,n=e._cachedMeta;e.configure(),e._cachedDataOpts={},e.update(t||"default"),n._clip=function(t){let e,n,i,r;return d(t)?(e=t.top,n=t.right,i=t.bottom,r=t.left):e=n=i=r=t,{top:e,right:n,bottom:i,left:r,disabled:!1===t}}(g(e.options.clip,function(t,e,n){if(!1===n)return!1;const i=un(t,n),r=un(e,n);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}(n.xScale,n.yScale,e.getMaxOverflow())))}update(t){}draw(){const t=this,e=t._ctx,n=t.chart,i=t._cachedMeta,r=i.data||[],o=n.chartArea,a=[],s=t._drawStart||0,l=t._drawCount||r.length-s;let c;for(i.dataset&&i.dataset.draw(e,o,s,l),c=s;c<s+l;++c){const t=r[c];t.hidden||(t.active?a.push(t):t.draw(e,o))}for(c=0;c<a.length;++c)a[c].draw(e,o)}getStyle(t,e){const n=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,e,n){const i=this,r=i.getDataset();let o;if(t>=0&&t<i._cachedMeta.data.length){const e=i._cachedMeta.data[t];o=e.$context||(e.$context=function(t,e,n){return Object.assign(Object.create(t),{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}(i.getContext(),t,e)),o.parsed=i.getParsed(t),o.raw=r.data[t],o.index=o.dataIndex=t}else o=i.$context||(i.$context=function(t,e){return Object.assign(Object.create(t),{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(i.chart.getContext(),i.index)),o.dataset=r,o.index=o.datasetIndex=i.index;return o.active=!!e,o.mode=n,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",n){const i=this,r="active"===e,o=i._cachedDataOpts,a=t+"-"+e,s=o[a],l=i.enableOptionSharing&&D(n);if(s)return vn(s,l);const c=i.chart.config,u=c.datasetElementScopeKeys(i._type,t),d=r?[`${t}Hover`,"hover",t,""]:[t,""],h=c.getOptionScopes(i.getDataset(),u),f=Object.keys(Nt.elements[t]),g=c.resolveNamedOptions(h,f,(()=>i.getContext(n,r)),d);return g.$shared&&(g.$shared=l,o[a]=Object.freeze(vn(g,l))),g}_resolveAnimations(t,e,n){const i=this,r=i.chart,o=i._cachedDataOpts,a=`animation-${e}`,s=o[a];if(s)return s;let l;if(!1!==r.options.animation){const r=i.chart.config,o=r.datasetAnimationScopeKeys(i._type,e),a=r.getOptionScopes(i.getDataset(),o);l=r.createResolver(a,i.getContext(t,n,e))}const c=new cn(r,l&&l.animations);return l&&l._cacheable&&(o[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||yn(t)||this.chart._animationsDisabled}updateElement(t,e,n,i){yn(i)?Object.assign(t,n):this._resolveAnimations(e,i).update(t,n)}updateSharedOptions(t,e,n){t&&!yn(e)&&this._resolveAnimations(void 0,e).update(t,n)}_setStyle(t,e,n,i){t.active=i;const r=this.getStyle(e,i);this._resolveAnimations(e,n,i).update(t,{options:!i&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,e,n){this._setStyle(t,n,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this,n=e._data,i=e._cachedMeta.data;for(const[t,n,i]of e._syncList)e[t](n,i);e._syncList=[];const r=i.length,o=n.length,a=Math.min(o,r);a&&e.parse(0,a),o>r?e._insertElements(r,o-r,t):o<r&&e._removeElements(o,r-o)}_insertElements(t,e,n=!0){const i=this,r=i._cachedMeta,o=r.data,a=t+e;let s;const l=t=>{for(t.length+=e,s=t.length-1;s>=a;s--)t[s]=t[s-e]};for(l(o),s=t;s<a;++s)o[s]=new i.dataElementType;i._parsing&&l(r._parsed),i.parse(t,e),n&&i.updateElements(o,t,e,"reset")}updateElements(t,e,n,i){}_removeElements(t,e){const n=this._cachedMeta;if(this._parsing){const i=n._parsed.splice(t,e);n._stacked&&xn(n,i)}n.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,n,i]=t;this[e](n,i)}}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){this._sync(["_removeElements",t,e]),this._sync(["_insertElements",t,arguments.length-2])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function _n(t){const e=function(t){if(!t._cache.$bar){const e=t.getMatchingVisibleMetas("bar");let n=[];for(let i=0,r=e.length;i<r;i++)n=n.concat(e[i].controller.getAllParsedValues(t));t._cache.$bar=he(n.sort(((t,e)=>t-e)))}return t._cache.$bar}(t);let n,i,r,o,a=t._length;const s=()=>{32767!==r&&-32768!==r&&(D(o)&&(a=Math.min(a,Math.abs(r-o)||a)),o=r)};for(n=0,i=e.length;n<i;++n)r=t.getPixelForValue(e[n]),s();for(o=void 0,n=0,i=t.ticks.length;n<i;++n)r=t.getPixelForTick(n),s();return a}function Mn(t,e,n,i){return u(t)?function(t,e,n,i){const r=n.parse(t[0],i),o=n.parse(t[1],i),a=Math.min(r,o),s=Math.max(r,o);let l=a,c=s;Math.abs(a)>Math.abs(s)&&(l=s,c=a),e[n.axis]=c,e._custom={barStart:l,barEnd:c,start:r,end:o,min:a,max:s}}(t,e,n,i):e[n.axis]=n.parse(t,i),e}function kn(t,e,n,i){const r=t.iScale,o=t.vScale,a=r.getLabels(),s=r===o,l=[];let c,u,d,h;for(c=n,u=n+i;c<u;++c)h=e[c],d={},d[r.axis]=s||r.parse(a[c],c),l.push(Mn(h,d,o,c));return l}function Cn(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function Tn(t,e,n,i){let r=e.borderSkipped;const o={};if(!r)return void(t.borderSkipped=o);const{start:a,end:s,reverse:l,top:c,bottom:u}=function(t){let e,n,i,r,o;return t.horizontal?(e=t.base>t.x,n="left",i="right"):(e=t.base<t.y,n="bottom",i="top"),e?(r="end",o="start"):(r="start",o="end"),{start:n,end:i,reverse:e,top:r,bottom:o}}(t);"middle"===r&&n&&(t.enableBorderRadius=!0,(n._top||0)===i?r=c:(n._bottom||0)===i?r=u:(o[Sn(u,a,s,l)]=!0,r=c)),o[Sn(r,a,s,l)]=!0,t.borderSkipped=o}function Sn(t,e,n,i){var r,o,a;return i?(a=n,t=Dn(t=(r=t)===(o=e)?a:r===a?o:r,n,e)):t=Dn(t,e,n),t}function Dn(t,e,n){return"start"===t?e:"end"===t?n:t}wn.defaults={},wn.prototype.datasetElementType=null,wn.prototype.dataElementType=null;class Pn extends wn{parsePrimitiveData(t,e,n,i){return kn(t,e,n,i)}parseArrayData(t,e,n,i){return kn(t,e,n,i)}parseObjectData(t,e,n,i){const{iScale:r,vScale:o}=t,{xAxisKey:a="x",yAxisKey:s="y"}=this._parsing,l="x"===r.axis?a:s,c="x"===o.axis?a:s,u=[];let d,h,f,g;for(d=n,h=n+i;d<h;++d)g=e[d],f={},f[r.axis]=r.parse(T(g,l),d),u.push(Mn(T(g,c),f,o,d));return u}updateRangeFromParsed(t,e,n,i){super.updateRangeFromParsed(t,e,n,i);const r=n._custom;r&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:n,vScale:i}=e,r=this.getParsed(t),o=r._custom,a=Cn(o)?"["+o.start+", "+o.end+"]":""+i.getLabelForValue(r[i.axis]);return{label:""+n.getLabelForValue(r[n.axis]),value:a}}initialize(){const t=this;t.enableOptionSharing=!0,super.initialize(),t._cachedMeta.stack=t.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,n,i){const r=this,o="reset"===i,{index:a,_cachedMeta:{vScale:s}}=r,l=s.getBasePixel(),u=s.isHorizontal(),d=r._getRuler(),h=r.resolveDataElementOptions(e,i),f=r.getSharedOptions(h),g=r.includeOptions(i,f);r.updateSharedOptions(f,i,h);for(let h=e;h<e+n;h++){const e=r.getParsed(h),n=o||c(e[s.axis])?{base:l,head:l}:r._calculateBarValuePixels(h),p=r._calculateBarIndexPixels(h,d),m=(e._stacks||{})[s.axis],b={horizontal:u,base:n.base,enableBorderRadius:!m||Cn(e._custom)||a===m._top||a===m._bottom,x:u?n.head:p.center,y:u?p.center:n.head,height:u?p.size:Math.abs(n.size),width:u?Math.abs(n.size):p.size};g&&(b.options=f||r.resolveDataElementOptions(h,t[h].active?"active":i)),Tn(b,b.options||t[h].options,m,a),r.updateElement(t[h],h,b,i)}}_getStacks(t,e){const n=this._cachedMeta.iScale,i=n.getMatchingVisibleMetas(this._type),r=n.options.stacked,o=i.length,a=[];let s,l;for(s=0;s<o;++s)if(l=i[s],l.controller.options.grouped){if(void 0!==e){const t=l.controller.getParsed(e)[l.controller._cachedMeta.vScale.axis];if(c(t)||isNaN(t))continue}if((!1===r||-1===a.indexOf(l.stack)||void 0===r&&void 0===l.stack)&&a.push(l.stack),l.index===t)break}return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,n){const i=this._getStacks(t,n),r=void 0!==e?i.indexOf(e):-1;return-1===r?i.length-1:r}_getRuler(){const t=this,e=t.options,n=t._cachedMeta,i=n.iScale,r=[];let o,a;for(o=0,a=n.data.length;o<a;++o)r.push(i.getPixelForValue(t.getParsed(o)[i.axis],o));const s=e.barThickness;return{min:s||_n(i),pixels:r,start:i._startPixel,end:i._endPixel,stackCount:t._getStackCount(),scale:i,grouped:e.grouped,ratio:s?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(t){const e=this,{_cachedMeta:{vScale:n,_stacked:i},options:{base:r,minBarLength:o}}=e,a=r||0,s=e.getParsed(t),l=s._custom,u=Cn(l);let d,h,f=s[n.axis],g=0,p=i?e.applyStack(n,s,i):f;p!==f&&(g=p-f,p=f),u&&(f=l.barStart,p=l.barEnd-l.barStart,0!==f&&H(f)!==H(l.barEnd)&&(g=0),g+=f);const m=c(r)||u?g:r;let b=n.getPixelForValue(m);if(d=e.chart.getDataVisibility(t)?n.getPixelForValue(g+p):b,h=d-b,Math.abs(h)<o&&(h=function(t,e,n){return 0!==t?H(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}(h,n,a)*o,f===a&&(b-=h/2),d=b+h),b===n.getPixelForValue(a)){const t=H(h)*n.getLineWidthForValue(a)/2;b+=t,h-=t}return{size:h,base:b,head:d,center:d+h/2}}_calculateBarIndexPixels(t,e){const n=this,i=e.scale,r=n.options,o=r.skipNull,a=g(r.maxBarThickness,1/0);let s,l;if(e.grouped){const i=o?n._getStackCount(t):e.stackCount,u="flex"===r.barThickness?function(t,e,n,i){const r=e.pixels,o=r[t];let a=t>0?r[t-1]:null,s=t<r.length-1?r[t+1]:null;const l=n.categoryPercentage;null===a&&(a=o-(null===s?e.end-e.start:s-o)),null===s&&(s=o+o-a);const c=o-(o-Math.min(a,s))/2*l;return{chunk:Math.abs(s-a)/2*l/i,ratio:n.barPercentage,start:c}}(t,e,r,i):function(t,e,n,i){const r=n.barThickness;let o,a;return c(r)?(o=e.min*n.categoryPercentage,a=n.barPercentage):(o=r*i,a=1),{chunk:o/i,ratio:a,start:e.pixels[t]-o/2}}(t,e,r,i),d=n._getStackIndex(n.index,n._cachedMeta.stack,o?t:void 0);s=u.start+u.chunk*d+u.chunk/2,l=Math.min(a,u.chunk*u.ratio)}else s=i.getPixelForValue(n.getParsed(t)[i.axis],t),l=Math.min(a,e.min*e.ratio);return{base:s-l/2,head:s+l/2,center:s,size:l}}draw(){const t=this,e=t._cachedMeta,n=e.vScale,i=e.data,r=i.length;let o=0;for(;o<r;++o)null!==t.getParsed(o)[n.axis]&&i[o].draw(t._ctx)}}Pn.id="bar",Pn.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}},Pn.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class zn extends wn{initialize(){this.enableOptionSharing=!0,super.initialize()}parseObjectData(t,e,n,i){const{xScale:r,yScale:o}=t,{xAxisKey:a="x",yAxisKey:s="y"}=this._parsing,l=[];let c,u,d;for(c=n,u=n+i;c<u;++c)d=e[c],l.push({x:r.parse(T(d,a),c),y:o.parse(T(d,s),c),_custom:d&&d.r&&+d.r});return l}getMaxOverflow(){const{data:t,_parsed:e}=this._cachedMeta;let n=0;for(let i=t.length-1;i>=0;--i)n=Math.max(n,t[i].size()/2,e[i]._custom);return n>0&&n}getLabelAndValue(t){const e=this._cachedMeta,{xScale:n,yScale:i}=e,r=this.getParsed(t),o=n.getLabelForValue(r.x),a=i.getLabelForValue(r.y),s=r._custom;return{label:e.label,value:"("+o+", "+a+(s?", "+s:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,n,i){const r=this,o="reset"===i,{iScale:a,vScale:s}=r._cachedMeta,l=r.resolveDataElementOptions(e,i),c=r.getSharedOptions(l),u=r.includeOptions(i,c),d=a.axis,h=s.axis;for(let l=e;l<e+n;l++){const e=t[l],n=!o&&r.getParsed(l),c={},f=c[d]=o?a.getPixelForDecimal(.5):a.getPixelForValue(n[d]),g=c[h]=o?s.getBasePixel():s.getPixelForValue(n[h]);c.skip=isNaN(f)||isNaN(g),u&&(c.options=r.resolveDataElementOptions(l,e.active?"active":i),o&&(c.options.radius=0)),r.updateElement(e,l,c,i)}r.updateSharedOptions(c,i,l)}resolveDataElementOptions(t,e){const n=this.getParsed(t);let i=super.resolveDataElementOptions(t,e);i.$shared&&(i=Object.assign({},i,{$shared:!1}));const r=i.radius;return"active"!==e&&(i.radius=0),i.radius+=g(n&&n._custom,r),i}}zn.id="bubble",zn.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},zn.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title:()=>""}}}};class On extends wn{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const n=this.getDataset().data,i=this._cachedMeta;let r,o;for(r=t,o=t+e;r<o;++r)i._parsed[r]=+n[r]}_getRotation(){return j(this.options.rotation-90)}_getCircumference(){return j(this.options.circumference)}_getRotationExtents(){let t=O,e=-O;const n=this;for(let i=0;i<n.chart.data.datasets.length;++i)if(n.chart.isDatasetVisible(i)){const r=n.chart.getDatasetMeta(i).controller,o=r._getRotation(),a=r._getCircumference();t=Math.min(t,o),e=Math.max(e,o+a)}return{rotation:t,circumference:e-t}}update(t){const e=this,n=e.chart,{chartArea:i}=n,r=e._cachedMeta,o=r.data,a=e.getMaxBorderWidth()+e.getMaxOffset(o)+e.options.spacing,s=Math.max((Math.min(i.width,i.height)-a)/2,0),l=Math.min((u=s,"string"==typeof(c=e.options.cutout)&&c.endsWith("%")?parseFloat(c)/100:c/u),1);var c,u;const d=e._getRingWeight(e.index),{circumference:h,rotation:f}=e._getRotationExtents(),{ratioX:g,ratioY:m,offsetX:b,offsetY:x}=function(t,e,n){let i=1,r=1,o=0,a=0;if(e<O){const s=t,l=s+e,c=Math.cos(s),u=Math.sin(s),d=Math.cos(l),h=Math.sin(l),f=(t,e,i)=>G(t,s,l,!0)?1:Math.max(e,e*n,i,i*n),g=(t,e,i)=>G(t,s,l,!0)?-1:Math.min(e,e*n,i,i*n),p=f(0,c,d),m=f(R,u,h),b=g(z,c,d),x=g(z+R,u,h);i=(p-b)/2,r=(m-x)/2,o=-(p+b)/2,a=-(m+x)/2}return{ratioX:i,ratioY:r,offsetX:o,offsetY:a}}(f,h,l),y=(i.width-a)/g,v=(i.height-a)/m,w=Math.max(Math.min(y,v)/2,0),_=p(e.options.radius,w),M=(_-Math.max(_*l,0))/e._getVisibleDatasetWeightTotal();e.offsetX=b*_,e.offsetY=x*_,r.total=e.calculateTotal(),e.outerRadius=_-M*e._getRingWeightOffset(e.index),e.innerRadius=Math.max(e.outerRadius-M*d,0),e.updateElements(o,0,o.length,t)}_circumference(t,e){const n=this,i=n.options,r=n._cachedMeta,o=n._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===r._parsed[t]||r.data[t].hidden?0:n.calculateCircumference(r._parsed[t]*o/O)}updateElements(t,e,n,i){const r=this,o="reset"===i,a=r.chart,s=a.chartArea,l=a.options.animation,c=(s.left+s.right)/2,u=(s.top+s.bottom)/2,d=o&&l.animateScale,h=d?0:r.innerRadius,f=d?0:r.outerRadius,g=r.resolveDataElementOptions(e,i),p=r.getSharedOptions(g),m=r.includeOptions(i,p);let b,x=r._getRotation();for(b=0;b<e;++b)x+=r._circumference(b,o);for(b=e;b<e+n;++b){const e=r._circumference(b,o),n=t[b],a={x:c+r.offsetX,y:u+r.offsetY,startAngle:x,endAngle:x+e,circumference:e,outerRadius:f,innerRadius:h};m&&(a.options=p||r.resolveDataElementOptions(b,n.active?"active":i)),x+=e,r.updateElement(n,b,a,i)}r.updateSharedOptions(p,i,g)}calculateTotal(){const t=this._cachedMeta,e=t.data;let n,i=0;for(n=0;n<e.length;n++){const r=t._parsed[n];null===r||isNaN(r)||!this.chart.getDataVisibility(n)||e[n].hidden||(i+=Math.abs(r))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?O*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,i=n.data.labels||[],r=$e(e._parsed[t],n.options.locale);return{label:i[t]||"",value:r}}getMaxBorderWidth(t){const e=this;let n=0;const i=e.chart;let r,o,a,s,l;if(!t)for(r=0,o=i.data.datasets.length;r<o;++r)if(i.isDatasetVisible(r)){a=i.getDatasetMeta(r),t=a.data,s=a.controller,s!==e&&s.configure();break}if(!t)return 0;for(r=0,o=t.length;r<o;++r)l=s.resolveDataElementOptions(r),"inner"!==l.borderAlign&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let e=0;for(let n=0,i=t.length;n<i;++n){const t=this.resolveDataElementOptions(n);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(e+=this._getRingWeight(n));return e}_getRingWeight(t){return Math.max(g(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}On.id="doughnut",On.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"},On.descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t},On.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n}}=t.legend.options;return e.labels.map(((e,i)=>{const r=t.getDatasetMeta(0).controller.getStyle(i);return{text:e,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(i),index:i}}))}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label;const n=": "+t.formattedValue;return u(e)?(e=e.slice(),e[0]+=n):e+=n,e}}}}};class An extends wn{initialize(){this.enableOptionSharing=!0,super.initialize()}update(t){const e=this,n=e._cachedMeta,{dataset:i,data:r=[],_dataset:o}=n,a=e.chart._animationsDisabled;let{start:s,count:l}=function(t,e,n){const i=e.length;let r=0,o=i;if(t._sorted){const{iScale:a,_parsed:s}=t,l=a.axis,{min:c,max:u,minDefined:d,maxDefined:h}=a.getUserBounds();d&&(r=K(Math.min(le(s,a.axis,c).lo,n?i:le(e,l,a.getPixelForValue(c)).lo),0,i-1)),o=h?K(Math.max(le(s,a.axis,u).hi+1,n?0:le(e,l,a.getPixelForValue(u)).hi+1),r,i)-r:i-r}return{start:r,count:o}}(n,r,a);e._drawStart=s,e._drawCount=l,function(t){const{xScale:e,yScale:n,_scaleRanges:i}=t,r={xmin:e.min,xmax:e.max,ymin:n.min,ymax:n.max};if(!i)return t._scaleRanges=r,!0;const o=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,r),o}(n)&&(s=0,l=r.length),i._datasetIndex=e.index,i._decimated=!!o._decimated,i.points=r;const c=e.resolveDatasetElementOptions(t);e.options.showLine||(c.borderWidth=0),c.segment=e.options.segment,e.updateElement(i,void 0,{animated:!a,options:c},t),e.updateElements(r,s,l,t)}updateElements(t,e,n,i){const r=this,o="reset"===i,{iScale:a,vScale:s,_stacked:l}=r._cachedMeta,u=r.resolveDataElementOptions(e,i),d=r.getSharedOptions(u),h=r.includeOptions(i,d),f=a.axis,g=s.axis,p=r.options.spanGaps,m=W(p)?p:Number.POSITIVE_INFINITY,b=r.chart._animationsDisabled||o||"none"===i;let x=e>0&&r.getParsed(e-1);for(let u=e;u<e+n;++u){const e=t[u],n=r.getParsed(u),p=b?e:{},y=c(n[g]),v=p[f]=a.getPixelForValue(n[f],u),w=p[g]=o||y?s.getBasePixel():s.getPixelForValue(l?r.applyStack(s,n,l):n[g],u);p.skip=isNaN(v)||isNaN(w)||y,p.stop=u>0&&n[f]-x[f]>m,p.parsed=n,h&&(p.options=d||r.resolveDataElementOptions(u,e.active?"active":i)),b||r.updateElement(e,u,p,i),x=n}r.updateSharedOptions(d,i,u)}getMaxOverflow(){const t=this,e=t._cachedMeta,n=e.dataset,i=n.options&&n.options.borderWidth||0,r=e.data||[];if(!r.length)return i;const o=r[0].size(t.resolveDataElementOptions(0)),a=r[r.length-1].size(t.resolveDataElementOptions(r.length-1));return Math.max(i,o,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}An.id="line",An.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},An.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class En extends wn{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,i=n.data.labels||[],r=$e(e._parsed[t].r,n.options.locale);return{label:i[t]||"",value:r}}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}_updateRadius(){const t=this,e=t.chart,n=e.chartArea,i=e.options,r=Math.min(n.right-n.left,n.bottom-n.top),o=Math.max(r/2,0),a=(o-Math.max(i.cutoutPercentage?o/100*i.cutoutPercentage:1,0))/e.getVisibleDatasetCount();t.outerRadius=o-a*t.index,t.innerRadius=t.outerRadius-a}updateElements(t,e,n,i){const r=this,o="reset"===i,a=r.chart,s=r.getDataset(),l=a.options.animation,c=r._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,h=c.getIndexAngle(0)-.5*z;let f,g=h;const p=360/r.countVisibleElements();for(f=0;f<e;++f)g+=r._computeAngle(f,i,p);for(f=e;f<e+n;f++){const e=t[f];let n=g,m=g+r._computeAngle(f,i,p),b=a.getDataVisibility(f)?c.getDistanceFromCenterForValue(s.data[f]):0;g=m,o&&(l.animateScale&&(b=0),l.animateRotate&&(n=m=h));const x={x:u,y:d,innerRadius:0,outerRadius:b,startAngle:n,endAngle:m,options:r.resolveDataElementOptions(f,e.active?"active":i)};r.updateElement(e,f,x,i)}}countVisibleElements(){const t=this.getDataset(),e=this._cachedMeta;let n=0;return e.data.forEach(((e,i)=>{!isNaN(t.data[i])&&this.chart.getDataVisibility(i)&&n++})),n}_computeAngle(t,e,n){return this.chart.getDataVisibility(t)?j(this.resolveDataElementOptions(t,e).angle||n):0}}En.id="polarArea",En.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},En.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n}}=t.legend.options;return e.labels.map(((e,i)=>{const r=t.getDatasetMeta(0).controller.getStyle(i);return{text:e,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(i),index:i}}))}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class Ln extends On{}Ln.id="pie",Ln.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Rn extends wn{getLabelAndValue(t){const e=this._cachedMeta.vScale,n=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(n[e.axis])}}update(t){const e=this,n=e._cachedMeta,i=n.dataset,r=n.data||[],o=n.iScale.getLabels();if(i.points=r,"resize"!==t){const n=e.resolveDatasetElementOptions(t);e.options.showLine||(n.borderWidth=0);const a={_loop:!0,_fullLoop:o.length===r.length,options:n};e.updateElement(i,void 0,a,t)}e.updateElements(r,0,r.length,t)}updateElements(t,e,n,i){const r=this,o=r.getDataset(),a=r._cachedMeta.rScale,s="reset"===i;for(let l=e;l<e+n;l++){const e=t[l],n=r.resolveDataElementOptions(l,e.active?"active":i),c=a.getPointPositionForValue(l,o.data[l]),u=s?a.xCenter:c.x,d=s?a.yCenter:c.y,h={x:u,y:d,angle:c.angle,skip:isNaN(u)||isNaN(d),options:n};r.updateElement(e,l,h,i)}}}Rn.id="radar",Rn.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}},Rn.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};class Fn extends An{}Fn.id="scatter",Fn.defaults={showLine:!1,fill:!1},Fn.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title:()=>"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var In=Object.freeze({__proto__:null,BarController:Pn,BubbleController:zn,DoughnutController:On,LineController:An,PolarAreaController:En,PieController:Ln,RadarController:Rn,ScatterController:Fn});function Nn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Hn{constructor(t){this.options=t||{}}formats(){return Nn()}parse(t,e){return Nn()}format(t,e){return Nn()}add(t,e,n){return Nn()}diff(t,e,n){return Nn()}startOf(t,e,n){return Nn()}endOf(t,e){return Nn()}}Hn.override=function(t){Object.assign(Hn.prototype,t)};var Bn={_date:Hn};function Wn(t,e){return"native"in t?{x:t.x,y:t.y}:Ne(t,e)}function Un(t,e,n,i){const{controller:r,data:o,_sorted:a}=t,s=r._cachedMeta.iScale;if(s&&e===s.axis&&a&&o.length){const t=s._reversePixels?ce:le;if(!i)return t(o,e,n);if(r._sharedOptions){const i=o[0],r="function"==typeof i.getRange&&i.getRange(e);if(r){const i=t(o,e,n-r),a=t(o,e,n+r);return{lo:i.lo,hi:a.hi}}}}return{lo:0,hi:o.length-1}}function Vn(t,e,n,i,r){const o=t.getSortedVisibleDatasetMetas(),a=n[e];for(let t=0,n=o.length;t<n;++t){const{index:n,data:s}=o[t],{lo:l,hi:c}=Un(o[t],e,a,r);for(let t=l;t<=c;++t){const e=s[t];e.skip||i(e,n,t)}}}function jn(t,e,n,i){const r=[];return jt(e,t.chartArea,t._minPadding)?(Vn(t,n,e,(function(t,n,o){t.inRange(e.x,e.y,i)&&r.push({element:t,datasetIndex:n,index:o})}),!0),r):r}function Yn(t,e,n,i,r){const o=function(t){const e=-1!==t.indexOf("x"),n=-1!==t.indexOf("y");return function(t,i){const r=e?Math.abs(t.x-i.x):0,o=n?Math.abs(t.y-i.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(o,2))}}(n);let a=Number.POSITIVE_INFINITY,s=[];return jt(e,t.chartArea,t._minPadding)?(Vn(t,n,e,(function(n,l,c){if(i&&!n.inRange(e.x,e.y,r))return;const u=n.getCenterPoint(r);if(!jt(u,t.chartArea,t._minPadding)&&!n.inRange(e.x,e.y,r))return;const d=o(e,u);d<a?(s=[{element:n,datasetIndex:l,index:c}],a=d):d===a&&s.push({element:n,datasetIndex:l,index:c})})),s):s}function qn(t,e,n,i){const r=Wn(e,t),o=[],a=n.axis,s="x"===a?"inXRange":"inYRange";let l=!1;return function(t,e){const n=t.getSortedVisibleDatasetMetas();let i,r,o;for(let t=0,a=n.length;t<a;++t){({index:i,data:r}=n[t]);for(let t=0,n=r.length;t<n;++t)o=r[t],o.skip||e(o,i,t)}}(t,((t,e,n)=>{t[s](r[a],i)&&o.push({element:t,datasetIndex:e,index:n}),t.inRange(r.x,r.y,i)&&(l=!0)})),n.intersect&&!l?[]:o}var $n={modes:{index(t,e,n,i){const r=Wn(e,t),o=n.axis||"x",a=n.intersect?jn(t,r,o,i):Yn(t,r,o,!1,i),s=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=a[0].index,n=t.data[e];n&&!n.skip&&s.push({element:n,datasetIndex:t.index,index:e})})),s):[]},dataset(t,e,n,i){const r=Wn(e,t),o=n.axis||"xy";let a=n.intersect?jn(t,r,o,i):Yn(t,r,o,!1,i);if(a.length>0){const e=a[0].datasetIndex,n=t.getDatasetMeta(e).data;a=[];for(let t=0;t<n.length;++t)a.push({element:n[t],datasetIndex:e,index:t})}return a},point:(t,e,n,i)=>jn(t,Wn(e,t),n.axis||"xy",i),nearest:(t,e,n,i)=>Yn(t,Wn(e,t),n.axis||"xy",n.intersect,i),x:(t,e,n,i)=>(n.axis="x",qn(t,e,n,i)),y:(t,e,n,i)=>(n.axis="y",qn(t,e,n,i))}};const Xn=["left","top","right","bottom"];function Qn(t,e){return t.filter((t=>t.pos===e))}function Gn(t,e){return t.filter((t=>-1===Xn.indexOf(t.pos)&&t.box.axis===e))}function Kn(t,e){return t.sort(((t,n)=>{const i=e?n:t,r=e?t:n;return i.weight===r.weight?i.index-r.index:i.weight-r.weight}))}function Jn(t,e,n,i){return Math.max(t[n],e[n])+Math.max(t[i],e[i])}function Zn(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function ti(t,e,n,i){const{pos:r,box:o}=n,a=t.maxPadding;if(!d(r)){n.size&&(t[r]-=n.size);const e=i[n.stack]||{size:0,count:1};e.size=Math.max(e.size,n.horizontal?o.height:o.width),n.size=e.size/e.count,t[r]+=n.size}o.getPadding&&Zn(a,o.getPadding());const s=Math.max(0,e.outerWidth-Jn(a,t,"left","right")),l=Math.max(0,e.outerHeight-Jn(a,t,"top","bottom")),c=s!==t.w,u=l!==t.h;return t.w=s,t.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function ei(t,e){const n=e.maxPadding;return function(t){const i={left:0,top:0,right:0,bottom:0};return t.forEach((t=>{i[t]=Math.max(e[t],n[t])})),i}(t?["left","right"]:["top","bottom"])}function ni(t,e,n,i){const r=[];let o,a,s,l,c,u;for(o=0,a=t.length,c=0;o<a;++o){s=t[o],l=s.box,l.update(s.width||e.w,s.height||e.h,ei(s.horizontal,e));const{same:a,other:d}=ti(e,n,s,i);c|=a&&r.length,u=u||d,l.fullSize||r.push(s)}return c&&ni(r,e,n,i)||u}function ii(t,e,n,i,r){t.top=n,t.left=e,t.right=e+i,t.bottom=n+r,t.width=i,t.height=r}function ri(t,e,n,i){const r=n.padding;let{x:o,y:a}=e;for(const s of t){const t=s.box,l=i[s.stack]||{count:1,placed:0,weight:1},c=s.stackWeight/l.weight||1;if(s.horizontal){const i=e.w*c,o=l.size||t.height;D(l.start)&&(a=l.start),t.fullSize?ii(t,r.left,a,n.outerWidth-r.right-r.left,o):ii(t,e.left+l.placed,a,i,o),l.start=a,l.placed+=i,a=t.bottom}else{const i=e.h*c,a=l.size||t.width;D(l.start)&&(o=l.start),t.fullSize?ii(t,o,r.top,a,n.outerHeight-r.bottom-r.top):ii(t,o,e.top+l.placed,a,i),l.start=o,l.placed+=i,o=t.right}}e.x=o,e.y=a}Nt.set("layout",{padding:{top:0,right:0,bottom:0,left:0}});var oi={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){const n=t.boxes?t.boxes.indexOf(e):-1;-1!==n&&t.boxes.splice(n,1)},configure(t,e,n){e.fullSize=n.fullSize,e.position=n.position,e.weight=n.weight},update(t,e,n,i){if(!t)return;const r=re(t.options.layout.padding),o=Math.max(e-r.width,0),a=Math.max(n-r.height,0),s=function(t){const e=function(t){const e=[];let n,i,r,o,a,s;for(n=0,i=(t||[]).length;n<i;++n)r=t[n],({position:o,options:{stack:a,stackWeight:s=1}}=r),e.push({index:n,box:r,pos:o,horizontal:r.isHorizontal(),weight:r.weight,stack:a&&o+a,stackWeight:s});return e}(t),n=Kn(e.filter((t=>t.box.fullSize)),!0),i=Kn(Qn(e,"left"),!0),r=Kn(Qn(e,"right")),o=Kn(Qn(e,"top"),!0),a=Kn(Qn(e,"bottom")),s=Gn(e,"x"),l=Gn(e,"y");return{fullSize:n,leftAndTop:i.concat(o),rightAndBottom:r.concat(l).concat(a).concat(s),chartArea:Qn(e,"chartArea"),vertical:i.concat(r).concat(l),horizontal:o.concat(a).concat(s)}}(t.boxes),l=s.vertical,c=s.horizontal;b(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}));const u=l.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,d=Object.freeze({outerWidth:e,outerHeight:n,padding:r,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/u,hBoxMaxHeight:a/2}),h=Object.assign({},r);Zn(h,re(i));const f=Object.assign({maxPadding:h,w:o,h:a,x:r.left,y:r.top},r),g=function(t,e){const n=function(t){const e={};for(const n of t){const{stack:t,pos:i,stackWeight:r}=n;if(!t||!Xn.includes(i))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=r}return e}(t),{vBoxMaxWidth:i,hBoxMaxHeight:r}=e;let o,a,s;for(o=0,a=t.length;o<a;++o){s=t[o];const{fullSize:a}=s.box,l=n[s.stack],c=l&&s.stackWeight/l.weight;s.horizontal?(s.width=c?c*i:a&&e.availableWidth,s.height=r):(s.width=i,s.height=c?c*r:a&&e.availableHeight)}return n}(l.concat(c),d);ni(s.fullSize,f,d,g),ni(l,f,d,g),ni(c,f,d,g)&&ni(l,f,d,g),function(t){const e=t.maxPadding;function n(n){const i=Math.max(e[n]-t[n],0);return t[n]+=i,i}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}(f),ri(s.leftAndTop,f,d,g),f.x+=f.w,f.y+=f.h,ri(s.rightAndBottom,f,d,g),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},b(s.chartArea,(e=>{const n=e.box;Object.assign(n,t.chartArea),n.update(f.w,f.h)}))}};class ai{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,n){}removeEventListener(t,e,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,n,i){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,i?Math.floor(e/i):n)}}isAttached(t){return!0}}class si extends ai{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}}const li={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ci=t=>null===t||""===t,ui=!!We&&{passive:!0};function di(t,e,n){t.canvas.removeEventListener(e,n,ui)}function hi(t,e,n){const i=t.canvas,r=i&&Ee(i)||i,o=new MutationObserver((t=>{const e=Ee(r);t.forEach((t=>{for(let i=0;i<t.addedNodes.length;i++){const o=t.addedNodes[i];o!==r&&o!==e||n(t.target)}}))}));return o.observe(document,{childList:!0,subtree:!0}),o}function fi(t,e,n){const i=t.canvas,r=i&&Ee(i);if(!r)return;const o=new MutationObserver((t=>{t.forEach((t=>{for(let e=0;e<t.removedNodes.length;e++)if(t.removedNodes[e]===i){n();break}}))}));return o.observe(r,{childList:!0}),o}const gi=new Map;let pi=0;function mi(){const t=window.devicePixelRatio;t!==pi&&(pi=t,gi.forEach(((e,n)=>{n.currentDevicePixelRatio!==t&&e()})))}function bi(t,e,n){const i=t.canvas,o=i&&Ee(i);if(!o)return;const a=r(((t,e)=>{const i=o.clientWidth;n(t,e),i<o.clientWidth&&n()}),window),s=new ResizeObserver((t=>{const e=t[0],n=e.contentRect.width,i=e.contentRect.height;0===n&&0===i||a(n,i)}));return s.observe(o),function(t,e){gi.size||window.addEventListener("resize",mi),gi.set(t,e)}(t,a),s}function xi(t,e,n){n&&n.disconnect(),"resize"===e&&function(t){gi.delete(t),gi.size||window.removeEventListener("resize",mi)}(t)}function yi(t,e,n){const i=t.canvas,o=r((e=>{null!==t.ctx&&n(function(t,e){const n=li[t.type]||t.type,{x:i,y:r}=Ne(t,e);return{type:n,chart:e,native:t,x:void 0!==i?i:null,y:void 0!==r?r:null}}(e,t))}),t,(t=>{const e=t[0];return[e,e.offsetX,e.offsetY]}));return function(t,e,n){t.addEventListener(e,n,ui)}(i,e,o),o}class vi extends ai{acquireContext(t,e){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(function(t,e){const n=t.style,i=t.getAttribute("height"),r=t.getAttribute("width");if(t.$chartjs={initial:{height:i,width:r,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",ci(r)){const e=Ue(t,"width");void 0!==e&&(t.width=e)}if(ci(i))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Ue(t,"height");void 0!==e&&(t.height=e)}}(t,e),n):null}releaseContext(t){const e=t.canvas;if(!e.$chartjs)return!1;const n=e.$chartjs.initial;["height","width"].forEach((t=>{const i=n[t];c(i)?e.removeAttribute(t):e.setAttribute(t,i)}));const i=n.style||{};return Object.keys(i).forEach((t=>{e.style[t]=i[t]})),e.width=e.width,delete e.$chartjs,!0}addEventListener(t,e,n){this.removeEventListener(t,e);const i=t.$proxies||(t.$proxies={}),r={attach:hi,detach:fi,resize:bi}[e]||yi;i[e]=r(t,e,n)}removeEventListener(t,e){const n=t.$proxies||(t.$proxies={}),i=n[e];i&&(({attach:xi,detach:xi,resize:xi}[e]||di)(t,e,i),n[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,i){return function(t,e,n,i){const r=Re(t),o=Ie(r,"margin"),a=Le(r.maxWidth,t,"clientWidth")||E,s=Le(r.maxHeight,t,"clientHeight")||E,l=function(t,e,n){let i,r;if(void 0===e||void 0===n){const o=Ee(t);if(o){const t=o.getBoundingClientRect(),a=Re(o),s=Ie(a,"border","width"),l=Ie(a,"padding");e=t.width-l.width-s.width,n=t.height-l.height-s.height,i=Le(a.maxWidth,o,"clientWidth"),r=Le(a.maxHeight,o,"clientHeight")}else e=t.clientWidth,n=t.clientHeight}return{width:e,height:n,maxWidth:i||E,maxHeight:r||E}}(t,e,n);let{width:c,height:u}=l;if("content-box"===r.boxSizing){const t=Ie(r,"border","width"),e=Ie(r,"padding");c-=e.width+t.width,u-=e.height+t.height}return c=Math.max(0,c-o.width),u=Math.max(0,i?Math.floor(c/i):u-o.height),c=He(Math.min(c,a,l.maxWidth)),u=He(Math.min(u,s,l.maxHeight)),c&&!u&&(u=He(c/2)),{width:c,height:u}}(t,e,n,i)}isAttached(t){const e=Ee(t);return!(!e||!e.isConnected)}}class wi{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}hasValue(){return W(this.x)&&W(this.y)}getProps(t,e){const n=this,i=this.$animations;if(!e||!i)return n;const r={};return t.forEach((t=>{r[t]=i[t]&&i[t].active()?i[t]._to:n[t]})),r}}wi.defaults={},wi.defaultRoutes=void 0;const _i={values:t=>u(t)?t:""+t,numeric(t,e,n){if(0===t)return"0";const i=this.chart.options.locale;let r,o=t;if(n.length>1){const e=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(e<1e-4||e>1e15)&&(r="scientific"),o=function(t,e){let n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(n)>=1&&t!==Math.floor(t)&&(n=t-Math.floor(t)),n}(t,n)}const a=N(Math.abs(o)),s=Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:r,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(l,this.options.ticks.format),$e(t,i,l)},logarithmic(t,e,n){if(0===t)return"0";const i=t/Math.pow(10,Math.floor(N(t)));return 1===i||2===i||5===i?_i.numeric.call(this,t,e,n):""}};var Mi={formatters:_i};function ki(t,e,n,i,r){const o=g(i,0),a=Math.min(g(r,t.length),t.length);let s,l,c,u=0;for(n=Math.ceil(n),r&&(s=r-i,n=s/Math.floor(s/n)),c=o;c<0;)u++,c=Math.round(o+u*n);for(l=Math.max(o,0);l<a;l++)l===c&&(e.push(t[l]),u++,c=Math.round(o+u*n))}Nt.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth: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:Mi.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),Nt.route("scale.ticks","color","","color"),Nt.route("scale.grid","color","","borderColor"),Nt.route("scale.grid","borderColor","","borderColor"),Nt.route("scale.title","color","","color"),Nt.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),Nt.describe("scales",{_fallback:"scale"}),Nt.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const Ci=(t,e,n)=>"top"===e||"left"===e?t[e]+n:t[e]-n;function Ti(t,e){const n=[],i=t.length/e,r=t.length;let o=0;for(;o<r;o+=i)n.push(t[Math.floor(o)]);return n}function Si(t,e,n){const i=t.ticks.length,r=Math.min(e,i-1),o=t._startPixel,a=t._endPixel,s=1e-6;let l,c=t.getPixelForTick(r);if(!(n&&(l=1===i?Math.max(c-o,a-c):0===e?(t.getPixelForTick(1)-c)/2:(c-t.getPixelForTick(r-1))/2,c+=r<e?l:-l,c<o-s||c>a+s)))return c}function Di(t){return t.drawTicks?t.tickLength:0}function Pi(t,e){if(!t.display)return 0;const n=oe(t.font,e),i=re(t.padding);return(u(t.text)?t.text.length:1)*n.lineHeight+i.height}function zi(t,e,n){let i=o(t);return(n&&"right"!==e||!n&&"right"===e)&&(i=(t=>"left"===t?"right":"right"===t?"left":t)(i)),i}class Oi extends wi{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){const e=this;e.options=t.setContext(e.getContext()),e.axis=t.axis,e._userMin=e.parse(t.min),e._userMax=e.parse(t.max),e._suggestedMin=e.parse(t.suggestedMin),e._suggestedMax=e.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:n,_suggestedMax:i}=this;return t=f(t,Number.POSITIVE_INFINITY),e=f(e,Number.NEGATIVE_INFINITY),n=f(n,Number.POSITIVE_INFINITY),i=f(i,Number.NEGATIVE_INFINITY),{min:f(t,n),max:f(e,i),minDefined:h(t),maxDefined:h(e)}}getMinMax(t){const e=this;let n,{min:i,max:r,minDefined:o,maxDefined:a}=e.getUserBounds();if(o&&a)return{min:i,max:r};const s=e.getMatchingVisibleMetas();for(let l=0,c=s.length;l<c;++l)n=s[l].controller.getMinMax(e,t),o||(i=Math.min(i,n.min)),a||(r=Math.max(r,n.max));return{min:f(i,f(r,i)),max:f(r,f(i,r))}}getPadding(){const t=this;return{left:t.paddingLeft||0,top:t.paddingTop||0,right:t.paddingRight||0,bottom:t.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){m(this.options.beforeUpdate,[this])}update(t,e,n){const i=this,r=i.options.ticks,o=r.sampleSize;i.beforeUpdate(),i.maxWidth=t,i.maxHeight=e,i._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),i.ticks=null,i._labelSizes=null,i._gridLineItems=null,i._labelItems=null,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i._maxLength=i.isHorizontal()?i.width+n.left+n.right:i.height+n.top+n.bottom,i._dataLimitsCached||(i.beforeDataLimits(),i.determineDataLimits(),i.afterDataLimits(),i._range=function(t,e){const{min:n,max:i}=t;return{min:n-Math.abs(p(e,n)),max:i+p(e,i)}}(i,i.options.grace),i._dataLimitsCached=!0),i.beforeBuildTicks(),i.ticks=i.buildTicks()||[],i.afterBuildTicks();const a=o<i.ticks.length;i._convertTicksToLabels(a?Ti(i.ticks,o):i.ticks),i.configure(),i.beforeCalculateLabelRotation(),i.calculateLabelRotation(),i.afterCalculateLabelRotation(),r.display&&(r.autoSkip||"auto"===r.source)&&(i.ticks=function(t,e){const n=t.options.ticks,i=n.maxTicksLimit||function(t){const e=t.options.offset,n=t._tickSize(),i=t._length/n+(e?0:1),r=t._maxLength/n;return Math.floor(Math.min(i,r))}(t),r=n.major.enabled?function(t){const e=[];let n,i;for(n=0,i=t.length;n<i;n++)t[n].major&&e.push(n);return e}(e):[],o=r.length,a=r[0],s=r[o-1],l=[];if(o>i)return function(t,e,n,i){let r,o=0,a=n[0];for(i=Math.ceil(i),r=0;r<t.length;r++)r===a&&(e.push(t[r]),o++,a=n[o*i])}(e,l,r,o/i),l;const u=function(t,e,n){const i=function(t){const e=t.length;let n,i;if(e<2)return!1;for(i=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==i)return!1;return i}(t),r=e.length/n;if(!i)return Math.max(r,1);const o=function(t){const e=[],n=Math.sqrt(t);let i;for(i=1;i<n;i++)t%i==0&&(e.push(i),e.push(t/i));return n===(0|n)&&e.push(n),e.sort(((t,e)=>t-e)).pop(),e}(i);for(let t=0,e=o.length-1;t<e;t++){const e=o[t];if(e>r)return e}return Math.max(r,1)}(r,e,i);if(o>0){let t,n;const i=o>1?Math.round((s-a)/(o-1)):null;for(ki(e,l,u,c(i)?0:a-i,a),t=0,n=o-1;t<n;t++)ki(e,l,u,r[t],r[t+1]);return ki(e,l,u,s,c(i)?e.length:s+i),l}return ki(e,l,u),l}(i,i.ticks),i._labelSizes=null),a&&i._convertTicksToLabels(i.ticks),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate()}configure(){const t=this;let e,n,i=t.options.reverse;t.isHorizontal()?(e=t.left,n=t.right):(e=t.top,n=t.bottom,i=!i),t._startPixel=e,t._endPixel=n,t._reversePixels=i,t._length=n-e,t._alignToPixels=t.options.alignToPixels}afterUpdate(){m(this.options.afterUpdate,[this])}beforeSetDimensions(){m(this.options.beforeSetDimensions,[this])}setDimensions(){const t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0}afterSetDimensions(){m(this.options.afterSetDimensions,[this])}_callHooks(t){const e=this;e.chart.notifyPlugins(t,e.getContext()),m(e.options[t],[e])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){m(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this,n=e.options.ticks;let i,r,o;for(i=0,r=t.length;i<r;i++)o=t[i],o.label=m(n.callback,[o.value,i,t],e)}afterTickToLabelConversion(){m(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){m(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this,e=t.options,n=e.ticks,i=t.ticks.length,r=n.minRotation||0,o=n.maxRotation;let a,s,l,c=r;if(!t._isVisible()||!n.display||r>=o||i<=1||!t.isHorizontal())return void(t.labelRotation=r);const u=t._getLabelSizes(),d=u.widest.width,h=u.highest.height,f=K(t.chart.width-d,0,t.maxWidth);a=e.offset?t.maxWidth/i:f/(i-1),d+6>a&&(a=f/(i-(e.offset?.5:1)),s=t.maxHeight-Di(e.grid)-n.padding-Pi(e.title,t.chart.options.font),l=Math.sqrt(d*d+h*h),c=Y(Math.min(Math.asin(K((u.highest.height+6)/a,-1,1)),Math.asin(K(s/l,-1,1))-Math.asin(K(h/l,-1,1)))),c=Math.max(r,Math.min(o,c))),t.labelRotation=c}afterCalculateLabelRotation(){m(this.options.afterCalculateLabelRotation,[this])}beforeFit(){m(this.options.beforeFit,[this])}fit(){const t=this,e={width:0,height:0},{chart:n,options:{ticks:i,title:r,grid:o}}=t,a=t._isVisible(),s=t.isHorizontal();if(a){const a=Pi(r,n.options.font);if(s?(e.width=t.maxWidth,e.height=Di(o)+a):(e.height=t.maxHeight,e.width=Di(o)+a),i.display&&t.ticks.length){const{first:n,last:r,widest:o,highest:a}=t._getLabelSizes(),l=2*i.padding,c=j(t.labelRotation),u=Math.cos(c),d=Math.sin(c);if(s){const n=i.mirror?0:d*o.width+u*a.height;e.height=Math.min(t.maxHeight,e.height+n+l)}else{const n=i.mirror?0:u*o.width+d*a.height;e.width=Math.min(t.maxWidth,e.width+n+l)}t._calculatePadding(n,r,d,u)}}t._handleMargins(),s?(t.width=t._length=n.width-t._margins.left-t._margins.right,t.height=e.height):(t.width=e.width,t.height=t._length=n.height-t._margins.top-t._margins.bottom)}_calculatePadding(t,e,n,i){const r=this,{ticks:{align:o,padding:a},position:s}=r.options,l=0!==r.labelRotation,c="top"!==s&&"x"===r.axis;if(r.isHorizontal()){const s=r.getPixelForTick(0)-r.left,u=r.right-r.getPixelForTick(r.ticks.length-1);let d=0,h=0;l?c?(d=i*t.width,h=n*e.height):(d=n*t.height,h=i*e.width):"start"===o?h=e.width:"end"===o?d=t.width:(d=t.width/2,h=e.width/2),r.paddingLeft=Math.max((d-s+a)*r.width/(r.width-s),0),r.paddingRight=Math.max((h-u+a)*r.width/(r.width-u),0)}else{let n=e.height/2,i=t.height/2;"start"===o?(n=0,i=t.height):"end"===o&&(n=e.height,i=0),r.paddingTop=n+a,r.paddingBottom=i+a}}_handleMargins(){const t=this;t._margins&&(t._margins.left=Math.max(t.paddingLeft,t._margins.left),t._margins.top=Math.max(t.paddingTop,t._margins.top),t._margins.right=Math.max(t.paddingRight,t._margins.right),t._margins.bottom=Math.max(t.paddingBottom,t._margins.bottom))}afterFit(){m(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){const e=this;let n,i;for(e.beforeTickToLabelConversion(),e.generateTickLabels(t),n=0,i=t.length;n<i;n++)c(t[n].label)&&(t.splice(n,1),i--,n--);e.afterTickToLabelConversion()}_getLabelSizes(){const t=this;let e=t._labelSizes;if(!e){const n=t.options.ticks.sampleSize;let i=t.ticks;n<i.length&&(i=Ti(i,n)),t._labelSizes=e=t._computeLabelSizes(i,i.length)}return e}_computeLabelSizes(t,e){const{ctx:n,_longestTextCache:i}=this,r=[],o=[];let a,s,l,d,h,f,g,p,m,x,y,v=0,w=0;for(a=0;a<e;++a){if(d=t[a].label,h=this._resolveTickFontOptions(a),n.font=f=h.string,g=i[f]=i[f]||{data:{},gc:[]},p=h.lineHeight,m=x=0,c(d)||u(d)){if(u(d))for(s=0,l=d.length;s<l;++s)y=d[s],c(y)||u(y)||(m=Ht(n,g.data,g.gc,m,y),x+=p)}else m=Ht(n,g.data,g.gc,m,d),x=p;r.push(m),o.push(x),v=Math.max(m,v),w=Math.max(x,w)}!function(t,e){b(t,(t=>{const n=t.gc,i=n.length/2;let r;if(i>e){for(r=0;r<i;++r)delete t.data[n[r]];n.splice(0,i)}}))}(i,e);const _=r.indexOf(v),M=o.indexOf(w),k=t=>({width:r[t]||0,height:o[t]||0});return{first:k(0),last:k(e-1),widest:k(_),highest:k(M),widths:r,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){const e=this;e._reversePixels&&(t=1-t);const n=e._startPixel+t*e._length;return K(e._alignToPixels?Wt(e.chart,n,0):n,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this,n=e.ticks||[];if(t>=0&&t<n.length){const i=n[t];return i.$context||(i.$context=function(t,e,n){return Object.assign(Object.create(t),{tick:n,index:e,type:"tick"})}(e.getContext(),t,i))}return e.$context||(e.$context=(i=e.chart.getContext(),r=e,Object.assign(Object.create(i),{scale:r,type:"scale"})));var i,r}_tickSize(){const t=this,e=t.options.ticks,n=j(t.labelRotation),i=Math.abs(Math.cos(n)),r=Math.abs(Math.sin(n)),o=t._getLabelSizes(),a=e.autoSkipPadding||0,s=o?o.widest.width+a:0,l=o?o.highest.height+a:0;return t.isHorizontal()?l*i>s*r?s/i:l/r:l*r<s*i?l/i:s/r}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this,n=e.axis,i=e.chart,r=e.options,{grid:o,position:a}=r,s=o.offset,l=e.isHorizontal(),c=e.ticks.length+(s?1:0),u=Di(o),h=[],f=o.setContext(e.getContext()),p=f.drawBorder?f.borderWidth:0,m=p/2,b=function(t){return Wt(i,t,p)};let x,y,v,w,_,M,k,C,T,S,D,P;if("top"===a)x=b(e.bottom),M=e.bottom-u,C=x-m,S=b(t.top)+m,P=t.bottom;else if("bottom"===a)x=b(e.top),S=t.top,P=b(t.bottom)-m,M=x+m,C=e.top+u;else if("left"===a)x=b(e.right),_=e.right-u,k=x-m,T=b(t.left)+m,D=t.right;else if("right"===a)x=b(e.left),T=t.left,D=b(t.right)-m,_=x+m,k=e.left+u;else if("x"===n){if("center"===a)x=b((t.top+t.bottom)/2+.5);else if(d(a)){const t=Object.keys(a)[0],n=a[t];x=b(e.chart.scales[t].getPixelForValue(n))}S=t.top,P=t.bottom,M=x+m,C=M+u}else if("y"===n){if("center"===a)x=b((t.left+t.right)/2);else if(d(a)){const t=Object.keys(a)[0],n=a[t];x=b(e.chart.scales[t].getPixelForValue(n))}_=x-m,k=_-u,T=t.left,D=t.right}const z=g(r.ticks.maxTicksLimit,c),O=Math.max(1,Math.ceil(c/z));for(y=0;y<c;y+=O){const t=o.setContext(e.getContext(y)),n=t.lineWidth,r=t.color,a=o.borderDash||[],c=t.borderDashOffset,u=t.tickWidth,d=t.tickColor,f=t.tickBorderDash||[],g=t.tickBorderDashOffset;v=Si(e,y,s),void 0!==v&&(w=Wt(i,v,n),l?_=k=T=D=w:M=C=S=P=w,h.push({tx1:_,ty1:M,tx2:k,ty2:C,x1:T,y1:S,x2:D,y2:P,width:n,color:r,borderDash:a,borderDashOffset:c,tickWidth:u,tickColor:d,tickBorderDash:f,tickBorderDashOffset:g}))}return e._ticksLength=c,e._borderValue=x,h}_computeLabelItems(t){const e=this,n=e.axis,i=e.options,{position:r,ticks:o}=i,a=e.isHorizontal(),s=e.ticks,{align:l,crossAlign:c,padding:h,mirror:f}=o,g=Di(i.grid),p=g+h,m=f?-h:p,b=-j(e.labelRotation),x=[];let y,v,w,_,M,k,C,T,S,D,P,z,O="middle";if("top"===r)k=e.bottom-m,C=e._getXAxisLabelAlignment();else if("bottom"===r)k=e.top+m,C=e._getXAxisLabelAlignment();else if("left"===r){const t=e._getYAxisLabelAlignment(g);C=t.textAlign,M=t.x}else if("right"===r){const t=e._getYAxisLabelAlignment(g);C=t.textAlign,M=t.x}else if("x"===n){if("center"===r)k=(t.top+t.bottom)/2+p;else if(d(r)){const t=Object.keys(r)[0],n=r[t];k=e.chart.scales[t].getPixelForValue(n)+p}C=e._getXAxisLabelAlignment()}else if("y"===n){if("center"===r)M=(t.left+t.right)/2-p;else if(d(r)){const t=Object.keys(r)[0],n=r[t];M=e.chart.scales[t].getPixelForValue(n)}C=e._getYAxisLabelAlignment(g).textAlign}"y"===n&&("start"===l?O="top":"end"===l&&(O="bottom"));const A=e._getLabelSizes();for(y=0,v=s.length;y<v;++y){w=s[y],_=w.label;const t=o.setContext(e.getContext(y));T=e.getPixelForTick(y)+o.labelOffset,S=e._resolveTickFontOptions(y),D=S.lineHeight,P=u(_)?_.length:1;const n=P/2,i=t.color,l=t.textStrokeColor,d=t.textStrokeWidth;let h;if(a?(M=T,z="top"===r?"near"===c||0!==b?-P*D+D/2:"center"===c?-A.highest.height/2-n*D+D:-A.highest.height+D/2:"near"===c||0!==b?D/2:"center"===c?A.highest.height/2-n*D:A.highest.height-P*D,f&&(z*=-1)):(k=T,z=(1-P)*D/2),t.showLabelBackdrop){const e=re(t.backdropPadding),n=A.heights[y],i=A.widths[y];let r=k+z-e.top,o=M-e.left;switch(O){case"middle":r-=n/2;break;case"bottom":r-=n}switch(C){case"center":o-=i/2;break;case"right":o-=i}h={left:o,top:r,width:i+e.width,height:n+e.height,color:t.backdropColor}}x.push({rotation:b,label:_,font:S,color:i,strokeColor:l,strokeWidth:d,textOffset:z,textAlign:C,textBaseline:O,translation:[M,k],backdrop:h})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-j(this.labelRotation))return"top"===t?"left":"right";let n="center";return"start"===e.align?n="left":"end"===e.align&&(n="right"),n}_getYAxisLabelAlignment(t){const e=this,{position:n,ticks:{crossAlign:i,mirror:r,padding:o}}=e.options,a=t+o,s=e._getLabelSizes().widest.width;let l,c;return"left"===n?r?(c=e.right+o,"near"===i?l="left":"center"===i?(l="center",c+=s/2):(l="right",c+=s)):(c=e.right-a,"near"===i?l="right":"center"===i?(l="center",c-=s/2):(l="left",c=e.left)):"right"===n?r?(c=e.left+o,"near"===i?l="right":"center"===i?(l="center",c-=s/2):(l="left",c-=s)):(c=e.left+a,"near"===i?l="left":"center"===i?(l="center",c+=s/2):(l="right",c=e.right)):l="right",{textAlign:l,x:c}}_computeLabelArea(){const t=this;if(t.options.ticks.mirror)return;const e=t.chart,n=t.options.position;return"left"===n||"right"===n?{top:0,left:t.left,bottom:e.height,right:t.right}:"top"===n||"bottom"===n?{top:t.top,left:0,bottom:t.bottom,right:e.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:n,top:i,width:r,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(n,i,r,o),t.restore())}getLineWidthForValue(t){const e=this,n=e.options.grid;if(!e._isVisible()||!n.display)return 0;const i=e.ticks.findIndex((e=>e.value===t));return i>=0?n.setContext(e.getContext(i)).lineWidth:0}drawGrid(t){const e=this,n=e.options.grid,i=e.ctx,r=e._gridLineItems||(e._gridLineItems=e._computeGridLineItems(t));let o,a;const s=(t,e,n)=>{n.width&&n.color&&(i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.setLineDash(n.borderDash||[]),i.lineDashOffset=n.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(n.display)for(o=0,a=r.length;o<a;++o){const t=r[o];n.drawOnChartArea&&s({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),n.drawTicks&&s({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const t=this,{chart:e,ctx:n,options:{grid:i}}=t,r=i.setContext(t.getContext()),o=i.drawBorder?r.borderWidth:0;if(!o)return;const a=i.setContext(t.getContext(0)).lineWidth,s=t._borderValue;let l,c,u,d;t.isHorizontal()?(l=Wt(e,t.left,o)-o/2,c=Wt(e,t.right,a)+a/2,u=d=s):(u=Wt(e,t.top,o)-o/2,d=Wt(e,t.bottom,a)+a/2,l=c=s),n.save(),n.lineWidth=r.borderWidth,n.strokeStyle=r.borderColor,n.beginPath(),n.moveTo(l,u),n.lineTo(c,d),n.stroke(),n.restore()}drawLabels(t){const e=this;if(!e.options.ticks.display)return;const n=e.ctx,i=e._computeLabelArea();i&&Yt(n,i);const r=e._labelItems||(e._labelItems=e._computeLabelItems(t));let o,a;for(o=0,a=r.length;o<a;++o){const t=r[o],e=t.font,i=t.label;t.backdrop&&(n.fillStyle=t.backdrop.color,n.fillRect(t.backdrop.left,t.backdrop.top,t.backdrop.width,t.backdrop.height)),Qt(n,i,0,t.textOffset,e,t)}i&&qt(n)}drawTitle(){const{ctx:t,options:{position:e,title:n,reverse:i}}=this;if(!n.display)return;const r=oe(n.font),o=re(n.padding),s=n.align;let l=r.lineHeight/2;"bottom"===e||"center"===e||d(e)?(l+=o.bottom,u(n.text)&&(l+=r.lineHeight*(n.text.length-1))):l+=o.top;const{titleX:c,titleY:h,maxWidth:f,rotation:g}=function(t,e,n,i){const{top:r,left:o,bottom:s,right:l,chart:c}=t,{chartArea:u,scales:h}=c;let f,g,p,m=0;const b=s-r,x=l-o;if(t.isHorizontal()){if(g=a(i,o,l),d(n)){const t=Object.keys(n)[0],i=n[t];p=h[t].getPixelForValue(i)+b-e}else p="center"===n?(u.bottom+u.top)/2+b-e:Ci(t,n,e);f=l-o}else{if(d(n)){const t=Object.keys(n)[0],i=n[t];g=h[t].getPixelForValue(i)-x+e}else g="center"===n?(u.left+u.right)/2-x+e:Ci(t,n,e);p=a(i,s,r),m="left"===n?-R:R}return{titleX:g,titleY:p,maxWidth:f,rotation:m}}(this,l,e,s);Qt(t,n.text,0,0,r,{color:n.color,maxWidth:f,rotation:g,textAlign:zi(s,e,i),textBaseline:"middle",translation:[c,h]})}draw(t){const e=this;e._isVisible()&&(e.drawBackground(),e.drawGrid(t),e.drawBorder(),e.drawTitle(),e.drawLabels(t))}_layers(){const t=this,e=t.options,n=e.ticks&&e.ticks.z||0,i=g(e.grid&&e.grid.z,-1);return t._isVisible()&&t.draw===Oi.prototype.draw?[{z:i,draw(e){t.drawBackground(),t.drawGrid(e),t.drawTitle()}},{z:i+1,draw(){t.drawBorder()}},{z:n,draw(e){t.drawLabels(e)}}]:[{z:n,draw(e){t.draw(e)}}]}getMatchingVisibleMetas(t){const e=this,n=e.chart.getSortedVisibleDatasetMetas(),i=e.axis+"AxisID",r=[];let o,a;for(o=0,a=n.length;o<a;++o){const a=n[o];a[i]!==e.id||t&&a.type!==t||r.push(a)}return r}_resolveTickFontOptions(t){return oe(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){const t=this,e=t._resolveTickFontOptions(0).lineHeight;return(t.isHorizontal()?t.width:t.height)/e}}class Ai{constructor(t,e,n){this.type=t,this.scope=e,this.override=n,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=this,n=Object.getPrototypeOf(t);let i;(function(t){return"id"in t&&"defaults"in t})(n)&&(i=e.register(n));const r=e.items,o=t.id,a=e.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in r||(r[o]=t,function(t,e,n){const i=_(Object.create(null),[n?Nt.get(n):{},Nt.get(e),t.defaults]);Nt.set(e,i),t.defaultRoutes&&function(t,e){Object.keys(e).forEach((n=>{const i=n.split("."),r=i.pop(),o=[t].concat(i).join("."),a=e[n].split("."),s=a.pop(),l=a.join(".");Nt.route(o,r,l,s)}))}(e,t.defaultRoutes),t.descriptors&&Nt.describe(e,t.descriptors)}(t,a,i),e.override&&Nt.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,n=t.id,i=this.scope;n in e&&delete e[n],i&&n in Nt[i]&&(delete Nt[i][n],this.override&&delete Lt[n])}}var Ei=new class{constructor(){this.controllers=new Ai(wn,"datasets",!0),this.elements=new Ai(wi,"elements"),this.plugins=new Ai(Object,"plugins"),this.scales=new Ai(Oi,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,n){const i=this;[...e].forEach((e=>{const r=n||i._getRegistryForType(e);n||r.isForType(e)||r===i.plugins&&e.id?i._exec(t,r,e):b(e,(e=>{const r=n||i._getRegistryForType(e);i._exec(t,r,e)}))}))}_exec(t,e,n){const i=S(t);m(n["before"+i],[],n),e[t](n),m(n["after"+i],[],n)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const n=this._typedRegistries[e];if(n.isForType(t))return n}return this.plugins}_get(t,e,n){const i=e.get(t);if(void 0===i)throw new Error('"'+t+'" is not a registered '+n+".");return i}};class Li{constructor(){this._init=[]}notify(t,e,n,i){const r=this;"beforeInit"===e&&(r._init=r._createDescriptors(t,!0),r._notify(r._init,t,"install"));const o=i?r._descriptors(t).filter(i):r._descriptors(t),a=r._notify(o,t,e,n);return"destroy"===e&&(r._notify(o,t,"stop"),r._notify(r._init,t,"uninstall")),a}_notify(t,e,n,i){i=i||{};for(const r of t){const t=r.plugin;if(!1===m(t[n],[e,i,r.options],t)&&i.cancelable)return!1}return!0}invalidate(){c(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const n=t&&t.config,i=g(n.options&&n.options.plugins,{}),r=function(t){const e=[],n=Object.keys(Ei.plugins.items);for(let t=0;t<n.length;t++)e.push(Ei.getPlugin(n[t]));const i=t.plugins||[];for(let t=0;t<i.length;t++){const n=i[t];-1===e.indexOf(n)&&e.push(n)}return e}(n);return!1!==i||e?function(t,e,n,i){const r=[],o=t.getContext();for(let a=0;a<e.length;a++){const s=e[a],l=Ri(n[s.id],i);null!==l&&r.push({plugin:s,options:Fi(t.config,s,l,o)})}return r}(t,r,i,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],n=this._cache,i=(t,e)=>t.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(i(e,n),t,"stop"),this._notify(i(n,e),t,"start")}}function Ri(t,e){return e||!1!==t?!0===t?{}:t:null}function Fi(t,e,n,i){const r=t.pluginScopeKeys(e),o=t.getOptionScopes(n,r);return t.createResolver(o,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ii(t,e){const n=Nt.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function Ni(t,e){return"x"===t||"y"===t?t:e.axis||("top"===(n=e.position)||"bottom"===n?"x":"left"===n||"right"===n?"y":void 0)||t.charAt(0).toLowerCase();var n}function Hi(t){const e=t.options||(t.options={});e.plugins=g(e.plugins,{}),e.scales=function(t,e){const n=Lt[t.type]||{scales:{}},i=e.scales||{},r=Ii(t.type,e),o=Object.create(null),a=Object.create(null);return Object.keys(i).forEach((t=>{const e=i[t],s=Ni(t,e),l=function(t,e){return t===e?"_index_":"_value_"}(s,r),c=n.scales||{};o[s]=o[s]||t,a[t]=M(Object.create(null),[{axis:s},e,c[s],c[l]])})),t.data.datasets.forEach((n=>{const r=n.type||t.type,s=n.indexAxis||Ii(r,e),l=(Lt[r]||{}).scales||{};Object.keys(l).forEach((t=>{const e=function(t,e){let n=t;return"_index_"===t?n=e:"_value_"===t&&(n="x"===e?"y":"x"),n}(t,s),r=n[e+"AxisID"]||o[e]||e;a[r]=a[r]||Object.create(null),M(a[r],[{axis:e},i[r],l[t]])}))})),Object.keys(a).forEach((t=>{const e=a[t];M(e,[Nt.scales[e.type],Nt.scale])})),a}(t,e)}function Bi(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Wi=new Map,Ui=new Set;function Vi(t,e){let n=Wi.get(t);return n||(n=e(),Wi.set(t,n),Ui.add(n)),n}const ji=(t,e,n)=>{const i=T(e,n);void 0!==i&&t.add(i)};class Yi{constructor(t){this._config=function(t){return(t=t||{}).data=Bi(t.data),Hi(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Bi(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Hi(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Vi(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return Vi(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return Vi(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return Vi(`${this.type}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const n=this._scopeCache;let i=n.get(t);return i&&!e||(i=new Map,n.set(t,i)),i}getOptionScopes(t,e,n){const{options:i,type:r}=this,o=this._cachedScopes(t,n),a=o.get(e);if(a)return a;const s=new Set;e.forEach((e=>{t&&(s.add(t),e.forEach((e=>ji(s,t,e)))),e.forEach((t=>ji(s,i,t))),e.forEach((t=>ji(s,Lt[r]||{},t))),e.forEach((t=>ji(s,Nt,t))),e.forEach((t=>ji(s,Rt,t)))}));const l=Array.from(s);return 0===l.length&&l.push(Object.create(null)),Ui.has(e)&&o.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,Lt[e]||{},Nt.datasets[e]||{},{type:e},Nt,Rt]}resolveNamedOptions(t,e,n,i=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=qi(this._resolverCache,t,i);let s=o;(function(t,e){const{isScriptable:n,isIndexable:i}=pe(t);for(const r of e)if(n(r)&&P(t[r])||i(r)&&u(t[r]))return!0;return!1})(o,e)&&(r.$shared=!1,s=ge(o,n=P(n)?n():n,this.createResolver(t,n,a)));for(const t of e)r[t]=s[t];return r}createResolver(t,e,n=[""],i){const{resolver:r}=qi(this._resolverCache,t,n);return d(e)?ge(r,e,void 0,i):r}}function qi(t,e,n){let i=t.get(e);i||(i=new Map,t.set(e,i));const r=n.join();let o=i.get(r);return o||(o={resolver:fe(e,n),subPrefixes:n.filter((t=>!t.toLowerCase().includes("hover")))},i.set(r,o)),o}const $i=["top","bottom","left","right","chartArea"];function Xi(t,e){return"top"===t||"bottom"===t||-1===$i.indexOf(t)&&"x"===e}function Qi(t,e){return function(n,i){return n[t]===i[t]?n[e]-i[e]:n[t]-i[t]}}function Gi(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),m(n&&n.onComplete,[t],e)}function Ki(t){const e=t.chart,n=e.options.animation;m(n&&n.onProgress,[t],e)}function Ji(t){return Ae()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Zi={},tr=t=>{const e=Ji(t);return Object.values(Zi).filter((t=>t.canvas===e)).pop()};class er{constructor(t,e){const n=this,i=this.config=new Yi(e),r=Ji(t),o=tr(r);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas can be reused.");const a=i.createResolver(i.chartOptionScopes(),n.getContext());this.platform=new(i.platform||function(t){return!Ae()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?si:vi}(r));const s=n.platform.acquireContext(r,a.aspectRatio),c=s&&s.canvas,u=c&&c.height,d=c&&c.width;this.id=l(),this.ctx=s,this.canvas=c,this.width=d,this.height=u,this._options=a,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 Li,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let n;return function(){return e?(clearTimeout(n),n=setTimeout(t,e)):t(),e}}((()=>this.update("resize")),a.resizeDelay||0),Zi[n.id]=n,s&&c?(rn.listen(n,"complete",Gi),rn.listen(n,"progress",Ki),n._initialize(),n.attached&&n.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:n,height:i,_aspectRatio:r}=this;return c(t)?e&&r?r:i?n/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){const t=this;return t.notifyPlugins("beforeInit"),t.options.responsive?t.resize():Be(t,t.options.devicePixelRatio),t.bindEvents(),t.notifyPlugins("afterInit"),t}clear(){return Ut(this.canvas,this.ctx),this}stop(){return rn.stop(this),this}resize(t,e){rn.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const n=this,i=n.options,r=n.canvas,o=i.maintainAspectRatio&&n.aspectRatio,a=n.platform.getMaximumSize(r,t,e,o),s=i.devicePixelRatio||n.platform.getDevicePixelRatio();n.width=a.width,n.height=a.height,n._aspectRatio=n.aspectRatio,Be(n,s,!0)&&(n.notifyPlugins("resize",{size:a}),m(i.onResize,[n,a],n),n.attached&&n._doResize()&&n.render())}ensureScalesHaveIDs(){b(this.options.scales||{},((t,e)=>{t.id=e}))}buildOrUpdateScales(){const t=this,e=t.options,n=e.scales,i=t.scales,r=Object.keys(i).reduce(((t,e)=>(t[e]=!1,t)),{});let o=[];n&&(o=o.concat(Object.keys(n).map((t=>{const e=n[t],i=Ni(t,e),r="r"===i,o="x"===i;return{options:e,dposition:r?"chartArea":o?"bottom":"left",dtype:r?"radialLinear":o?"category":"linear"}})))),b(o,(n=>{const o=n.options,a=o.id,s=Ni(a,o),l=g(o.type,n.dtype);void 0!==o.position&&Xi(o.position,s)===Xi(n.dposition)||(o.position=n.dposition),r[a]=!0;let c=null;a in i&&i[a].type===l?c=i[a]:(c=new(Ei.getScale(l))({id:a,type:l,ctx:t.ctx,chart:t}),i[c.id]=c),c.init(o,e)})),b(r,((t,e)=>{t||delete i[e]})),b(i,(e=>{oi.configure(t,e,e.options),oi.addBox(t,e)}))}_updateMetasets(){const t=this,e=t._metasets,n=t.data.datasets.length,i=e.length;if(e.sort(((t,e)=>t.index-e.index)),i>n){for(let e=n;e<i;++e)t._destroyDatasetMeta(e);e.splice(n,i-n)}t._sortedMetasets=e.slice(0).sort(Qi("order","index"))}_removeUnreferencedMetasets(){const t=this,{_metasets:e,data:{datasets:n}}=t;e.length>n.length&&delete t._stacks,e.forEach(((e,i)=>{0===n.filter((t=>t===e._dataset)).length&&t._destroyDatasetMeta(i)}))}buildOrUpdateControllers(){const t=this,e=[],n=t.data.datasets;let i,r;for(t._removeUnreferencedMetasets(),i=0,r=n.length;i<r;i++){const r=n[i];let o=t.getDatasetMeta(i);const a=r.type||t.config.type;if(o.type&&o.type!==a&&(t._destroyDatasetMeta(i),o=t.getDatasetMeta(i)),o.type=a,o.indexAxis=r.indexAxis||Ii(a,t.options),o.order=r.order||0,o.index=i,o.label=""+r.label,o.visible=t.isDatasetVisible(i),o.controller)o.controller.updateIndex(i),o.controller.linkScales();else{const n=Ei.getController(a),{datasetElementType:r,dataElementType:s}=Nt.datasets[a];Object.assign(n.prototype,{dataElementType:Ei.getElement(s),datasetElementType:r&&Ei.getElement(r)}),o.controller=new n(t,i),e.push(o.controller)}}return t._updateMetasets(),e}_resetElements(){const t=this;b(t.data.datasets,((e,n)=>{t.getDatasetMeta(n).controller.reset()}),t)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this,n=e.config;n.update(),e._options=n.createResolver(n.chartOptionScopes(),e.getContext()),b(e.scales,(t=>{oi.removeBox(e,t)}));const i=e._animationsDisabled=!e.options.animation;if(e.ensureScalesHaveIDs(),e.buildOrUpdateScales(),((t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0})(new Set(Object.keys(e._listeners)),new Set(e.options.events))&&!!this._responsiveListeners===e.options.responsive||(e.unbindEvents(),e.bindEvents()),e._plugins.invalidate(),!1===e.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const r=e.buildOrUpdateControllers();e.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,n=e.data.datasets.length;t<n;t++){const{controller:n}=e.getDatasetMeta(t),a=!i&&-1===r.indexOf(n);n.buildOrUpdateElements(a),o=Math.max(+n.getMaxOverflow(),o)}e._minPadding=o,e._updateLayout(o),i||b(r,(t=>{t.reset()})),e._updateDatasets(t),e.notifyPlugins("afterUpdate",{mode:t}),e._layers.sort(Qi("z","_idx")),e._lastEvent&&e._eventHandler(e._lastEvent,!0),e.render()}_updateLayout(t){const e=this;if(!1===e.notifyPlugins("beforeLayout",{cancelable:!0}))return;oi.update(e,e.width,e.height,t);const n=e.chartArea,i=n.width<=0||n.height<=0;e._layers=[],b(e.boxes,(t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),e._layers.push(...t._layers()))}),e),e._layers.forEach(((t,e)=>{t._idx=e})),e.notifyPlugins("afterLayout")}_updateDatasets(t){const e=this,n="function"==typeof t;if(!1!==e.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let i=0,r=e.data.datasets.length;i<r;++i)e._updateDataset(i,n?t({datasetIndex:i}):t);e.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const n=this,i=n.getDatasetMeta(t),r={meta:i,index:t,mode:e,cancelable:!0};!1!==n.notifyPlugins("beforeDatasetUpdate",r)&&(i.controller._update(e),r.cancelable=!1,n.notifyPlugins("afterDatasetUpdate",r))}render(){const t=this;!1!==t.notifyPlugins("beforeRender",{cancelable:!0})&&(rn.has(t)?t.attached&&!rn.running(t)&&rn.start(t):(t.draw(),Gi({chart:t})))}draw(){const t=this;let e;if(t._resizeBeforeDraw){const{width:e,height:n}=t._resizeBeforeDraw;t._resize(e,n),t._resizeBeforeDraw=null}if(t.clear(),t.width<=0||t.height<=0)return;if(!1===t.notifyPlugins("beforeDraw",{cancelable:!0}))return;const n=t._layers;for(e=0;e<n.length&&n[e].z<=0;++e)n[e].draw(t.chartArea);for(t._drawDatasets();e<n.length;++e)n[e].draw(t.chartArea);t.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,n=[];let i,r;for(i=0,r=e.length;i<r;++i){const r=e[i];t&&!r.visible||n.push(r)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){const t=this;if(!1===t.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const e=t.getSortedVisibleDatasetMetas();for(let n=e.length-1;n>=0;--n)t._drawDataset(e[n]);t.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this,n=e.ctx,i=t._clip,r=!i.disabled,o=e.chartArea,a={meta:t,index:t.index,cancelable:!0};!1!==e.notifyPlugins("beforeDatasetDraw",a)&&(r&&Yt(n,{left:!1===i.left?0:o.left-i.left,right:!1===i.right?e.width:o.right+i.right,top:!1===i.top?0:o.top-i.top,bottom:!1===i.bottom?e.height:o.bottom+i.bottom}),t.controller.draw(),r&&qt(n),a.cancelable=!1,e.notifyPlugins("afterDatasetDraw",a))}getElementsAtEventForMode(t,e,n,i){const r=$n.modes[e];return"function"==typeof r?r(this,t,n,i):[]}getDatasetMeta(t){const e=this.data.datasets[t],n=this._metasets;let i=n.filter((t=>t&&t._dataset===e)).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},n.push(i)),i}getContext(){return this.$context||(this.$context={chart:this,type:"chart"})}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const n=this.getDatasetMeta(t);return"boolean"==typeof n.hidden?!n.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,n){const i=this,r=n?"show":"hide",o=i.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,r);D(e)?(o.data[e].hidden=!n,i.update()):(i.setDatasetVisibility(t,n),a.update(o,{visible:n}),i.update((e=>e.datasetIndex===t?r:void 0)))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this,n=e._metasets&&e._metasets[t];n&&n.controller&&(n.controller._destroy(),delete e._metasets[t])}destroy(){const t=this,{canvas:e,ctx:n}=t;let i,r;for(t.stop(),rn.remove(t),i=0,r=t.data.datasets.length;i<r;++i)t._destroyDatasetMeta(i);t.config.clearCache(),e&&(t.unbindEvents(),Ut(e,n),t.platform.releaseContext(n),t.canvas=null,t.ctx=null),t.notifyPlugins("destroy"),delete Zi[t.id]}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this,e=t._listeners,n=t.platform,i=function(e,n,i){e.offsetX=n,e.offsetY=i,t._eventHandler(e)};b(t.options.events,(r=>((i,r)=>{n.addEventListener(t,i,r),e[i]=r})(r,i)))}bindResponsiveEvents(){const t=this;t._responsiveListeners||(t._responsiveListeners={});const e=t._responsiveListeners,n=t.platform,i=(i,r)=>{n.addEventListener(t,i,r),e[i]=r},r=(i,r)=>{e[i]&&(n.removeEventListener(t,i,r),delete e[i])},o=(e,n)=>{t.canvas&&t.resize(e,n)};let a;const s=()=>{r("attach",s),t.attached=!0,t.resize(),i("resize",o),i("detach",a)};a=()=>{t.attached=!1,r("resize",o),i("attach",s)},n.isAttached(t.canvas)?s():a()}unbindEvents(){const t=this;b(t._listeners,((e,n)=>{t.platform.removeEventListener(t,n,e)})),t._listeners={},b(t._responsiveListeners,((e,n)=>{t.platform.removeEventListener(t,n,e)})),t._responsiveListeners=void 0}updateHoverStyle(t,e,n){const i=n?"set":"remove";let r,o,a,s;for("dataset"===e&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+i+"DatasetHoverStyle"]()),a=0,s=t.length;a<s;++a){o=t[a];const e=o&&this.getDatasetMeta(o.datasetIndex).controller;e&&e[i+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this,n=e._active||[],i=t.map((({datasetIndex:t,index:n})=>{const i=e.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[n],index:n}}));!x(i,n)&&(e._active=i,e._updateHoverStyles(i,n))}notifyPlugins(t,e,n){return this._plugins.notify(this,t,e,n)}_updateHoverStyles(t,e,n){const i=this,r=i.options.hover,o=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),a=o(e,t),s=n?t:o(t,e);a.length&&i.updateHoverStyle(a,r.mode,!1),s.length&&r.mode&&i.updateHoverStyle(s,r.mode,!0)}_eventHandler(t,e){const n=this,i={event:t,replay:e,cancelable:!0},r=e=>(e.options.events||this.options.events).includes(t.type);if(!1===n.notifyPlugins("beforeEvent",i,r))return;const o=n._handleEvent(t,e);return i.cancelable=!1,n.notifyPlugins("afterEvent",i,r),(o||i.changed)&&n.render(),n}_handleEvent(t,e){const n=this,{_active:i=[],options:r}=n,o=r.hover,a=e;let s=[],l=!1,c=null;return"mouseout"!==t.type&&(s=n.getElementsAtEventForMode(t,o.mode,o,a),c="click"===t.type?n._lastEvent:t),n._lastEvent=null,jt(t,n.chartArea,n._minPadding)&&(m(r.onHover,[t,s,n],n),"mouseup"!==t.type&&"click"!==t.type&&"contextmenu"!==t.type||m(r.onClick,[t,s,n],n)),l=!x(s,i),(l||e)&&(n._active=s,n._updateHoverStyles(s,i,e)),n._lastEvent=c,l}}const nr=()=>b(er.instances,(t=>t._plugins.invalidate())),ir=!0;function rr(t,e,n){const{startAngle:i,pixelMargin:r,x:o,y:a,outerRadius:s,innerRadius:l}=e;let c=r/s;t.beginPath(),t.arc(o,a,s,i-c,n+c),l>r?(c=r/l,t.arc(o,a,l,n+c,i-c,!0)):t.arc(o,a,r,n+R,i-R),t.closePath(),t.clip()}function or(t,e,n,i){return{x:n+t*Math.cos(e),y:i+t*Math.sin(e)}}function ar(t,e,n,i,r){const{x:o,y:a,startAngle:s,pixelMargin:l,innerRadius:c}=e,u=Math.max(e.outerRadius+i+n-l,0),d=c>0?c+i+n+l:0;let h=0;const f=r-s;if(i){const t=((c>0?c-i:0)+(u>0?u-i:0))/2;h=(f-(0!==t?f*t/(t+i):f))/2}const g=(f-Math.max(.001,f*u-n/z)/u)/2,p=s+g+h,m=r-g-h,{outerStart:b,outerEnd:x,innerStart:y,innerEnd:v}=function(t,e,n,i){const r=ee(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),o=(n-e)/2,a=Math.min(o,i*e/2),s=t=>{const e=(n-Math.min(o,t))*i/2;return K(t,0,Math.min(o,e))};return{outerStart:s(r.outerStart),outerEnd:s(r.outerEnd),innerStart:K(r.innerStart,0,a),innerEnd:K(r.innerEnd,0,a)}}(e,d,u,m-p),w=u-b,_=u-x,M=p+b/w,k=m-x/_,C=d+y,T=d+v,S=p+y/C,D=m-v/T;if(t.beginPath(),t.arc(o,a,u,M,k),x>0){const e=or(_,k,o,a);t.arc(e.x,e.y,x,k,m+R)}const P=or(T,m,o,a);if(t.lineTo(P.x,P.y),v>0){const e=or(T,D,o,a);t.arc(e.x,e.y,v,m+R,D+Math.PI)}if(t.arc(o,a,d,m-v/d,p+y/d,!0),y>0){const e=or(C,S,o,a);t.arc(e.x,e.y,y,S+Math.PI,p-R)}const O=or(w,p,o,a);if(t.lineTo(O.x,O.y),b>0){const e=or(w,M,o,a);t.arc(e.x,e.y,b,p-R,M)}t.closePath()}Object.defineProperties(er,{defaults:{enumerable:ir,value:Nt},instances:{enumerable:ir,value:Zi},overrides:{enumerable:ir,value:Lt},registry:{enumerable:ir,value:Ei},version:{enumerable:ir,value:"3.5.1"},getChart:{enumerable:ir,value:tr},register:{enumerable:ir,value:(...t)=>{Ei.add(...t),nr()}},unregister:{enumerable:ir,value:(...t)=>{Ei.remove(...t),nr()}}});class sr extends wi{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,n){const i=this.getProps(["x","y"],n),{angle:r,distance:o}=function(t,e){const n=e.x-t.x,i=e.y-t.y,r=Math.sqrt(n*n+i*i);let o=Math.atan2(i,n);return o<-.5*z&&(o+=O),{angle:o,distance:r}}(i,{x:t,y:e}),{startAngle:a,endAngle:s,innerRadius:l,outerRadius:c,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),d=this.options.spacing/2;return(u>=O||G(r,a,s))&&o>=l+d&&o<=c+d}getCenterPoint(t){const{x:e,y:n,startAngle:i,endAngle:r,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:s,spacing:l}=this.options,c=(i+r)/2,u=(o+a+l+s)/2;return{x:e+Math.cos(c)*u,y:n+Math.sin(c)*u}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const e=this,{options:n,circumference:i}=e,r=(n.offset||0)/2,o=(n.spacing||0)/2;if(e.pixelMargin="inner"===n.borderAlign?.33:0,e.fullCircles=i>O?Math.floor(i/O):0,0===i||e.innerRadius<0||e.outerRadius<0)return;t.save();let a=0;if(r){a=r/2;const n=(e.startAngle+e.endAngle)/2;t.translate(Math.cos(n)*a,Math.sin(n)*a),e.circumference>=z&&(a=r)}t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor;const s=function(t,e,n,i){const{fullCircles:r,startAngle:o,circumference:a}=e;let s=e.endAngle;if(r){ar(t,e,n,i,o+O);for(let e=0;e<r;++e)t.fill();isNaN(a)||(s=o+a%O,a%O==0&&(s+=O))}return ar(t,e,n,i,s),t.fill(),s}(t,e,a,o);(function(t,e,n,i,r){const{options:o}=e,a="inner"===o.borderAlign;o.borderWidth&&(a?(t.lineWidth=2*o.borderWidth,t.lineJoin="round"):(t.lineWidth=o.borderWidth,t.lineJoin="bevel"),e.fullCircles&&function(t,e,n){const{x:i,y:r,startAngle:o,pixelMargin:a,fullCircles:s}=e,l=Math.max(e.outerRadius-a,0),c=e.innerRadius+a;let u;for(n&&rr(t,e,o+O),t.beginPath(),t.arc(i,r,c,o+O,o,!0),u=0;u<s;++u)t.stroke();for(t.beginPath(),t.arc(i,r,l,o,o+O),u=0;u<s;++u)t.stroke()}(t,e,a),a&&rr(t,e,r),ar(t,e,n,i,r),t.stroke())})(t,e,a,o,s),t.restore()}}function lr(t,e,n=e){t.lineCap=g(n.borderCapStyle,e.borderCapStyle),t.setLineDash(g(n.borderDash,e.borderDash)),t.lineDashOffset=g(n.borderDashOffset,e.borderDashOffset),t.lineJoin=g(n.borderJoinStyle,e.borderJoinStyle),t.lineWidth=g(n.borderWidth,e.borderWidth),t.strokeStyle=g(n.borderColor,e.borderColor)}function cr(t,e,n){t.lineTo(n.x,n.y)}function ur(t,e,n={}){const i=t.length,{start:r=0,end:o=i-1}=n,{start:a,end:s}=e,l=Math.max(r,a),c=Math.min(o,s),u=r<a&&o<a||r>s&&o>s;return{count:i,start:l,loop:e.loop,ilen:c<l&&!u?i+c-l:c-l}}function dr(t,e,n,i){const{points:r,options:o}=e,{count:a,start:s,loop:l,ilen:c}=ur(r,n,i),u=function(t){return t.stepped?$t:t.tension||"monotone"===t.cubicInterpolationMode?Xt:cr}(o);let d,h,f,{move:g=!0,reverse:p}=i||{};for(d=0;d<=c;++d)h=r[(s+(p?c-d:d))%a],h.skip||(g?(t.moveTo(h.x,h.y),g=!1):u(t,f,h,p,o.stepped),f=h);return l&&(h=r[(s+(p?c:0))%a],u(t,f,h,p,o.stepped)),!!l}function hr(t,e,n,i){const r=e.points,{count:o,start:a,ilen:s}=ur(r,n,i),{move:l=!0,reverse:c}=i||{};let u,d,h,f,g,p,m=0,b=0;const x=t=>(a+(c?s-t:t))%o,y=()=>{f!==g&&(t.lineTo(m,g),t.lineTo(m,f),t.lineTo(m,p))};for(l&&(d=r[x(0)],t.moveTo(d.x,d.y)),u=0;u<=s;++u){if(d=r[x(u)],d.skip)continue;const e=d.x,n=d.y,i=0|e;i===h?(n<f?f=n:n>g&&(g=n),m=(b*m+e)/++b):(y(),t.lineTo(e,n),h=i,b=0,f=g=n),p=n}y()}function fr(t){const e=t.options,n=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||n?dr:hr}sr.id="arc",sr.defaults={borderAlign:"center",borderColor:"#fff",borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},sr.defaultRoutes={backgroundColor:"backgroundColor"};const gr="function"==typeof Path2D;class pr extends wi{constructor(t){super(),this.animated=!0,this.options=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const n=this,i=n.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!n._pointsUpdated){const r=i.spanGaps?n._loop:n._fullLoop;Oe(n._points,i,t,r,e),n._pointsUpdated=!0}}set points(t){const e=this;e._points=t,delete e._segments,delete e._path,e._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const n=t.points,i=t.options.spanGaps,r=n.length;if(!r)return[];const o=!!t._loop,{start:a,end:s}=function(t,e,n,i){let r=0,o=e-1;if(n&&!i)for(;r<e&&!t[r].skip;)r++;for(;r<e&&t[r].skip;)r++;for(r%=e,n&&(o+=r);o>r&&t[o%e].skip;)o--;return o%=e,{start:r,end:o}}(n,r,o,i);return function(t,e,n,i){return i&&i.setContext&&n?function(t,e,n,i){const r=en(t.options),o=n.length,a=[];let s=e[0].start,l=s;for(const c of e){let e,u=r,d=n[s%o];for(l=s+1;l<=c.end;l++){const r=n[l%o];e=en(i.setContext({type:"segment",p0:d,p1:r,p0DataIndex:(l-1)%o,p1DataIndex:l%o,datasetIndex:t._datasetIndex})),nn(e,u)&&(a.push({start:s,end:l-1,loop:c.loop,style:u}),u=e,s=l-1),d=r,u=e}s<l-1&&(a.push({start:s,end:l-1,loop:c.loop,style:e}),s=l-1)}return a}(t,e,n,i):e}(t,!0===i?[{start:a,end:s,loop:o}]:function(t,e,n,i){const r=t.length,o=[];let a,s=e,l=t[e];for(a=e+1;a<=n;++a){const n=t[a%r];n.skip||n.stop?l.skip||(i=!1,o.push({start:e%r,end:(a-1)%r,loop:i}),e=s=n.stop?a:null):(s=a,l.skip&&(e=a)),l=n}return null!==s&&o.push({start:e%r,end:s%r,loop:i}),o}(n,a,s<a?s+r:s,!!t._fullLoop&&0===a&&s===r-1),n,e)}(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,n=t.length;return n&&e[t[n-1].end]}interpolate(t,e){const n=this,i=n.options,r=t[e],o=n.points,a=tn(n,{property:e,start:r,end:r});if(!a.length)return;const s=[],l=function(t){return t.stepped?je:t.tension||"monotone"===t.cubicInterpolationMode?Ye:Ve}(i);let c,u;for(c=0,u=a.length;c<u;++c){const{start:n,end:u}=a[c],d=o[n],h=o[u];if(d===h){s.push(d);continue}const f=l(d,h,Math.abs((r-d[e])/(h[e]-d[e])),i.stepped);f[e]=t[e],s.push(f)}return 1===s.length?s[0]:s}pathSegment(t,e,n){return fr(this)(t,this,e,n)}path(t,e,n){const i=this,r=i.segments,o=fr(i);let a=i._loop;e=e||0,n=n||i.points.length-e;for(const s of r)a&=o(t,i,s,{start:e,end:e+n-1});return!!a}draw(t,e,n,i){const r=this,o=r.options||{};(r.points||[]).length&&o.borderWidth&&(t.save(),function(t,e,n,i){gr&&1===e.segments.length?function(t,e,n,i){let r=e._path;r||(r=e._path=new Path2D,e.path(r,n,i)&&r.closePath()),lr(t,e.options),t.stroke(r)}(t,e,n,i):function(t,e,n,i){const{segments:r,options:o}=e,a=fr(e);for(const s of r)lr(t,o,s.style),t.beginPath(),a(t,e,s,{start:n,end:n+i-1})&&t.closePath(),t.stroke()}(t,e,n,i)}(t,r,n,i),t.restore(),r.animated&&(r._pointsUpdated=!1,r._path=void 0))}}function mr(t,e,n,i){const r=t.options,{[n]:o}=t.getProps([n],i);return Math.abs(e-o)<r.radius+r.hitRadius}pr.id="line",pr.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0},pr.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"},pr.descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};class br extends wi{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,n){const i=this.options,{x:r,y:o}=this.getProps(["x","y"],n);return Math.pow(t-r,2)+Math.pow(e-o,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(t,e){return mr(this,t,"x",e)}inYRange(t,e){return mr(this,t,"y",e)}getCenterPoint(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}size(t){let e=(t=t||this.options||{}).radius||0;return e=Math.max(e,e&&t.hoverRadius||0),2*(e+(e&&t.borderWidth||0))}draw(t,e){const n=this,i=n.options;n.skip||i.radius<.1||!jt(n,e,n.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Vt(t,i,n.x,n.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function xr(t,e){const{x:n,y:i,base:r,width:o,height:a}=t.getProps(["x","y","base","width","height"],e);let s,l,c,u,d;return t.horizontal?(d=a/2,s=Math.min(n,r),l=Math.max(n,r),c=i-d,u=i+d):(d=o/2,s=n-d,l=n+d,c=Math.min(i,r),u=Math.max(i,r)),{left:s,top:c,right:l,bottom:u}}function yr(t,e,n,i){return t?0:K(e,n,i)}function vr(t,e,n,i){const r=null===e,o=null===n,a=t&&!(r&&o)&&xr(t,i);return a&&(r||e>=a.left&&e<=a.right)&&(o||n>=a.top&&n<=a.bottom)}function wr(t,e){t.rect(e.x,e.y,e.w,e.h)}function _r(t,e,n={}){const i=t.x!==n.x?-e:0,r=t.y!==n.y?-e:0,o=(t.x+t.w!==n.x+n.w?e:0)-i,a=(t.y+t.h!==n.y+n.h?e:0)-r;return{x:t.x+i,y:t.y+r,w:t.w+o,h:t.h+a,radius:t.radius}}br.id="point",br.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},br.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class Mr extends wi{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,t&&Object.assign(this,t)}draw(t){const e=this.options,{inner:n,outer:i}=function(t){const e=xr(t),n=e.right-e.left,i=e.bottom-e.top,r=function(t,e,n){const i=t.options.borderWidth,r=t.borderSkipped,o=ne(i);return{t:yr(r.top,o.top,0,n),r:yr(r.right,o.right,0,e),b:yr(r.bottom,o.bottom,0,n),l:yr(r.left,o.left,0,e)}}(t,n/2,i/2),o=function(t,e,n){const{enableBorderRadius:i}=t.getProps(["enableBorderRadius"]),r=t.options.borderRadius,o=ie(r),a=Math.min(e,n),s=t.borderSkipped,l=i||d(r);return{topLeft:yr(!l||s.top||s.left,o.topLeft,0,a),topRight:yr(!l||s.top||s.right,o.topRight,0,a),bottomLeft:yr(!l||s.bottom||s.left,o.bottomLeft,0,a),bottomRight:yr(!l||s.bottom||s.right,o.bottomRight,0,a)}}(t,n/2,i/2);return{outer:{x:e.left,y:e.top,w:n,h:i,radius:o},inner:{x:e.left+r.l,y:e.top+r.t,w:n-r.l-r.r,h:i-r.t-r.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,o.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(r.b,r.r))}}}}(this),r=(o=i.radius).topLeft||o.topRight||o.bottomLeft||o.bottomRight?Kt:wr;var o;t.save(),i.w===n.w&&i.h===n.h||(t.beginPath(),r(t,_r(i,.33,n)),t.clip(),r(t,_r(n,-.33,i)),t.fillStyle=e.borderColor,t.fill("evenodd")),t.beginPath(),r(t,_r(n,.33,i)),t.fillStyle=e.backgroundColor,t.fill(),t.restore()}inRange(t,e,n){return vr(this,t,e,n)}inXRange(t,e){return vr(this,t,null,e)}inYRange(t,e){return vr(this,null,t,e)}getCenterPoint(t){const{x:e,y:n,base:i,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(e+i)/2:e,y:r?n:(n+i)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}Mr.id="bar",Mr.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,enableBorderRadius:!0,pointStyle:void 0},Mr.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var kr=Object.freeze({__proto__:null,ArcElement:sr,LineElement:pr,PointElement:br,BarElement:Mr});function Cr(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{value:e})}}function Tr(t){t.data.datasets.forEach((t=>{Cr(t)}))}var Sr={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,n)=>{if(!n.enabled)return void Tr(t);const i=t.width;t.data.datasets.forEach(((e,r)=>{const{_data:o,indexAxis:a}=e,s=t.getDatasetMeta(r),l=o||e.data;if("y"===ae([a,t.options.indexAxis]))return;if("line"!==s.type)return;const u=t.scales[s.xAxisID];if("linear"!==u.type&&"time"!==u.type)return;if(t.options.parsing)return;let d,{start:h,count:f}=function(t,e){const n=e.length;let i,r=0;const{iScale:o}=t,{min:a,max:s,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(r=K(le(e,o.axis,a).lo,0,n-1)),i=c?K(le(e,o.axis,s).hi+1,r,n)-r:n-r,{start:r,count:i}}(s,l);if(f<=(n.threshold||4*i))Cr(e);else{switch(c(o)&&(e._data=l,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),n.algorithm){case"lttb":d=function(t,e,n,i,r){const o=r.samples||i;if(o>=n)return t.slice(e,e+n);const a=[],s=(n-2)/(o-2);let l=0;const c=e+n-1;let u,d,h,f,g,p=e;for(a[l++]=t[p],u=0;u<o-2;u++){let i,r=0,o=0;const c=Math.floor((u+1)*s)+1+e,m=Math.min(Math.floor((u+2)*s)+1,n)+e,b=m-c;for(i=c;i<m;i++)r+=t[i].x,o+=t[i].y;r/=b,o/=b;const x=Math.floor(u*s)+1+e,y=Math.min(Math.floor((u+1)*s)+1,n)+e,{x:v,y:w}=t[p];for(h=f=-1,i=x;i<y;i++)f=.5*Math.abs((v-r)*(t[i].y-w)-(v-t[i].x)*(o-w)),f>h&&(h=f,d=t[i],g=i);a[l++]=d,p=g}return a[l++]=t[c],a}(l,h,f,i,n);break;case"min-max":d=function(t,e,n,i){let r,o,a,s,l,u,d,h,f,g,p=0,m=0;const b=[],x=e+n-1,y=t[e].x,v=t[x].x-y;for(r=e;r<e+n;++r){o=t[r],a=(o.x-y)/v*i,s=o.y;const e=0|a;if(e===l)s<f?(f=s,u=r):s>g&&(g=s,d=r),p=(m*p+o.x)/++m;else{const n=r-1;if(!c(u)&&!c(d)){const e=Math.min(u,d),i=Math.max(u,d);e!==h&&e!==n&&b.push({...t[e],x:p}),i!==h&&i!==n&&b.push({...t[i],x:p})}r>0&&n!==h&&b.push(t[n]),b.push(o),l=e,m=0,f=g=s,u=d=h=r}}return b}(l,h,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}e._decimated=d}}))},destroy(t){Tr(t)}};function Dr(t,e,n){const i=function(t){const e=t.options,n=e.fill;let i=g(n&&n.target,n);return void 0===i&&(i=!!e.backgroundColor),!1!==i&&null!==i&&(!0===i?"origin":i)}(t);if(d(i))return!isNaN(i.value)&&i;let r=parseFloat(i);return h(r)&&Math.floor(r)===r?("-"!==i[0]&&"+"!==i[0]||(r=e+r),!(r===e||r<0||r>=n)&&r):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}class Pr{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,n){const{x:i,y:r,radius:o}=this;return e=e||{start:0,end:O},t.arc(i,r,o,e.end,e.start,!0),!n.bounds}interpolate(t){const{x:e,y:n,radius:i}=this,r=t.angle;return{x:e+Math.cos(r)*i,y:n+Math.sin(r)*i,angle:r}}}function zr(t,e,n){for(;e>t;e--){const t=n[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}const Or=t=>"line"===t.type&&!t.hidden;function Ar(t,e,n){const i=[];for(let r=0;r<n.length;r++){const o=n[r],{first:a,last:s,point:l}=Er(o,e,"x");if(!(!l||a&&s))if(a)i.unshift(l);else if(t.push(l),!s)break}t.push(...i)}function Er(t,e,n){const i=t.interpolate(e,n);if(!i)return{};const r=i[n],o=t.segments,a=t.points;let s=!1,l=!1;for(let t=0;t<o.length;t++){const e=o[t],i=a[e.start][n],c=a[e.end][n];if(r>=i&&r<=c){s=r===i,l=r===c;break}}return{first:s,last:l,point:i}}function Lr(t,e){let n=[],i=!1;return u(t)?(i=!0,n=t):n=function(t,e){const{x:n=null,y:i=null}=t||{},r=e.points,o=[];return e.segments.forEach((({start:t,end:e})=>{e=zr(t,e,r);const a=r[t],s=r[e];null!==i?(o.push({x:a.x,y:i}),o.push({x:s.x,y:i})):null!==n&&(o.push({x:n,y:a.y}),o.push({x:n,y:s.y}))})),o}(t,e),n.length?new pr({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function Rr(t,e,n){let i=t[e].fill;const r=[e];let o;if(!n)return i;for(;!1!==i&&-1===r.indexOf(i);){if(!h(i))return i;if(o=t[i],!o)return!1;if(o.visible)return i;r.push(i),i=o.fill}return!1}function Fr(t,e,n){t.beginPath(),e.path(t),t.lineTo(e.last().x,n),t.lineTo(e.first().x,n),t.closePath(),t.clip()}function Ir(t,e,n,i){if(i)return;let r=e[t],o=n[t];return"angle"===t&&(r=Q(r),o=Q(o)),{property:t,start:r,end:o}}function Nr(t,e,n,i){return t&&e?i(t[n],e[n]):t?t[n]:e?e[n]:0}function Hr(t,e,n){const{top:i,bottom:r}=e.chart.chartArea,{property:o,start:a,end:s}=n||{};"x"===o&&(t.beginPath(),t.rect(a,i,s-a,r-i),t.clip())}function Br(t,e,n,i){const r=e.interpolate(n,i);r&&t.lineTo(r.x,r.y)}function Wr(t,e){const{line:n,target:i,property:r,color:o,scale:a}=e,s=function(t,e,n){const i=t.segments,r=t.points,o=e.points,a=[];for(const t of i){let{start:i,end:s}=t;s=zr(i,s,r);const l=Ir(n,r[i],r[s],t.loop);if(!e.segments){a.push({source:t,target:l,start:r[i],end:r[s]});continue}const c=tn(e,l);for(const e of c){const i=Ir(n,o[e.start],o[e.end],e.loop),s=Ze(t,r,i);for(const t of s)a.push({source:t,target:e,start:{[n]:Nr(l,i,"start",Math.max)},end:{[n]:Nr(l,i,"end",Math.min)}})}}return a}(n,i,r);for(const{source:e,target:l,start:c,end:u}of s){const{style:{backgroundColor:s=o}={}}=e,d=!0!==i;t.save(),t.fillStyle=s,Hr(t,a,d&&Ir(r,c,u)),t.beginPath();const h=!!n.pathSegment(t,e);let f;if(d){h?t.closePath():Br(t,i,u,r);const e=!!i.pathSegment(t,l,{move:h,reverse:!0});f=h&&e,f||Br(t,i,c,r)}t.closePath(),t.fill(f?"evenodd":"nonzero"),t.restore()}}function Ur(t,e,n){const i=function(t){const{chart:e,fill:n,line:i}=t;if(h(n))return function(t,e){const n=t.getDatasetMeta(e);return n&&t.isDatasetVisible(e)?n.dataset:null}(e,n);if("stack"===n)return function(t){const{chart:e,scale:n,index:i,line:r}=t,o=[],a=r.segments,s=r.points,l=function(t,e){const n=[],i=t.getSortedVisibleDatasetMetas();for(let t=0;t<i.length;t++){const r=i[t];if(r.index===e)break;Or(r)&&n.unshift(r.dataset)}return n}(e,i);l.push(Lr({x:null,y:n.bottom},r));for(let t=0;t<a.length;t++){const e=a[t];for(let t=e.start;t<=e.end;t++)Ar(o,s[t],l)}return new pr({points:o,options:{}})}(t);if("shape"===n)return!0;const r=function(t){return(t.scale||{}).getPointPositionForValue?function(t){const{scale:e,fill:n}=t,i=e.options,r=e.getLabels().length,o=[],a=i.reverse?e.max:e.min,s=i.reverse?e.min:e.max;let l,c,u;if(u="start"===n?a:"end"===n?s:d(n)?n.value:e.getBaseValue(),i.grid.circular)return c=e.getPointPositionForValue(0,a),new Pr({x:c.x,y:c.y,radius:e.getDistanceFromCenterForValue(u)});for(l=0;l<r;++l)o.push(e.getPointPositionForValue(l,u));return o}(t):function(t){const{scale:e={},fill:n}=t;let i,r=null;return"start"===n?r=e.bottom:"end"===n?r=e.top:d(n)?r=e.getPixelForValue(n.value):e.getBasePixel&&(r=e.getBasePixel()),h(r)?(i=e.isHorizontal(),{x:i?r:null,y:i?null:r}):null}(t)}(t);return r instanceof Pr?r:Lr(r,i)}(e),{line:r,scale:o,axis:a}=e,s=r.options,l=s.fill,c=s.backgroundColor,{above:u=c,below:f=c}=l||{};i&&r.points.length&&(Yt(t,n),function(t,e){const{line:n,target:i,above:r,below:o,area:a,scale:s}=e,l=n._loop?"angle":e.axis;t.save(),"x"===l&&o!==r&&(Fr(t,i,a.top),Wr(t,{line:n,target:i,color:r,scale:s,property:l}),t.restore(),t.save(),Fr(t,i,a.bottom)),Wr(t,{line:n,target:i,color:o,scale:s,property:l}),t.restore()}(t,{line:r,target:i,above:u,below:f,area:n,scale:o,axis:a}),qt(t))}var Vr={id:"filler",afterDatasetsUpdate(t,e,n){const i=(t.data.datasets||[]).length,r=[];let o,a,s,l;for(a=0;a<i;++a)o=t.getDatasetMeta(a),s=o.dataset,l=null,s&&s.options&&s instanceof pr&&(l={visible:t.isDatasetVisible(a),index:a,fill:Dr(s,a,i),chart:t,axis:o.controller.options.indexAxis,scale:o.vScale,line:s}),o.$filler=l,r.push(l);for(a=0;a<i;++a)l=r[a],l&&!1!==l.fill&&(l.fill=Rr(r,a,n.propagate))},beforeDraw(t,e,n){const i="beforeDraw"===n.drawTime,r=t.getSortedVisibleDatasetMetas(),o=t.chartArea;for(let e=r.length-1;e>=0;--e){const n=r[e].$filler;n&&(n.line.updateControlPoints(o,n.axis),i&&Ur(t.ctx,n,o))}},beforeDatasetsDraw(t,e,n){if("beforeDatasetsDraw"!==n.drawTime)return;const i=t.getSortedVisibleDatasetMetas();for(let e=i.length-1;e>=0;--e){const n=i[e].$filler;n&&Ur(t.ctx,n,t.chartArea)}},beforeDatasetDraw(t,e,n){const i=e.meta.$filler;i&&!1!==i.fill&&"beforeDatasetDraw"===n.drawTime&&Ur(t.ctx,i,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const jr=(t,e)=>{let{boxHeight:n=e,boxWidth:i=e}=t;return t.usePointStyle&&(n=Math.min(n,e),i=Math.min(i,e)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(e,n)}};class Yr extends wi{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,n){const i=this;i.maxWidth=t,i.maxHeight=e,i._margins=n,i.setDimensions(),i.buildLabels(),i.fit()}setDimensions(){const t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=t._margins.left,t.right=t.width):(t.height=t.maxHeight,t.top=t._margins.top,t.bottom=t.height)}buildLabels(){const t=this,e=t.options.labels||{};let n=m(e.generateLabels,[t.chart],t)||[];e.filter&&(n=n.filter((n=>e.filter(n,t.chart.data)))),e.sort&&(n=n.sort(((n,i)=>e.sort(n,i,t.chart.data)))),t.options.reverse&&n.reverse(),t.legendItems=n}fit(){const t=this,{options:e,ctx:n}=t;if(!e.display)return void(t.width=t.height=0);const i=e.labels,r=oe(i.font),o=r.size,a=t._computeTitleHeight(),{boxWidth:s,itemHeight:l}=jr(i,o);let c,u;n.font=r.string,t.isHorizontal()?(c=t.maxWidth,u=t._fitRows(a,o,s,l)+10):(u=t.maxHeight,c=t._fitCols(a,o,s,l)+10),t.width=Math.min(c,e.maxWidth||t.maxWidth),t.height=Math.min(u,e.maxHeight||t.maxHeight)}_fitRows(t,e,n,i){const r=this,{ctx:o,maxWidth:a,options:{labels:{padding:s}}}=r,l=r.legendHitBoxes=[],c=r.lineWidths=[0],u=i+s;let d=t;o.textAlign="left",o.textBaseline="middle";let h=-1,f=-u;return r.legendItems.forEach(((t,r)=>{const g=n+e/2+o.measureText(t.text).width;(0===r||c[c.length-1]+g+2*s>a)&&(d+=u,c[c.length-(r>0?0:1)]=0,f+=u,h++),l[r]={left:0,top:f,row:h,width:g,height:i},c[c.length-1]+=g+s})),d}_fitCols(t,e,n,i){const r=this,{ctx:o,maxHeight:a,options:{labels:{padding:s}}}=r,l=r.legendHitBoxes=[],c=r.columnSizes=[],u=a-t;let d=s,h=0,f=0,g=0,p=0;return r.legendItems.forEach(((t,r)=>{const a=n+e/2+o.measureText(t.text).width;r>0&&f+i+2*s>u&&(d+=h+s,c.push({width:h,height:f}),g+=h+s,p++,h=f=0),l[r]={left:g,top:f,col:p,width:a,height:i},h=Math.max(h,a),f+=i+s})),d+=h,c.push({width:h,height:f}),d}adjustHitBoxes(){const t=this;if(!t.options.display)return;const e=t._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:r},rtl:o}}=t,s=Xe(o,t.left,t.width);if(this.isHorizontal()){let o=0,l=a(i,t.left+r,t.right-t.lineWidths[o]);for(const c of n)o!==c.row&&(o=c.row,l=a(i,t.left+r,t.right-t.lineWidths[o])),c.top+=t.top+e+r,c.left=s.leftForLtr(s.x(l),c.width),l+=c.width+r}else{let o=0,l=a(i,t.top+e+r,t.bottom-t.columnSizes[o].height);for(const c of n)c.col!==o&&(o=c.col,l=a(i,t.top+e+r,t.bottom-t.columnSizes[o].height)),c.top=l,c.left+=t.left+r,c.left=s.leftForLtr(s.x(c.left),c.width),l+=c.height+r}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){const t=this;if(t.options.display){const e=t.ctx;Yt(e,t),t._draw(),qt(e)}}_draw(){const t=this,{options:e,columnSizes:n,lineWidths:i,ctx:r}=t,{align:o,labels:s}=e,l=Nt.color,c=Xe(e.rtl,t.left,t.width),u=oe(s.font),{color:d,padding:h}=s,f=u.size,p=f/2;let m;t.drawTitle(),r.textAlign=c.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=u.string;const{boxWidth:b,boxHeight:x,itemHeight:y}=jr(s,f),v=t.isHorizontal(),w=this._computeTitleHeight();m=v?{x:a(o,t.left+h,t.right-i[0]),y:t.top+h+w,line:0}:{x:t.left+h,y:a(o,t.top+w+h,t.bottom-n[0].height),line:0},Qe(t.ctx,e.textDirection);const _=y+h;t.legendItems.forEach(((M,k)=>{r.strokeStyle=M.fontColor||d,r.fillStyle=M.fontColor||d;const C=r.measureText(M.text).width,T=c.textAlign(M.textAlign||(M.textAlign=s.textAlign)),S=b+p+C;let D=m.x,P=m.y;c.setWidth(t.width),v?k>0&&D+S+h>t.right&&(P=m.y+=_,m.line++,D=m.x=a(o,t.left+h,t.right-i[m.line])):k>0&&P+_>t.bottom&&(D=m.x=D+n[m.line].width+h,m.line++,P=m.y=a(o,t.top+w+h,t.bottom-n[m.line].height)),function(t,e,n){if(isNaN(b)||b<=0||isNaN(x)||x<0)return;r.save();const i=g(n.lineWidth,1);if(r.fillStyle=g(n.fillStyle,l),r.lineCap=g(n.lineCap,"butt"),r.lineDashOffset=g(n.lineDashOffset,0),r.lineJoin=g(n.lineJoin,"miter"),r.lineWidth=i,r.strokeStyle=g(n.strokeStyle,l),r.setLineDash(g(n.lineDash,[])),s.usePointStyle){const o={radius:b*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:i},a=c.xPlus(t,b/2);Vt(r,o,a,e+p)}else{const o=e+Math.max((f-x)/2,0),a=c.leftForLtr(t,b),s=ie(n.borderRadius);r.beginPath(),Object.values(s).some((t=>0!==t))?Kt(r,{x:a,y:o,w:b,h:x,radius:s}):r.rect(a,o,b,x),r.fill(),0!==i&&r.stroke()}r.restore()}(c.x(D),P,M),D=((t,e,n,i)=>t===(i?"left":"right")?n:"center"===t?(e+n)/2:e)(T,D+b+p,v?D+S:t.right,e.rtl),function(t,e,n){Qt(r,n.text,t,e+y/2,u,{strikethrough:n.hidden,textAlign:c.textAlign(n.textAlign)})}(c.x(D),P,M),v?m.x+=S+h:m.y+=_})),Ge(t.ctx,e.textDirection)}drawTitle(){const t=this,e=t.options,n=e.title,i=oe(n.font),r=re(n.padding);if(!n.display)return;const s=Xe(e.rtl,t.left,t.width),l=t.ctx,c=n.position,u=i.size/2,d=r.top+u;let h,f=t.left,g=t.width;if(this.isHorizontal())g=Math.max(...t.lineWidths),h=t.top+d,f=a(e.align,f,t.right-g);else{const n=t.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);h=d+a(e.align,t.top,t.bottom-n-e.labels.padding-t._computeTitleHeight())}const p=a(c,f,f+g);l.textAlign=s.textAlign(o(c)),l.textBaseline="middle",l.strokeStyle=n.color,l.fillStyle=n.color,l.font=i.string,Qt(l,n.text,p,h,i)}_computeTitleHeight(){const t=this.options.title,e=oe(t.font),n=re(t.padding);return t.display?e.lineHeight+n.height:0}_getLegendItemAt(t,e){const n=this;let i,r,o;if(t>=n.left&&t<=n.right&&e>=n.top&&e<=n.bottom)for(o=n.legendHitBoxes,i=0;i<o.length;++i)if(r=o[i],t>=r.left&&t<=r.left+r.width&&e>=r.top&&e<=r.top+r.height)return n.legendItems[i];return null}handleEvent(t){const e=this,n=e.options;if(!function(t,e){return!("mousemove"!==t||!e.onHover&&!e.onLeave)||!(!e.onClick||"click"!==t&&"mouseup"!==t)}(t.type,n))return;const i=e._getLegendItemAt(t.x,t.y);if("mousemove"===t.type){const a=e._hoveredItem,s=(o=i,null!==(r=a)&&null!==o&&r.datasetIndex===o.datasetIndex&&r.index===o.index);a&&!s&&m(n.onLeave,[t,a,e],e),e._hoveredItem=i,i&&!s&&m(n.onHover,[t,i,e],e)}else i&&m(n.onClick,[t,i,e],e);var r,o}}var qr={id:"legend",_element:Yr,start(t,e,n){const i=t.legend=new Yr({ctx:t.ctx,options:n,chart:t});oi.configure(t,i,n),oi.addBox(t,i)},stop(t){oi.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const i=t.legend;oi.configure(t,i,n),i.options=n},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,n){const i=e.datasetIndex,r=n.chart;r.isDatasetVisible(i)?(r.hide(i),e.hidden=!0):(r.show(i),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:r,color:o}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const a=t.controller.getStyle(n?0:void 0),s=re(a.borderWidth);return{text:e[t.index].label,fillStyle:a.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(s.width+s.height)/4,strokeStyle:a.borderColor,pointStyle:i||a.pointStyle,rotation:a.rotation,textAlign:r||a.textAlign,borderRadius:0,datasetIndex:t.index}}),this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class $r extends wi{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const n=this,i=n.options;if(n.left=0,n.top=0,!i.display)return void(n.width=n.height=n.right=n.bottom=0);n.width=n.right=t,n.height=n.bottom=e;const r=u(i.text)?i.text.length:1;n._padding=re(i.padding);const o=r*oe(i.font).lineHeight+n._padding.height;n.isHorizontal()?n.height=o:n.width=o}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:n,bottom:i,right:r,options:o}=this,s=o.align;let l,c,u,d=0;return this.isHorizontal()?(c=a(s,n,r),u=e+t,l=r-n):("left"===o.position?(c=n+t,u=a(s,i,e),d=-.5*z):(c=r-t,u=a(s,e,i),d=.5*z),l=i-e),{titleX:c,titleY:u,maxWidth:l,rotation:d}}draw(){const t=this,e=t.ctx,n=t.options;if(!n.display)return;const i=oe(n.font),r=i.lineHeight/2+t._padding.top,{titleX:a,titleY:s,maxWidth:l,rotation:c}=t._drawArgs(r);Qt(e,n.text,0,0,i,{color:n.color,maxWidth:l,rotation:c,textAlign:o(n.align),textBaseline:"middle",translation:[a,s]})}}var Xr={id:"title",_element:$r,start(t,e,n){!function(t,e){const n=new $r({ctx:t.ctx,options:e,chart:t});oi.configure(t,n,e),oi.addBox(t,n),t.titleBlock=n}(t,n)},stop(t){const e=t.titleBlock;oi.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const i=t.titleBlock;oi.configure(t,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Qr=new WeakMap;var Gr={id:"subtitle",start(t,e,n){const i=new $r({ctx:t.ctx,options:n,chart:t});oi.configure(t,i,n),oi.addBox(t,i),Qr.set(t,i)},stop(t){oi.removeBox(t,Qr.get(t)),Qr.delete(t)},beforeUpdate(t,e,n){const i=Qr.get(t);oi.configure(t,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Kr={average(t){if(!t.length)return!1;let e,n,i=0,r=0,o=0;for(e=0,n=t.length;e<n;++e){const n=t[e].element;if(n&&n.hasValue()){const t=n.tooltipPosition();i+=t.x,r+=t.y,++o}}return{x:i/o,y:r/o}},nearest(t,e){if(!t.length)return!1;let n,i,r,o=e.x,a=e.y,s=Number.POSITIVE_INFINITY;for(n=0,i=t.length;n<i;++n){const i=t[n].element;if(i&&i.hasValue()){const t=$(e,i.getCenterPoint());t<s&&(s=t,r=i)}}if(r){const t=r.tooltipPosition();o=t.x,a=t.y}return{x:o,y:a}}};function Jr(t,e){return e&&(u(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Zr(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function to(t,e){const{element:n,datasetIndex:i,index:r}=e,o=t.getDatasetMeta(i).controller,{label:a,value:s}=o.getLabelAndValue(r);return{chart:t,label:a,parsed:o.getParsed(r),raw:t.data.datasets[i].data[r],formattedValue:s,dataset:o.getDataset(),dataIndex:r,datasetIndex:i,element:n}}function eo(t,e){const n=t._chart.ctx,{body:i,footer:r,title:o}=t,{boxWidth:a,boxHeight:s}=e,l=oe(e.bodyFont),c=oe(e.titleFont),u=oe(e.footerFont),d=o.length,h=r.length,f=i.length,g=re(e.padding);let p=g.height,m=0,x=i.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);x+=t.beforeBody.length+t.afterBody.length,d&&(p+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),x&&(p+=f*(e.displayColors?Math.max(s,l.lineHeight):l.lineHeight)+(x-f)*l.lineHeight+(x-1)*e.bodySpacing),h&&(p+=e.footerMarginTop+h*u.lineHeight+(h-1)*e.footerSpacing);let y=0;const v=function(t){m=Math.max(m,n.measureText(t).width+y)};return n.save(),n.font=c.string,b(t.title,v),n.font=l.string,b(t.beforeBody.concat(t.afterBody),v),y=e.displayColors?a+2:0,b(i,(t=>{b(t.before,v),b(t.lines,v),b(t.after,v)})),y=0,n.font=u.string,b(t.footer,v),n.restore(),m+=g.width,{width:m,height:p}}function no(t,e,n,i){const{x:r,width:o}=n,{width:a,chartArea:{left:s,right:l}}=t;let c="center";return"center"===i?c=r<=(s+l)/2?"left":"right":r<=o/2?c="left":r>=a-o/2&&(c="right"),function(t,e,n,i){const{x:r,width:o}=i,a=n.caretSize+n.caretPadding;return"left"===t&&r+o+a>e.width||"right"===t&&r-o-a<0||void 0}(c,t,e,n)&&(c="center"),c}function io(t,e,n){const i=e.yAlign||function(t,e){const{y:n,height:i}=e;return n<i/2?"top":n>t.height-i/2?"bottom":"center"}(t,n);return{xAlign:e.xAlign||no(t,e,n,i),yAlign:i}}function ro(t,e,n,i){const{caretSize:r,caretPadding:o,cornerRadius:a}=t,{xAlign:s,yAlign:l}=n,c=r+o,u=a+o;let d=function(t,e){let{x:n,width:i}=t;return"right"===e?n-=i:"center"===e&&(n-=i/2),n}(e,s);const h=function(t,e,n){let{y:i,height:r}=t;return"top"===e?i+=n:i-="bottom"===e?r+n:r/2,i}(e,l,c);return"center"===l?"left"===s?d+=c:"right"===s&&(d-=c):"left"===s?d-=u:"right"===s&&(d+=u),{x:K(d,0,i.width-e.width),y:K(h,0,i.height-e.height)}}function oo(t,e,n){const i=re(n.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-i.right:t.x+i.left}function ao(t){return Jr([],Zr(t))}function so(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}class lo extends wi{constructor(t){super(),this.opacity=0,this._active=[],this._chart=t._chart,this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this,e=t._cachedAnimations;if(e)return e;const n=t._chart,i=t.options.setContext(t.getContext()),r=i.enabled&&n.options.animation&&i.animations,o=new cn(t._chart,r);return r._cacheable&&(t._cachedAnimations=Object.freeze(o)),o}getContext(){const t=this;return t.$context||(t.$context=(e=t._chart.getContext(),n=t,i=t._tooltipItems,Object.assign(Object.create(e),{tooltip:n,tooltipItems:i,type:"tooltip"})));var e,n,i}getTitle(t,e){const n=this,{callbacks:i}=e,r=i.beforeTitle.apply(n,[t]),o=i.title.apply(n,[t]),a=i.afterTitle.apply(n,[t]);let s=[];return s=Jr(s,Zr(r)),s=Jr(s,Zr(o)),s=Jr(s,Zr(a)),s}getBeforeBody(t,e){return ao(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const n=this,{callbacks:i}=e,r=[];return b(t,(t=>{const e={before:[],lines:[],after:[]},o=so(i,t);Jr(e.before,Zr(o.beforeLabel.call(n,t))),Jr(e.lines,o.label.call(n,t)),Jr(e.after,Zr(o.afterLabel.call(n,t))),r.push(e)})),r}getAfterBody(t,e){return ao(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const n=this,{callbacks:i}=e,r=i.beforeFooter.apply(n,[t]),o=i.footer.apply(n,[t]),a=i.afterFooter.apply(n,[t]);let s=[];return s=Jr(s,Zr(r)),s=Jr(s,Zr(o)),s=Jr(s,Zr(a)),s}_createItems(t){const e=this,n=e._active,i=e._chart.data,r=[],o=[],a=[];let s,l,c=[];for(s=0,l=n.length;s<l;++s)c.push(to(e._chart,n[s]));return t.filter&&(c=c.filter(((e,n,r)=>t.filter(e,n,r,i)))),t.itemSort&&(c=c.sort(((e,n)=>t.itemSort(e,n,i)))),b(c,(n=>{const i=so(t.callbacks,n);r.push(i.labelColor.call(e,n)),o.push(i.labelPointStyle.call(e,n)),a.push(i.labelTextColor.call(e,n))})),e.labelColors=r,e.labelPointStyles=o,e.labelTextColors=a,e.dataPoints=c,c}update(t,e){const n=this,i=n.options.setContext(n.getContext()),r=n._active;let o,a=[];if(r.length){const t=Kr[i.position].call(n,r,n._eventPosition);a=n._createItems(i),n.title=n.getTitle(a,i),n.beforeBody=n.getBeforeBody(a,i),n.body=n.getBody(a,i),n.afterBody=n.getAfterBody(a,i),n.footer=n.getFooter(a,i);const e=n._size=eo(n,i),s=Object.assign({},t,e),l=io(n._chart,i,s),c=ro(i,s,l,n._chart);n.xAlign=l.xAlign,n.yAlign=l.yAlign,o={opacity:1,x:c.x,y:c.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==n.opacity&&(o={opacity:0});n._tooltipItems=a,n.$context=void 0,o&&n._resolveAnimations().update(n,o),t&&i.external&&i.external.call(n,{chart:n._chart,tooltip:n,replay:e})}drawCaret(t,e,n,i){const r=this.getCaretPosition(t,n,i);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,n){const{xAlign:i,yAlign:r}=this,{cornerRadius:o,caretSize:a}=n,{x:s,y:l}=t,{width:c,height:u}=e;let d,h,f,g,p,m;return"center"===r?(p=l+u/2,"left"===i?(d=s,h=d-a,g=p+a,m=p-a):(d=s+c,h=d+a,g=p-a,m=p+a),f=d):(h="left"===i?s+o+a:"right"===i?s+c-o-a:this.caretX,"top"===r?(g=l,p=g-a,d=h-a,f=h+a):(g=l+u,p=g+a,d=h+a,f=h-a),m=g),{x1:d,x2:h,x3:f,y1:g,y2:p,y3:m}}drawTitle(t,e,n){const i=this,r=i.title,o=r.length;let a,s,l;if(o){const c=Xe(n.rtl,i.x,i.width);for(t.x=oo(i,n.titleAlign,n),e.textAlign=c.textAlign(n.titleAlign),e.textBaseline="middle",a=oe(n.titleFont),s=n.titleSpacing,e.fillStyle=n.titleColor,e.font=a.string,l=0;l<o;++l)e.fillText(r[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+s,l+1===o&&(t.y+=n.titleMarginBottom-s)}}_drawColorBox(t,e,n,i,r){const o=this,a=o.labelColors[n],s=o.labelPointStyles[n],{boxHeight:l,boxWidth:c}=r,u=oe(r.bodyFont),d=oo(o,"left",r),h=i.x(d),f=l<u.lineHeight?(u.lineHeight-l)/2:0,g=e.y+f;if(r.usePointStyle){const e={radius:Math.min(c,l)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},n=i.leftForLtr(h,c)+c/2,o=g+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Vt(t,e,n,o),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Vt(t,e,n,o)}else{t.lineWidth=a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const e=i.leftForLtr(h,c),n=i.leftForLtr(i.xPlus(h,1),c-2),o=ie(a.borderRadius);Object.values(o).some((t=>0!==t))?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Kt(t,{x:e,y:g,w:c,h:l,radius:o}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Kt(t,{x:n,y:g+1,w:c-2,h:l-2,radius:o}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(e,g,c,l),t.strokeRect(e,g,c,l),t.fillStyle=a.backgroundColor,t.fillRect(n,g+1,c-2,l-2))}t.fillStyle=o.labelTextColors[n]}drawBody(t,e,n){const i=this,{body:r}=i,{bodySpacing:o,bodyAlign:a,displayColors:s,boxHeight:l,boxWidth:c}=n,u=oe(n.bodyFont);let d=u.lineHeight,h=0;const f=Xe(n.rtl,i.x,i.width),g=function(n){e.fillText(n,f.x(t.x+h),t.y+d/2),t.y+=d+o},p=f.textAlign(a);let m,x,y,v,w,_,M;for(e.textAlign=a,e.textBaseline="middle",e.font=u.string,t.x=oo(i,p,n),e.fillStyle=n.bodyColor,b(i.beforeBody,g),h=s&&"right"!==p?"center"===a?c/2+1:c+2:0,v=0,_=r.length;v<_;++v){for(m=r[v],x=i.labelTextColors[v],e.fillStyle=x,b(m.before,g),y=m.lines,s&&y.length&&(i._drawColorBox(e,t,v,f,n),d=Math.max(u.lineHeight,l)),w=0,M=y.length;w<M;++w)g(y[w]),d=u.lineHeight;b(m.after,g)}h=0,d=u.lineHeight,b(i.afterBody,g),t.y-=o}drawFooter(t,e,n){const i=this,r=i.footer,o=r.length;let a,s;if(o){const l=Xe(n.rtl,i.x,i.width);for(t.x=oo(i,n.footerAlign,n),t.y+=n.footerMarginTop,e.textAlign=l.textAlign(n.footerAlign),e.textBaseline="middle",a=oe(n.footerFont),e.fillStyle=n.footerColor,e.font=a.string,s=0;s<o;++s)e.fillText(r[s],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+n.footerSpacing}}drawBackground(t,e,n,i){const{xAlign:r,yAlign:o}=this,{x:a,y:s}=t,{width:l,height:c}=n,u=i.cornerRadius;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.beginPath(),e.moveTo(a+u,s),"top"===o&&this.drawCaret(t,e,n,i),e.lineTo(a+l-u,s),e.quadraticCurveTo(a+l,s,a+l,s+u),"center"===o&&"right"===r&&this.drawCaret(t,e,n,i),e.lineTo(a+l,s+c-u),e.quadraticCurveTo(a+l,s+c,a+l-u,s+c),"bottom"===o&&this.drawCaret(t,e,n,i),e.lineTo(a+u,s+c),e.quadraticCurveTo(a,s+c,a,s+c-u),"center"===o&&"left"===r&&this.drawCaret(t,e,n,i),e.lineTo(a,s+u),e.quadraticCurveTo(a,s,a+u,s),e.closePath(),e.fill(),i.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this,n=e._chart,i=e.$animations,r=i&&i.x,o=i&&i.y;if(r||o){const i=Kr[t.position].call(e,e._active,e._eventPosition);if(!i)return;const a=e._size=eo(e,t),s=Object.assign({},i,e._size),l=io(n,t,s),c=ro(t,s,l,n);r._to===c.x&&o._to===c.y||(e.xAlign=l.xAlign,e.yAlign=l.yAlign,e.width=a.width,e.height=a.height,e.caretX=i.x,e.caretY=i.y,e._resolveAnimations().update(e,c))}}draw(t){const e=this,n=e.options.setContext(e.getContext());let i=e.opacity;if(!i)return;e._updateAnimationTarget(n);const r={width:e.width,height:e.height},o={x:e.x,y:e.y};i=Math.abs(i)<.001?0:i;const a=re(n.padding),s=e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length;n.enabled&&s&&(t.save(),t.globalAlpha=i,e.drawBackground(o,t,r,n),Qe(t,n.textDirection),o.y+=a.top,e.drawTitle(o,t,n),e.drawBody(o,t,n),e.drawFooter(o,t,n),Ge(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const n=this,i=n._active,r=t.map((({datasetIndex:t,index:e})=>{const i=n._chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}})),o=!x(i,r),a=n._positionChanged(r,e);(o||a)&&(n._active=r,n._eventPosition=e,n.update(!0))}handleEvent(t,e){const n=this,i=n.options,r=n._active||[];let o=!1,a=[];"mouseout"!==t.type&&(a=n._chart.getElementsAtEventForMode(t,i.mode,i,e),i.reverse&&a.reverse());const s=n._positionChanged(a,t);return o=e||!x(a,r)||s,o&&(n._active=a,(i.enabled||i.external)&&(n._eventPosition={x:t.x,y:t.y},n.update(!0,e))),o}_positionChanged(t,e){const{caretX:n,caretY:i,options:r}=this,o=Kr[r.position].call(this,t,e);return!1!==o&&(n!==o.x||i!==o.y)}}lo.positioners=Kr;var co={id:"tooltip",_element:lo,positioners:Kr,afterInit(t,e,n){n&&(t.tooltip=new lo({_chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip,n={tooltip:e};!1!==t.notifyPlugins("beforeTooltipDraw",n)&&(e&&e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n))},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,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:{beforeTitle:s,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,i=n?n.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex<i)return n[e.dataIndex]}return""},afterTitle:s,beforeBody:s,beforeLabel:s,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return c(n)||(e+=n),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:s,afterBody:s,beforeFooter:s,footer:s,afterFooter:s}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},uo=Object.freeze({__proto__:null,Decimation:Sr,Filler:Vr,Legend:qr,SubTitle:Gr,Title:Xr,Tooltip:co});class ho extends Oi{constructor(t){super(t),this._startValue=void 0,this._valueRange=0}parse(t,e){if(c(t))return null;const n=this.getLabels();return((t,e)=>null===t?null:K(Math.round(t),0,e))(e=isFinite(e)&&n[e]===t?e:function(t,e,n){const i=t.indexOf(e);return-1===i?((t,e,n)=>"string"==typeof e?t.push(e)-1:isNaN(e)?null:n)(t,e,n):i!==t.lastIndexOf(e)?n:i}(n,t,g(e,t)),n.length-1)}determineDataLimits(){const t=this,{minDefined:e,maxDefined:n}=t.getUserBounds();let{min:i,max:r}=t.getMinMax(!0);"ticks"===t.options.bounds&&(e||(i=0),n||(r=t.getLabels().length-1)),t.min=i,t.max=r}buildTicks(){const t=this,e=t.min,n=t.max,i=t.options.offset,r=[];let o=t.getLabels();o=0===e&&n===o.length-1?o:o.slice(e,n+1),t._valueRange=Math.max(o.length-(i?0:1),1),t._startValue=t.min-(i?.5:0);for(let t=e;t<=n;t++)r.push({value:t});return r}getLabelForValue(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}configure(){const t=this;super.configure(),t.isHorizontal()||(t._reversePixels=!t._reversePixels)}getPixelForValue(t){const e=this;return"number"!=typeof t&&(t=e.parse(t)),null===t?NaN:e.getPixelForDecimal((t-e._startValue)/e._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){const e=this;return Math.round(e._startValue+e.getDecimalForPixel(t)*e._valueRange)}getBasePixel(){return this.bottom}}function fo(t,e,{horizontal:n,minRotation:i}){const r=j(i),o=(n?Math.sin(r):Math.cos(r))||.001,a=.75*e*(""+t).length;return Math.min(e/o,a)}ho.id="category",ho.defaults={ticks:{callback:ho.prototype.getLabelForValue}};class go extends Oi{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return c(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const t=this,{beginAtZero:e}=t.options,{minDefined:n,maxDefined:i}=t.getUserBounds();let{min:r,max:o}=t;const a=t=>r=n?r:t,s=t=>o=i?o:t;if(e){const t=H(r),e=H(o);t<0&&e<0?s(0):t>0&&e>0&&a(0)}if(r===o){let t=1;(o>=Number.MAX_SAFE_INTEGER||r<=Number.MIN_SAFE_INTEGER)&&(t=Math.abs(.05*o)),s(o+t),e||a(r-t)}t.min=r,t.max=o}getTickLimit(){const t=this,e=t.options.ticks;let n,{maxTicksLimit:i,stepSize:r}=e;return r?n=Math.ceil(t.max/r)-Math.floor(t.min/r)+1:(n=t.computeTickLimit(),i=i||11),i&&(n=Math.min(i,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this,e=t.options,n=e.ticks;let i=t.getTickLimit();i=Math.max(2,i);const r=function(t,e){const n=[],{bounds:i,step:r,min:o,max:a,precision:s,count:l,maxTicks:u,maxDigits:d,includeBounds:h}=t,f=r||1,g=u-1,{min:p,max:m}=e,b=!c(o),x=!c(a),y=!c(l),v=(m-p)/(d+1);let w,_,M,k,C=B((m-p)/g/f)*f;if(C<1e-14&&!b&&!x)return[{value:p},{value:m}];k=Math.ceil(m/C)-Math.floor(p/C),k>g&&(C=B(k*C/g/f)*f),c(s)||(w=Math.pow(10,s),C=Math.ceil(C*w)/w),"ticks"===i?(_=Math.floor(p/C)*C,M=Math.ceil(m/C)*C):(_=p,M=m),b&&x&&r&&function(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}((a-o)/r,C/1e3)?(k=Math.round(Math.min((a-o)/C,u)),C=(a-o)/k,_=o,M=a):y?(_=b?o:_,M=x?a:M,k=l-1,C=(M-_)/k):(k=(M-_)/C,k=U(k,Math.round(k),C/1e3)?Math.round(k):Math.ceil(k));const T=Math.max(q(C),q(_));w=Math.pow(10,c(s)?T:s),_=Math.round(_*w)/w,M=Math.round(M*w)/w;let S=0;for(b&&(h&&_!==o?(n.push({value:o}),_<o&&S++,U(Math.round((_+S*C)*w)/w,o,fo(o,v,t))&&S++):_<o&&S++);S<k;++S)n.push({value:Math.round((_+S*C)*w)/w});return x&&h&&M!==a?U(n[n.length-1].value,a,fo(a,v,t))?n[n.length-1].value=a:n.push({value:a}):x&&M!==a||n.push({value:M}),n}({maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:t._maxDigits(),horizontal:t.isHorizontal(),minRotation:n.minRotation||0,includeBounds:!1!==n.includeBounds},t._range||t);return"ticks"===e.bounds&&V(r,t,"value"),e.reverse?(r.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),r}configure(){const t=this,e=t.ticks;let n=t.min,i=t.max;if(super.configure(),t.options.offset&&e.length){const t=(i-n)/Math.max(e.length-1,1)/2;n-=t,i+=t}t._startValue=n,t._endValue=i,t._valueRange=i-n}getLabelForValue(t){return $e(t,this.chart.options.locale)}}class po extends go{determineDataLimits(){const t=this,{min:e,max:n}=t.getMinMax(!0);t.min=h(e)?e:0,t.max=h(n)?n:1,t.handleTickRangeOptions()}computeTickLimit(){const t=this,e=t.isHorizontal(),n=e?t.width:t.height,i=j(t.options.ticks.minRotation),r=(e?Math.sin(i):Math.cos(i))||.001,o=t._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/r))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}function mo(t){return 1==t/Math.pow(10,Math.floor(N(t)))}po.id="linear",po.defaults={ticks:{callback:Mi.formatters.numeric}};class bo extends Oi{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const n=go.prototype.parse.apply(this,[t,e]);if(0!==n)return h(n)&&n>0?n:null;this._zero=!0}determineDataLimits(){const t=this,{min:e,max:n}=t.getMinMax(!0);t.min=h(e)?Math.max(0,e):null,t.max=h(n)?Math.max(0,n):null,t.options.beginAtZero&&(t._zero=!0),t.handleTickRangeOptions()}handleTickRangeOptions(){const t=this,{minDefined:e,maxDefined:n}=t.getUserBounds();let i=t.min,r=t.max;const o=t=>i=e?i:t,a=t=>r=n?r:t,s=(t,e)=>Math.pow(10,Math.floor(N(t))+e);i===r&&(i<=0?(o(1),a(10)):(o(s(i,-1)),a(s(r,1)))),i<=0&&o(s(r,-1)),r<=0&&a(s(i,1)),t._zero&&t.min!==t._suggestedMin&&i===s(t.min,0)&&o(s(i,-1)),t.min=i,t.max=r}buildTicks(){const t=this,e=t.options,n=function(t,e){const n=Math.floor(N(e.max)),i=Math.ceil(e.max/Math.pow(10,n)),r=[];let o=f(t.min,Math.pow(10,Math.floor(N(e.min)))),a=Math.floor(N(o)),s=Math.floor(o/Math.pow(10,a)),l=a<0?Math.pow(10,Math.abs(a)):1;do{r.push({value:o,major:mo(o)}),++s,10===s&&(s=1,++a,l=a>=0?1:l),o=Math.round(s*Math.pow(10,a)*l)/l}while(a<n||a===n&&s<i);const c=f(t.max,o);return r.push({value:c,major:mo(o)}),r}({min:t._userMin,max:t._userMax},t);return"ticks"===e.bounds&&V(n,t,"value"),e.reverse?(n.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),n}getLabelForValue(t){return void 0===t?"0":$e(t,this.chart.options.locale)}configure(){const t=this,e=t.min;super.configure(),t._startValue=N(e),t._valueRange=N(t.max)-N(e)}getPixelForValue(t){const e=this;return void 0!==t&&0!==t||(t=e.min),null===t||isNaN(t)?NaN:e.getPixelForDecimal(t===e.min?0:(N(t)-e._startValue)/e._valueRange)}getValueForPixel(t){const e=this,n=e.getDecimalForPixel(t);return Math.pow(10,e._startValue+n*e._valueRange)}}function xo(t){const e=t.ticks;if(e.display&&t.display){const t=re(e.backdropPadding);return g(e.font&&e.font.size,Nt.font.size)+t.height}return 0}function yo(t,e,n,i,r){return t===i||t===r?{start:e-n/2,end:e+n/2}:t<i||t>r?{start:e-n,end:e}:{start:e,end:e+n}}function vo(t){return 0===t||180===t?"center":t<180?"left":"right"}function wo(t,e,n){return 90===n||270===n?t-=e/2:(n>270||n<90)&&(t-=e),t}function _o(t,e,n,i){const{ctx:r}=t;if(n)r.arc(t.xCenter,t.yCenter,e,0,O);else{let n=t.getPointPosition(0,e);r.moveTo(n.x,n.y);for(let o=1;o<i;o++)n=t.getPointPosition(o,e),r.lineTo(n.x,n.y)}}function Mo(t){return W(t)?t:0}bo.id="logarithmic",bo.defaults={ticks:{callback:Mi.formatters.logarithmic,major:{enabled:!0}}};class ko extends go{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this;t.width=t.maxWidth,t.height=t.maxHeight,t.paddingTop=xo(t.options)/2,t.xCenter=Math.floor(t.width/2),t.yCenter=Math.floor((t.height-t.paddingTop)/2),t.drawingArea=Math.min(t.height-t.paddingTop,t.width)/2}determineDataLimits(){const t=this,{min:e,max:n}=t.getMinMax(!1);t.min=h(e)&&!isNaN(e)?e:0,t.max=h(n)&&!isNaN(n)?n:0,t.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/xo(this.options))}generateTickLabels(t){const e=this;go.prototype.generateTickLabels.call(e,t),e._pointLabels=e.getLabels().map(((t,n)=>{const i=m(e.options.pointLabels.callback,[t,n],e);return i||0===i?i:""}))}fit(){const t=this,e=t.options;e.display&&e.pointLabels.display?function(t){const e={l:0,r:t.width,t:0,b:t.height-t.paddingTop},n={},i=[],r=[],o=t.getLabels().length;for(let c=0;c<o;c++){const o=t.options.pointLabels.setContext(t.getPointLabelContext(c));r[c]=o.padding;const d=t.getPointPosition(c,t.drawingArea+r[c]),h=oe(o.font),f=(a=t.ctx,s=h,l=u(l=t._pointLabels[c])?l:[l],{w:Bt(a,s.string,l),h:l.length*s.lineHeight});i[c]=f;const g=t.getIndexAngle(c),p=Y(g),m=yo(p,d.x,f.w,0,180),b=yo(p,d.y,f.h,90,270);m.start<e.l&&(e.l=m.start,n.l=g),m.end>e.r&&(e.r=m.end,n.r=g),b.start<e.t&&(e.t=b.start,n.t=g),b.end>e.b&&(e.b=b.end,n.b=g)}var a,s,l;t._setReductions(t.drawingArea,e,n),t._pointLabelItems=function(t,e,n){const i=[],r=t.getLabels().length,o=t.options,a=xo(o),s=t.getDistanceFromCenterForValue(o.ticks.reverse?t.min:t.max);for(let o=0;o<r;o++){const r=0===o?a/2:0,d=t.getPointPosition(o,s+r+n[o]),h=Y(t.getIndexAngle(o)),f=e[o],g=wo(d.y,f.h,h),p=vo(h),m=(l=d.x,c=f.w,"right"===(u=p)?l-=c:"center"===u&&(l-=c/2),l);i.push({x:d.x,y:g,textAlign:p,left:m,top:g,right:m+f.w,bottom:g+f.h})}var l,c,u;return i}(t,i,r)}(t):t.setCenterPoint(0,0,0,0)}_setReductions(t,e,n){const i=this;let r=e.l/Math.sin(n.l),o=Math.max(e.r-i.width,0)/Math.sin(n.r),a=-e.t/Math.cos(n.t),s=-Math.max(e.b-(i.height-i.paddingTop),0)/Math.cos(n.b);r=Mo(r),o=Mo(o),a=Mo(a),s=Mo(s),i.drawingArea=Math.max(t/2,Math.min(Math.floor(t-(r+o)/2),Math.floor(t-(a+s)/2))),i.setCenterPoint(r,o,a,s)}setCenterPoint(t,e,n,i){const r=this,o=r.width-e-r.drawingArea,a=t+r.drawingArea,s=n+r.drawingArea,l=r.height-r.paddingTop-i-r.drawingArea;r.xCenter=Math.floor((a+o)/2+r.left),r.yCenter=Math.floor((s+l)/2+r.top+r.paddingTop)}getIndexAngle(t){return Q(t*(O/this.getLabels().length)+j(this.options.startAngle||0))}getDistanceFromCenterForValue(t){const e=this;if(c(t))return NaN;const n=e.drawingArea/(e.max-e.min);return e.options.reverse?(e.max-t)*n:(t-e.min)*n}getValueForDistanceFromCenter(t){if(c(t))return NaN;const e=this,n=t/(e.drawingArea/(e.max-e.min));return e.options.reverse?e.max-n:e.min+n}getPointLabelContext(t){const e=this,n=e._pointLabels||[];if(t>=0&&t<n.length){const i=n[t];return function(t,e,n){return Object.assign(Object.create(t),{label:n,index:e,type:"pointLabel"})}(e.getContext(),t,i)}}getPointPosition(t,e){const n=this,i=n.getIndexAngle(t)-R;return{x:Math.cos(i)*e+n.xCenter,y:Math.sin(i)*e+n.yCenter,angle:i}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:n,right:i,bottom:r}=this._pointLabelItems[t];return{left:e,top:n,right:i,bottom:r}}drawBackground(){const t=this,{backgroundColor:e,grid:{circular:n}}=t.options;if(e){const i=t.ctx;i.save(),i.beginPath(),_o(t,t.getDistanceFromCenterForValue(t._endValue),n,t.getLabels().length),i.closePath(),i.fillStyle=e,i.fill(),i.restore()}}drawGrid(){const t=this,e=t.ctx,n=t.options,{angleLines:i,grid:r}=n,o=t.getLabels().length;let a,s,l;if(n.pointLabels.display&&function(t,e){const{ctx:n,options:{pointLabels:i}}=t;for(let r=e-1;r>=0;r--){const e=i.setContext(t.getPointLabelContext(r)),o=oe(e.font),{x:a,y:s,textAlign:l,left:u,top:d,right:h,bottom:f}=t._pointLabelItems[r],{backdropColor:g}=e;if(!c(g)){const t=re(e.backdropPadding);n.fillStyle=g,n.fillRect(u-t.left,d-t.top,h-u+t.width,f-d+t.height)}Qt(n,t._pointLabels[r],a,s+o.lineHeight/2,o,{color:e.color,textAlign:l,textBaseline:"middle"})}}(t,o),r.display&&t.ticks.forEach(((e,n)=>{if(0!==n){s=t.getDistanceFromCenterForValue(e.value);const i=r.setContext(t.getContext(n-1));!function(t,e,n,i){const r=t.ctx,o=e.circular,{color:a,lineWidth:s}=e;!o&&!i||!a||!s||n<0||(r.save(),r.strokeStyle=a,r.lineWidth=s,r.setLineDash(e.borderDash),r.lineDashOffset=e.borderDashOffset,r.beginPath(),_o(t,n,o,i),r.closePath(),r.stroke(),r.restore())}(t,i,s,o)}})),i.display){for(e.save(),a=t.getLabels().length-1;a>=0;a--){const r=i.setContext(t.getPointLabelContext(a)),{color:o,lineWidth:c}=r;c&&o&&(e.lineWidth=c,e.strokeStyle=o,e.setLineDash(r.borderDash),e.lineDashOffset=r.borderDashOffset,s=t.getDistanceFromCenterForValue(n.ticks.reverse?t.min:t.max),l=t.getPointPosition(a,s),e.beginPath(),e.moveTo(t.xCenter,t.yCenter),e.lineTo(l.x,l.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const t=this,e=t.ctx,n=t.options,i=n.ticks;if(!i.display)return;const r=t.getIndexAngle(0);let o,a;e.save(),e.translate(t.xCenter,t.yCenter),e.rotate(r),e.textAlign="center",e.textBaseline="middle",t.ticks.forEach(((r,s)=>{if(0===s&&!n.reverse)return;const l=i.setContext(t.getContext(s)),c=oe(l.font);if(o=t.getDistanceFromCenterForValue(t.ticks[s].value),l.showLabelBackdrop){e.font=c.string,a=e.measureText(r.label).width,e.fillStyle=l.backdropColor;const t=re(l.backdropPadding);e.fillRect(-a/2-t.left,-o-c.size/2-t.top,a+t.width,c.size+t.height)}Qt(e,r.label,0,-o,c,{color:l.color})})),e.restore()}drawTitle(){}}ko.id="radialLinear",ko.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Mi.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5}},ko.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},ko.descriptors={angleLines:{_fallback:"grid"}};const Co={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}},To=Object.keys(Co);function So(t,e){return t-e}function Do(t,e){if(c(e))return null;const n=t._adapter,{parser:i,round:r,isoWeekday:o}=t._parseOpts;let a=e;return"function"==typeof i&&(a=i(a)),h(a)||(a="string"==typeof i?n.parse(a,i):n.parse(a)),null===a?null:(r&&(a="week"!==r||!W(o)&&!0!==o?n.startOf(a,r):n.startOf(a,"isoWeek",o)),+a)}function Po(t,e,n,i){const r=To.length;for(let o=To.indexOf(t);o<r-1;++o){const t=Co[To[o]],r=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((n-e)/(r*t.size))<=i)return To[o]}return To[r-1]}function zo(t,e,n){if(n){if(n.length){const{lo:i,hi:r}=se(n,e);t[n[i]>=e?n[i]:n[r]]=!0}}else t[e]=!0}function Oo(t,e,n){const i=[],r={},o=e.length;let a,s;for(a=0;a<o;++a)s=e[a],r[s]=a,i.push({value:s,major:!1});return 0!==o&&n?function(t,e,n,i){const r=t._adapter,o=+r.startOf(e[0].value,i),a=e[e.length-1].value;let s,l;for(s=o;s<=a;s=+r.add(s,1,i))l=n[s],l>=0&&(e[l].major=!0);return e}(t,i,r,n):i}class Ao extends Oi{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e){const n=t.time||(t.time={}),i=this._adapter=new Bn._date(t.adapters.date);M(n.displayFormats,i.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:Do(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this,e=t.options,n=t._adapter,i=e.time.unit||"day";let{min:r,max:o,minDefined:a,maxDefined:s}=t.getUserBounds();function l(t){a||isNaN(t.min)||(r=Math.min(r,t.min)),s||isNaN(t.max)||(o=Math.max(o,t.max))}a&&s||(l(t._getLabelBounds()),"ticks"===e.bounds&&"labels"===e.ticks.source||l(t.getMinMax(!1))),r=h(r)&&!isNaN(r)?r:+n.startOf(Date.now(),i),o=h(o)&&!isNaN(o)?o:+n.endOf(Date.now(),i)+1,t.min=Math.min(r,o-1),t.max=Math.max(r+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],n=t[t.length-1]),{min:e,max:n}}buildTicks(){const t=this,e=t.options,n=e.time,i=e.ticks,r="labels"===i.source?t.getLabelTimestamps():t._generate();"ticks"===e.bounds&&r.length&&(t.min=t._userMin||r[0],t.max=t._userMax||r[r.length-1]);const o=t.min,a=function(t,e,n){let i=0,r=t.length;for(;i<r&&t[i]<e;)i++;for(;r>i&&t[r-1]>n;)r--;return i>0||r<t.length?t.slice(i,r):t}(r,o,t.max);return t._unit=n.unit||(i.autoSkip?Po(n.minUnit,t.min,t.max,t._getLabelCapacity(o)):function(t,e,n,i,r){for(let o=To.length-1;o>=To.indexOf(n);o--){const n=To[o];if(Co[n].common&&t._adapter.diff(r,i,n)>=e-1)return n}return To[n?To.indexOf(n):0]}(t,a.length,n.minUnit,t.min,t.max)),t._majorUnit=i.major.enabled&&"year"!==t._unit?function(t){for(let e=To.indexOf(t)+1,n=To.length;e<n;++e)if(Co[To[e]].common)return To[e]}(t._unit):void 0,t.initOffsets(r),e.reverse&&a.reverse(),Oo(t,a,t._majorUnit)}initOffsets(t){const e=this;let n,i,r=0,o=0;e.options.offset&&t.length&&(n=e.getDecimalForValue(t[0]),r=1===t.length?1-n:(e.getDecimalForValue(t[1])-n)/2,i=e.getDecimalForValue(t[t.length-1]),o=1===t.length?i:(i-e.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;r=K(r,0,a),o=K(o,0,a),e._offsets={start:r,end:o,factor:1/(r+1+o)}}_generate(){const t=this,e=t._adapter,n=t.min,i=t.max,r=t.options,o=r.time,a=o.unit||Po(o.minUnit,n,i,t._getLabelCapacity(n)),s=g(o.stepSize,1),l="week"===a&&o.isoWeekday,c=W(l)||!0===l,u={};let d,h,f=n;if(c&&(f=+e.startOf(f,"isoWeek",l)),f=+e.startOf(f,c?"day":a),e.diff(i,n,a)>1e5*s)throw new Error(n+" and "+i+" are too far apart with stepSize of "+s+" "+a);const p="data"===r.ticks.source&&t.getDataTimestamps();for(d=f,h=0;d<i;d=+e.add(d,s,a),h++)zo(u,d,p);return d!==i&&"ticks"!==r.bounds&&1!==h||zo(u,d,p),Object.keys(u).sort(((t,e)=>t-e)).map((t=>+t))}getLabelForValue(t){const e=this._adapter,n=this.options.time;return n.tooltipFormat?e.format(t,n.tooltipFormat):e.format(t,n.displayFormats.datetime)}_tickFormatFunction(t,e,n,i){const r=this,o=r.options,a=o.time.displayFormats,s=r._unit,l=r._majorUnit,c=s&&a[s],u=l&&a[l],d=n[e],h=l&&u&&d&&d.major,f=r._adapter.format(t,i||(h?u:c)),g=o.ticks.callback;return g?m(g,[f,e,n],r):f}generateTickLabels(t){let e,n,i;for(e=0,n=t.length;e<n;++e)i=t[e],i.label=this._tickFormatFunction(i.value,e,t)}getDecimalForValue(t){const e=this;return null===t?NaN:(t-e.min)/(e.max-e.min)}getPixelForValue(t){const e=this,n=e._offsets,i=e.getDecimalForValue(t);return e.getPixelForDecimal((n.start+i)*n.factor)}getValueForPixel(t){const e=this,n=e._offsets,i=e.getDecimalForPixel(t)/n.factor-n.end;return e.min+i*(e.max-e.min)}_getLabelSize(t){const e=this,n=e.options.ticks,i=e.ctx.measureText(t).width,r=j(e.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(r),a=Math.sin(r),s=e._resolveTickFontOptions(0).size;return{w:i*o+s*a,h:i*a+s*o}}_getLabelCapacity(t){const e=this,n=e.options.time,i=n.displayFormats,r=i[n.unit]||i.millisecond,o=e._tickFormatFunction(t,0,Oo(e,[t],e._majorUnit),r),a=e._getLabelSize(o),s=Math.floor(e.isHorizontal()?e.width/a.w:e.height/a.h)-1;return s>0?s:1}getDataTimestamps(){const t=this;let e,n,i=t._cache.data||[];if(i.length)return i;const r=t.getMatchingVisibleMetas();if(t._normalized&&r.length)return t._cache.data=r[0].controller.getAllParsedValues(t);for(e=0,n=r.length;e<n;++e)i=i.concat(r[e].controller.getAllParsedValues(t));return t._cache.data=t.normalize(i)}getLabelTimestamps(){const t=this,e=t._cache.labels||[];let n,i;if(e.length)return e;const r=t.getLabels();for(n=0,i=r.length;n<i;++n)e.push(Do(t,r[n]));return t._cache.labels=t._normalized?e:t.normalize(e)}normalize(t){return he(t.sort(So))}}function Eo(t,e,n){let i,r,o,a,s=0,l=t.length-1;n?(e>=t[s].pos&&e<=t[l].pos&&({lo:s,hi:l}=le(t,"pos",e)),({pos:i,time:o}=t[s]),({pos:r,time:a}=t[l])):(e>=t[s].time&&e<=t[l].time&&({lo:s,hi:l}=le(t,"time",e)),({time:i,pos:o}=t[s]),({time:r,pos:a}=t[l]));const c=r-i;return c?o+(a-o)*(e-i)/c:o}Ao.id="time",Ao.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class Lo extends Ao{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this,e=t._getTimestampsForTable(),n=t._table=t.buildLookupTable(e);t._minPos=Eo(n,t.min),t._tableRange=Eo(n,t.max)-t._minPos,super.initOffsets(e)}buildLookupTable(t){const{min:e,max:n}=this,i=[],r=[];let o,a,s,l,c;for(o=0,a=t.length;o<a;++o)l=t[o],l>=e&&l<=n&&i.push(l);if(i.length<2)return[{time:e,pos:0},{time:n,pos:1}];for(o=0,a=i.length;o<a;++o)c=i[o+1],s=i[o-1],l=i[o],Math.round((c+s)/2)!==l&&r.push({time:l,pos:o/(a-1)});return r}_getTimestampsForTable(){const t=this;let e=t._cache.all||[];if(e.length)return e;const n=t.getDataTimestamps(),i=t.getLabelTimestamps();return e=n.length&&i.length?t.normalize(n.concat(i)):n.length?n:i,e=t._cache.all=e,e}getDecimalForValue(t){return(Eo(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this,n=e._offsets,i=e.getDecimalForPixel(t)/n.factor-n.end;return Eo(e._table,i*e._tableRange+e._minPos,!0)}}Lo.id="timeseries",Lo.defaults=Ao.defaults;const Ro=[In,kr,uo,Object.freeze({__proto__:null,CategoryScale:ho,LinearScale:po,LogarithmicScale:bo,RadialLinearScale:ko,TimeScale:Ao,TimeSeriesScale:Lo})];er.register(...Ro);const Fo=er;function Io(t,e){if(e.length<t)throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+e.length+" present")}function No(t){Io(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"==typeof t&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}var Ho={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function Bo(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.width?String(e.width):t.defaultWidth,i=t.formats[n]||t.formats[t.defaultWidth];return i}}var Wo,Uo={date:Bo({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Bo({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:Bo({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},Vo={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function jo(t){return function(e,n){var i,r=n||{};if("formatting"===(r.context?String(r.context):"standalone")&&t.formattingValues){var o=t.defaultFormattingWidth||t.defaultWidth,a=r.width?String(r.width):o;i=t.formattingValues[a]||t.formattingValues[o]}else{var s=t.defaultWidth,l=r.width?String(r.width):t.defaultWidth;i=t.values[l]||t.values[s]}return i[t.argumentCallback?t.argumentCallback(e):e]}}function Yo(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.width,r=i&&t.matchPatterns[i]||t.matchPatterns[t.defaultMatchWidth],o=e.match(r);if(!o)return null;var a,s=o[0],l=i&&t.parsePatterns[i]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?$o(l,(function(t){return t.test(s)})):qo(l,(function(t){return t.test(s)}));a=t.valueCallback?t.valueCallback(c):c,a=n.valueCallback?n.valueCallback(a):a;var u=e.slice(s.length);return{value:a,rest:u}}}function qo(t,e){for(var n in t)if(t.hasOwnProperty(n)&&e(t[n]))return n}function $o(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return n}const Xo={code:"en-US",formatDistance:function(t,e,n){var i,r=Ho[t];return i="string"==typeof r?r:1===e?r.one:r.other.replace("{{count}}",e.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i},formatLong:Uo,formatRelative:function(t,e,n,i){return Vo[t]},localize:{ordinalNumber:function(t,e){var n=Number(t),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:jo({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:jo({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:jo({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:jo({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:jo({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(Wo={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.match(Wo.matchPattern);if(!n)return null;var i=n[0],r=t.match(Wo.parsePattern);if(!r)return null;var o=Wo.valueCallback?Wo.valueCallback(r[0]):r[0];o=e.valueCallback?e.valueCallback(o):o;var a=t.slice(i.length);return{value:o,rest:a}}),era:Yo({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:Yo({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:Yo({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:Yo({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:Yo({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function Qo(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function Go(t,e){Io(2,arguments);var n=No(t).getTime(),i=Qo(e);return new Date(n+i)}function Ko(t,e){Io(2,arguments);var n=Qo(e);return Go(t,-n)}function Jo(t,e){if(null==t)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in e=e||{})Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}function Zo(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}}function ta(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}}var ea={p:ta,P:function(t,e){var n,i=t.match(/(P+)(p+)?/),r=i[1],o=i[2];if(!o)return Zo(t,e);switch(r){case"P":n=e.dateTime({width:"short"});break;case"PP":n=e.dateTime({width:"medium"});break;case"PPP":n=e.dateTime({width:"long"});break;default:n=e.dateTime({width:"full"})}return n.replace("{{date}}",Zo(r,e)).replace("{{time}}",ta(o,e))}};const na=ea;function ia(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}var ra=["D","DD"],oa=["YY","YYYY"];function aa(t){return-1!==ra.indexOf(t)}function sa(t){return-1!==oa.indexOf(t)}function la(t,e,n){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"))}function ca(t,e){Io(1,arguments);var n=e||{},i=n.locale,r=i&&i.options&&i.options.weekStartsOn,o=null==r?0:Qo(r),a=null==n.weekStartsOn?o:Qo(n.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var s=No(t),l=s.getUTCDay(),c=(l<a?7:0)+l-a;return s.setUTCDate(s.getUTCDate()-c),s.setUTCHours(0,0,0,0),s}function ua(t,e){Io(1,arguments);var n=No(t,e),i=n.getUTCFullYear(),r=e||{},o=r.locale,a=o&&o.options&&o.options.firstWeekContainsDate,s=null==a?1:Qo(a),l=null==r.firstWeekContainsDate?s:Qo(r.firstWeekContainsDate);if(!(l>=1&&l<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=new Date(0);c.setUTCFullYear(i+1,0,l),c.setUTCHours(0,0,0,0);var u=ca(c,e),d=new Date(0);d.setUTCFullYear(i,0,l),d.setUTCHours(0,0,0,0);var h=ca(d,e);return n.getTime()>=u.getTime()?i+1:n.getTime()>=h.getTime()?i:i-1}function da(t,e,n){Io(2,arguments);var i=n||{},r=i.locale,o=r&&r.options&&r.options.weekStartsOn,a=null==o?0:Qo(o),s=null==i.weekStartsOn?a:Qo(i.weekStartsOn);if(!(s>=0&&s<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var l=No(t),c=Qo(e),u=l.getUTCDay(),d=c%7,h=(d+7)%7,f=(h<s?7:0)+c-u;return l.setUTCDate(l.getUTCDate()+f),l}function ha(t){Io(1,arguments);var e=1,n=No(t),i=n.getUTCDay(),r=(i<e?7:0)+i-e;return n.setUTCDate(n.getUTCDate()-r),n.setUTCHours(0,0,0,0),n}function fa(t){Io(1,arguments);var e=No(t),n=e.getUTCFullYear(),i=new Date(0);i.setUTCFullYear(n+1,0,4),i.setUTCHours(0,0,0,0);var r=ha(i),o=new Date(0);o.setUTCFullYear(n,0,4),o.setUTCHours(0,0,0,0);var a=ha(o);return e.getTime()>=r.getTime()?n+1:e.getTime()>=a.getTime()?n:n-1}function ga(t){Io(1,arguments);var e=fa(t),n=new Date(0);n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0);var i=ha(n);return i}var pa=6048e5;function ma(t){Io(1,arguments);var e=No(t),n=ha(e).getTime()-ga(e).getTime();return Math.round(n/pa)+1}function ba(t,e){Io(1,arguments);var n=e||{},i=n.locale,r=i&&i.options&&i.options.firstWeekContainsDate,o=null==r?1:Qo(r),a=null==n.firstWeekContainsDate?o:Qo(n.firstWeekContainsDate),s=ua(t,e),l=new Date(0);l.setUTCFullYear(s,0,a),l.setUTCHours(0,0,0,0);var c=ca(l,e);return c}var xa=6048e5;function ya(t,e){Io(1,arguments);var n=No(t),i=ca(n,e).getTime()-ba(n,e).getTime();return Math.round(i/xa)+1}var va=/^(1[0-2]|0?\d)/,wa=/^(3[0-1]|[0-2]?\d)/,_a=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,Ma=/^(5[0-3]|[0-4]?\d)/,ka=/^(2[0-3]|[0-1]?\d)/,Ca=/^(2[0-4]|[0-1]?\d)/,Ta=/^(1[0-1]|0?\d)/,Sa=/^(1[0-2]|0?\d)/,Da=/^[0-5]?\d/,Pa=/^[0-5]?\d/,za=/^\d/,Oa=/^\d{1,2}/,Aa=/^\d{1,3}/,Ea=/^\d{1,4}/,La=/^-?\d+/,Ra=/^-?\d/,Fa=/^-?\d{1,2}/,Ia=/^-?\d{1,3}/,Na=/^-?\d{1,4}/,Ha=/^([+-])(\d{2})(\d{2})?|Z/,Ba=/^([+-])(\d{2})(\d{2})|Z/,Wa=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,Ua=/^([+-])(\d{2}):(\d{2})|Z/,Va=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function ja(t,e,n){var i=e.match(t);if(!i)return null;var r=parseInt(i[0],10);return{value:n?n(r):r,rest:e.slice(i[0].length)}}function Ya(t,e){var n=e.match(t);return n?"Z"===n[0]?{value:0,rest:e.slice(1)}:{value:("+"===n[1]?1:-1)*(36e5*(n[2]?parseInt(n[2],10):0)+6e4*(n[3]?parseInt(n[3],10):0)+1e3*(n[5]?parseInt(n[5],10):0)),rest:e.slice(n[0].length)}:null}function qa(t,e){return ja(La,t,e)}function $a(t,e,n){switch(t){case 1:return ja(za,e,n);case 2:return ja(Oa,e,n);case 3:return ja(Aa,e,n);case 4:return ja(Ea,e,n);default:return ja(new RegExp("^\\d{1,"+t+"}"),e,n)}}function Xa(t,e,n){switch(t){case 1:return ja(Ra,e,n);case 2:return ja(Fa,e,n);case 3:return ja(Ia,e,n);case 4:return ja(Na,e,n);default:return ja(new RegExp("^-?\\d{1,"+t+"}"),e,n)}}function Qa(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function Ga(t,e){var n,i=e>0,r=i?e:1-e;if(r<=50)n=t||100;else{var o=r+50;n=t+100*Math.floor(o/100)-(t>=o%100?100:0)}return i?n:1-n}var Ka=[31,28,31,30,31,30,31,31,30,31,30,31],Ja=[31,29,31,30,31,30,31,31,30,31,30,31];function Za(t){return t%400==0||t%4==0&&t%100!=0}const ts={G:{priority:140,parse:function(t,e,n,i){switch(e){case"G":case"GG":case"GGG":return n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"});case"GGGGG":return n.era(t,{width:"narrow"});default:return n.era(t,{width:"wide"})||n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"})}},set:function(t,e,n,i){return e.era=n,t.setUTCFullYear(n,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["R","u","t","T"]},y:{priority:130,parse:function(t,e,n,i){var r=function(t){return{year:t,isTwoDigitYear:"yy"===e}};switch(e){case"y":return $a(4,t,r);case"yo":return n.ordinalNumber(t,{unit:"year",valueCallback:r});default:return $a(e.length,t,r)}},validate:function(t,e,n){return e.isTwoDigitYear||e.year>0},set:function(t,e,n,i){var r=t.getUTCFullYear();if(n.isTwoDigitYear){var o=Ga(n.year,r);return t.setUTCFullYear(o,0,1),t.setUTCHours(0,0,0,0),t}var a="era"in e&&1!==e.era?1-n.year:n.year;return t.setUTCFullYear(a,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","u","w","I","i","e","c","t","T"]},Y:{priority:130,parse:function(t,e,n,i){var r=function(t){return{year:t,isTwoDigitYear:"YY"===e}};switch(e){case"Y":return $a(4,t,r);case"Yo":return n.ordinalNumber(t,{unit:"year",valueCallback:r});default:return $a(e.length,t,r)}},validate:function(t,e,n){return e.isTwoDigitYear||e.year>0},set:function(t,e,n,i){var r=ua(t,i);if(n.isTwoDigitYear){var o=Ga(n.year,r);return t.setUTCFullYear(o,0,i.firstWeekContainsDate),t.setUTCHours(0,0,0,0),ca(t,i)}var a="era"in e&&1!==e.era?1-n.year:n.year;return t.setUTCFullYear(a,0,i.firstWeekContainsDate),t.setUTCHours(0,0,0,0),ca(t,i)},incompatibleTokens:["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:{priority:130,parse:function(t,e,n,i){return Xa("R"===e?4:e.length,t)},set:function(t,e,n,i){var r=new Date(0);return r.setUTCFullYear(n,0,4),r.setUTCHours(0,0,0,0),ha(r)},incompatibleTokens:["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:{priority:130,parse:function(t,e,n,i){return Xa("u"===e?4:e.length,t)},set:function(t,e,n,i){return t.setUTCFullYear(n,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["G","y","Y","R","w","I","i","e","c","t","T"]},Q:{priority:120,parse:function(t,e,n,i){switch(e){case"Q":case"QQ":return $a(e.length,t);case"Qo":return n.ordinalNumber(t,{unit:"quarter"});case"QQQ":return n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(t,{width:"narrow",context:"formatting"});default:return n.quarter(t,{width:"wide",context:"formatting"})||n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=1&&e<=4},set:function(t,e,n,i){return t.setUTCMonth(3*(n-1),1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:{priority:120,parse:function(t,e,n,i){switch(e){case"q":case"qq":return $a(e.length,t);case"qo":return n.ordinalNumber(t,{unit:"quarter"});case"qqq":return n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(t,{width:"narrow",context:"standalone"});default:return n.quarter(t,{width:"wide",context:"standalone"})||n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,n){return e>=1&&e<=4},set:function(t,e,n,i){return t.setUTCMonth(3*(n-1),1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:{priority:110,parse:function(t,e,n,i){var r=function(t){return t-1};switch(e){case"M":return ja(va,t,r);case"MM":return $a(2,t,r);case"Mo":return n.ordinalNumber(t,{unit:"month",valueCallback:r});case"MMM":return n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(t,{width:"narrow",context:"formatting"});default:return n.month(t,{width:"wide",context:"formatting"})||n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=0&&e<=11},set:function(t,e,n,i){return t.setUTCMonth(n,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]},L:{priority:110,parse:function(t,e,n,i){var r=function(t){return t-1};switch(e){case"L":return ja(va,t,r);case"LL":return $a(2,t,r);case"Lo":return n.ordinalNumber(t,{unit:"month",valueCallback:r});case"LLL":return n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(t,{width:"narrow",context:"standalone"});default:return n.month(t,{width:"wide",context:"standalone"})||n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,n){return e>=0&&e<=11},set:function(t,e,n,i){return t.setUTCMonth(n,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:{priority:100,parse:function(t,e,n,i){switch(e){case"w":return ja(Ma,t);case"wo":return n.ordinalNumber(t,{unit:"week"});default:return $a(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=53},set:function(t,e,n,i){return ca(function(t,e,n){Io(2,arguments);var i=No(t),r=Qo(e),o=ya(i,n)-r;return i.setUTCDate(i.getUTCDate()-7*o),i}(t,n,i),i)},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:{priority:100,parse:function(t,e,n,i){switch(e){case"I":return ja(Ma,t);case"Io":return n.ordinalNumber(t,{unit:"week"});default:return $a(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=53},set:function(t,e,n,i){return ha(function(t,e){Io(2,arguments);var n=No(t),i=Qo(e),r=ma(n)-i;return n.setUTCDate(n.getUTCDate()-7*r),n}(t,n,i),i)},incompatibleTokens:["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:{priority:90,subPriority:1,parse:function(t,e,n,i){switch(e){case"d":return ja(wa,t);case"do":return n.ordinalNumber(t,{unit:"date"});default:return $a(e.length,t)}},validate:function(t,e,n){var i=Za(t.getUTCFullYear()),r=t.getUTCMonth();return i?e>=1&&e<=Ja[r]:e>=1&&e<=Ka[r]},set:function(t,e,n,i){return t.setUTCDate(n),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:{priority:90,subPriority:1,parse:function(t,e,n,i){switch(e){case"D":case"DD":return ja(_a,t);case"Do":return n.ordinalNumber(t,{unit:"date"});default:return $a(e.length,t)}},validate:function(t,e,n){return Za(t.getUTCFullYear())?e>=1&&e<=366:e>=1&&e<=365},set:function(t,e,n,i){return t.setUTCMonth(0,n),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:{priority:90,parse:function(t,e,n,i){switch(e){case"E":case"EE":case"EEE":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=0&&e<=6},set:function(t,e,n,i){return(t=da(t,n,i)).setUTCHours(0,0,0,0),t},incompatibleTokens:["D","i","e","c","t","T"]},e:{priority:90,parse:function(t,e,n,i){var r=function(t){var e=7*Math.floor((t-1)/7);return(t+i.weekStartsOn+6)%7+e};switch(e){case"e":case"ee":return $a(e.length,t,r);case"eo":return n.ordinalNumber(t,{unit:"day",valueCallback:r});case"eee":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"eeeee":return n.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=0&&e<=6},set:function(t,e,n,i){return(t=da(t,n,i)).setUTCHours(0,0,0,0),t},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:{priority:90,parse:function(t,e,n,i){var r=function(t){var e=7*Math.floor((t-1)/7);return(t+i.weekStartsOn+6)%7+e};switch(e){case"c":case"cc":return $a(e.length,t,r);case"co":return n.ordinalNumber(t,{unit:"day",valueCallback:r});case"ccc":return n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});case"ccccc":return n.day(t,{width:"narrow",context:"standalone"});case"cccccc":return n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});default:return n.day(t,{width:"wide",context:"standalone"})||n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,n){return e>=0&&e<=6},set:function(t,e,n,i){return(t=da(t,n,i)).setUTCHours(0,0,0,0),t},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:{priority:90,parse:function(t,e,n,i){var r=function(t){return 0===t?7:t};switch(e){case"i":case"ii":return $a(e.length,t);case"io":return n.ordinalNumber(t,{unit:"day"});case"iii":return n.day(t,{width:"abbreviated",context:"formatting",valueCallback:r})||n.day(t,{width:"short",context:"formatting",valueCallback:r})||n.day(t,{width:"narrow",context:"formatting",valueCallback:r});case"iiiii":return n.day(t,{width:"narrow",context:"formatting",valueCallback:r});case"iiiiii":return n.day(t,{width:"short",context:"formatting",valueCallback:r})||n.day(t,{width:"narrow",context:"formatting",valueCallback:r});default:return n.day(t,{width:"wide",context:"formatting",valueCallback:r})||n.day(t,{width:"abbreviated",context:"formatting",valueCallback:r})||n.day(t,{width:"short",context:"formatting",valueCallback:r})||n.day(t,{width:"narrow",context:"formatting",valueCallback:r})}},validate:function(t,e,n){return e>=1&&e<=7},set:function(t,e,n,i){return t=function(t,e){Io(2,arguments);var n=Qo(e);n%7==0&&(n-=7);var i=1,r=No(t),o=r.getUTCDay(),a=((n%7+7)%7<i?7:0)+n-o;return r.setUTCDate(r.getUTCDate()+a),r}(t,n,i),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:{priority:80,parse:function(t,e,n,i){switch(e){case"a":case"aa":case"aaa":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(t,{width:"narrow",context:"formatting"});default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}},set:function(t,e,n,i){return t.setUTCHours(Qa(n),0,0,0),t},incompatibleTokens:["b","B","H","K","k","t","T"]},b:{priority:80,parse:function(t,e,n,i){switch(e){case"b":case"bb":case"bbb":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(t,{width:"narrow",context:"formatting"});default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}},set:function(t,e,n,i){return t.setUTCHours(Qa(n),0,0,0),t},incompatibleTokens:["a","B","H","K","k","t","T"]},B:{priority:80,parse:function(t,e,n,i){switch(e){case"B":case"BB":case"BBB":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(t,{width:"narrow",context:"formatting"});default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}},set:function(t,e,n,i){return t.setUTCHours(Qa(n),0,0,0),t},incompatibleTokens:["a","b","t","T"]},h:{priority:70,parse:function(t,e,n,i){switch(e){case"h":return ja(Sa,t);case"ho":return n.ordinalNumber(t,{unit:"hour"});default:return $a(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=12},set:function(t,e,n,i){var r=t.getUTCHours()>=12;return r&&n<12?t.setUTCHours(n+12,0,0,0):r||12!==n?t.setUTCHours(n,0,0,0):t.setUTCHours(0,0,0,0),t},incompatibleTokens:["H","K","k","t","T"]},H:{priority:70,parse:function(t,e,n,i){switch(e){case"H":return ja(ka,t);case"Ho":return n.ordinalNumber(t,{unit:"hour"});default:return $a(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=23},set:function(t,e,n,i){return t.setUTCHours(n,0,0,0),t},incompatibleTokens:["a","b","h","K","k","t","T"]},K:{priority:70,parse:function(t,e,n,i){switch(e){case"K":return ja(Ta,t);case"Ko":return n.ordinalNumber(t,{unit:"hour"});default:return $a(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=11},set:function(t,e,n,i){return t.getUTCHours()>=12&&n<12?t.setUTCHours(n+12,0,0,0):t.setUTCHours(n,0,0,0),t},incompatibleTokens:["a","b","h","H","k","t","T"]},k:{priority:70,parse:function(t,e,n,i){switch(e){case"k":return ja(Ca,t);case"ko":return n.ordinalNumber(t,{unit:"hour"});default:return $a(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=24},set:function(t,e,n,i){var r=n<=24?n%24:n;return t.setUTCHours(r,0,0,0),t},incompatibleTokens:["a","b","h","H","K","t","T"]},m:{priority:60,parse:function(t,e,n,i){switch(e){case"m":return ja(Da,t);case"mo":return n.ordinalNumber(t,{unit:"minute"});default:return $a(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=59},set:function(t,e,n,i){return t.setUTCMinutes(n,0,0),t},incompatibleTokens:["t","T"]},s:{priority:50,parse:function(t,e,n,i){switch(e){case"s":return ja(Pa,t);case"so":return n.ordinalNumber(t,{unit:"second"});default:return $a(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=59},set:function(t,e,n,i){return t.setUTCSeconds(n,0),t},incompatibleTokens:["t","T"]},S:{priority:30,parse:function(t,e,n,i){return $a(e.length,t,(function(t){return Math.floor(t*Math.pow(10,3-e.length))}))},set:function(t,e,n,i){return t.setUTCMilliseconds(n),t},incompatibleTokens:["t","T"]},X:{priority:10,parse:function(t,e,n,i){switch(e){case"X":return Ya(Ha,t);case"XX":return Ya(Ba,t);case"XXXX":return Ya(Wa,t);case"XXXXX":return Ya(Va,t);default:return Ya(Ua,t)}},set:function(t,e,n,i){return e.timestampIsSet?t:new Date(t.getTime()-n)},incompatibleTokens:["t","T","x"]},x:{priority:10,parse:function(t,e,n,i){switch(e){case"x":return Ya(Ha,t);case"xx":return Ya(Ba,t);case"xxxx":return Ya(Wa,t);case"xxxxx":return Ya(Va,t);default:return Ya(Ua,t)}},set:function(t,e,n,i){return e.timestampIsSet?t:new Date(t.getTime()-n)},incompatibleTokens:["t","T","X"]},t:{priority:40,parse:function(t,e,n,i){return qa(t)},set:function(t,e,n,i){return[new Date(1e3*n),{timestampIsSet:!0}]},incompatibleTokens:"*"},T:{priority:20,parse:function(t,e,n,i){return qa(t)},set:function(t,e,n,i){return[new Date(n),{timestampIsSet:!0}]},incompatibleTokens:"*"}};var es=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ns=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,is=/^'([^]*?)'?$/,rs=/''/g,os=/\S/,as=/[a-zA-Z]/;function ss(t,e){if(e.timestampIsSet)return t;var n=new Date(0);return n.setFullYear(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()),n.setHours(t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds()),n}function ls(t){return t.match(is)[1].replace(rs,"'")}var cs=36e5,us={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ds=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,hs=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,fs=/^([+-])(\d{2})(?::?(\d{2}))?$/;function gs(t){var e,n={},i=t.split(us.dateTimeDelimiter);if(i.length>2)return n;if(/:/.test(i[0])?(n.date=null,e=i[0]):(n.date=i[0],e=i[1],us.timeZoneDelimiter.test(n.date)&&(n.date=t.split(us.timeZoneDelimiter)[0],e=t.substr(n.date.length,t.length))),e){var r=us.timezone.exec(e);r?(n.time=e.replace(r[1],""),n.timezone=r[1]):n.time=e}return n}function ps(t,e){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),i=t.match(n);if(!i)return{year:null};var r=i[1]&&parseInt(i[1]),o=i[2]&&parseInt(i[2]);return{year:null==o?r:100*o,restDateString:t.slice((i[1]||i[2]).length)}}function ms(t,e){if(null===e)return null;var n=t.match(ds);if(!n)return null;var i=!!n[4],r=bs(n[1]),o=bs(n[2])-1,a=bs(n[3]),s=bs(n[4]),l=bs(n[5])-1;if(i)return function(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}(0,s,l)?function(t,e,n){var i=new Date(0);i.setUTCFullYear(t,0,4);var r=7*(e-1)+n+1-(i.getUTCDay()||7);return i.setUTCDate(i.getUTCDate()+r),i}(e,s,l):new Date(NaN);var c=new Date(0);return function(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(ws[e]||(_s(t)?29:28))}(e,o,a)&&function(t,e){return e>=1&&e<=(_s(t)?366:365)}(e,r)?(c.setUTCFullYear(e,o,Math.max(r,a)),c):new Date(NaN)}function bs(t){return t?parseInt(t):1}function xs(t){var e=t.match(hs);if(!e)return null;var n=ys(e[1]),i=ys(e[2]),r=ys(e[3]);return function(t,e,n){return 24===t?0===e&&0===n:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}(n,i,r)?n*cs+6e4*i+1e3*r:NaN}function ys(t){return t&&parseFloat(t.replace(",","."))||0}function vs(t){if("Z"===t)return 0;var e=t.match(fs);if(!e)return 0;var n="+"===e[1]?-1:1,i=parseInt(e[2]),r=e[3]&&parseInt(e[3])||0;return function(t,e){return e>=0&&e<=59}(0,r)?n*(i*cs+6e4*r):NaN}var ws=[31,null,31,30,31,30,31,31,30,31,30,31];function _s(t){return t%400==0||t%4==0&&t%100}function Ms(t){return Io(1,arguments),t instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)}function ks(t){if(Io(1,arguments),!Ms(t)&&"number"!=typeof t)return!1;var e=No(t);return!isNaN(Number(e))}function Cs(t,e){for(var n=t<0?"-":"",i=Math.abs(t).toString();i.length<e;)i="0"+i;return n+i}const Ts=function(t,e){var n=t.getUTCFullYear(),i=n>0?n:1-n;return Cs("yy"===e?i%100:i,e.length)},Ss=function(t,e){var n=t.getUTCMonth();return"M"===e?String(n+1):Cs(n+1,2)},Ds=function(t,e){return Cs(t.getUTCDate(),e.length)},Ps=function(t,e){return Cs(t.getUTCHours()%12||12,e.length)},zs=function(t,e){return Cs(t.getUTCHours(),e.length)},Os=function(t,e){return Cs(t.getUTCMinutes(),e.length)},As=function(t,e){return Cs(t.getUTCSeconds(),e.length)},Es=function(t,e){var n=e.length,i=t.getUTCMilliseconds();return Cs(Math.floor(i*Math.pow(10,n-3)),e.length)};var Ls=864e5;function Rs(t,e){var n=t>0?"-":"+",i=Math.abs(t),r=Math.floor(i/60),o=i%60;if(0===o)return n+String(r);var a=e||"";return n+String(r)+a+Cs(o,2)}function Fs(t,e){return t%60==0?(t>0?"-":"+")+Cs(Math.abs(t)/60,2):Is(t,e)}function Is(t,e){var n=e||"",i=t>0?"-":"+",r=Math.abs(t);return i+Cs(Math.floor(r/60),2)+n+Cs(r%60,2)}const Ns={G:function(t,e,n){var i=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});default:return n.era(i,{width:"wide"})}},y:function(t,e,n){if("yo"===e){var i=t.getUTCFullYear(),r=i>0?i:1-i;return n.ordinalNumber(r,{unit:"year"})}return Ts(t,e)},Y:function(t,e,n,i){var r=ua(t,i),o=r>0?r:1-r;return"YY"===e?Cs(o%100,2):"Yo"===e?n.ordinalNumber(o,{unit:"year"}):Cs(o,e.length)},R:function(t,e){return Cs(fa(t),e.length)},u:function(t,e){return Cs(t.getUTCFullYear(),e.length)},Q:function(t,e,n){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return Cs(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(t,e,n){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return Cs(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(t,e,n){var i=t.getUTCMonth();switch(e){case"M":case"MM":return Ss(t,e);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(t,e,n){var i=t.getUTCMonth();switch(e){case"L":return String(i+1);case"LL":return Cs(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(t,e,n,i){var r=ya(t,i);return"wo"===e?n.ordinalNumber(r,{unit:"week"}):Cs(r,e.length)},I:function(t,e,n){var i=ma(t);return"Io"===e?n.ordinalNumber(i,{unit:"week"}):Cs(i,e.length)},d:function(t,e,n){return"do"===e?n.ordinalNumber(t.getUTCDate(),{unit:"date"}):Ds(t,e)},D:function(t,e,n){var i=function(t){Io(1,arguments);var e=No(t),n=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var i=e.getTime(),r=n-i;return Math.floor(r/Ls)+1}(t);return"Do"===e?n.ordinalNumber(i,{unit:"dayOfYear"}):Cs(i,e.length)},E:function(t,e,n){var i=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(t,e,n,i){var r=t.getUTCDay(),o=(r-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return Cs(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(t,e,n,i){var r=t.getUTCDay(),o=(r-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return Cs(o,e.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(t,e,n){var i=t.getUTCDay(),r=0===i?7:i;switch(e){case"i":return String(r);case"ii":return Cs(r,e.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(t,e,n){var i=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,e,n){var i,r=t.getUTCHours();switch(i=12===r?"noon":0===r?"midnight":r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,e,n){var i,r=t.getUTCHours();switch(i=r>=17?"evening":r>=12?"afternoon":r>=4?"morning":"night",e){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,e,n){if("ho"===e){var i=t.getUTCHours()%12;return 0===i&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Ps(t,e)},H:function(t,e,n){return"Ho"===e?n.ordinalNumber(t.getUTCHours(),{unit:"hour"}):zs(t,e)},K:function(t,e,n){var i=t.getUTCHours()%12;return"Ko"===e?n.ordinalNumber(i,{unit:"hour"}):Cs(i,e.length)},k:function(t,e,n){var i=t.getUTCHours();return 0===i&&(i=24),"ko"===e?n.ordinalNumber(i,{unit:"hour"}):Cs(i,e.length)},m:function(t,e,n){return"mo"===e?n.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):Os(t,e)},s:function(t,e,n){return"so"===e?n.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):As(t,e)},S:function(t,e){return Es(t,e)},X:function(t,e,n,i){var r=(i._originalDate||t).getTimezoneOffset();if(0===r)return"Z";switch(e){case"X":return Fs(r);case"XXXX":case"XX":return Is(r);default:return Is(r,":")}},x:function(t,e,n,i){var r=(i._originalDate||t).getTimezoneOffset();switch(e){case"x":return Fs(r);case"xxxx":case"xx":return Is(r);default:return Is(r,":")}},O:function(t,e,n,i){var r=(i._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Rs(r,":");default:return"GMT"+Is(r,":")}},z:function(t,e,n,i){var r=(i._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Rs(r,":");default:return"GMT"+Is(r,":")}},t:function(t,e,n,i){var r=i._originalDate||t;return Cs(Math.floor(r.getTime()/1e3),e.length)},T:function(t,e,n,i){return Cs((i._originalDate||t).getTime(),e.length)}};var Hs=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Bs=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ws=/^'([^]*?)'?$/,Us=/''/g,Vs=/[a-zA-Z]/;function js(t){return t.match(Ws)[1].replace(Us,"'")}var Ys=36e5;function qs(t,e){Io(2,arguments);var n=No(t),i=Qo(e);return isNaN(i)?new Date(NaN):i?(n.setDate(n.getDate()+i),n):n}function $s(t,e){Io(2,arguments);var n=No(t),i=Qo(e);if(isNaN(i))return new Date(NaN);if(!i)return n;var r=n.getDate(),o=new Date(n.getTime());o.setMonth(n.getMonth()+i+1,0);var a=o.getDate();return r>=a?o:(n.setFullYear(o.getFullYear(),o.getMonth(),r),n)}function Xs(t,e){return Io(2,arguments),No(t).getTime()-No(e).getTime()}var Qs={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}};function Gs(t){return t?Qs[t]:Qs.trunc}Math.pow(10,8);var Ks=36e5;function Js(t){Io(1,arguments);var e=No(t);return e.setHours(0,0,0,0),e}var Zs=864e5;function tl(t,e){Io(2,arguments);var n=Js(t),i=Js(e),r=n.getTime()-ia(n),o=i.getTime()-ia(i);return Math.round((r-o)/Zs)}function el(t,e){var n=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return n<0?-1:n>0?1:n}function nl(t,e){Io(2,arguments);var n=No(t),i=No(e),r=el(n,i),o=Math.abs(tl(n,i));n.setDate(n.getDate()-r*o);var a=Number(el(n,i)===-r),s=r*(o-a);return 0===s?0:s}function il(t,e){Io(2,arguments);var n=No(t),i=No(e),r=n.getFullYear()-i.getFullYear(),o=n.getMonth()-i.getMonth();return 12*r+o}function rl(t,e){Io(2,arguments);var n=No(t),i=No(e),r=n.getTime()-i.getTime();return r<0?-1:r>0?1:r}function ol(t){Io(1,arguments);var e=No(t);return e.setHours(23,59,59,999),e}function al(t){Io(1,arguments);var e=No(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(23,59,59,999),e}function sl(t){Io(1,arguments);var e=No(t);return ol(e).getTime()===al(e).getTime()}function ll(t,e){Io(2,arguments);var n,i=No(t),r=No(e),o=rl(i,r),a=Math.abs(il(i,r));if(a<1)n=0;else{1===i.getMonth()&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-o*a);var s=rl(i,r)===-o;sl(No(t))&&1===a&&1===rl(t,r)&&(s=!1),n=o*(a-Number(s))}return 0===n?0:n}function cl(t,e){Io(2,arguments);var n=No(t),i=No(e);return n.getFullYear()-i.getFullYear()}function ul(t,e){Io(1,arguments);var n=e||{},i=n.locale,r=i&&i.options&&i.options.weekStartsOn,o=null==r?0:Qo(r),a=null==n.weekStartsOn?o:Qo(n.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var s=No(t),l=s.getDay(),c=(l<a?7:0)+l-a;return s.setDate(s.getDate()-c),s.setHours(0,0,0,0),s}const dl={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};Bn._date.override({_id:"date-fns",formats:function(){return dl},parse:function(t,e){if(null==t)return null;const n=typeof t;return"number"===n||t instanceof Date?t=No(t):"string"===n&&(t="string"==typeof e?function(t,e,n,i){Io(3,arguments);var r=String(t),o=String(e),a=i||{},s=a.locale||Xo;if(!s.match)throw new RangeError("locale must contain match property");var l=s.options&&s.options.firstWeekContainsDate,c=null==l?1:Qo(l),u=null==a.firstWeekContainsDate?c:Qo(a.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var d=s.options&&s.options.weekStartsOn,h=null==d?0:Qo(d),f=null==a.weekStartsOn?h:Qo(a.weekStartsOn);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(""===o)return""===r?No(n):new Date(NaN);var g,p={firstWeekContainsDate:u,weekStartsOn:f,locale:s},m=[{priority:10,subPriority:-1,set:ss,index:0}],b=o.match(ns).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,na[e])(t,s.formatLong,p):t})).join("").match(es),x=[];for(g=0;g<b.length;g++){var y=b[g];!a.useAdditionalWeekYearTokens&&sa(y)&&la(y,o,t),!a.useAdditionalDayOfYearTokens&&aa(y)&&la(y,o,t);var v=y[0],w=ts[v];if(w){var _=w.incompatibleTokens;if(Array.isArray(_)){for(var M=void 0,k=0;k<x.length;k++){var C=x[k].token;if(-1!==_.indexOf(C)||C===v){M=x[k];break}}if(M)throw new RangeError("The format string mustn't contain `".concat(M.fullToken,"` and `").concat(y,"` at the same time"))}else if("*"===w.incompatibleTokens&&x.length)throw new RangeError("The format string mustn't contain `".concat(y,"` and any other token at the same time"));x.push({token:v,fullToken:y});var T=w.parse(r,y,s.match,p);if(!T)return new Date(NaN);m.push({priority:w.priority,subPriority:w.subPriority||0,set:w.set,validate:w.validate,value:T.value,index:m.length}),r=T.rest}else{if(v.match(as))throw new RangeError("Format string contains an unescaped latin alphabet character `"+v+"`");if("''"===y?y="'":"'"===v&&(y=ls(y)),0!==r.indexOf(y))return new Date(NaN);r=r.slice(y.length)}}if(r.length>0&&os.test(r))return new Date(NaN);var S=m.map((function(t){return t.priority})).sort((function(t,e){return e-t})).filter((function(t,e,n){return n.indexOf(t)===e})).map((function(t){return m.filter((function(e){return e.priority===t})).sort((function(t,e){return e.subPriority-t.subPriority}))})).map((function(t){return t[0]})),D=No(n);if(isNaN(D))return new Date(NaN);var P=Ko(D,ia(D)),z={};for(g=0;g<S.length;g++){var O=S[g];if(O.validate&&!O.validate(P,O.value,p))return new Date(NaN);var A=O.set(P,z,O.value,p);A[0]?(P=A[0],Jo(z,A[1])):P=A}return P}(t,e,new Date,this.options):function(t,e){Io(1,arguments);var n=e||{},i=null==n.additionalDigits?2:Qo(n.additionalDigits);if(2!==i&&1!==i&&0!==i)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof t&&"[object String]"!==Object.prototype.toString.call(t))return new Date(NaN);var r,o=gs(t);if(o.date){var a=ps(o.date,i);r=ms(a.restDateString,a.year)}if(isNaN(r)||!r)return new Date(NaN);var s,l=r.getTime(),c=0;if(o.time&&(c=xs(o.time),isNaN(c)||null===c))return new Date(NaN);if(!o.timezone){var u=new Date(l+c),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return s=vs(o.timezone),isNaN(s)?new Date(NaN):new Date(l+c+s)}(t,this.options)),ks(t)?t.getTime():null},format:function(t,e){return function(t,e,n){Io(2,arguments);var i=String(e),r=n||{},o=r.locale||Xo,a=o.options&&o.options.firstWeekContainsDate,s=null==a?1:Qo(a),l=null==r.firstWeekContainsDate?s:Qo(r.firstWeekContainsDate);if(!(l>=1&&l<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=o.options&&o.options.weekStartsOn,u=null==c?0:Qo(c),d=null==r.weekStartsOn?u:Qo(r.weekStartsOn);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!o.localize)throw new RangeError("locale must contain localize property");if(!o.formatLong)throw new RangeError("locale must contain formatLong property");var h=No(t);if(!ks(h))throw new RangeError("Invalid time value");var f=ia(h),g=Ko(h,f),p={firstWeekContainsDate:l,weekStartsOn:d,locale:o,_originalDate:h};return i.match(Bs).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,na[e])(t,o.formatLong,p):t})).join("").match(Hs).map((function(n){if("''"===n)return"'";var i=n[0];if("'"===i)return js(n);var a=Ns[i];if(a)return!r.useAdditionalWeekYearTokens&&sa(n)&&la(n,e,t),!r.useAdditionalDayOfYearTokens&&aa(n)&&la(n,e,t),a(g,n,o.localize,p);if(i.match(Vs))throw new RangeError("Format string contains an unescaped latin alphabet character `"+i+"`");return n})).join("")}(t,e,this.options)},add:function(t,e,n){switch(n){case"millisecond":return Go(t,e);case"second":return function(t,e){Io(2,arguments);var n=Qo(e);return Go(t,1e3*n)}(t,e);case"minute":return function(t,e){Io(2,arguments);var n=Qo(e);return Go(t,6e4*n)}(t,e);case"hour":return function(t,e){Io(2,arguments);var n=Qo(e);return Go(t,n*Ys)}(t,e);case"day":return qs(t,e);case"week":return function(t,e){Io(2,arguments);var n=Qo(e);return qs(t,7*n)}(t,e);case"month":return $s(t,e);case"quarter":return function(t,e){Io(2,arguments);var n=Qo(e);return $s(t,3*n)}(t,e);case"year":return function(t,e){Io(2,arguments);var n=Qo(e);return $s(t,12*n)}(t,e);default:return t}},diff:function(t,e,n){switch(n){case"millisecond":return Xs(t,e);case"second":return function(t,e,n){Io(2,arguments);var i=Xs(t,e)/1e3;return Gs(null==n?void 0:n.roundingMethod)(i)}(t,e);case"minute":return function(t,e,n){Io(2,arguments);var i=Xs(t,e)/6e4;return Gs(null==n?void 0:n.roundingMethod)(i)}(t,e);case"hour":return function(t,e,n){Io(2,arguments);var i=Xs(t,e)/Ks;return Gs(null==n?void 0:n.roundingMethod)(i)}(t,e);case"day":return nl(t,e);case"week":return function(t,e,n){Io(2,arguments);var i=nl(t,e)/7;return Gs(null==n?void 0:n.roundingMethod)(i)}(t,e);case"month":return ll(t,e);case"quarter":return function(t,e,n){Io(2,arguments);var i=ll(t,e)/3;return Gs(null==n?void 0:n.roundingMethod)(i)}(t,e);case"year":return function(t,e){Io(2,arguments);var n=No(t),i=No(e),r=rl(n,i),o=Math.abs(cl(n,i));n.setFullYear(1584),i.setFullYear(1584);var a=rl(n,i)===-r,s=r*(o-Number(a));return 0===s?0:s}(t,e);default:return 0}},startOf:function(t,e,n){switch(e){case"second":return function(t){Io(1,arguments);var e=No(t);return e.setMilliseconds(0),e}(t);case"minute":return function(t){Io(1,arguments);var e=No(t);return e.setSeconds(0,0),e}(t);case"hour":return function(t){Io(1,arguments);var e=No(t);return e.setMinutes(0,0,0),e}(t);case"day":return Js(t);case"week":return ul(t);case"isoWeek":return ul(t,{weekStartsOn:+n});case"month":return function(t){Io(1,arguments);var e=No(t);return e.setDate(1),e.setHours(0,0,0,0),e}(t);case"quarter":return function(t){Io(1,arguments);var e=No(t),n=e.getMonth(),i=n-n%3;return e.setMonth(i,1),e.setHours(0,0,0,0),e}(t);case"year":return function(t){Io(1,arguments);var e=No(t),n=new Date(0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}(t);default:return t}},endOf:function(t,e){switch(e){case"second":return function(t){Io(1,arguments);var e=No(t);return e.setMilliseconds(999),e}(t);case"minute":return function(t){Io(1,arguments);var e=No(t);return e.setSeconds(59,999),e}(t);case"hour":return function(t){Io(1,arguments);var e=No(t);return e.setMinutes(59,59,999),e}(t);case"day":return ol(t);case"week":return function(t,e){Io(1,arguments);var n=e||{},i=n.locale,r=i&&i.options&&i.options.weekStartsOn,o=null==r?0:Qo(r),a=null==n.weekStartsOn?o:Qo(n.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var s=No(t),l=s.getDay(),c=6+(l<a?-7:0)-(l-a);return s.setDate(s.getDate()+c),s.setHours(23,59,59,999),s}(t);case"month":return al(t);case"quarter":return function(t){Io(1,arguments);var e=No(t),n=e.getMonth(),i=n-n%3+3;return e.setMonth(i,0),e.setHours(23,59,59,999),e}(t);case"year":return function(t){Io(1,arguments);var e=No(t),n=e.getFullYear();return e.setFullYear(n+1,0,0),e.setHours(23,59,59,999),e}(t);default:return t}}}),e().use(Fo)})()})();
+(()=>{var t={616:function(t){t.exports=function(){"use strict";function t(t){return"[object Array]"===Object.prototype.toString.call(t)}function e(t){return t instanceof Function}function i(t){return"[object Object]"===Object.prototype.toString.call(t)&&!e(t)&&t instanceof Object}function n(e,r){var o;for(o in r)"__proto__"!==o&&(i(r[o])||t(r[o])?(i(r[o])&&!i(e[o])&&(e[o]={}),t(r[o])&&!t(e[o])&&(e[o]=[]),n(e[o],r[o])):void 0!==r[o]&&(e[o]=r[o]))}function r(t,e){var i={};return n(i,t),n(i,e),i}var o=/^(\d\d\d\d)(-)?(\d\d)(-)?(\d\d)$/i;function a(t){return""+t}function s(t){return parseFloat(t)}function l(t){var e,i,n,r;if("object"!=typeof t)if("number"==typeof t)t=new Date(1e3*t);else{if(e=(t=a(t)).match(o))return i=parseInt(e[1],10),n=parseInt(e[3],10)-1,r=parseInt(e[5],10),new Date(i,n,r);var s=t.replace(/ /,"T").replace(" ","").replace("UTC","Z");t=new Date(Date.parse(s)||t)}return t}function h(e){if(!t(e)){var i,n=[];for(i in e)e.hasOwnProperty(i)&&n.push([i,e[i]]);e=n}return e}function c(t,e,i,n,o,a,s,l){return function(h,c,u){var d=h.data,f=r({},t);return f=r(f,u||{}),(h.singleSeriesFormat||"legend"in c)&&e(f,c.legend,h.singleSeriesFormat),c.title&&i(f,c.title),"min"in c?n(f,c.min):function(t){var e,i,n;for(e=0;e<t.length;e++)for(n=t[e].data,i=0;i<n.length;i++)if(n[i][1]<0)return!0;return!1}(d)||n(f,0),c.max&&o(f,c.max),"stacked"in c&&a(f,c.stacked),c.colors&&(f.colors=c.colors),c.xtitle&&s(f,c.xtitle),c.ytitle&&l(f,c.ytitle),r(f,c.library||{})}}function u(t,e){return t[0].getTime()-e[0].getTime()}function d(t,e){return t[0]-e[0]}function f(t,e){return t-e}function g(t){return 0===t.getMilliseconds()&&0===t.getSeconds()}function p(t){return g(t)&&0===t.getMinutes()}function m(t){return p(t)&&0===t.getHours()}function b(t,e){return m(t)&&t.getDay()===e}function x(t){return m(t)&&1===t.getDate()}function y(t){return x(t)&&0===t.getMonth()}function v(t){return!isNaN(l(t))&&a(t).length>=6}function w(t){return"number"==typeof t}var _=["bytes","KB","MB","GB","TB","PB","EB"];function M(t,e,i,n){t=t||"",i.prefix&&(e<0&&(e*=-1,t+="-"),t+=i.prefix);var r=i.suffix||"",o=i.precision,s=i.round;if(i.byteScale){var l,h=n?i.byteScale:e;h>=0x1000000000000000?(e/=0x1000000000000000,l=6):h>=0x4000000000000?(e/=0x4000000000000,l=5):h>=1099511627776?(e/=1099511627776,l=4):h>=1073741824?(e/=1073741824,l=3):h>=1048576?(e/=1048576,l=2):h>=1024?(e/=1024,l=1):l=0,void 0===o&&void 0===s&&(e>=1023.5&&l<_.length-1&&(e=1,l+=1),o=e>=1e3?4:3),r=" "+_[l]}if(void 0!==o&&void 0!==s)throw Error("Use either round or precision, not both");if(!n&&(void 0!==o&&(e=e.toPrecision(o),i.zeros||(e=parseFloat(e))),void 0!==s))if(s<0){var c=Math.pow(10,-1*s);e=parseInt((1*e/c).toFixed(0))*c}else e=e.toFixed(s),i.zeros||(e=parseFloat(e));if(i.thousands||i.decimal){var u=(e=a(e)).split(".");e=u[0],i.thousands&&(e=e.replace(/\B(?=(\d{3})+(?!\d))/g,i.thousands)),u.length>1&&(e+=(i.decimal||".")+u[1])}return t+e+r}function k(t,e,i){return i in e?e[i]:i in t.options?t.options[i]:null}var C={maintainAspectRatio:!1,animation:!1,plugins:{legend:{},tooltip:{displayColors:!1,callbacks:{}},title:{font:{size:20},color:"#333"}},interaction:{}},T={scales:{y:{ticks:{maxTicksLimit:4},title:{font:{size:16},color:"#333"},grid:{}},x:{grid:{drawOnChartArea:!1},title:{font:{size:16},color:"#333"},time:{},ticks:{}}}},D=["#3366CC","#DC3912","#FF9900","#109618","#990099","#3B3EAC","#0099C6","#DD4477","#66AA00","#B82E2E","#316395","#994499","#22AA99","#AAAA11","#6633CC","#E67300","#8B0707","#329262","#5574A6","#651067"],S=function(t,e,i){void 0!==e?(t.plugins.legend.display=!!e,e&&!0!==e&&(t.plugins.legend.position=e)):i&&(t.plugins.legend.display=!1)},P=function(t,e){t.plugins.title.display=!0,t.plugins.title.text=e},z=function(t,e){null!==e&&(t.scales.x.min=s(e))},O=function(t,e){t.scales.x.max=s(e)},A=function(t,e){t.scales.x.stacked=!!e,t.scales.y.stacked=!!e},E=function(t,e){t.scales.x.title.display=!0,t.scales.x.title.text=e},L=function(t,e){t.scales.y.title.display=!0,t.scales.y.title.text=e},R=function(t,e){var i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return i?"rgba("+parseInt(i[1],16)+", "+parseInt(i[2],16)+", "+parseInt(i[3],16)+", "+e+")":t},F=function(t){return null!=t},I=function(e,i,n){var r={prefix:e.options.prefix,suffix:e.options.suffix,thousands:e.options.thousands,decimal:e.options.decimal,precision:e.options.precision,round:e.options.round,zeros:e.options.zeros};if(e.options.bytes){var o=e.data;"pie"===n&&(o=[{data:o}]);for(var a=0,s=0;s<o.length;s++)for(var l=o[s],h=0;h<l.data.length;h++)l.data[h][1]>a&&(a=l.data[h][1]);for(var c=1;a>=1024;)c*=1024,a/=1024;r.byteScale=c}if("pie"!==n){var u=i.scales.y;"bar"===n&&(u=i.scales.x),r.byteScale&&(u.ticks.stepSize||(u.ticks.stepSize=r.byteScale/2),u.ticks.maxTicksLimit||(u.ticks.maxTicksLimit=4)),u.ticks.callback||(u.ticks.callback=function(t){return M("",t,r,!0)})}if(!i.plugins.tooltip.callbacks.label)if("scatter"===n)i.plugins.tooltip.callbacks.label=function(t){var e=t.dataset.label||"";return e&&(e+=": "),e+"("+t.label+", "+t.formattedValue+")"};else if("bubble"===n)i.plugins.tooltip.callbacks.label=function(t){var e=t.dataset.label||"";e&&(e+=": ");var i=t.raw;return e+"("+i.x+", "+i.y+", "+i.v+")"};else if("pie"===n)i.plugins.tooltip.callbacks.label=function(e){var i=e.label;return t(i)?(i=i.slice())[0]+=": ":i+=": ",M(i,e.parsed,r)};else{var d="bar"===n?"x":"y";i.plugins.tooltip.callbacks.label=function(t){if(null!==t.parsed[d]){var e=t.dataset.label||"";return e&&(e+=": "),M(e,t.parsed[d],r)}}}},N=c(r(C,T),S,P,(function(t,e){null!==e&&(t.scales.y.min=s(e))}),(function(t,e){t.scales.y.max=s(e)}),A,E,L),H=function(e,i,n){var o,a=[],h=[],c=e.options.colors||D,u=!0,d=!0,v=!0,w=!0,_=!0,M=!0,C=e.data,T=0;if("bubble"===n)for(var S=0;S<C.length;S++)for(var P=C[S],z=0;z<P.data.length;z++)P.data[z][2]>T&&(T=P.data[z][2]);var O,A,E,L,I,N,H,B=[],W=[];if("bar"===n||"column"===n||"number"!==e.xtype&&"bubble"!==e.xtype){var U,V,j=[];for(O=0;O<C.length;O++)for(E=C[O],A=0;A<E.data.length;A++)L=E.data[A],B[I="datetime"==e.xtype?L[0].getTime():L[0]]||(B[I]=new Array(C.length)),B[I][O]=s(L[1]),-1===j.indexOf(I)&&j.push(I);for("datetime"!==e.xtype&&"number"!==e.xtype||j.sort(f),A=0;A<C.length;A++)W.push([]);for(V=0;V<j.length;V++)for(O=j[V],"datetime"===e.xtype?(U=new Date(s(O)),u=u&&m(U),o||(o=U.getDay()),d=d&&b(U,o),v=v&&x(U),w=w&&y(U),_=_&&p(U),M=M&&g(U)):U=O,h.push(U),A=0;A<C.length;A++)W[A].push(void 0===B[O][A]?null:B[O][A])}else for(var Y=0;Y<C.length;Y++){for(var $=C[Y],q=[],X=0;X<$.data.length;X++){var Q={x:s($.data[X][0]),y:s($.data[X][1])};"bubble"===n&&(Q.r=20*s($.data[X][2])/T,Q.v=$.data[X][2]),q.push(Q)}W.push(q)}for(O=0;O<C.length;O++){if(E=C[O],!e.options.colors||!e.singleSeriesFormat||"bar"!==n&&"column"!==n||E.color||!t(e.options.colors)||t(e.options.colors[0]))N=E.color||c[O],H="line"!==n?R(N,.5):N;else{N=c,H=[];for(var G=0;G<c.length;G++)H[G]=R(N[G],.5)}var K={label:E.name||"",data:W[O],fill:"area"===n,borderColor:N,backgroundColor:H,borderWidth:2},Z="line"===n||"area"===n||"scatter"===n||"bubble"===n;Z&&(K.pointBackgroundColor=N,K.pointHoverBackgroundColor=N,K.pointHitRadius=50),"bubble"===n&&(K.pointBackgroundColor=H,K.pointHoverBackgroundColor=H,K.pointHoverBorderWidth=2),E.stack&&(K.stack=E.stack),!1===k(e,E,"curve")?K.tension=0:Z&&(K.tension=.4),!1===k(e,E,"points")&&(K.pointRadius=0,K.pointHoverRadius=0),K=r(K,e.options.dataset||{}),K=r(K,E.library||{}),K=r(K,E.dataset||{}),a.push(K)}var J=e.options.xmin,tt=e.options.xmax;if("datetime"===e.xtype?(F(J)&&(i.scales.x.ticks.min=l(J).getTime()),F(tt)&&(i.scales.x.ticks.max=l(tt).getTime())):"number"===e.xtype&&(F(J)&&(i.scales.x.ticks.min=J),F(tt)&&(i.scales.x.ticks.max=tt)),"datetime"===e.xtype&&0===h.length&&(F(J)&&h.push(l(J)),F(tt)&&h.push(l(tt)),u=!1,d=!1,v=!1,w=!1,_=!1,M=!1),"datetime"===e.xtype&&h.length>0){var et=(F(J)?l(J):h[0]).getTime(),it=(F(tt)?l(tt):h[0]).getTime();for(O=1;O<h.length;O++){var nt=h[O].getTime();nt<et&&(et=nt),nt>it&&(it=nt)}var rt,ot=(it-et)/864e5;if(!i.scales.x.time.unit&&(w||ot>3650?(i.scales.x.time.unit="year",rt=365):v||ot>300?(i.scales.x.time.unit="month",rt=30):u||ot>10?(i.scales.x.time.unit="day",rt=1):_||ot>.5?(i.scales.x.time.displayFormats={hour:"MMM d, h a"},i.scales.x.time.unit="hour",rt=1/24):M&&(i.scales.x.time.displayFormats={minute:"h:mm a"},i.scales.x.time.unit="minute",rt=1/24/60),rt&&ot>0)){var at=e.element.offsetWidth;if(at>0){var st=Math.ceil(ot/rt/(at/100));d&&1===rt&&(st=7*Math.ceil(st/7)),i.scales.x.time.stepSize=st}}i.scales.x.time.tooltipFormat||(u?i.scales.x.time.tooltipFormat="PP":_?i.scales.x.time.tooltipFormat="MMM d, h a":M&&(i.scales.x.time.tooltipFormat="h:mm a"))}return{labels:h,datasets:a}},B=function(t){this.name="chartjs",this.library=t};B.prototype.renderLineChart=function(t,e){var i={};!t.options.max&&function(t){var e,i,n;for(e=0;e<t.length;e++)for(n=t[e].data,i=0;i<n.length;i++)if(0!=n[i][1])return!1;return!0}(t.data)&&(i.max=1);var n=N(t,r(i,t.options));I(t,n,e);var o=H(t,n,e||"line");"number"===t.xtype?(n.scales.x.type=n.scales.x.type||"linear",n.scales.x.position=n.scales.x.position||"bottom"):n.scales.x.type="string"===t.xtype?"category":"time",this.drawChart(t,"line",o,n)},B.prototype.renderPieChart=function(t){var e=r({},C);t.options.donut&&(e.cutout="50%"),"legend"in t.options&&S(e,t.options.legend),t.options.title&&P(e,t.options.title),e=r(e,t.options.library||{}),I(t,e,"pie");for(var i=[],n=[],o=0;o<t.data.length;o++){var a=t.data[o];i.push(a[0]),n.push(a[1])}var s={data:n,backgroundColor:t.options.colors||D},l={labels:i,datasets:[s=r(s,t.options.dataset||{})]};this.drawChart(t,"pie",l,e)},B.prototype.renderColumnChart=function(t,e){var i;if("bar"===e){var n=r(C,T);n.indexAxis="y",n.scales.x.grid.drawOnChartArea=!0,n.scales.y.grid.drawOnChartArea=!1,delete n.scales.y.ticks.maxTicksLimit,i=c(n,S,P,z,O,A,E,L)(t,t.options)}else i=N(t,t.options);I(t,i,e);var o=H(t,i,"column");"bar"!==e&&function(t,e,i){var n=Math.ceil(t.element.offsetWidth/4/e.labels.length);n>25?n=25:n<10&&(n=10),i.scales.x.ticks.callback||(i.scales.x.ticks.callback=function(t){return(t=a(this.getLabelForValue(t))).length>n?t.substring(0,n-2)+"...":t})}(t,o,i),this.drawChart(t,"bar",o,i)},B.prototype.renderAreaChart=function(t){this.renderLineChart(t,"area")},B.prototype.renderBarChart=function(t){this.renderColumnChart(t,"bar")},B.prototype.renderScatterChart=function(t,e){e=e||"scatter";var i=N(t,t.options);I(t,i,e),"showLine"in i||(i.showLine=!1);var n=H(t,i,e);i.scales.x.type=i.scales.x.type||"linear",i.scales.x.position=i.scales.x.position||"bottom","mode"in i.interaction||(i.interaction.mode="nearest"),this.drawChart(t,e,n,i)},B.prototype.renderBubbleChart=function(t){this.renderScatterChart(t,"bubble")},B.prototype.destroy=function(t){t.chart&&t.chart.destroy()},B.prototype.drawChart=function(t,e,i,n){if(this.destroy(t),!t.destroyed){var r={type:e,data:i,options:n};t.options.code&&window.console.log("new Chart(ctx, "+JSON.stringify(r)+");"),t.element.innerHTML="<canvas></canvas>";var o=t.element.getElementsByTagName("CANVAS")[0];t.chart=new this.library(o,r)}};var W={chart:{},xAxis:{title:{text:null},labels:{style:{fontSize:"12px"}}},yAxis:{title:{text:null},labels:{style:{fontSize:"12px"}}},title:{text:null},credits:{enabled:!1},legend:{borderWidth:0},tooltip:{style:{fontSize:"12px"}},plotOptions:{areaspline:{},area:{},series:{marker:{}}},time:{useUTC:!1}},U=function(t,e,i){void 0!==e?(t.legend.enabled=!!e,e&&!0!==e&&("top"===e||"bottom"===e?t.legend.verticalAlign=e:(t.legend.layout="vertical",t.legend.verticalAlign="middle",t.legend.align=e))):i&&(t.legend.enabled=!1)},V=function(t,e){t.title.text=e},j=c(W,U,V,(function(t,e){t.yAxis.min=e}),(function(t,e){t.yAxis.max=e}),(function(t,e){var i=e?!0===e?"normal":e:null;t.plotOptions.series.stacking=i,t.plotOptions.area.stacking=i,t.plotOptions.areaspline.stacking=i}),(function(t,e){t.xAxis.title.text=e}),(function(t,e){t.yAxis.title.text=e})),Y=function(t,e,i){var n={prefix:t.options.prefix,suffix:t.options.suffix,thousands:t.options.thousands,decimal:t.options.decimal,precision:t.options.precision,round:t.options.round,zeros:t.options.zeros};"pie"===i||e.yAxis.labels.formatter||(e.yAxis.labels.formatter=function(){return M("",this.value,n)}),e.tooltip.pointFormatter||e.tooltip.pointFormat||(e.tooltip.pointFormatter=function(){return'<span style="color:'+this.color+'">●</span> '+M(this.series.name+": <b>",this.y,n)+"</b><br/>"})},$=function(t){this.name="highcharts",this.library=t};$.prototype.renderLineChart=function(t,e){var i={};"areaspline"===(e=e||"spline")&&(i={plotOptions:{areaspline:{stacking:"normal"},area:{stacking:"normal"},series:{marker:{enabled:!1}}}}),!1===t.options.curve&&("areaspline"===e?e="area":"spline"===e&&(e="line"));var n,r,o,a=j(t,t.options,i);"number"===t.xtype?a.xAxis.type=a.xAxis.type||"linear":a.xAxis.type="string"===t.xtype?"category":"datetime",a.chart.type||(a.chart.type=e),Y(t,a,e);var s=t.data;for(r=0;r<s.length;r++){if(s[r].name=s[r].name||"Value",n=s[r].data,"datetime"===t.xtype)for(o=0;o<n.length;o++)n[o][0]=n[o][0].getTime();s[r].marker={symbol:"circle"},!1===t.options.points&&(s[r].marker.enabled=!1)}this.drawChart(t,s,a)},$.prototype.renderScatterChart=function(t){var e=j(t,t.options,{});e.chart.type="scatter",this.drawChart(t,t.data,e)},$.prototype.renderPieChart=function(t){var e=r(W,{});t.options.colors&&(e.colors=t.options.colors),t.options.donut&&(e.plotOptions={pie:{innerSize:"50%"}}),"legend"in t.options&&U(e,t.options.legend),t.options.title&&V(e,t.options.title);var i=r(e,t.options.library||{});Y(t,i,"pie");var n=[{type:"pie",name:t.options.label||"Value",data:t.data}];this.drawChart(t,n,i)},$.prototype.renderColumnChart=function(t,e){e=e||"column";var i,n,r,o,a=t.data,s=j(t,t.options),l=[],h=[];for(s.chart.type=e,Y(t,s,e),i=0;i<a.length;i++)for(r=a[i],n=0;n<r.data.length;n++)l[(o=r.data[n])[0]]||(l[o[0]]=new Array(a.length),h.push(o[0])),l[o[0]][i]=o[1];"number"===t.xtype&&h.sort(f),s.xAxis.categories=h;var c,u=[];for(i=0;i<a.length;i++){for(o=[],n=0;n<h.length;n++)o.push(l[h[n]][i]||0);c={name:a[i].name||"Value",data:o},a[i].stack&&(c.stack=a[i].stack),u.push(c)}this.drawChart(t,u,s)},$.prototype.renderBarChart=function(t){this.renderColumnChart(t,"bar")},$.prototype.renderAreaChart=function(t){this.renderLineChart(t,"areaspline")},$.prototype.destroy=function(t){t.chart&&t.chart.destroy()},$.prototype.drawChart=function(t,e,i){this.destroy(t),t.destroyed||(i.chart.renderTo=t.element.id,i.series=e,t.options.code&&window.console.log("new Highcharts.Chart("+JSON.stringify(i)+");"),t.chart=new this.library.Chart(i))};var q={},X=[],Q={chartArea:{},fontName:"'Lucida Grande', 'Lucida Sans Unicode', Verdana, Arial, Helvetica, sans-serif",pointSize:6,legend:{textStyle:{fontSize:12,color:"#444"},alignment:"center",position:"right"},curveType:"function",hAxis:{textStyle:{color:"#666",fontSize:12},titleTextStyle:{},gridlines:{color:"transparent"},baselineColor:"#ccc",viewWindow:{}},vAxis:{textStyle:{color:"#666",fontSize:12},titleTextStyle:{},baselineColor:"#ccc",viewWindow:{}},tooltip:{textStyle:{color:"#666",fontSize:12}}},G=function(t,e,i){var n;void 0!==e?(n=e?!0===e?"right":e:"none",t.legend.position=n):i&&(t.legend.position="none")},K=function(t,e){t.title=e,t.titleTextStyle={color:"#333",fontSize:"20px"}},Z=function(t,e){t.hAxis.viewWindow.min=e},J=function(t,e){t.hAxis.viewWindow.max=e},tt=function(t,e){t.isStacked=e||!1},et=function(t,e){t.hAxis.title=e,t.hAxis.titleTextStyle.italic=!1},it=function(t,e){t.vAxis.title=e,t.vAxis.titleTextStyle.italic=!1},nt=c(Q,G,K,(function(t,e){t.vAxis.viewWindow.min=e}),(function(t,e){t.vAxis.viewWindow.max=e}),tt,et,it),rt=function(t){this.name="google",this.library=t};function ot(t,e){var i,n,r=[];if(n="number"===e?s:"datetime"===e?l:a,"bubble"===e)for(i=0;i<t.length;i++)r.push([s(t[i][0]),s(t[i][1]),s(t[i][2])]);else for(i=0;i<t.length;i++)r.push([n(t[i][0]),s(t[i][1])]);return"datetime"===e?r.sort(u):"number"===e&&r.sort(d),r}function at(t,e){var i,n,r;for(i=0;i<t.length;i++)for(r=h(t[i].data),n=0;n<r.length;n++)if(!e(r[n][0]))return!1;return!0}function st(e,i,n){var r,o=e.options,a=e.rawData;for(e.singleSeriesFormat=!t(a)||"object"!=typeof a[0]||t(a[0]),e.singleSeriesFormat&&(a=[{name:o.label,data:a}]),a=function(t){var e,i,n=[];for(e=0;e<t.length;e++){var r={};for(i in t[e])t[e].hasOwnProperty(i)&&(r[i]=t[e][i]);n.push(r)}return n}(a),r=0;r<a.length;r++)a[r].data=h(a[r].data);for(e.xtype=i||(o.discrete?"string":function(t,e,i){return ht(t)?!i.xmin&&!i.xmax||i.xmin&&!v(i.xmin)||i.xmax&&!v(i.xmax)?"number":"datetime":at(t,w)?"number":!e&&at(t,v)?"datetime":"string"}(a,n,o)),r=0;r<a.length;r++)a[r].data=ot(a[r].data,e.xtype);return a}function lt(t){var e,i=h(t.rawData);for(e=0;e<i.length;e++)i[e]=[a(i[e][0]),s(i[e][1])];return i}function ht(t,e){if("PieChart"===e||"GeoChart"===e||"Timeline"===e)return 0===t.length;for(var i=0;i<t.length;i++)if(t[i].data.length>0)return!1;return!0}function ct(t,e,i){if(t.addEventListener)return t.addEventListener(e,i,!1),i;var n=function(){return i.call(t,window.event)};return t.attachEvent("on"+e,n),n}function ut(t,e,i){t.removeEventListener?t.removeEventListener(e,i,!1):t.detachEvent("on"+e,i)}function dt(t,e){if(t===e)return!1;for(;e&&e!==t;)e=e.parentNode;return e===t}rt.prototype.renderLineChart=function(t){var e=this;this.waitForLoaded(t,(function(){var i={};!1===t.options.curve&&(i.curveType="none"),!1===t.options.points&&(i.pointSize=0);var n=nt(t,t.options,i),r=e.createDataTable(t.data,t.xtype);e.drawChart(t,"LineChart",r,n)}))},rt.prototype.renderPieChart=function(t){var e=this;this.waitForLoaded(t,(function(){var i={chartArea:{top:"10%",height:"80%"},legend:{}};t.options.colors&&(i.colors=t.options.colors),t.options.donut&&(i.pieHole=.5),"legend"in t.options&&G(i,t.options.legend),t.options.title&&K(i,t.options.title);var n=r(r(Q,i),t.options.library||{}),o=new e.library.visualization.DataTable;o.addColumn("string",""),o.addColumn("number","Value"),o.addRows(t.data),e.drawChart(t,"PieChart",o,n)}))},rt.prototype.renderColumnChart=function(t){var e=this;this.waitForLoaded(t,(function(){var i=nt(t,t.options),n=e.createDataTable(t.data,t.xtype);e.drawChart(t,"ColumnChart",n,i)}))},rt.prototype.renderBarChart=function(t){var e=this;this.waitForLoaded(t,(function(){var i=c(Q,G,K,Z,J,tt,et,it)(t,t.options,{hAxis:{gridlines:{color:"#ccc"}}}),n=e.createDataTable(t.data,t.xtype);e.drawChart(t,"BarChart",n,i)}))},rt.prototype.renderAreaChart=function(t){var e=this;this.waitForLoaded(t,(function(){var i=nt(t,t.options,{isStacked:!0,pointSize:0,areaOpacity:.5}),n=e.createDataTable(t.data,t.xtype);e.drawChart(t,"AreaChart",n,i)}))},rt.prototype.renderGeoChart=function(t){var e=this;this.waitForLoaded(t,"geochart",(function(){var i={legend:"none",colorAxis:{colors:t.options.colors||["#f6c7b6","#ce502d"]}},n=r(r(Q,i),t.options.library||{}),o=new e.library.visualization.DataTable;o.addColumn("string",""),o.addColumn("number",t.options.label||"Value"),o.addRows(t.data),e.drawChart(t,"GeoChart",o,n)}))},rt.prototype.renderScatterChart=function(t){var e=this;this.waitForLoaded(t,(function(){var i,n,r,o,a=nt(t,t.options,{}),s=t.data,l=[];for(i=0;i<s.length;i++)for(s[i].name=s[i].name||"Value",o=s[i].data,n=0;n<o.length;n++){var h=new Array(s.length+1);h[0]=o[n][0],h[i+1]=o[n][1],l.push(h)}for((r=new e.library.visualization.DataTable).addColumn("number",""),i=0;i<s.length;i++)r.addColumn("number",s[i].name);r.addRows(l),e.drawChart(t,"ScatterChart",r,a)}))},rt.prototype.renderTimeline=function(t){var e=this;this.waitForLoaded(t,"timeline",(function(){var i={legend:"none"};t.options.colors&&(i.colors=t.options.colors);var n=r(r(Q,i),t.options.library||{}),o=new e.library.visualization.DataTable;o.addColumn({type:"string",id:"Name"}),o.addColumn({type:"date",id:"Start"}),o.addColumn({type:"date",id:"End"}),o.addRows(t.data),t.element.style.lineHeight="normal",e.drawChart(t,"Timeline",o,n)}))},rt.prototype.destroy=function(t){t.chart&&t.chart.clearChart()},rt.prototype.drawChart=function(t,e,i,n){var r;this.destroy(t),t.destroyed||(t.options.code&&window.console.log("var data = new google.visualization.DataTable("+i.toJSON()+");\nvar chart = new google.visualization."+e+"(element);\nchart.draw(data, "+JSON.stringify(n)+");"),t.chart=new this.library.visualization[e](t.element),r=function(){t.chart.draw(i,n)},window.attachEvent?window.attachEvent("onresize",r):window.addEventListener&&window.addEventListener("resize",r,!0),r())},rt.prototype.waitForLoaded=function(t,e,i){var n=this;if(i||(i=e,e="corechart"),X.push({pack:e,callback:i}),q[e])this.runCallbacks();else{q[e]=!0;var r={packages:[e],callback:function(){n.runCallbacks()}},o=t.__config();o.language&&(r.language=o.language),"geochart"===e&&o.mapsApiKey&&(r.mapsApiKey=o.mapsApiKey),this.library.charts.load("current",r)}},rt.prototype.runCallbacks=function(){for(var t,e=0;e<X.length;e++)t=X[e],this.library.visualization&&("corechart"===t.pack&&this.library.visualization.LineChart||"timeline"===t.pack&&this.library.visualization.Timeline||"geochart"===t.pack&&this.library.visualization.GeoChart)&&(t.callback(),X.splice(e,1),e--)},rt.prototype.createDataTable=function(t,e){var i,n,r,o,l,h=[],c=[];for(i=0;i<t.length;i++)for(r=t[i],t[i].name=t[i].name||"Value",n=0;n<r.data.length;n++)o=r.data[n],h[l="datetime"===e?o[0].getTime():o[0]]||(h[l]=new Array(t.length),c.push(l)),h[l][i]=s(o[1]);var f,g=[],p=!0;for(n=0;n<c.length;n++)i=c[n],"datetime"===e?(f=new Date(s(i)),p=p&&m(f)):f="number"===e?s(i):i,g.push([f].concat(h[i]));if("datetime"===e)g.sort(u);else if("number"===e){for(g.sort(d),i=0;i<g.length;i++)g[i][0]=a(g[i][0]);e="string"}var b=new this.library.visualization.DataTable;for(e="datetime"===e&&p?"date":e,b.addColumn(e,""),i=0;i<t.length;i++)b.addColumn("number",t[i].name);return b.addRows(g),b};var ft=[],gt=0;function pt(){if(gt<4){var t=ft.shift();t&&(gt++,e=t[0],i=t[1],n=t[2],function(t,e,i){var n=window.jQuery||window.Zepto||window.$;if(n&&n.ajax)n.ajax({dataType:"json",url:t,success:e,error:i,complete:mt});else{var r=new XMLHttpRequest;r.open("GET",t,!0),r.setRequestHeader("Content-Type","application/json"),r.onload=function(){mt(),200===r.status?e(JSON.parse(r.responseText),r.statusText,r):i(r,"error",r.statusText)},r.send()}}(e,i,(function(t,e,i){var r="string"==typeof i?i:i.message;n(r)})),pt())}var e,i,n}function mt(){gt--,pt()}var bt={},xt=[];function yt(t,e){document.body.innerText?t.innerText=e:t.textContent=e}function vt(t,e,i){i||(e="Error Loading Chart: "+e),yt(t,e),t.style.color="#ff0000"}function wt(t){try{t.__render()}catch(e){throw vt(t.element,e.message),e}}function _t(t,e,i){if(i&&t.options.loading&&("string"==typeof e||"function"==typeof e)&&yt(t.element,t.options.loading),"string"==typeof e)n=e,r=function(e){t.rawData=e,wt(t)},o=function(e){vt(t.element,e)},ft.push([n,r,o]),pt();else if("function"==typeof e)try{e((function(e){t.rawData=e,wt(t)}),(function(e){vt(t.element,e,!0)}))}catch(e){vt(t.element,e,!0)}else t.rawData=e,wt(t);var n,r,o}function Mt(t){var i=new(function(t){if(t){if("Highcharts"===t.product)return $;if(t.charts)return rt;if(e(t))return B}throw new Error("Unknown adapter")}(t))(t);-1===xt.indexOf(i)&&xt.push(i)}function kt(t,i){if(ht(i.data,t)){var n=i.options.empty||i.options.messages&&i.options.messages.empty||"No data";yt(i.element,n)}else(function(t,i){var n,r,o,a;for((o="render"+t,a=i.options.adapter,"Chart"in window&&Mt(window.Chart),"Highcharts"in window&&Mt(window.Highcharts),window.google&&window.google.charts&&Mt(window.google),n=0);n<xt.length;n++)if(r=xt[n],(!a||a===r.name)&&e(r[o]))return i.adapter=r.name,i.__adapterObject=r,r[o](i);throw xt.length>0?new Error("No charting library found for "+t):new Error("No charting libraries found - be sure to include one before your charts")})(t,i),i.options.download&&!i.__downloadAttached&&"chartjs"===i.adapter&&function(t){var e=t.element,i=document.createElement("a"),n=t.options.download;!0===n?n={}:"string"==typeof n&&(n={filename:n}),i.download=n.filename||"chart.png",i.style.position="absolute",i.style.top="20px",i.style.right="20px",i.style.zIndex=1e3,i.style.lineHeight="20px",i.target="_blank";var r=document.createElement("img");r.alt="Download",r.style.border="none",r.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAABCFBMVEUAAADMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMywEsqxAAAAV3RSTlMAAQIDBggJCgsMDQ4PERQaHB0eISIjJCouLzE0OTo/QUJHSUpLTU5PUllhYmltcHh5foWLjI+SlaCio6atr7S1t7m6vsHHyM7R2tze5Obo7fHz9ff5+/1hlxK2AAAA30lEQVQYGUXBhVYCQQBA0TdYWAt2d3d3YWAHyur7/z9xgD16Lw0DW+XKx+1GgX+FRzM3HWQWrHl5N/oapW5RPe0PkBu+UYeICvozTWZVK23Ao04B79oJrOsJDOoxkZoQPWgX29pHpCZEk7rEvQYiNSFq1UMqvlCjJkRBS1R8hb00Vb/TajtBL7nTHE1X1vyMQF732dQhyF2o6SAwrzP06iUQzvwsArlnzcOdrgBhJyHa1QOgO9U1GsKuvjUTjavliZYQ8nNPapG6sap/3nrIdJ6bOWzmX/fy0XVpfzZP3S8OJT3g9EEiJwAAAABJRU5ErkJggg==",i.appendChild(r),e.style.position="relative",t.__downloadAttached=!0,t.__enterEvent=ct(e,"mouseover",(function(r){var o=r.relatedTarget;o&&(o===this||dt(this,o))||!t.options.download||(i.href=t.toImage(n),e.appendChild(i))})),t.__leaveEvent=ct(e,"mouseout",(function(t){var e=t.relatedTarget;e&&(e===this||dt(this,e))||i.parentNode&&i.parentNode.removeChild(i)}))}(i)}var Ct=function(t,e,i){var n;if("string"==typeof t&&(n=t,!(t=document.getElementById(t))))throw new Error("No element with id "+n);this.element=t,this.options=r(Rt.options,i||{}),this.dataSource=e,Rt.charts[t.id]=this,_t(this,e,!0),this.options.refresh&&this.startRefresh()};Ct.prototype.getElement=function(){return this.element},Ct.prototype.getDataSource=function(){return this.dataSource},Ct.prototype.getData=function(){return this.data},Ct.prototype.getOptions=function(){return this.options},Ct.prototype.getChartObject=function(){return this.chart},Ct.prototype.getAdapter=function(){return this.adapter},Ct.prototype.updateData=function(t,e){this.dataSource=t,e&&this.__updateOptions(e),_t(this,t,!0)},Ct.prototype.setOptions=function(t){this.__updateOptions(t),this.redraw()},Ct.prototype.redraw=function(){_t(this,this.rawData)},Ct.prototype.refreshData=function(){if("string"==typeof this.dataSource){var t=-1===this.dataSource.indexOf("?")?"?":"&";_t(this,this.dataSource+t+"_="+(new Date).getTime())}else"function"==typeof this.dataSource&&_t(this,this.dataSource)},Ct.prototype.startRefresh=function(){var t=this,e=this.options.refresh;if(e&&"string"!=typeof this.dataSource&&"function"!=typeof this.dataSource)throw new Error("Data source must be a URL or callback for refresh");if(!this.intervalId){if(!e)throw new Error("No refresh interval");this.intervalId=setInterval((function(){t.refreshData()}),1e3*e)}},Ct.prototype.stopRefresh=function(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)},Ct.prototype.toImage=function(t){if("chartjs"===this.adapter){if(t&&t.background&&"transparent"!==t.background){var e=this.chart.canvas,i=this.chart.ctx,n=document.createElement("canvas"),r=n.getContext("2d");return n.width=i.canvas.width,n.height=i.canvas.height,r.fillStyle=t.background,r.fillRect(0,0,n.width,n.height),r.drawImage(e,0,0),n.toDataURL("image/png")}return this.chart.toBase64Image()}throw new Error("Feature only available for Chart.js")},Ct.prototype.destroy=function(){this.destroyed=!0,this.stopRefresh(),this.__adapterObject&&this.__adapterObject.destroy(this),this.__enterEvent&&ut(this.element,"mouseover",this.__enterEvent),this.__leaveEvent&&ut(this.element,"mouseout",this.__leaveEvent)},Ct.prototype.__updateOptions=function(t){var e=t.refresh&&t.refresh!==this.options.refresh;this.options=r(Rt.options,t),e&&(this.stopRefresh(),this.startRefresh())},Ct.prototype.__render=function(){this.data=this.__processData(),kt(this.__chartName(),this)},Ct.prototype.__config=function(){return bt};var Tt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return st(this)},e.prototype.__chartName=function(){return"LineChart"},e}(Ct),Dt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return lt(this)},e.prototype.__chartName=function(){return"PieChart"},e}(Ct),St=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return st(this,null,!0)},e.prototype.__chartName=function(){return"ColumnChart"},e}(Ct),Pt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return st(this,null,!0)},e.prototype.__chartName=function(){return"BarChart"},e}(Ct),zt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return st(this)},e.prototype.__chartName=function(){return"AreaChart"},e}(Ct),Ot=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return lt(this)},e.prototype.__chartName=function(){return"GeoChart"},e}(Ct),At=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return st(this,"number")},e.prototype.__chartName=function(){return"ScatterChart"},e}(Ct),Et=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return st(this,"bubble")},e.prototype.__chartName=function(){return"BubbleChart"},e}(Ct),Lt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){var t,e=this.rawData;for(t=0;t<e.length;t++)e[t][1]=l(e[t][1]),e[t][2]=l(e[t][2]);return e},e.prototype.__chartName=function(){return"Timeline"},e}(Ct),Rt={LineChart:Tt,PieChart:Dt,ColumnChart:St,BarChart:Pt,AreaChart:zt,GeoChart:Ot,ScatterChart:At,BubbleChart:Et,Timeline:Lt,charts:{},configure:function(t){for(var e in t)t.hasOwnProperty(e)&&(bt[e]=t[e])},setDefaultOptions:function(t){Rt.options=t},eachChart:function(t){for(var e in Rt.charts)Rt.charts.hasOwnProperty(e)&&t(Rt.charts[e])},destroyAll:function(){for(var t in Rt.charts)Rt.charts.hasOwnProperty(t)&&(Rt.charts[t].destroy(),delete Rt.charts[t])},config:bt,options:{},adapters:xt,addAdapter:Mt,use:function(t){return Mt(t),Rt}};return"undefined"==typeof window||window.Chartkick||(window.Chartkick=Rt,document.addEventListener("turbolinks:before-render",(function(){Rt.destroyAll()})),document.addEventListener("turbo:before-render",(function(){Rt.destroyAll()})),setTimeout((function(){window.dispatchEvent(new Event("chartkick:load"))}),0)),Rt.default=Rt,Rt}()}},e={};function i(n){var r=e[n];if(void 0!==r)return r.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,i),o.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=i(616),e=i.n(t);const n="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function r(t,e,i){const r=i||(t=>Array.prototype.slice.call(t));let o=!1,a=[];return function(...i){a=r(i),o||(o=!0,n.call(window,(()=>{o=!1,t.apply(e,a)})))}}const o=t=>"start"===t?"left":"end"===t?"right":"center",a=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function s(){}const l=function(){let t=0;return function(){return t++}}();function h(t){return null==t}function c(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)}function u(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}const d=t=>("number"==typeof t||t instanceof Number)&&isFinite(+t);function f(t,e){return d(t)?t:e}function g(t,e){return void 0===t?e:t}const p=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function m(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function b(t,e,i,n){let r,o,a;if(c(t))if(o=t.length,n)for(r=o-1;r>=0;r--)e.call(i,t[r],r);else for(r=0;r<o;r++)e.call(i,t[r],r);else if(u(t))for(a=Object.keys(t),o=a.length,r=0;r<o;r++)e.call(i,t[a[r]],a[r])}function x(t,e){let i,n,r,o;if(!t||!e||t.length!==e.length)return!1;for(i=0,n=t.length;i<n;++i)if(r=t[i],o=e[i],r.datasetIndex!==o.datasetIndex||r.index!==o.index)return!1;return!0}function y(t){if(c(t))return t.map(y);if(u(t)){const e=Object.create(null),i=Object.keys(t),n=i.length;let r=0;for(;r<n;++r)e[i[r]]=y(t[i[r]]);return e}return t}function v(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function w(t,e,i,n){if(!v(t))return;const r=e[t],o=i[t];u(r)&&u(o)?_(r,o,n):e[t]=y(o)}function _(t,e,i){const n=c(e)?e:[e],r=n.length;if(!u(t))return t;const o=(i=i||{}).merger||w;for(let a=0;a<r;++a){if(!u(e=n[a]))continue;const r=Object.keys(e);for(let n=0,a=r.length;n<a;++n)o(r[n],t,e,i)}return t}function M(t,e){return _(t,e,{merger:k})}function k(t,e,i){if(!v(t))return;const n=e[t],r=i[t];u(n)&&u(r)?M(n,r):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=y(r))}function C(t,e){const i=t.indexOf(".",e);return-1===i?t.length:i}function T(t,e){if(""===e)return t;let i=0,n=C(e,i);for(;t&&n>i;)t=t[e.substr(i,n-i)],i=n+1,n=C(e,i);return t}function D(t){return t.charAt(0).toUpperCase()+t.slice(1)}const S=t=>void 0!==t,P=t=>"function"==typeof t,z=Math.PI,O=2*z,A=O+z,E=Number.POSITIVE_INFINITY,L=z/180,R=z/2,F=z/4,I=2*z/3,N=Math.log10,H=Math.sign;function B(t){const e=Math.round(t);t=U(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(N(t))),n=t/i;return(n<=1?1:n<=2?2:n<=5?5:10)*i}function W(t){return!isNaN(parseFloat(t))&&isFinite(t)}function U(t,e,i){return Math.abs(t-e)<i}function V(t,e,i){let n,r,o;for(n=0,r=t.length;n<r;n++)o=t[n][i],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}function j(t){return t*(z/180)}function Y(t){return t*(180/z)}function $(t){if(!d(t))return;let e=1,i=0;for(;Math.round(t*e)/e!==t;)e*=10,i++;return i}function q(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function X(t,e){return(t-e+A)%O-z}function Q(t){return(t%O+O)%O}function G(t,e,i,n){const r=Q(t),o=Q(e),a=Q(i),s=Q(o-r),l=Q(a-r),h=Q(r-o),c=Q(r-a);return r===o||r===a||n&&o===a||s>l&&h<c}function K(t,e,i){return Math.max(e,Math.min(i,t))}const Z=t=>0===t||1===t,J=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*O/i),tt=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*O/i)+1,et={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*R),easeOutSine:t=>Math.sin(t*R),easeInOutSine:t=>-.5*(Math.cos(z*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>Z(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Z(t)?t:J(t,.075,.3),easeOutElastic:t=>Z(t)?t:tt(t,.075,.3),easeInOutElastic(t){const e=.1125;return Z(t)?t:t<.5?.5*J(2*t,e,.45):.5+.5*tt(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-et.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*et.easeInBounce(2*t):.5*et.easeOutBounce(2*t-1)+.5},it={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},nt="0123456789ABCDEF",rt=t=>nt[15&t],ot=t=>nt[(240&t)>>4]+nt[15&t],at=t=>(240&t)>>4==(15&t);function st(t){return t+.5|0}const lt=(t,e,i)=>Math.max(Math.min(t,i),e);function ht(t){return lt(st(2.55*t),0,255)}function ct(t){return lt(st(255*t),0,255)}function ut(t){return lt(st(t/2.55)/100,0,1)}function dt(t){return lt(st(100*t),0,100)}const ft=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,gt=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function pt(t,e,i){const n=e*Math.min(i,1-i),r=(e,r=(e+t/30)%12)=>i-n*Math.max(Math.min(r-3,9-r,1),-1);return[r(0),r(8),r(4)]}function mt(t,e,i){const n=(n,r=(n+t/60)%6)=>i-i*e*Math.max(Math.min(r,4-r,1),0);return[n(5),n(3),n(1)]}function bt(t,e,i){const n=pt(t,1,.5);let r;for(e+i>1&&(r=1/(e+i),e*=r,i*=r),r=0;r<3;r++)n[r]*=1-e-i,n[r]+=e;return n}function xt(t){const e=t.r/255,i=t.g/255,n=t.b/255,r=Math.max(e,i,n),o=Math.min(e,i,n),a=(r+o)/2;let s,l,h;return r!==o&&(h=r-o,l=a>.5?h/(2-r-o):h/(r+o),s=r===e?(i-n)/h+(i<n?6:0):r===i?(n-e)/h+2:(e-i)/h+4,s=60*s+.5),[0|s,l||0,a]}function yt(t,e,i,n){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,n)).map(ct)}function vt(t,e,i){return yt(pt,t,e,i)}function wt(t){return(t%360+360)%360}const _t={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"},Mt={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 kt;function Ct(t,e,i){if(t){let n=xt(t);n[e]=Math.max(0,Math.min(n[e]+n[e]*i,0===e?360:1)),n=vt(n),t.r=n[0],t.g=n[1],t.b=n[2]}}function Tt(t,e){return t?Object.assign(e||{},t):t}function Dt(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=ct(t[3]))):(e=Tt(t,{r:0,g:0,b:0,a:1})).a=ct(e.a),e}function St(t){return"r"===t.charAt(0)?function(t){const e=ft.exec(t);let i,n,r,o=255;if(e){if(e[7]!==i){const t=+e[7];o=255&(e[8]?ht(t):255*t)}return i=+e[1],n=+e[3],r=+e[5],i=255&(e[2]?ht(i):i),n=255&(e[4]?ht(n):n),r=255&(e[6]?ht(r):r),{r:i,g:n,b:r,a:o}}}(t):function(t){const e=gt.exec(t);let i,n=255;if(!e)return;e[5]!==i&&(n=e[6]?ht(+e[5]):ct(+e[5]));const r=wt(+e[2]),o=+e[3]/100,a=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return yt(bt,t,e,i)}(r,o,a):"hsv"===e[1]?function(t,e,i){return yt(mt,t,e,i)}(r,o,a):vt(r,o,a),{r:i[0],g:i[1],b:i[2],a:n}}(t)}class Pt{constructor(t){if(t instanceof Pt)return t;const e=typeof t;let i;var n,r,o;"object"===e?i=Dt(t):"string"===e&&(o=(n=t).length,"#"===n[0]&&(4===o||5===o?r={r:255&17*it[n[1]],g:255&17*it[n[2]],b:255&17*it[n[3]],a:5===o?17*it[n[4]]:255}:7!==o&&9!==o||(r={r:it[n[1]]<<4|it[n[2]],g:it[n[3]]<<4|it[n[4]],b:it[n[5]]<<4|it[n[6]],a:9===o?it[n[7]]<<4|it[n[8]]:255})),i=r||function(t){kt||(kt=function(){const t={},e=Object.keys(Mt),i=Object.keys(_t);let n,r,o,a,s;for(n=0;n<e.length;n++){for(a=s=e[n],r=0;r<i.length;r++)o=i[r],s=s.replace(o,_t[o]);o=parseInt(Mt[a],16),t[s]=[o>>16&255,o>>8&255,255&o]}return t}(),kt.transparent=[0,0,0,0]);const e=kt[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}(t)||St(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Tt(this._rgb);return t&&(t.a=ut(t.a)),t}set rgb(t){this._rgb=Dt(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${ut(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):this._rgb;var t}hexString(){return this._valid?(t=this._rgb,e=function(t){return at(t.r)&&at(t.g)&&at(t.b)&&at(t.a)}(t)?rt:ot,t?"#"+e(t.r)+e(t.g)+e(t.b)+(t.a<255?e(t.a):""):t):this._rgb;var t,e}hslString(){return this._valid?function(t){if(!t)return;const e=xt(t),i=e[0],n=dt(e[1]),r=dt(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${r}%, ${ut(t.a)})`:`hsl(${i}, ${n}%, ${r}%)`}(this._rgb):this._rgb}mix(t,e){const i=this;if(t){const n=i.rgb,r=t.rgb;let o;const a=e===o?.5:e,s=2*a-1,l=n.a-r.a,h=((s*l==-1?s:(s+l)/(1+s*l))+1)/2;o=1-h,n.r=255&h*n.r+o*r.r+.5,n.g=255&h*n.g+o*r.g+.5,n.b=255&h*n.b+o*r.b+.5,n.a=a*n.a+(1-a)*r.a,i.rgb=n}return i}clone(){return new Pt(this.rgb)}alpha(t){return this._rgb.a=ct(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=st(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Ct(this._rgb,2,t),this}darken(t){return Ct(this._rgb,2,-t),this}saturate(t){return Ct(this._rgb,1,t),this}desaturate(t){return Ct(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=xt(t);i[0]=wt(i[0]+e),i=vt(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function zt(t){return new Pt(t)}const Ot=t=>t instanceof CanvasGradient||t instanceof CanvasPattern;function At(t){return Ot(t)?t:zt(t)}function Et(t){return Ot(t)?t:zt(t).saturate(.5).darken(.1).hexString()}const Lt=Object.create(null),Rt=Object.create(null);function Ft(t,e){if(!e)return t;const i=e.split(".");for(let e=0,n=i.length;e<n;++e){const n=i[e];t=t[n]||(t[n]=Object.create(null))}return t}function It(t,e,i){return"string"==typeof e?_(Ft(t,e),i):_(Ft(t,""),e)}var Nt=new class{constructor(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=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>Et(e.backgroundColor),this.hoverBorderColor=(t,e)=>Et(e.borderColor),this.hoverColor=(t,e)=>Et(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0},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.describe(t)}set(t,e){return It(this,t,e)}get(t){return Ft(this,t)}describe(t,e){return It(Rt,t,e)}override(t,e){return It(Lt,t,e)}route(t,e,i,n){const r=Ft(this,t),o=Ft(this,i),a="_"+e;Object.defineProperties(r,{[a]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[a],e=o[n];return u(t)?Object.assign({},e,t):g(t,e)},set(t){this[a]=t}}})}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function Ht(t,e,i,n,r){let o=e[r];return o||(o=e[r]=t.measureText(r).width,i.push(r)),o>n&&(n=o),n}function Bt(t,e,i,n){let r=(n=n||{}).data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(r=n.data={},o=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let a=0;const s=i.length;let l,h,u,d,f;for(l=0;l<s;l++)if(d=i[l],null!=d&&!0!==c(d))a=Ht(t,r,o,a,d);else if(c(d))for(h=0,u=d.length;h<u;h++)f=d[h],null==f||c(f)||(a=Ht(t,r,o,a,f));t.restore();const g=o.length/2;if(g>i.length){for(l=0;l<g;l++)delete r[o[l]];o.splice(0,g)}return a}function Wt(t,e,i){const n=t.currentDevicePixelRatio,r=0!==i?Math.max(i/2,.5):0;return Math.round((e-r)*n)/n+r}function Ut(t,e){(e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function Vt(t,e,i,n){let r,o,a,s,l;const h=e.pointStyle,c=e.rotation,u=e.radius;let d=(c||0)*L;if(h&&"object"==typeof h&&(r=h.toString(),"[object HTMLImageElement]"===r||"[object HTMLCanvasElement]"===r))return t.save(),t.translate(i,n),t.rotate(d),t.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),void t.restore();if(!(isNaN(u)||u<=0)){switch(t.beginPath(),h){default:t.arc(i,n,u,0,O),t.closePath();break;case"triangle":t.moveTo(i+Math.sin(d)*u,n-Math.cos(d)*u),d+=I,t.lineTo(i+Math.sin(d)*u,n-Math.cos(d)*u),d+=I,t.lineTo(i+Math.sin(d)*u,n-Math.cos(d)*u),t.closePath();break;case"rectRounded":l=.516*u,s=u-l,o=Math.cos(d+F)*s,a=Math.sin(d+F)*s,t.arc(i-o,n-a,l,d-z,d-R),t.arc(i+a,n-o,l,d-R,d),t.arc(i+o,n+a,l,d,d+R),t.arc(i-a,n+o,l,d+R,d+z),t.closePath();break;case"rect":if(!c){s=Math.SQRT1_2*u,t.rect(i-s,n-s,2*s,2*s);break}d+=F;case"rectRot":o=Math.cos(d)*u,a=Math.sin(d)*u,t.moveTo(i-o,n-a),t.lineTo(i+a,n-o),t.lineTo(i+o,n+a),t.lineTo(i-a,n+o),t.closePath();break;case"crossRot":d+=F;case"cross":o=Math.cos(d)*u,a=Math.sin(d)*u,t.moveTo(i-o,n-a),t.lineTo(i+o,n+a),t.moveTo(i+a,n-o),t.lineTo(i-a,n+o);break;case"star":o=Math.cos(d)*u,a=Math.sin(d)*u,t.moveTo(i-o,n-a),t.lineTo(i+o,n+a),t.moveTo(i+a,n-o),t.lineTo(i-a,n+o),d+=F,o=Math.cos(d)*u,a=Math.sin(d)*u,t.moveTo(i-o,n-a),t.lineTo(i+o,n+a),t.moveTo(i+a,n-o),t.lineTo(i-a,n+o);break;case"line":o=Math.cos(d)*u,a=Math.sin(d)*u,t.moveTo(i-o,n-a),t.lineTo(i+o,n+a);break;case"dash":t.moveTo(i,n),t.lineTo(i+Math.cos(d)*u,n+Math.sin(d)*u)}t.fill(),e.borderWidth>0&&t.stroke()}}function jt(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}function Yt(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function $t(t){t.restore()}function qt(t,e,i,n,r){if(!e)return t.lineTo(i.x,i.y);if("middle"===r){const n=(e.x+i.x)/2;t.lineTo(n,e.y),t.lineTo(n,i.y)}else"after"===r!=!!n?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}function Xt(t,e,i,n){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(n?e.cp1x:e.cp2x,n?e.cp1y:e.cp2y,n?i.cp2x:i.cp1x,n?i.cp2y:i.cp1y,i.x,i.y)}function Qt(t,e,i,n,r,o={}){const a=c(e)?e:[e],s=o.strokeWidth>0&&""!==o.strokeColor;let l,u;for(t.save(),t.font=r.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),h(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,o),l=0;l<a.length;++l)u=a[l],s&&(o.strokeColor&&(t.strokeStyle=o.strokeColor),h(o.strokeWidth)||(t.lineWidth=o.strokeWidth),t.strokeText(u,i,n,o.maxWidth)),t.fillText(u,i,n,o.maxWidth),Gt(t,i,n,u,o),n+=r.lineHeight;t.restore()}function Gt(t,e,i,n,r){if(r.strikethrough||r.underline){const o=t.measureText(n),a=e-o.actualBoundingBoxLeft,s=e+o.actualBoundingBoxRight,l=i-o.actualBoundingBoxAscent,h=i+o.actualBoundingBoxDescent,c=r.strikethrough?(l+h)/2:h;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=r.decorationWidth||2,t.moveTo(a,c),t.lineTo(s,c),t.stroke()}}function Kt(t,e){const{x:i,y:n,w:r,h:o,radius:a}=e;t.arc(i+a.topLeft,n+a.topLeft,a.topLeft,-R,z,!0),t.lineTo(i,n+o-a.bottomLeft),t.arc(i+a.bottomLeft,n+o-a.bottomLeft,a.bottomLeft,z,R,!0),t.lineTo(i+r-a.bottomRight,n+o),t.arc(i+r-a.bottomRight,n+o-a.bottomRight,a.bottomRight,R,0,!0),t.lineTo(i+r,n+a.topRight),t.arc(i+r-a.topRight,n+a.topRight,a.topRight,0,-R,!0),t.lineTo(i+a.topLeft,n)}const Zt=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),Jt=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function te(t,e){const i=(""+t).match(Zt);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}function ee(t,e){const i={},n=u(e),r=n?Object.keys(e):e,o=u(t)?n?i=>g(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of r)i[t]=+o(t)||0;return i}function ie(t){return ee(t,{top:"y",right:"x",bottom:"y",left:"x"})}function ne(t){return ee(t,["topLeft","topRight","bottomLeft","bottomRight"])}function re(t){const e=ie(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function oe(t,e){t=t||{},e=e||Nt.font;let i=g(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let n=g(t.style,e.style);n&&!(""+n).match(Jt)&&(console.warn('Invalid font style specified: "'+n+'"'),n="");const r={family:g(t.family,e.family),lineHeight:te(g(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:g(t.weight,e.weight),string:""};return r.string=function(t){return!t||h(t.size)||h(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(r),r}function ae(t,e,i,n){let r,o,a,s=!0;for(r=0,o=t.length;r<o;++r)if(a=t[r],void 0!==a&&(void 0!==e&&"function"==typeof a&&(a=a(e),s=!1),void 0!==i&&c(a)&&(a=a[i%a.length],s=!1),void 0!==a))return n&&!s&&(n.cacheable=!1),a}function se(t,e){return Object.assign(Object.create(t),e)}function le(t,e,i){i=i||(i=>t[i]<e);let n,r=t.length-1,o=0;for(;r-o>1;)n=o+r>>1,i(n)?o=n:r=n;return{lo:o,hi:r}}const he=(t,e,i)=>le(t,i,(n=>t[n][e]<i)),ce=(t,e,i)=>le(t,i,(n=>t[n][e]>=i)),ue=["push","pop","shift","splice","unshift"];function de(t,e){const i=t._chartjs;if(!i)return;const n=i.listeners,r=n.indexOf(e);-1!==r&&n.splice(r,1),n.length>0||(ue.forEach((e=>{delete t[e]})),delete t._chartjs)}function fe(t){const e=new Set;let i,n;for(i=0,n=t.length;i<n;++i)e.add(t[i]);return e.size===n?t:Array.from(e)}function ge(t,e=[""],i=t,n,r=(()=>t[0])){S(n)||(n=Ce("_fallback",t));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:n,_getTarget:r,override:r=>ge([r,...t],e,i,n)};return new Proxy(o,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,n)=>ye(i,n,(()=>function(t,e,i,n){let r;for(const o of e)if(r=Ce(be(o,t),i),S(r))return xe(t,r)?Me(i,n,t,r):r}(n,e,t,i))),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>Te(t).includes(e),ownKeys:t=>Te(t),set:(t,e,i)=>((t._storage||(t._storage=r()))[e]=i,delete t[e],delete t._keys,!0)})}function pe(t,e,i,n){const r={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:me(t,n),setContext:e=>pe(t,e,i,n),override:r=>pe(t.override(r),e,i,n)};return new Proxy(r,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>ye(t,e,(()=>function(t,e,i){const{_proxy:n,_context:r,_subProxy:o,_descriptors:a}=t;let s=n[e];return P(s)&&a.isScriptable(e)&&(s=function(t,e,i,n){const{_proxy:r,_context:o,_subProxy:a,_stack:s}=i;if(s.has(t))throw new Error("Recursion detected: "+Array.from(s).join("->")+"->"+t);return s.add(t),e=e(o,a||n),s.delete(t),u(e)&&(e=Me(r._scopes,r,t,e)),e}(e,s,t,i)),c(s)&&s.length&&(s=function(t,e,i,n){const{_proxy:r,_context:o,_subProxy:a,_descriptors:s}=i;if(S(o.index)&&n(t))e=e[o.index%e.length];else if(u(e[0])){const i=e,n=r._scopes.filter((t=>t!==i));e=[];for(const l of i){const i=Me(n,r,t,l);e.push(pe(i,o,a&&a[t],s))}}return e}(e,s,t,a.isIndexable)),xe(e,s)&&(s=pe(s,r,o&&o[e],a)),s}(t,e,i))),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,n)=>(t[i]=n,delete e[i],!0)})}function me(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:r=e.allKeys}=t;return{allKeys:r,scriptable:i,indexable:n,isScriptable:P(i)?i:()=>i,isIndexable:P(n)?n:()=>n}}const be=(t,e)=>t?t+D(e):e,xe=(t,e)=>u(e)&&"adapters"!==t;function ye(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const n=i();return t[e]=n,n}function ve(t,e,i){return P(t)?t(e,i):t}const we=(t,e)=>!0===t?e:"string"==typeof t?T(e,t):void 0;function _e(t,e,i,n){for(const r of e){const e=we(i,r);if(e){t.add(e);const r=ve(e._fallback,i,e);if(S(r)&&r!==i&&r!==n)return r}else if(!1===e&&S(n)&&i!==n)return null}return!1}function Me(t,e,i,n){const r=e._rootScopes,o=ve(e._fallback,i,n),a=[...t,...r],s=new Set;s.add(n);let l=ke(s,a,i,o||i);return null!==l&&(!S(o)||o===i||(l=ke(s,a,o,l),null!==l))&&ge(Array.from(s),[""],r,o,(()=>function(t,e,i){const n=t._getTarget();e in n||(n[e]={});const r=n[e];return c(r)&&u(i)?i:r}(e,i,n)))}function ke(t,e,i,n){for(;i;)i=_e(t,e,i,n);return i}function Ce(t,e){for(const i of e){if(!i)continue;const e=i[t];if(S(e))return e}}function Te(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter((t=>!t.startsWith("_"))))e.add(t);return Array.from(e)}(t._scopes)),e}const De=Number.EPSILON||1e-14,Se=(t,e)=>e<t.length&&!t[e].skip&&t[e],Pe=t=>"x"===t?"y":"x";function ze(t,e,i,n){const r=t.skip?e:t,o=e,a=i.skip?e:i,s=q(o,r),l=q(a,o);let h=s/(s+l),c=l/(s+l);h=isNaN(h)?0:h,c=isNaN(c)?0:c;const u=n*h,d=n*c;return{previous:{x:o.x-u*(a.x-r.x),y:o.y-u*(a.y-r.y)},next:{x:o.x+d*(a.x-r.x),y:o.y+d*(a.y-r.y)}}}function Oe(t,e,i){return Math.max(Math.min(t,i),e)}function Ae(t,e,i,n,r){let o,a,s,l;if(e.spanGaps&&(t=t.filter((t=>!t.skip))),"monotone"===e.cubicInterpolationMode)!function(t,e="x"){const i=Pe(e),n=t.length,r=Array(n).fill(0),o=Array(n);let a,s,l,h=Se(t,0);for(a=0;a<n;++a)if(s=l,l=h,h=Se(t,a+1),l){if(h){const t=h[e]-l[e];r[a]=0!==t?(h[i]-l[i])/t:0}o[a]=s?h?H(r[a-1])!==H(r[a])?0:(r[a-1]+r[a])/2:r[a-1]:r[a]}!function(t,e,i){const n=t.length;let r,o,a,s,l,h=Se(t,0);for(let c=0;c<n-1;++c)l=h,h=Se(t,c+1),l&&h&&(U(e[c],0,De)?i[c]=i[c+1]=0:(r=i[c]/e[c],o=i[c+1]/e[c],s=Math.pow(r,2)+Math.pow(o,2),s<=9||(a=3/Math.sqrt(s),i[c]=r*a*e[c],i[c+1]=o*a*e[c])))}(t,r,o),function(t,e,i="x"){const n=Pe(i),r=t.length;let o,a,s,l=Se(t,0);for(let h=0;h<r;++h){if(a=s,s=l,l=Se(t,h+1),!s)continue;const r=s[i],c=s[n];a&&(o=(r-a[i])/3,s[`cp1${i}`]=r-o,s[`cp1${n}`]=c-o*e[h]),l&&(o=(l[i]-r)/3,s[`cp2${i}`]=r+o,s[`cp2${n}`]=c+o*e[h])}}(t,o,e)}(t,r);else{let i=n?t[t.length-1]:t[0];for(o=0,a=t.length;o<a;++o)s=t[o],l=ze(i,s,t[Math.min(o+1,a-(n?0:1))%a],e.tension),s.cp1x=l.previous.x,s.cp1y=l.previous.y,s.cp2x=l.next.x,s.cp2y=l.next.y,i=s}e.capBezierPoints&&function(t,e){let i,n,r,o,a,s=jt(t[0],e);for(i=0,n=t.length;i<n;++i)a=o,o=s,s=i<n-1&&jt(t[i+1],e),o&&(r=t[i],a&&(r.cp1x=Oe(r.cp1x,e.left,e.right),r.cp1y=Oe(r.cp1y,e.top,e.bottom)),s&&(r.cp2x=Oe(r.cp2x,e.left,e.right),r.cp2y=Oe(r.cp2y,e.top,e.bottom)))}(t,i)}function Ee(){return"undefined"!=typeof window&&"undefined"!=typeof document}function Le(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function Re(t,e,i){let n;return"string"==typeof t?(n=parseInt(t,10),-1!==t.indexOf("%")&&(n=n/100*e.parentNode[i])):n=t,n}const Fe=t=>window.getComputedStyle(t,null),Ie=["top","right","bottom","left"];function Ne(t,e,i){const n={};i=i?"-"+i:"";for(let r=0;r<4;r++){const o=Ie[r];n[o]=parseFloat(t[e+"-"+o+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function He(t,e){const{canvas:i,currentDevicePixelRatio:n}=e,r=Fe(i),o="border-box"===r.boxSizing,a=Ne(r,"padding"),s=Ne(r,"border","width"),{x:l,y:h,box:c}=function(t,e){const i=t.native||t,n=i.touches,r=n&&n.length?n[0]:i,{offsetX:o,offsetY:a}=r;let s,l,h=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(o,a,i.target))s=o,l=a;else{const t=e.getBoundingClientRect();s=r.clientX-t.left,l=r.clientY-t.top,h=!0}return{x:s,y:l,box:h}}(t,i),u=a.left+(c&&s.left),d=a.top+(c&&s.top);let{width:f,height:g}=e;return o&&(f-=a.width+s.width,g-=a.height+s.height),{x:Math.round((l-u)/f*i.width/n),y:Math.round((h-d)/g*i.height/n)}}const Be=t=>Math.round(10*t)/10;function We(t,e,i){const n=e||1,r=Math.floor(t.height*n),o=Math.floor(t.width*n);t.height=r/n,t.width=o/n;const a=t.canvas;return a.style&&(i||!a.style.height&&!a.style.width)&&(a.style.height=`${t.height}px`,a.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==n||a.height!==r||a.width!==o)&&(t.currentDevicePixelRatio=n,a.height=r,a.width=o,t.ctx.setTransform(n,0,0,n,0,0),!0)}const Ue=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function Ve(t,e){const i=function(t,e){return Fe(t).getPropertyValue(e)}(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function je(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function Ye(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function $e(t,e,i,n){const r={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},a=je(t,r,i),s=je(r,o,i),l=je(o,e,i),h=je(a,s,i),c=je(s,l,i);return je(h,c,i)}const qe=new Map;function Xe(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let n=qe.get(i);return n||(n=new Intl.NumberFormat(t,e),qe.set(i,n)),n}(e,i).format(t)}function Qe(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function Ge(t,e){let i,n;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}function Ke(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Ze(t){return"angle"===t?{between:G,compare:X,normalize:Q}:{between:(t,e,i)=>t>=Math.min(e,i)&&t<=Math.max(i,e),compare:(t,e)=>t-e,normalize:t=>t}}function Je({start:t,end:e,count:i,loop:n,style:r}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i==0,style:r}}function ti(t,e,i){if(!i)return[t];const{property:n,start:r,end:o}=i,a=e.length,{compare:s,between:l,normalize:h}=Ze(n),{start:c,end:u,loop:d,style:f}=function(t,e,i){const{property:n,start:r,end:o}=i,{between:a,normalize:s}=Ze(n),l=e.length;let h,c,{start:u,end:d,loop:f}=t;if(f){for(u+=l,d+=l,h=0,c=l;h<c&&a(s(e[u%l][n]),r,o);++h)u--,d--;u%=l,d%=l}return d<u&&(d+=l),{start:u,end:d,loop:f,style:t.style}}(t,e,i),g=[];let p,m,b,x=!1,y=null;for(let t=c,i=c;t<=u;++t)m=e[t%a],m.skip||(p=h(m[n]),p!==b&&(x=l(p,r,o),null===y&&(x||l(r,b,p)&&0!==s(r,b))&&(y=0===s(p,r)?t:i),null!==y&&(!x||0===s(o,p)||l(o,b,p))&&(g.push(Je({start:y,end:t,loop:d,count:a,style:f})),y=null),i=t,b=p));return null!==y&&g.push(Je({start:y,end:u,loop:d,count:a,style:f})),g}function ei(t,e){const i=[],n=t.segments;for(let r=0;r<n.length;r++){const o=ti(n[r],t.points,e);o.length&&i.push(...o)}return i}function ii(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function ni(t,e){return e&&JSON.stringify(t)!==JSON.stringify(e)}var ri=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,n){const r=e.listeners[n],o=e.duration;r.forEach((n=>n({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)})))}_refresh(){this._request||(this._running=!0,this._request=n.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let e=0;this._charts.forEach(((i,n)=>{if(!i.running||!i.items.length)return;const r=i.items;let o,a=r.length-1,s=!1;for(;a>=0;--a)o=r[a],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),s=!0):(r[a]=r[r.length-1],r.pop());s&&(n.draw(),this._notify(n,i,t,"progress")),r.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=r.length})),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce(((t,e)=>Math.max(t,e._duration)),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};const oi="transparent",ai={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const n=At(t||oi),r=n.valid&&At(e||oi);return r&&r.valid?r.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class si{constructor(t,e,i,n){const r=e[i];n=ae([t.to,n,r,t.from]);const o=ae([t.from,r,n]);this._active=!0,this._fn=t.fn||ai[t.type||typeof o],this._easing=et[t.easing]||et.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],r=i-this._start,o=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=ae([t.to,e,n,t.from]),this._from=ae([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,r=this._from,o=this._loop,a=this._to;let s;if(this._active=r!==a&&(o||e<i),!this._active)return this._target[n]=a,void this._notify(!0);e<0?this._target[n]=r:(s=e/i%2,s=o&&s>1?2-s:s,s=this._easing(Math.min(1,Math.max(0,s))),this._target[n]=this._fn(r,a,s))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,i)=>{t.push({res:e,rej:i})}))}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t<i.length;t++)i[t][e]()}}Nt.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const li=Object.keys(Nt.animation);Nt.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),Nt.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),Nt.describe("animations",{_fallback:"animation"}),Nt.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}});class hi{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!u(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach((i=>{const n=t[i];if(!u(n))return;const r={};for(const t of li)r[t]=n[t];(c(n.properties)&&n.properties||[i]).forEach((t=>{t!==i&&e.has(t)||e.set(t,r)}))}))}_animateOptions(t,e){const i=e.options,n=function(t,e){if(!e)return;let i=t.options;if(i)return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i;t.options=e}(t,i);if(!n)return[];const r=this._createAnimations(n,i);return i.$shared&&function(t,e){const i=[],n=Object.keys(e);for(let e=0;e<n.length;e++){const r=t[n[e]];r&&r.active()&&i.push(r.wait())}return Promise.all(i)}(t.options.$animations,i).then((()=>{t.options=i}),(()=>{})),r}_createAnimations(t,e){const i=this._properties,n=[],r=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let s;for(s=o.length-1;s>=0;--s){const l=o[s];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}const h=e[l];let c=r[l];const u=i.get(l);if(c){if(u&&c.active()){c.update(u,h,a);continue}c.cancel()}u&&u.duration?(r[l]=c=new si(u,t,l,h),n.push(c)):t[l]=h}return n}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(ri.add(this._chart,i),!0):void 0}}function ci(t,e){const i=t&&t.options||{},n=i.reverse,r=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:n?o:r,end:n?r:o}}function ui(t,e){const i=[],n=t._getSortedDatasetMetas(e);let r,o;for(r=0,o=n.length;r<o;++r)i.push(n[r].index);return i}function di(t,e,i,n={}){const r=t.keys,o="single"===n.mode;let a,s,l,h;if(null!==e){for(a=0,s=r.length;a<s;++a){if(l=+r[a],l===i){if(n.all)continue;break}h=t.values[l],d(h)&&(o||0===e||H(e)===H(h))&&(e+=h)}return e}}function fi(t,e){const i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function gi(t,e,i){const n=t[e]||(t[e]={});return n[i]||(n[i]={})}function pi(t,e,i,n){for(const r of e.getMatchingVisibleMetas(n).reverse()){const e=t[r.index];if(i&&e>0||!i&&e<0)return r.index}return null}function mi(t,e){const{chart:i,_cachedMeta:n}=t,r=i._stacks||(i._stacks={}),{iScale:o,vScale:a,index:s}=n,l=o.axis,h=a.axis,c=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(o,a,n),u=e.length;let d;for(let t=0;t<u;++t){const i=e[t],{[l]:o,[h]:u}=i;d=(i._stacks||(i._stacks={}))[h]=gi(r,c,o),d[s]=u,d._top=pi(d,a,!0,n.type),d._bottom=pi(d,a,!1,n.type)}}function bi(t,e){const i=t.scales;return Object.keys(i).filter((t=>i[t].axis===e)).shift()}function xi(t,e){const i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[n]||void 0===e[n][i])return;delete e[n][i]}}}const yi=t=>"reset"===t||"none"===t,vi=(t,e)=>e?t:Object.assign({},t);class wi{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=fi(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&xi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,r=e.xAxisID=g(i.xAxisID,bi(t,"x")),o=e.yAxisID=g(i.yAxisID,bi(t,"y")),a=e.rAxisID=g(i.rAxisID,bi(t,"r")),s=e.indexAxis,l=e.iAxisID=n(s,r,o,a),h=e.vAxisID=n(s,o,r,a);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&de(this._data,this),t._stacked&&xi(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(u(e))this._data=function(t){const e=Object.keys(t),i=new Array(e.length);let n,r,o;for(n=0,r=e.length;n<r;++n)o=e[n],i[n]={x:o,y:t[o]};return i}(e);else if(i!==e){if(i){de(i,this);const t=this._cachedMeta;xi(t),t._parsed=[]}e&&Object.isExtensible(e)&&(this,(n=e)._chartjs?n._chartjs.listeners.push(this):(Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[this]}}),ue.forEach((t=>{const e="_onData"+D(t),i=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...t){const r=i.apply(this,t);return n._chartjs.listeners.forEach((i=>{"function"==typeof i[e]&&i[e](...t)})),r}})})))),this._syncList=[],this._data=e}var n}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const r=e._stacked;e._stacked=fi(e.vScale,e),e.stack!==i.stack&&(n=!0,xi(e),e.stack=i.stack),this._resyncElements(t),(n||r!==e._stacked)&&mi(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:r,_stacked:o}=i,a=r.axis;let s,l,h,d=0===t&&e===n.length||i._sorted,f=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=n,i._sorted=!0,h=n;else{h=c(n[t])?this.parseArrayData(i,n,t,e):u(n[t])?this.parseObjectData(i,n,t,e):this.parsePrimitiveData(i,n,t,e);const r=()=>null===l[a]||f&&l[a]<f[a];for(s=0;s<e;++s)i._parsed[s+t]=l=h[s],d&&(r()&&(d=!1),f=l);i._sorted=d}o&&mi(this,h)}parsePrimitiveData(t,e,i,n){const{iScale:r,vScale:o}=t,a=r.axis,s=o.axis,l=r.getLabels(),h=r===o,c=new Array(n);let u,d,f;for(u=0,d=n;u<d;++u)f=u+i,c[u]={[a]:h||r.parse(l[f],f),[s]:o.parse(e[f],f)};return c}parseArrayData(t,e,i,n){const{xScale:r,yScale:o}=t,a=new Array(n);let s,l,h,c;for(s=0,l=n;s<l;++s)h=s+i,c=e[h],a[s]={x:r.parse(c[0],h),y:o.parse(c[1],h)};return a}parseObjectData(t,e,i,n){const{xScale:r,yScale:o}=t,{xAxisKey:a="x",yAxisKey:s="y"}=this._parsing,l=new Array(n);let h,c,u,d;for(h=0,c=n;h<c;++h)u=h+i,d=e[u],l[h]={x:r.parse(T(d,a),u),y:o.parse(T(d,s),u)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const n=this.chart,r=this._cachedMeta,o=e[t.axis];return di({keys:ui(n,!0),values:e._stacks[t.axis]},o,r.index,{mode:i})}updateRangeFromParsed(t,e,i,n){const r=i[e.axis];let o=null===r?NaN:r;const a=n&&i._stacks[e.axis];n&&a&&(n.values=a,o=di(n,r,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const i=this._cachedMeta,n=i._parsed,r=i._sorted&&t===i.iScale,o=n.length,a=this._getOtherScale(t),s=((t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:ui(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:c}=function(t){const{min:e,max:i,minDefined:n,maxDefined:r}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:r?i:Number.POSITIVE_INFINITY}}(a);let u,f;function g(){f=n[u];const e=f[a.axis];return!d(f[t.axis])||h>e||c<e}for(u=0;u<o&&(g()||(this.updateRangeFromParsed(l,t,f,s),!r));++u);if(r)for(u=o-1;u>=0;--u)if(!g()){this.updateRangeFromParsed(l,t,f,s);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,r,o;for(n=0,r=e.length;n<r;++n)o=e[n][t.axis],d(o)&&i.push(o);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,n=e.vScale,r=this.getParsed(t);return{label:i?""+i.getLabelForValue(r[i.axis]):"",value:n?""+n.getLabelForValue(r[n.axis]):""}}_update(t){const e=this._cachedMeta;this.configure(),this._cachedDataOpts={},this.update(t||"default"),e._clip=function(t){let e,i,n,r;return u(t)?(e=t.top,i=t.right,n=t.bottom,r=t.left):e=i=n=r=t,{top:e,right:i,bottom:n,left:r,disabled:!1===t}}(g(this.options.clip,function(t,e,i){if(!1===i)return!1;const n=ci(t,i),r=ci(e,i);return{top:r.end,right:n.end,bottom:r.start,left:n.start}}(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,n=i.data||[],r=e.chartArea,o=[],a=this._drawStart||0,s=this._drawCount||n.length-a;let l;for(i.dataset&&i.dataset.draw(t,r,a,s),l=a;l<a+s;++l){const e=n[l];e.hidden||(e.active?o.push(e):e.draw(t,r))}for(l=0;l<o.length;++l)o[l].draw(t,r)}getStyle(t,e){const i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const n=this.getDataset();let r;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];r=e.$context||(e.$context=function(t,e,i){return se(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}(this.getContext(),t,e)),r.parsed=this.getParsed(t),r.raw=n.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=function(t,e){return se(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),r.dataset=n,r.index=r.datasetIndex=this.index;return r.active=!!e,r.mode=i,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const n="active"===e,r=this._cachedDataOpts,o=t+"-"+e,a=r[o],s=this.enableOptionSharing&&S(i);if(a)return vi(a,s);const l=this.chart.config,h=l.datasetElementScopeKeys(this._type,t),c=n?[`${t}Hover`,"hover",t,""]:[t,""],u=l.getOptionScopes(this.getDataset(),h),d=Object.keys(Nt.elements[t]),f=l.resolveNamedOptions(u,d,(()=>this.getContext(i,n)),c);return f.$shared&&(f.$shared=s,r[o]=Object.freeze(vi(f,s))),f}_resolveAnimations(t,e,i){const n=this.chart,r=this._cachedDataOpts,o=`animation-${e}`,a=r[o];if(a)return a;let s;if(!1!==n.options.animation){const n=this.chart.config,r=n.datasetAnimationScopeKeys(this._type,e),o=n.getOptionScopes(this.getDataset(),r);s=n.createResolver(o,this.getContext(t,i,e))}const l=new hi(n,s&&s.animations);return s&&s._cacheable&&(r[o]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||yi(t)||this.chart._animationsDisabled}updateElement(t,e,i,n){yi(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!yi(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const r=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const n=i.length,r=e.length,o=Math.min(r,n);o&&this.parse(0,o),r>n?this._insertElements(n,r-n,t):r<n&&this._removeElements(r,n-r)}_insertElements(t,e,i=!0){const n=this._cachedMeta,r=n.data,o=t+e;let a;const s=t=>{for(t.length+=e,a=t.length-1;a>=o;a--)t[a]=t[a-e]};for(s(r),a=t;a<o;++a)r[a]=new this.dataElementType;this._parsing&&s(n._parsed),this.parse(t,e),i&&this.updateElements(r,t,e,"reset")}updateElements(t,e,i,n){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const n=i._parsed.splice(t,e);i._stacked&&xi(i,n)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,n]=t;this[e](i,n)}}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){this._sync(["_removeElements",t,e]),this._sync(["_insertElements",t,arguments.length-2])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function _i(t){const e=t.iScale,i=function(t,e){if(!t._cache.$bar){const i=t.getMatchingVisibleMetas(e);let n=[];for(let e=0,r=i.length;e<r;e++)n=n.concat(i[e].controller.getAllParsedValues(t));t._cache.$bar=fe(n.sort(((t,e)=>t-e)))}return t._cache.$bar}(e,t.type);let n,r,o,a,s=e._length;const l=()=>{32767!==o&&-32768!==o&&(S(a)&&(s=Math.min(s,Math.abs(o-a)||s)),a=o)};for(n=0,r=i.length;n<r;++n)o=e.getPixelForValue(i[n]),l();for(a=void 0,n=0,r=e.ticks.length;n<r;++n)o=e.getPixelForTick(n),l();return s}function Mi(t,e,i,n){return c(t)?function(t,e,i,n){const r=i.parse(t[0],n),o=i.parse(t[1],n),a=Math.min(r,o),s=Math.max(r,o);let l=a,h=s;Math.abs(a)>Math.abs(s)&&(l=s,h=a),e[i.axis]=h,e._custom={barStart:l,barEnd:h,start:r,end:o,min:a,max:s}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function ki(t,e,i,n){const r=t.iScale,o=t.vScale,a=r.getLabels(),s=r===o,l=[];let h,c,u,d;for(h=i,c=i+n;h<c;++h)d=e[h],u={},u[r.axis]=s||r.parse(a[h],h),l.push(Mi(d,u,o,h));return l}function Ci(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function Ti(t,e,i,n){let r=e.borderSkipped;const o={};if(!r)return void(t.borderSkipped=o);const{start:a,end:s,reverse:l,top:h,bottom:c}=function(t){let e,i,n,r,o;return t.horizontal?(e=t.base>t.x,i="left",n="right"):(e=t.base<t.y,i="bottom",n="top"),e?(r="end",o="start"):(r="start",o="end"),{start:i,end:n,reverse:e,top:r,bottom:o}}(t);"middle"===r&&i&&(t.enableBorderRadius=!0,(i._top||0)===n?r=h:(i._bottom||0)===n?r=c:(o[Di(c,a,s,l)]=!0,r=h)),o[Di(r,a,s,l)]=!0,t.borderSkipped=o}function Di(t,e,i,n){var r,o,a;return n?(a=i,t=Si(t=(r=t)===(o=e)?a:r===a?o:r,i,e)):t=Si(t,e,i),t}function Si(t,e,i){return"start"===t?e:"end"===t?i:t}function Pi(t,{inflateAmount:e},i){t.inflateAmount="auto"===e?1===i?.33:0:e}wi.defaults={},wi.prototype.datasetElementType=null,wi.prototype.dataElementType=null;class zi extends wi{parsePrimitiveData(t,e,i,n){return ki(t,e,i,n)}parseArrayData(t,e,i,n){return ki(t,e,i,n)}parseObjectData(t,e,i,n){const{iScale:r,vScale:o}=t,{xAxisKey:a="x",yAxisKey:s="y"}=this._parsing,l="x"===r.axis?a:s,h="x"===o.axis?a:s,c=[];let u,d,f,g;for(u=i,d=i+n;u<d;++u)g=e[u],f={},f[r.axis]=r.parse(T(g,l),u),c.push(Mi(T(g,h),f,o,u));return c}updateRangeFromParsed(t,e,i,n){super.updateRangeFromParsed(t,e,i,n);const r=i._custom;r&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:n}=e,r=this.getParsed(t),o=r._custom,a=Ci(o)?"["+o.start+", "+o.end+"]":""+n.getLabelForValue(r[n.axis]);return{label:""+i.getLabelForValue(r[i.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize(),this._cachedMeta.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,n){const r="reset"===n,{index:o,_cachedMeta:{vScale:a}}=this,s=a.getBasePixel(),l=a.isHorizontal(),c=this._getRuler(),u=this.resolveDataElementOptions(e,n),d=this.getSharedOptions(u),f=this.includeOptions(n,d);this.updateSharedOptions(d,n,u);for(let u=e;u<e+i;u++){const e=this.getParsed(u),i=r||h(e[a.axis])?{base:s,head:s}:this._calculateBarValuePixels(u),g=this._calculateBarIndexPixels(u,c),p=(e._stacks||{})[a.axis],m={horizontal:l,base:i.base,enableBorderRadius:!p||Ci(e._custom)||o===p._top||o===p._bottom,x:l?i.head:g.center,y:l?g.center:i.head,height:l?g.size:Math.abs(i.size),width:l?Math.abs(i.size):g.size};f&&(m.options=d||this.resolveDataElementOptions(u,t[u].active?"active":n));const b=m.options||t[u].options;Ti(m,b,p,o),Pi(m,b,c.ratio),this.updateElement(t[u],u,m,n)}}_getStacks(t,e){const i=this._cachedMeta.iScale,n=i.getMatchingVisibleMetas(this._type),r=i.options.stacked,o=n.length,a=[];let s,l;for(s=0;s<o;++s)if(l=n[s],l.controller.options.grouped){if(void 0!==e){const t=l.controller.getParsed(e)[l.controller._cachedMeta.vScale.axis];if(h(t)||isNaN(t))continue}if((!1===r||-1===a.indexOf(l.stack)||void 0===r&&void 0===l.stack)&&a.push(l.stack),l.index===t)break}return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const n=this._getStacks(t,i),r=void 0!==e?n.indexOf(e):-1;return-1===r?n.length-1:r}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,n=[];let r,o;for(r=0,o=e.data.length;r<o;++r)n.push(i.getPixelForValue(this.getParsed(r)[i.axis],r));const a=t.barThickness;return{min:a||_i(e),pixels:n,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i},options:{base:n,minBarLength:r}}=this,o=n||0,a=this.getParsed(t),s=a._custom,l=Ci(s);let c,u,d=a[e.axis],f=0,g=i?this.applyStack(e,a,i):d;g!==d&&(f=g-d,g=d),l&&(d=s.barStart,g=s.barEnd-s.barStart,0!==d&&H(d)!==H(s.barEnd)&&(f=0),f+=d);const p=h(n)||l?f:n;let m=e.getPixelForValue(p);if(c=this.chart.getDataVisibility(t)?e.getPixelForValue(f+g):m,u=c-m,Math.abs(u)<r&&(u=function(t,e,i){return 0!==t?H(t):(e.isHorizontal()?1:-1)*(e.min>=i?1:-1)}(u,e,o)*r,d===o&&(m-=u/2),c=m+u),m===e.getPixelForValue(o)){const t=H(u)*e.getLineWidthForValue(o)/2;m+=t,u-=t}return{size:u,base:m,head:c,center:c+u/2}}_calculateBarIndexPixels(t,e){const i=e.scale,n=this.options,r=n.skipNull,o=g(n.maxBarThickness,1/0);let a,s;if(e.grouped){const i=r?this._getStackCount(t):e.stackCount,l="flex"===n.barThickness?function(t,e,i,n){const r=e.pixels,o=r[t];let a=t>0?r[t-1]:null,s=t<r.length-1?r[t+1]:null;const l=i.categoryPercentage;null===a&&(a=o-(null===s?e.end-e.start:s-o)),null===s&&(s=o+o-a);const h=o-(o-Math.min(a,s))/2*l;return{chunk:Math.abs(s-a)/2*l/n,ratio:i.barPercentage,start:h}}(t,e,n,i):function(t,e,i,n){const r=i.barThickness;let o,a;return h(r)?(o=e.min*i.categoryPercentage,a=i.barPercentage):(o=r*n,a=1),{chunk:o/n,ratio:a,start:e.pixels[t]-o/2}}(t,e,n,i),c=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0);a=l.start+l.chunk*c+l.chunk/2,s=Math.min(o,l.chunk*l.ratio)}else a=i.getPixelForValue(this.getParsed(t)[i.axis],t),s=Math.min(o,e.min*e.ratio);return{base:a-s/2,head:a+s/2,center:a,size:s}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,n=i.length;let r=0;for(;r<n;++r)null!==this.getParsed(r)[e.axis]&&i[r].draw(this._ctx)}}zi.id="bar",zi.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}},zi.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class Oi extends wi{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,n){const r=super.parsePrimitiveData(t,e,i,n);for(let t=0;t<r.length;t++)r[t]._custom=this.resolveDataElementOptions(t+i).radius;return r}parseArrayData(t,e,i,n){const r=super.parseArrayData(t,e,i,n);for(let t=0;t<r.length;t++){const n=e[i+t];r[t]._custom=g(n[2],this.resolveDataElementOptions(t+i).radius)}return r}parseObjectData(t,e,i,n){const r=super.parseObjectData(t,e,i,n);for(let t=0;t<r.length;t++){const n=e[i+t];r[t]._custom=g(n&&n.r&&+n.r,this.resolveDataElementOptions(t+i).radius)}return r}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:i,yScale:n}=e,r=this.getParsed(t),o=i.getLabelForValue(r.x),a=n.getLabelForValue(r.y),s=r._custom;return{label:e.label,value:"("+o+", "+a+(s?", "+s:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){const r="reset"===n,{iScale:o,vScale:a}=this._cachedMeta,s=this.resolveDataElementOptions(e,n),l=this.getSharedOptions(s),h=this.includeOptions(n,l),c=o.axis,u=a.axis;for(let s=e;s<e+i;s++){const e=t[s],i=!r&&this.getParsed(s),l={},d=l[c]=r?o.getPixelForDecimal(.5):o.getPixelForValue(i[c]),f=l[u]=r?a.getBasePixel():a.getPixelForValue(i[u]);l.skip=isNaN(d)||isNaN(f),h&&(l.options=this.resolveDataElementOptions(s,e.active?"active":n),r&&(l.options.radius=0)),this.updateElement(e,s,l,n)}this.updateSharedOptions(l,n,s)}resolveDataElementOptions(t,e){const i=this.getParsed(t);let n=super.resolveDataElementOptions(t,e);n.$shared&&(n=Object.assign({},n,{$shared:!1}));const r=n.radius;return"active"!==e&&(n.radius=0),n.radius+=g(i&&i._custom,r),n}}Oi.id="bubble",Oi.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},Oi.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title:()=>""}}}};class Ai extends wi{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=i;else{let r,o,a=t=>+i[t];if(u(i[t])){const{key:t="value"}=this._parsing;a=e=>+T(i[e],t)}for(r=t,o=t+e;r<o;++r)n._parsed[r]=a(r)}}_getRotation(){return j(this.options.rotation-90)}_getCircumference(){return j(this.options.circumference)}_getRotationExtents(){let t=O,e=-O;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)){const n=this.chart.getDatasetMeta(i).controller,r=n._getRotation(),o=n._getCircumference();t=Math.min(t,r),e=Math.max(e,r+o)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,n=this._cachedMeta,r=n.data,o=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-o)/2,0),s=Math.min((h=a,"string"==typeof(l=this.options.cutout)&&l.endsWith("%")?parseFloat(l)/100:l/h),1);var l,h;const c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:g,offsetX:m,offsetY:b}=function(t,e,i){let n=1,r=1,o=0,a=0;if(e<O){const s=t,l=s+e,h=Math.cos(s),c=Math.sin(s),u=Math.cos(l),d=Math.sin(l),f=(t,e,n)=>G(t,s,l,!0)?1:Math.max(e,e*i,n,n*i),g=(t,e,n)=>G(t,s,l,!0)?-1:Math.min(e,e*i,n,n*i),p=f(0,h,u),m=f(R,c,d),b=g(z,h,u),x=g(z+R,c,d);n=(p-b)/2,r=(m-x)/2,o=-(p+b)/2,a=-(m+x)/2}return{ratioX:n,ratioY:r,offsetX:o,offsetY:a}}(d,u,s),x=(i.width-o)/f,y=(i.height-o)/g,v=Math.max(Math.min(x,y)/2,0),w=p(this.options.radius,v),_=(w-Math.max(w*s,0))/this._getVisibleDatasetWeightTotal();this.offsetX=m*w,this.offsetY=b*w,n.total=this.calculateTotal(),this.outerRadius=w-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*c,0),this.updateElements(r,0,r.length,t)}_circumference(t,e){const i=this.options,n=this._cachedMeta,r=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===n._parsed[t]||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*r/O)}updateElements(t,e,i,n){const r="reset"===n,o=this.chart,a=o.chartArea,s=o.options.animation,l=(a.left+a.right)/2,h=(a.top+a.bottom)/2,c=r&&s.animateScale,u=c?0:this.innerRadius,d=c?0:this.outerRadius,f=this.resolveDataElementOptions(e,n),g=this.getSharedOptions(f),p=this.includeOptions(n,g);let m,b=this._getRotation();for(m=0;m<e;++m)b+=this._circumference(m,r);for(m=e;m<e+i;++m){const e=this._circumference(m,r),i=t[m],o={x:l+this.offsetX,y:h+this.offsetY,startAngle:b,endAngle:b+e,circumference:e,outerRadius:d,innerRadius:u};p&&(o.options=g||this.resolveDataElementOptions(m,i.active?"active":n)),b+=e,this.updateElement(i,m,o,n)}this.updateSharedOptions(g,n,f)}calculateTotal(){const t=this._cachedMeta,e=t.data;let i,n=0;for(i=0;i<e.length;i++){const r=t._parsed[i];null===r||isNaN(r)||!this.chart.getDataVisibility(i)||e[i].hidden||(n+=Math.abs(r))}return n}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?O*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],r=Xe(e._parsed[t],i.options.locale);return{label:n[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const i=this.chart;let n,r,o,a,s;if(!t)for(n=0,r=i.data.datasets.length;n<r;++n)if(i.isDatasetVisible(n)){o=i.getDatasetMeta(n),t=o.data,a=o.controller,a!==this&&a.configure();break}if(!t)return 0;for(n=0,r=t.length;n<r;++n)s=a.resolveDataElementOptions(n),"inner"!==s.borderAlign&&(e=Math.max(e,s.borderWidth||0,s.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,n=t.length;i<n;++i){const t=this.resolveDataElementOptions(i);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(g(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Ai.id="doughnut",Ai.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"},Ai.descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t},Ai.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map(((e,n)=>{const r=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label;const i=": "+t.formattedValue;return c(e)?(e=e.slice(),e[0]+=i):e+=i,e}}}}};class Ei extends wi{initialize(){this.enableOptionSharing=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:n=[],_dataset:r}=e,o=this.chart._animationsDisabled;let{start:a,count:s}=function(t,e,i){const n=e.length;let r=0,o=n;if(t._sorted){const{iScale:a,_parsed:s}=t,l=a.axis,{min:h,max:c,minDefined:u,maxDefined:d}=a.getUserBounds();u&&(r=K(Math.min(he(s,a.axis,h).lo,i?n:he(e,l,a.getPixelForValue(h)).lo),0,n-1)),o=d?K(Math.max(he(s,a.axis,c).hi+1,i?0:he(e,l,a.getPixelForValue(c)).hi+1),r,n)-r:n-r}return{start:r,count:o}}(e,n,o);this._drawStart=a,this._drawCount=s,function(t){const{xScale:e,yScale:i,_scaleRanges:n}=t,r={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=r,!0;const o=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,r),o}(e)&&(a=0,s=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=n;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:l},t),this.updateElements(n,a,s,t)}updateElements(t,e,i,n){const r="reset"===n,{iScale:o,vScale:a,_stacked:s,_dataset:l}=this._cachedMeta,c=this.resolveDataElementOptions(e,n),u=this.getSharedOptions(c),d=this.includeOptions(n,u),f=o.axis,g=a.axis,{spanGaps:p,segment:m}=this.options,b=W(p)?p:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||r||"none"===n;let y=e>0&&this.getParsed(e-1);for(let c=e;c<e+i;++c){const e=t[c],i=this.getParsed(c),p=x?e:{},v=h(i[g]),w=p[f]=o.getPixelForValue(i[f],c),_=p[g]=r||v?a.getBasePixel():a.getPixelForValue(s?this.applyStack(a,i,s):i[g],c);p.skip=isNaN(w)||isNaN(_)||v,p.stop=c>0&&i[f]-y[f]>b,m&&(p.parsed=i,p.raw=l.data[c]),d&&(p.options=u||this.resolveDataElementOptions(c,e.active?"active":n)),x||this.updateElement(e,c,p,n),y=i}this.updateSharedOptions(u,n,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const r=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,r,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Ei.id="line",Ei.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},Ei.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Li extends wi{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],r=Xe(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:r}}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(n/2,0),o=(r-Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=r-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,i,n){const r="reset"===n,o=this.chart,a=this.getDataset(),s=o.options.animation,l=this._cachedMeta.rScale,h=l.xCenter,c=l.yCenter,u=l.getIndexAngle(0)-.5*z;let d,f=u;const g=360/this.countVisibleElements();for(d=0;d<e;++d)f+=this._computeAngle(d,n,g);for(d=e;d<e+i;d++){const e=t[d];let i=f,p=f+this._computeAngle(d,n,g),m=o.getDataVisibility(d)?l.getDistanceFromCenterForValue(a.data[d]):0;f=p,r&&(s.animateScale&&(m=0),s.animateRotate&&(i=p=u));const b={x:h,y:c,innerRadius:0,outerRadius:m,startAngle:i,endAngle:p,options:this.resolveDataElementOptions(d,e.active?"active":n)};this.updateElement(e,d,b,n)}}countVisibleElements(){const t=this.getDataset(),e=this._cachedMeta;let i=0;return e.data.forEach(((e,n)=>{!isNaN(t.data[n])&&this.chart.getDataVisibility(n)&&i++})),i}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?j(this.resolveDataElementOptions(t,e).angle||i):0}}Li.id="polarArea",Li.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},Li.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map(((e,n)=>{const r=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class Ri extends Ai{}Ri.id="pie",Ri.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Fi extends wi{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}update(t){const e=this._cachedMeta,i=e.dataset,n=e.data||[],r=e.iScale.getLabels();if(i.points=n,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const o={_loop:!0,_fullLoop:r.length===n.length,options:e};this.updateElement(i,void 0,o,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){const r=this.getDataset(),o=this._cachedMeta.rScale,a="reset"===n;for(let s=e;s<e+i;s++){const e=t[s],i=this.resolveDataElementOptions(s,e.active?"active":n),l=o.getPointPositionForValue(s,r.data[s]),h=a?o.xCenter:l.x,c=a?o.yCenter:l.y,u={x:h,y:c,angle:l.angle,skip:isNaN(h)||isNaN(c),options:i};this.updateElement(e,s,u,n)}}}Fi.id="radar",Fi.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}},Fi.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};class Ii extends Ei{}Ii.id="scatter",Ii.defaults={showLine:!1,fill:!1},Ii.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title:()=>"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var Ni=Object.freeze({__proto__:null,BarController:zi,BubbleController:Oi,DoughnutController:Ai,LineController:Ei,PolarAreaController:Li,PieController:Ri,RadarController:Fi,ScatterController:Ii});function Hi(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Bi{constructor(t){this.options=t||{}}formats(){return Hi()}parse(t,e){return Hi()}format(t,e){return Hi()}add(t,e,i){return Hi()}diff(t,e,i){return Hi()}startOf(t,e,i){return Hi()}endOf(t,e){return Hi()}}Bi.override=function(t){Object.assign(Bi.prototype,t)};var Wi={_date:Bi};function Ui(t,e){return"native"in t?{x:t.x,y:t.y}:He(t,e)}function Vi(t,e,i,n){const{controller:r,data:o,_sorted:a}=t,s=r._cachedMeta.iScale;if(s&&e===s.axis&&a&&o.length){const t=s._reversePixels?ce:he;if(!n)return t(o,e,i);if(r._sharedOptions){const n=o[0],r="function"==typeof n.getRange&&n.getRange(e);if(r){const n=t(o,e,i-r),a=t(o,e,i+r);return{lo:n.lo,hi:a.hi}}}}return{lo:0,hi:o.length-1}}function ji(t,e,i,n,r){const o=t.getSortedVisibleDatasetMetas(),a=i[e];for(let t=0,i=o.length;t<i;++t){const{index:i,data:s}=o[t],{lo:l,hi:h}=Vi(o[t],e,a,r);for(let t=l;t<=h;++t){const e=s[t];e.skip||n(e,i,t)}}}function Yi(t,e,i,n){const r=[];return jt(e,t.chartArea,t._minPadding)?(ji(t,i,e,(function(t,i,o){t.inRange(e.x,e.y,n)&&r.push({element:t,datasetIndex:i,index:o})}),!0),r):r}function $i(t,e,i,n,r){const o=function(t){const e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,n){const r=e?Math.abs(t.x-n.x):0,o=i?Math.abs(t.y-n.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(o,2))}}(i);let a=Number.POSITIVE_INFINITY,s=[];return jt(e,t.chartArea,t._minPadding)?(ji(t,i,e,(function(i,l,h){if(n&&!i.inRange(e.x,e.y,r))return;const c=i.getCenterPoint(r);if(!jt(c,t.chartArea,t._minPadding)&&!i.inRange(e.x,e.y,r))return;const u=o(e,c);u<a?(s=[{element:i,datasetIndex:l,index:h}],a=u):u===a&&s.push({element:i,datasetIndex:l,index:h})})),s):s}function qi(t,e,i,n){const r=Ui(e,t),o=[],a=i.axis,s="x"===a?"inXRange":"inYRange";let l=!1;return function(t,e){const i=t.getSortedVisibleDatasetMetas();let n,r,o;for(let t=0,a=i.length;t<a;++t){({index:n,data:r}=i[t]);for(let t=0,i=r.length;t<i;++t)o=r[t],o.skip||e(o,n,t)}}(t,((t,e,i)=>{t[s](r[a],n)&&o.push({element:t,datasetIndex:e,index:i}),t.inRange(r.x,r.y,n)&&(l=!0)})),i.intersect&&!l?[]:o}var Xi={modes:{index(t,e,i,n){const r=Ui(e,t),o=i.axis||"x",a=i.intersect?Yi(t,r,o,n):$i(t,r,o,!1,n),s=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=a[0].index,i=t.data[e];i&&!i.skip&&s.push({element:i,datasetIndex:t.index,index:e})})),s):[]},dataset(t,e,i,n){const r=Ui(e,t),o=i.axis||"xy";let a=i.intersect?Yi(t,r,o,n):$i(t,r,o,!1,n);if(a.length>0){const e=a[0].datasetIndex,i=t.getDatasetMeta(e).data;a=[];for(let t=0;t<i.length;++t)a.push({element:i[t],datasetIndex:e,index:t})}return a},point:(t,e,i,n)=>Yi(t,Ui(e,t),i.axis||"xy",n),nearest:(t,e,i,n)=>$i(t,Ui(e,t),i.axis||"xy",i.intersect,n),x:(t,e,i,n)=>(i.axis="x",qi(t,e,i,n)),y:(t,e,i,n)=>(i.axis="y",qi(t,e,i,n))}};const Qi=["left","top","right","bottom"];function Gi(t,e){return t.filter((t=>t.pos===e))}function Ki(t,e){return t.filter((t=>-1===Qi.indexOf(t.pos)&&t.box.axis===e))}function Zi(t,e){return t.sort(((t,i)=>{const n=e?i:t,r=e?t:i;return n.weight===r.weight?n.index-r.index:n.weight-r.weight}))}function Ji(t,e,i,n){return Math.max(t[i],e[i])+Math.max(t[n],e[n])}function tn(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function en(t,e,i,n){const{pos:r,box:o}=i,a=t.maxPadding;if(!u(r)){i.size&&(t[r]-=i.size);const e=n[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?o.height:o.width),i.size=e.size/e.count,t[r]+=i.size}o.getPadding&&tn(a,o.getPadding());const s=Math.max(0,e.outerWidth-Ji(a,t,"left","right")),l=Math.max(0,e.outerHeight-Ji(a,t,"top","bottom")),h=s!==t.w,c=l!==t.h;return t.w=s,t.h=l,i.horizontal?{same:h,other:c}:{same:c,other:h}}function nn(t,e){const i=e.maxPadding;return function(t){const n={left:0,top:0,right:0,bottom:0};return t.forEach((t=>{n[t]=Math.max(e[t],i[t])})),n}(t?["left","right"]:["top","bottom"])}function rn(t,e,i,n){const r=[];let o,a,s,l,h,c;for(o=0,a=t.length,h=0;o<a;++o){s=t[o],l=s.box,l.update(s.width||e.w,s.height||e.h,nn(s.horizontal,e));const{same:a,other:u}=en(e,i,s,n);h|=a&&r.length,c=c||u,l.fullSize||r.push(s)}return h&&rn(r,e,i,n)||c}function on(t,e,i,n,r){t.top=i,t.left=e,t.right=e+n,t.bottom=i+r,t.width=n,t.height=r}function an(t,e,i,n){const r=i.padding;let{x:o,y:a}=e;for(const s of t){const t=s.box,l=n[s.stack]||{count:1,placed:0,weight:1},h=s.stackWeight/l.weight||1;if(s.horizontal){const n=e.w*h,o=l.size||t.height;S(l.start)&&(a=l.start),t.fullSize?on(t,r.left,a,i.outerWidth-r.right-r.left,o):on(t,e.left+l.placed,a,n,o),l.start=a,l.placed+=n,a=t.bottom}else{const n=e.h*h,a=l.size||t.width;S(l.start)&&(o=l.start),t.fullSize?on(t,o,r.top,a,i.outerHeight-r.bottom-r.top):on(t,o,e.top+l.placed,a,n),l.start=o,l.placed+=n,o=t.right}}e.x=o,e.y=a}Nt.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var sn={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){const i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,n){if(!t)return;const r=re(t.options.layout.padding),o=Math.max(e-r.width,0),a=Math.max(i-r.height,0),s=function(t){const e=function(t){const e=[];let i,n,r,o,a,s;for(i=0,n=(t||[]).length;i<n;++i)r=t[i],({position:o,options:{stack:a,stackWeight:s=1}}=r),e.push({index:i,box:r,pos:o,horizontal:r.isHorizontal(),weight:r.weight,stack:a&&o+a,stackWeight:s});return e}(t),i=Zi(e.filter((t=>t.box.fullSize)),!0),n=Zi(Gi(e,"left"),!0),r=Zi(Gi(e,"right")),o=Zi(Gi(e,"top"),!0),a=Zi(Gi(e,"bottom")),s=Ki(e,"x"),l=Ki(e,"y");return{fullSize:i,leftAndTop:n.concat(o),rightAndBottom:r.concat(l).concat(a).concat(s),chartArea:Gi(e,"chartArea"),vertical:n.concat(r).concat(l),horizontal:o.concat(a).concat(s)}}(t.boxes),l=s.vertical,h=s.horizontal;b(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}));const c=l.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,u=Object.freeze({outerWidth:e,outerHeight:i,padding:r,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/c,hBoxMaxHeight:a/2}),d=Object.assign({},r);tn(d,re(n));const f=Object.assign({maxPadding:d,w:o,h:a,x:r.left,y:r.top},r),g=function(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:n,stackWeight:r}=i;if(!t||!Qi.includes(n))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=r}return e}(t),{vBoxMaxWidth:n,hBoxMaxHeight:r}=e;let o,a,s;for(o=0,a=t.length;o<a;++o){s=t[o];const{fullSize:a}=s.box,l=i[s.stack],h=l&&s.stackWeight/l.weight;s.horizontal?(s.width=h?h*n:a&&e.availableWidth,s.height=r):(s.width=n,s.height=h?h*r:a&&e.availableHeight)}return i}(l.concat(h),u);rn(s.fullSize,f,u,g),rn(l,f,u,g),rn(h,f,u,g)&&rn(l,f,u,g),function(t){const e=t.maxPadding;function i(i){const n=Math.max(e[i]-t[i],0);return t[i]+=n,n}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(f),an(s.leftAndTop,f,u,g),f.x+=f.w,f.y+=f.h,an(s.rightAndBottom,f,u,g),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},b(s.chartArea,(e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h)}))}};class ln{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class hn extends ln{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const cn={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},un=t=>null===t||""===t,dn=!!Ue&&{passive:!0};function fn(t,e,i){t.canvas.removeEventListener(e,i,dn)}function gn(t,e,i){const n=t.canvas,r=new MutationObserver((t=>{for(const e of t)for(const t of e.addedNodes)if(t===n||t.contains(n))return i()}));return r.observe(document,{childList:!0,subtree:!0}),r}function pn(t,e,i){const n=t.canvas,r=new MutationObserver((t=>{for(const e of t)for(const t of e.removedNodes)if(t===n||t.contains(n))return i()}));return r.observe(document,{childList:!0,subtree:!0}),r}const mn=new Map;let bn=0;function xn(){const t=window.devicePixelRatio;t!==bn&&(bn=t,mn.forEach(((e,i)=>{i.currentDevicePixelRatio!==t&&e()})))}function yn(t,e,i){const n=t.canvas,o=n&&Le(n);if(!o)return;const a=r(((t,e)=>{const n=o.clientWidth;i(t,e),n<o.clientWidth&&i()}),window),s=new ResizeObserver((t=>{const e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||a(i,n)}));return s.observe(o),function(t,e){mn.size||window.addEventListener("resize",xn),mn.set(t,e)}(t,a),s}function vn(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){mn.delete(t),mn.size||window.removeEventListener("resize",xn)}(t)}function wn(t,e,i){const n=t.canvas,o=r((e=>{null!==t.ctx&&i(function(t,e){const i=cn[t.type]||t.type,{x:n,y:r}=He(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==r?r:null}}(e,t))}),t,(t=>{const e=t[0];return[e,e.offsetX,e.offsetY]}));return function(t,e,i){t.addEventListener(e,i,dn)}(n,e,o),o}class _n extends ln{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,n=t.getAttribute("height"),r=t.getAttribute("width");if(t.$chartjs={initial:{height:n,width:r,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",un(r)){const e=Ve(t,"width");void 0!==e&&(t.width=e)}if(un(n))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Ve(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e.$chartjs)return!1;const i=e.$chartjs.initial;["height","width"].forEach((t=>{const n=i[t];h(n)?e.removeAttribute(t):e.setAttribute(t,n)}));const n=i.style||{};return Object.keys(n).forEach((t=>{e.style[t]=n[t]})),e.width=e.width,delete e.$chartjs,!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),r={attach:gn,detach:pn,resize:yn}[e]||wn;n[e]=r(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];n&&(({attach:vn,detach:vn,resize:vn}[e]||fn)(t,e,n),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return function(t,e,i,n){const r=Fe(t),o=Ne(r,"margin"),a=Re(r.maxWidth,t,"clientWidth")||E,s=Re(r.maxHeight,t,"clientHeight")||E,l=function(t,e,i){let n,r;if(void 0===e||void 0===i){const o=Le(t);if(o){const t=o.getBoundingClientRect(),a=Fe(o),s=Ne(a,"border","width"),l=Ne(a,"padding");e=t.width-l.width-s.width,i=t.height-l.height-s.height,n=Re(a.maxWidth,o,"clientWidth"),r=Re(a.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||E,maxHeight:r||E}}(t,e,i);let{width:h,height:c}=l;if("content-box"===r.boxSizing){const t=Ne(r,"border","width"),e=Ne(r,"padding");h-=e.width+t.width,c-=e.height+t.height}return h=Math.max(0,h-o.width),c=Math.max(0,n?Math.floor(h/n):c-o.height),h=Be(Math.min(h,a,l.maxWidth)),c=Be(Math.min(c,s,l.maxHeight)),h&&!c&&(c=Be(h/2)),{width:h,height:c}}(t,e,i,n)}isAttached(t){const e=Le(t);return!(!e||!e.isConnected)}}class Mn{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return W(this.x)&&W(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach((t=>{n[t]=i[t]&&i[t].active()?i[t]._to:this[t]})),n}}Mn.defaults={},Mn.defaultRoutes=void 0;const kn={values:t=>c(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const n=this.chart.options.locale;let r,o=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(r="scientific"),o=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}(t,i)}const a=N(Math.abs(o)),s=Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:r,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(l,this.options.ticks.format),Xe(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";const n=t/Math.pow(10,Math.floor(N(t)));return 1===n||2===n||5===n?kn.numeric.call(this,t,e,i):""}};var Cn={formatters:kn};function Tn(t,e,i,n,r){const o=g(n,0),a=Math.min(g(r,t.length),t.length);let s,l,h,c=0;for(i=Math.ceil(i),r&&(s=r-n,i=s/Math.floor(s/i)),h=o;h<0;)c++,h=Math.round(o+c*i);for(l=Math.max(o,0);l<a;l++)l===h&&(e.push(t[l]),c++,h=Math.round(o+c*i))}Nt.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth: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:Cn.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),Nt.route("scale.ticks","color","","color"),Nt.route("scale.grid","color","","borderColor"),Nt.route("scale.grid","borderColor","","borderColor"),Nt.route("scale.title","color","","color"),Nt.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),Nt.describe("scales",{_fallback:"scale"}),Nt.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const Dn=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function Sn(t,e){const i=[],n=t.length/e,r=t.length;let o=0;for(;o<r;o+=n)i.push(t[Math.floor(o)]);return i}function Pn(t,e,i){const n=t.ticks.length,r=Math.min(e,n-1),o=t._startPixel,a=t._endPixel,s=1e-6;let l,h=t.getPixelForTick(r);if(!(i&&(l=1===n?Math.max(h-o,a-h):0===e?(t.getPixelForTick(1)-h)/2:(h-t.getPixelForTick(r-1))/2,h+=r<e?l:-l,h<o-s||h>a+s)))return h}function zn(t){return t.drawTicks?t.tickLength:0}function On(t,e){if(!t.display)return 0;const i=oe(t.font,e),n=re(t.padding);return(c(t.text)?t.text.length:1)*i.lineHeight+n.height}function An(t,e,i){let n=o(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class En extends Mn{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=f(t,Number.POSITIVE_INFINITY),e=f(e,Number.NEGATIVE_INFINITY),i=f(i,Number.POSITIVE_INFINITY),n=f(n,Number.NEGATIVE_INFINITY),{min:f(t,i),max:f(e,n),minDefined:d(t),maxDefined:d(e)}}getMinMax(t){let e,{min:i,max:n,minDefined:r,maxDefined:o}=this.getUserBounds();if(r&&o)return{min:i,max:n};const a=this.getMatchingVisibleMetas();for(let s=0,l=a.length;s<l;++s)e=a[s].controller.getMinMax(this,t),r||(i=Math.min(i,e.min)),o||(n=Math.max(n,e.max));return i=o&&i>n?n:i,n=r&&i>n?i:n,{min:f(i,f(n,i)),max:f(n,f(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){m(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,i){const{min:n,max:r}=t,o=p(e,(r-n)/2),a=(t,e)=>i&&0===t?0:t+e;return{min:a(n,-Math.abs(o)),max:a(r,o)}}(this,r,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const s=a<this.ticks.length;this._convertTicksToLabels(s?Sn(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||"auto"===o.source)&&(this.ticks=function(t,e){const i=t.options.ticks,n=i.maxTicksLimit||function(t){const e=t.options.offset,i=t._tickSize(),n=t._length/i+(e?0:1),r=t._maxLength/i;return Math.floor(Math.min(n,r))}(t),r=i.major.enabled?function(t){const e=[];let i,n;for(i=0,n=t.length;i<n;i++)t[i].major&&e.push(i);return e}(e):[],o=r.length,a=r[0],s=r[o-1],l=[];if(o>n)return function(t,e,i,n){let r,o=0,a=i[0];for(n=Math.ceil(n),r=0;r<t.length;r++)r===a&&(e.push(t[r]),o++,a=i[o*n])}(e,l,r,o/n),l;const c=function(t,e,i){const n=function(t){const e=t.length;let i,n;if(e<2)return!1;for(n=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==n)return!1;return n}(t),r=e.length/i;if(!n)return Math.max(r,1);const o=function(t){const e=[],i=Math.sqrt(t);let n;for(n=1;n<i;n++)t%n==0&&(e.push(n),e.push(t/n));return i===(0|i)&&e.push(i),e.sort(((t,e)=>t-e)).pop(),e}(n);for(let t=0,e=o.length-1;t<e;t++){const e=o[t];if(e>r)return e}return Math.max(r,1)}(r,e,n);if(o>0){let t,i;const n=o>1?Math.round((s-a)/(o-1)):null;for(Tn(e,l,c,h(n)?0:a-n,a),t=0,i=o-1;t<i;t++)Tn(e,l,c,r[t],r[t+1]);return Tn(e,l,c,s,h(n)?e.length:s+n),l}return Tn(e,l,c),l}(this,this.ticks),this._labelSizes=null),s&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,i=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,i=!i),this._startPixel=t,this._endPixel=e,this._reversePixels=i,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){m(this.options.afterUpdate,[this])}beforeSetDimensions(){m(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(){m(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),m(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){m(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,n,r;for(i=0,n=t.length;i<n;i++)r=t[i],r.label=m(e.callback,[r.value,i,t],this)}afterTickToLabelConversion(){m(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){m(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=this.ticks.length,n=e.minRotation||0,r=e.maxRotation;let o,a,s,l=n;if(!this._isVisible()||!e.display||n>=r||i<=1||!this.isHorizontal())return void(this.labelRotation=n);const h=this._getLabelSizes(),c=h.widest.width,u=h.highest.height,d=K(this.chart.width-c,0,this.maxWidth);o=t.offset?this.maxWidth/i:d/(i-1),c+6>o&&(o=d/(i-(t.offset?.5:1)),a=this.maxHeight-zn(t.grid)-e.padding-On(t.title,this.chart.options.font),s=Math.sqrt(c*c+u*u),l=Y(Math.min(Math.asin(K((h.highest.height+6)/o,-1,1)),Math.asin(K(a/s,-1,1))-Math.asin(K(u/s,-1,1)))),l=Math.max(n,Math.min(r,l))),this.labelRotation=l}afterCalculateLabelRotation(){m(this.options.afterCalculateLabelRotation,[this])}beforeFit(){m(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const o=On(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=zn(r)+o):(t.height=this.maxHeight,t.width=zn(r)+o),i.display&&this.ticks.length){const{first:e,last:n,widest:r,highest:o}=this._getLabelSizes(),s=2*i.padding,l=j(this.labelRotation),h=Math.cos(l),c=Math.sin(l);if(a){const e=i.mirror?0:c*r.width+h*o.height;t.height=Math.min(this.maxHeight,t.height+e+s)}else{const e=i.mirror?0:h*r.width+c*o.height;t.width=Math.min(this.maxWidth,t.width+e+s)}this._calculatePadding(e,n,c,h)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){const{ticks:{align:r,padding:o},position:a}=this.options,s=0!==this.labelRotation,l="top"!==a&&"x"===this.axis;if(this.isHorizontal()){const a=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,u=0;s?l?(c=n*t.width,u=i*e.height):(c=i*t.height,u=n*e.width):"start"===r?u=e.width:"end"===r?c=t.width:(c=t.width/2,u=e.width/2),this.paddingLeft=Math.max((c-a+o)*this.width/(this.width-a),0),this.paddingRight=Math.max((u-h+o)*this.width/(this.width-h),0)}else{let i=e.height/2,n=t.height/2;"start"===r?(i=0,n=t.height):"end"===r&&(i=e.height,n=0),this.paddingTop=i+o,this.paddingBottom=n+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){m(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e<i;e++)h(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=Sn(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length)}return t}_computeLabelSizes(t,e){const{ctx:i,_longestTextCache:n}=this,r=[],o=[];let a,s,l,u,d,f,g,p,m,x,y,v=0,w=0;for(a=0;a<e;++a){if(u=t[a].label,d=this._resolveTickFontOptions(a),i.font=f=d.string,g=n[f]=n[f]||{data:{},gc:[]},p=d.lineHeight,m=x=0,h(u)||c(u)){if(c(u))for(s=0,l=u.length;s<l;++s)y=u[s],h(y)||c(y)||(m=Ht(i,g.data,g.gc,m,y),x+=p)}else m=Ht(i,g.data,g.gc,m,u),x=p;r.push(m),o.push(x),v=Math.max(m,v),w=Math.max(x,w)}!function(t,e){b(t,(t=>{const i=t.gc,n=i.length/2;let r;if(n>e){for(r=0;r<n;++r)delete t.data[i[r]];i.splice(0,n)}}))}(n,e);const _=r.indexOf(v),M=o.indexOf(w),k=t=>({width:r[t]||0,height:o[t]||0});return{first:k(0),last:k(e-1),widest:k(_),highest:k(M),widths:r,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return K(this._alignToPixels?Wt(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=function(t,e,i){return se(t,{tick:i,index:e,type:"tick"})}(this.getContext(),t,i))}return this.$context||(this.$context=se(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){const t=this.options.ticks,e=j(this.labelRotation),i=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),r=this._getLabelSizes(),o=t.autoSkipPadding||0,a=r?r.widest.width+o:0,s=r?r.highest.height+o:0;return this.isHorizontal()?s*i>a*n?a/i:s/n:s*n<a*i?s/i:a/n}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:r,position:o}=n,a=r.offset,s=this.isHorizontal(),l=this.ticks.length+(a?1:0),h=zn(r),c=[],d=r.setContext(this.getContext()),f=d.drawBorder?d.borderWidth:0,p=f/2,m=function(t){return Wt(i,t,f)};let b,x,y,v,w,_,M,k,C,T,D,S;if("top"===o)b=m(this.bottom),_=this.bottom-h,k=b-p,T=m(t.top)+p,S=t.bottom;else if("bottom"===o)b=m(this.top),T=t.top,S=m(t.bottom)-p,_=b+p,k=this.top+h;else if("left"===o)b=m(this.right),w=this.right-h,M=b-p,C=m(t.left)+p,D=t.right;else if("right"===o)b=m(this.left),C=t.left,D=m(t.right)-p,w=b+p,M=this.left+h;else if("x"===e){if("center"===o)b=m((t.top+t.bottom)/2+.5);else if(u(o)){const t=Object.keys(o)[0],e=o[t];b=m(this.chart.scales[t].getPixelForValue(e))}T=t.top,S=t.bottom,_=b+p,k=_+h}else if("y"===e){if("center"===o)b=m((t.left+t.right)/2);else if(u(o)){const t=Object.keys(o)[0],e=o[t];b=m(this.chart.scales[t].getPixelForValue(e))}w=b-p,M=w-h,C=t.left,D=t.right}const P=g(n.ticks.maxTicksLimit,l),z=Math.max(1,Math.ceil(l/P));for(x=0;x<l;x+=z){const t=r.setContext(this.getContext(x)),e=t.lineWidth,n=t.color,o=r.borderDash||[],l=t.borderDashOffset,h=t.tickWidth,u=t.tickColor,d=t.tickBorderDash||[],f=t.tickBorderDashOffset;y=Pn(this,x,a),void 0!==y&&(v=Wt(i,y,e),s?w=M=C=D=v:_=k=T=S=v,c.push({tx1:w,ty1:_,tx2:M,ty2:k,x1:C,y1:T,x2:D,y2:S,width:e,color:n,borderDash:o,borderDashOffset:l,tickWidth:h,tickColor:u,tickBorderDash:d,tickBorderDashOffset:f}))}return this._ticksLength=l,this._borderValue=b,c}_computeLabelItems(t){const e=this.axis,i=this.options,{position:n,ticks:r}=i,o=this.isHorizontal(),a=this.ticks,{align:s,crossAlign:l,padding:h,mirror:d}=r,f=zn(i.grid),g=f+h,p=d?-h:g,m=-j(this.labelRotation),b=[];let x,y,v,w,_,M,k,C,T,D,S,P,z="middle";if("top"===n)M=this.bottom-p,k=this._getXAxisLabelAlignment();else if("bottom"===n)M=this.top+p,k=this._getXAxisLabelAlignment();else if("left"===n){const t=this._getYAxisLabelAlignment(f);k=t.textAlign,_=t.x}else if("right"===n){const t=this._getYAxisLabelAlignment(f);k=t.textAlign,_=t.x}else if("x"===e){if("center"===n)M=(t.top+t.bottom)/2+g;else if(u(n)){const t=Object.keys(n)[0],e=n[t];M=this.chart.scales[t].getPixelForValue(e)+g}k=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===n)_=(t.left+t.right)/2-g;else if(u(n)){const t=Object.keys(n)[0],e=n[t];_=this.chart.scales[t].getPixelForValue(e)}k=this._getYAxisLabelAlignment(f).textAlign}"y"===e&&("start"===s?z="top":"end"===s&&(z="bottom"));const O=this._getLabelSizes();for(x=0,y=a.length;x<y;++x){v=a[x],w=v.label;const t=r.setContext(this.getContext(x));C=this.getPixelForTick(x)+r.labelOffset,T=this._resolveTickFontOptions(x),D=T.lineHeight,S=c(w)?w.length:1;const e=S/2,i=t.color,s=t.textStrokeColor,h=t.textStrokeWidth;let u;if(o?(_=C,P="top"===n?"near"===l||0!==m?-S*D+D/2:"center"===l?-O.highest.height/2-e*D+D:-O.highest.height+D/2:"near"===l||0!==m?D/2:"center"===l?O.highest.height/2-e*D:O.highest.height-S*D,d&&(P*=-1)):(M=C,P=(1-S)*D/2),t.showLabelBackdrop){const e=re(t.backdropPadding),i=O.heights[x],n=O.widths[x];let r=M+P-e.top,o=_-e.left;switch(z){case"middle":r-=i/2;break;case"bottom":r-=i}switch(k){case"center":o-=n/2;break;case"right":o-=n}u={left:o,top:r,width:n+e.width,height:i+e.height,color:t.backdropColor}}b.push({rotation:m,label:w,font:T,color:i,strokeColor:s,strokeWidth:h,textOffset:P,textAlign:k,textBaseline:z,translation:[_,M],backdrop:u})}return b}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-j(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align&&(i="right"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:n,padding:r}}=this.options,o=t+r,a=this._getLabelSizes().widest.width;let s,l;return"left"===e?n?(l=this.right+r,"near"===i?s="left":"center"===i?(s="center",l+=a/2):(s="right",l+=a)):(l=this.right-o,"near"===i?s="right":"center"===i?(s="center",l-=a/2):(s="left",l=this.left)):"right"===e?n?(l=this.left+r,"near"===i?s="right":"center"===i?(s="center",l-=a/2):(s="left",l-=a)):(l=this.left+o,"near"===i?s="left":"center"===i?(s="center",l+=a/2):(s="right",l=this.right)):s="right",{textAlign:s,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:n,width:r,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,n,r,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex((e=>e.value===t));return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,o;const a=(t,e,n)=>{n.width&&n.color&&(i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.setLineDash(n.borderDash||[]),i.lineDashOffset=n.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(r=0,o=n.length;r<o;++r){const t=n[r];e.drawOnChartArea&&a({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.drawTicks&&a({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{grid:i}}=this,n=i.setContext(this.getContext()),r=i.drawBorder?n.borderWidth:0;if(!r)return;const o=i.setContext(this.getContext(0)).lineWidth,a=this._borderValue;let s,l,h,c;this.isHorizontal()?(s=Wt(t,this.left,r)-r/2,l=Wt(t,this.right,o)+o/2,h=c=a):(h=Wt(t,this.top,r)-r/2,c=Wt(t,this.bottom,o)+o/2,s=l=a),e.save(),e.lineWidth=n.borderWidth,e.strokeStyle=n.borderColor,e.beginPath(),e.moveTo(s,h),e.lineTo(l,c),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const e=this.ctx,i=this._computeLabelArea();i&&Yt(e,i);const n=this._labelItems||(this._labelItems=this._computeLabelItems(t));let r,o;for(r=0,o=n.length;r<o;++r){const t=n[r],i=t.font,o=t.label;t.backdrop&&(e.fillStyle=t.backdrop.color,e.fillRect(t.backdrop.left,t.backdrop.top,t.backdrop.width,t.backdrop.height)),Qt(e,o,0,t.textOffset,i,t)}i&&$t(e)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:n}}=this;if(!i.display)return;const r=oe(i.font),o=re(i.padding),s=i.align;let l=r.lineHeight/2;"bottom"===e||"center"===e||u(e)?(l+=o.bottom,c(i.text)&&(l+=r.lineHeight*(i.text.length-1))):l+=o.top;const{titleX:h,titleY:d,maxWidth:f,rotation:g}=function(t,e,i,n){const{top:r,left:o,bottom:s,right:l,chart:h}=t,{chartArea:c,scales:d}=h;let f,g,p,m=0;const b=s-r,x=l-o;if(t.isHorizontal()){if(g=a(n,o,l),u(i)){const t=Object.keys(i)[0],n=i[t];p=d[t].getPixelForValue(n)+b-e}else p="center"===i?(c.bottom+c.top)/2+b-e:Dn(t,i,e);f=l-o}else{if(u(i)){const t=Object.keys(i)[0],n=i[t];g=d[t].getPixelForValue(n)-x+e}else g="center"===i?(c.left+c.right)/2-x+e:Dn(t,i,e);p=a(n,s,r),m="left"===i?-R:R}return{titleX:g,titleY:p,maxWidth:f,rotation:m}}(this,l,e,s);Qt(t,i.text,0,0,r,{color:i.color,maxWidth:f,rotation:g,textAlign:An(s,e,n),textBaseline:"middle",translation:[h,d]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=g(t.grid&&t.grid.z,-1);return this._isVisible()&&this.draw===En.prototype.draw?[{z:i,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let r,o;for(r=0,o=e.length;r<o;++r){const o=e[r];o[i]!==this.id||t&&o.type!==t||n.push(o)}return n}_resolveTickFontOptions(t){return oe(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ln{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;(function(t){return"id"in t&&"defaults"in t})(e)&&(i=this.register(e));const n=this.items,r=t.id,o=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in n||(n[r]=t,function(t,e,i){const n=_(Object.create(null),[i?Nt.get(i):{},Nt.get(e),t.defaults]);Nt.set(e,n),t.defaultRoutes&&function(t,e){Object.keys(e).forEach((i=>{const n=i.split("."),r=n.pop(),o=[t].concat(n).join("."),a=e[i].split("."),s=a.pop(),l=a.join(".");Nt.route(o,r,l,s)}))}(e,t.defaultRoutes),t.descriptors&&Nt.describe(e,t.descriptors)}(t,o,i),this.override&&Nt.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in Nt[n]&&(delete Nt[n][i],this.override&&delete Lt[i])}}var Rn=new class{constructor(){this.controllers=new Ln(wi,"datasets",!0),this.elements=new Ln(Mn,"elements"),this.plugins=new Ln(Object,"plugins"),this.scales=new Ln(En,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach((e=>{const n=i||this._getRegistryForType(e);i||n.isForType(e)||n===this.plugins&&e.id?this._exec(t,n,e):b(e,(e=>{const n=i||this._getRegistryForType(e);this._exec(t,n,e)}))}))}_exec(t,e,i){const n=D(t);m(i["before"+n],[],i),e[t](i),m(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const n=e.get(t);if(void 0===n)throw new Error('"'+t+'" is not a registered '+i+".");return n}};class Fn{constructor(){this._init=[]}notify(t,e,i,n){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const r=n?this._descriptors(t).filter(n):this._descriptors(t),o=this._notify(r,t,e,i);return"destroy"===e&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,i,n){n=n||{};for(const r of t){const t=r.plugin;if(!1===m(t[i],[e,n,r.options],t)&&n.cancelable)return!1}return!0}invalidate(){h(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,n=g(i.options&&i.options.plugins,{}),r=function(t){const e=[],i=Object.keys(Rn.plugins.items);for(let t=0;t<i.length;t++)e.push(Rn.getPlugin(i[t]));const n=t.plugins||[];for(let t=0;t<n.length;t++){const i=n[t];-1===e.indexOf(i)&&e.push(i)}return e}(i);return!1!==n||e?function(t,e,i,n){const r=[],o=t.getContext();for(let a=0;a<e.length;a++){const s=e[a],l=In(i[s.id],n);null!==l&&r.push({plugin:s,options:Nn(t.config,s,l,o)})}return r}(t,r,n,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,n=(t,e)=>t.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function In(t,e){return e||!1!==t?!0===t?{}:t:null}function Nn(t,e,i,n){const r=t.pluginScopeKeys(e),o=t.getOptionScopes(i,r);return t.createResolver(o,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Hn(t,e){const i=Nt.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Bn(t,e){return"x"===t||"y"===t?t:e.axis||("top"===(i=e.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.charAt(0).toLowerCase();var i}function Wn(t){const e=t.options||(t.options={});e.plugins=g(e.plugins,{}),e.scales=function(t,e){const i=Lt[t.type]||{scales:{}},n=e.scales||{},r=Hn(t.type,e),o=Object.create(null),a=Object.create(null);return Object.keys(n).forEach((t=>{const e=n[t];if(!u(e))return console.error(`Invalid scale configuration for scale: ${t}`);if(e._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);const s=Bn(t,e),l=function(t,e){return t===e?"_index_":"_value_"}(s,r),h=i.scales||{};o[s]=o[s]||t,a[t]=M(Object.create(null),[{axis:s},e,h[s],h[l]])})),t.data.datasets.forEach((i=>{const r=i.type||t.type,s=i.indexAxis||Hn(r,e),l=(Lt[r]||{}).scales||{};Object.keys(l).forEach((t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,s),r=i[e+"AxisID"]||o[e]||e;a[r]=a[r]||Object.create(null),M(a[r],[{axis:e},n[r],l[t]])}))})),Object.keys(a).forEach((t=>{const e=a[t];M(e,[Nt.scales[e.type],Nt.scale])})),a}(t,e)}function Un(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Vn=new Map,jn=new Set;function Yn(t,e){let i=Vn.get(t);return i||(i=e(),Vn.set(t,i),jn.add(i)),i}const $n=(t,e,i)=>{const n=T(e,i);void 0!==n&&t.add(n)};class qn{constructor(t){this._config=function(t){return(t=t||{}).data=Un(t.data),Wn(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Un(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Wn(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Yn(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return Yn(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return Yn(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return Yn(`${this.type}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return n&&!e||(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:r}=this,o=this._cachedScopes(t,i),a=o.get(e);if(a)return a;const s=new Set;e.forEach((e=>{t&&(s.add(t),e.forEach((e=>$n(s,t,e)))),e.forEach((t=>$n(s,n,t))),e.forEach((t=>$n(s,Lt[r]||{},t))),e.forEach((t=>$n(s,Nt,t))),e.forEach((t=>$n(s,Rt,t)))}));const l=Array.from(s);return 0===l.length&&l.push(Object.create(null)),jn.has(e)&&o.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,Lt[e]||{},Nt.datasets[e]||{},{type:e},Nt,Rt]}resolveNamedOptions(t,e,i,n=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=Xn(this._resolverCache,t,n);let s=o;(function(t,e){const{isScriptable:i,isIndexable:n}=me(t);for(const r of e){const e=i(r),o=n(r),a=(o||e)&&t[r];if(e&&(P(a)||Qn(a))||o&&c(a))return!0}return!1})(o,e)&&(r.$shared=!1,s=pe(o,i=P(i)?i():i,this.createResolver(t,i,a)));for(const t of e)r[t]=s[t];return r}createResolver(t,e,i=[""],n){const{resolver:r}=Xn(this._resolverCache,t,i);return u(e)?pe(r,e,void 0,n):r}}function Xn(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));const r=i.join();let o=n.get(r);return o||(o={resolver:ge(e,i),subPrefixes:i.filter((t=>!t.toLowerCase().includes("hover")))},n.set(r,o)),o}const Qn=t=>u(t)&&Object.getOwnPropertyNames(t).reduce(((e,i)=>e||P(t[i])),!1),Gn=["top","bottom","left","right","chartArea"];function Kn(t,e){return"top"===t||"bottom"===t||-1===Gn.indexOf(t)&&"x"===e}function Zn(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function Jn(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),m(i&&i.onComplete,[t],e)}function tr(t){const e=t.chart,i=e.options.animation;m(i&&i.onProgress,[t],e)}function er(t){return Ee()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const ir={},nr=t=>{const e=er(t);return Object.values(ir).filter((t=>t.canvas===e)).pop()};class rr{constructor(t,e){const i=this.config=new qn(e),n=er(t),r=nr(n);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!Ee()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?hn:_n}(n)),this.platform.updateConfig(i);const a=this.platform.acquireContext(n,o.aspectRatio),s=a&&a.canvas,h=s&&s.height,c=s&&s.width;this.id=l(),this.ctx=a,this.canvas=s,this.width=c,this.height=h,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 Fn,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...n){return e?(clearTimeout(i),i=setTimeout(t,e,n)):t.apply(this,n),e}}((t=>this.update(t)),o.resizeDelay||0),ir[this.id]=this,a&&s?(ri.listen(this,"complete",Jn),ri.listen(this,"progress",tr),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:r}=this;return h(t)?e&&r?r:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():We(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Ut(this.canvas,this.ctx),this}stop(){return ri.stop(this),this}resize(t,e){ri.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(n,t,e,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,We(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),m(i.onResize,[this,o],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){b(this.options.scales||{},((t,e)=>{t.id=e}))}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce(((t,e)=>(t[e]=!1,t)),{});let r=[];e&&(r=r.concat(Object.keys(e).map((t=>{const i=e[t],n=Bn(t,i),r="r"===n,o="x"===n;return{options:i,dposition:r?"chartArea":o?"bottom":"left",dtype:r?"radialLinear":o?"category":"linear"}})))),b(r,(e=>{const r=e.options,o=r.id,a=Bn(o,r),s=g(r.type,e.dtype);void 0!==r.position&&Kn(r.position,a)===Kn(e.dposition)||(r.position=e.dposition),n[o]=!0;let l=null;o in i&&i[o].type===s?l=i[o]:(l=new(Rn.getScale(s))({id:o,type:s,ctx:this.ctx,chart:this}),i[l.id]=l),l.init(r,t)})),b(n,((t,e)=>{t||delete i[e]})),b(i,(t=>{sn.configure(this,t,t.options),sn.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort(((t,e)=>t.index-e.index)),i>e){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Zn("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach(((t,i)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(i)}))}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i<n;i++){const n=e[i];let r=this.getDatasetMeta(i);const o=n.type||this.config.type;if(r.type&&r.type!==o&&(this._destroyDatasetMeta(i),r=this.getDatasetMeta(i)),r.type=o,r.indexAxis=n.indexAxis||Hn(o,this.options),r.order=n.order||0,r.index=i,r.label=""+n.label,r.visible=this.isDatasetVisible(i),r.controller)r.controller.updateIndex(i),r.controller.linkScales();else{const e=Rn.getController(o),{datasetElementType:n,dataElementType:a}=Nt.datasets[o];Object.assign(e.prototype,{dataElementType:Rn.getElement(a),datasetElementType:n&&Rn.getElement(n)}),r.controller=new e(this,i),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){b(this.data.datasets,((t,e)=>{this.getDatasetMeta(e).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext());b(this.scales,(t=>{sn.removeBox(this,t)}));const n=this._animationsDisabled=!i.animation;if(this.ensureScalesHaveIDs(),this.buildOrUpdateScales(),((t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0})(new Set(Object.keys(this._listeners)),new Set(i.events))&&!!this._responsiveListeners===i.responsive||(this.unbindEvents(),this.bindEvents()),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,e=this.data.datasets.length;t<e;t++){const{controller:e}=this.getDatasetMeta(t),i=!n&&-1===r.indexOf(e);e.buildOrUpdateElements(i),o=Math.max(+e.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),n||b(r,(t=>{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Zn("z","_idx")),this._lastEvent&&this._eventHandler(this._lastEvent,!0),this.render()}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;sn.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],b(this.boxes,(t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,e)=>{t._idx=e})),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,P(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),n={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",n)&&(i.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(ri.has(this)?this.attached&&!ri.running(this)&&ri.start(this):(this.draw(),Jn({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resize(t,e),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let n,r;for(n=0,r=e.length;n<r;++n){const r=e[n];t&&!r.visible||i.push(r)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,n=!i.disabled,r=this.chartArea,o={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",o)&&(n&&Yt(e,{left:!1===i.left?0:r.left-i.left,right:!1===i.right?this.width:r.right+i.right,top:!1===i.top?0:r.top-i.top,bottom:!1===i.bottom?this.height:r.bottom+i.bottom}),t.controller.draw(),n&&$t(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}getElementsAtEventForMode(t,e,i,n){const r=Xi.modes[e];return"function"==typeof r?r(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter((t=>t&&t._dataset===e)).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=se(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,n);S(e)?(r.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(r,{visible:i}),this.update((e=>e.datasetIndex===t?n:void 0)))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),ri.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Ut(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete ir[this.id]}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};b(this.options.events,(t=>i(t,n)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(i,n)=>{t[i]&&(e.removeEventListener(this,i,n),delete t[i])},r=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const a=()=>{n("attach",a),this.attached=!0,this.resize(),i("resize",r),i("detach",o)};o=()=>{this.attached=!1,n("resize",r),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){b(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._listeners={},b(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let r,o,a,s;for("dataset"===e&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+n+"DatasetHoverStyle"]()),a=0,s=t.length;a<s;++a){o=t[a];const e=o&&this.getDatasetMeta(o.datasetIndex).controller;e&&e[n+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map((({datasetIndex:t,index:e})=>{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}));!x(i,e)&&(this._active=i,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){const n=this.options.hover,r=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),o=r(e,t),a=i?t:r(t,e);o.length&&this.updateHoverStyle(o,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0},n=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,n))return;const r=this._handleEvent(t,e);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(r||i.changed)&&this.render(),this}_handleEvent(t,e){const{_active:i=[],options:n}=this,r=n.hover,o=e;let a=[],s=!1,l=null;return"mouseout"!==t.type&&(a=this.getElementsAtEventForMode(t,r.mode,r,o),l="click"===t.type?this._lastEvent:t),this._lastEvent=null,jt(t,this.chartArea,this._minPadding)&&(m(n.onHover,[t,a,this],this),"mouseup"!==t.type&&"click"!==t.type&&"contextmenu"!==t.type||m(n.onClick,[t,a,this],this)),s=!x(a,i),(s||e)&&(this._active=a,this._updateHoverStyles(a,i,e)),this._lastEvent=l,s}}const or=()=>b(rr.instances,(t=>t._plugins.invalidate())),ar=!0;function sr(t,e,i){const{startAngle:n,pixelMargin:r,x:o,y:a,outerRadius:s,innerRadius:l}=e;let h=r/s;t.beginPath(),t.arc(o,a,s,n-h,i+h),l>r?(h=r/l,t.arc(o,a,l,i+h,n-h,!0)):t.arc(o,a,r,i+R,n-R),t.closePath(),t.clip()}function lr(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function hr(t,e,i,n,r){const{x:o,y:a,startAngle:s,pixelMargin:l,innerRadius:h}=e,c=Math.max(e.outerRadius+n+i-l,0),u=h>0?h+n+i+l:0;let d=0;const f=r-s;if(n){const t=((h>0?h-n:0)+(c>0?c-n:0))/2;d=(f-(0!==t?f*t/(t+n):f))/2}const g=(f-Math.max(.001,f*c-i/z)/c)/2,p=s+g+d,m=r-g-d,{outerStart:b,outerEnd:x,innerStart:y,innerEnd:v}=function(t,e,i,n){const r=ee(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),o=(i-e)/2,a=Math.min(o,n*e/2),s=t=>{const e=(i-Math.min(o,t))*n/2;return K(t,0,Math.min(o,e))};return{outerStart:s(r.outerStart),outerEnd:s(r.outerEnd),innerStart:K(r.innerStart,0,a),innerEnd:K(r.innerEnd,0,a)}}(e,u,c,m-p),w=c-b,_=c-x,M=p+b/w,k=m-x/_,C=u+y,T=u+v,D=p+y/C,S=m-v/T;if(t.beginPath(),t.arc(o,a,c,M,k),x>0){const e=lr(_,k,o,a);t.arc(e.x,e.y,x,k,m+R)}const P=lr(T,m,o,a);if(t.lineTo(P.x,P.y),v>0){const e=lr(T,S,o,a);t.arc(e.x,e.y,v,m+R,S+Math.PI)}if(t.arc(o,a,u,m-v/u,p+y/u,!0),y>0){const e=lr(C,D,o,a);t.arc(e.x,e.y,y,D+Math.PI,p-R)}const O=lr(w,p,o,a);if(t.lineTo(O.x,O.y),b>0){const e=lr(w,M,o,a);t.arc(e.x,e.y,b,p-R,M)}t.closePath()}Object.defineProperties(rr,{defaults:{enumerable:ar,value:Nt},instances:{enumerable:ar,value:ir},overrides:{enumerable:ar,value:Lt},registry:{enumerable:ar,value:Rn},version:{enumerable:ar,value:"3.6.0"},getChart:{enumerable:ar,value:nr},register:{enumerable:ar,value:(...t)=>{Rn.add(...t),or()}},unregister:{enumerable:ar,value:(...t)=>{Rn.remove(...t),or()}}});class cr extends Mn{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.getProps(["x","y"],i),{angle:r,distance:o}=function(t,e){const i=e.x-t.x,n=e.y-t.y,r=Math.sqrt(i*i+n*n);let o=Math.atan2(n,i);return o<-.5*z&&(o+=O),{angle:o,distance:r}}(n,{x:t,y:e}),{startAngle:a,endAngle:s,innerRadius:l,outerRadius:h,circumference:c}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),u=this.options.spacing/2;return(c>=O||G(r,a,s))&&o>=l+u&&o<=h+u}getCenterPoint(t){const{x:e,y:i,startAngle:n,endAngle:r,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:s,spacing:l}=this.options,h=(n+r)/2,c=(o+a+l+s)/2;return{x:e+Math.cos(h)*c,y:i+Math.sin(h)*c}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,n=(e.offset||0)/2,r=(e.spacing||0)/2;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>O?Math.floor(i/O):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();let o=0;if(n){o=n/2;const e=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(e)*o,Math.sin(e)*o),this.circumference>=z&&(o=n)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const a=function(t,e,i,n){const{fullCircles:r,startAngle:o,circumference:a}=e;let s=e.endAngle;if(r){hr(t,e,i,n,o+O);for(let e=0;e<r;++e)t.fill();isNaN(a)||(s=o+a%O,a%O==0&&(s+=O))}return hr(t,e,i,n,s),t.fill(),s}(t,this,o,r);(function(t,e,i,n,r){const{options:o}=e,a="inner"===o.borderAlign;o.borderWidth&&(a?(t.lineWidth=2*o.borderWidth,t.lineJoin="round"):(t.lineWidth=o.borderWidth,t.lineJoin="bevel"),e.fullCircles&&function(t,e,i){const{x:n,y:r,startAngle:o,pixelMargin:a,fullCircles:s}=e,l=Math.max(e.outerRadius-a,0),h=e.innerRadius+a;let c;for(i&&sr(t,e,o+O),t.beginPath(),t.arc(n,r,h,o+O,o,!0),c=0;c<s;++c)t.stroke();for(t.beginPath(),t.arc(n,r,l,o,o+O),c=0;c<s;++c)t.stroke()}(t,e,a),a&&sr(t,e,r),hr(t,e,i,n,r),t.stroke())})(t,this,o,r,a),t.restore()}}function ur(t,e,i=e){t.lineCap=g(i.borderCapStyle,e.borderCapStyle),t.setLineDash(g(i.borderDash,e.borderDash)),t.lineDashOffset=g(i.borderDashOffset,e.borderDashOffset),t.lineJoin=g(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=g(i.borderWidth,e.borderWidth),t.strokeStyle=g(i.borderColor,e.borderColor)}function dr(t,e,i){t.lineTo(i.x,i.y)}function fr(t,e,i={}){const n=t.length,{start:r=0,end:o=n-1}=i,{start:a,end:s}=e,l=Math.max(r,a),h=Math.min(o,s),c=r<a&&o<a||r>s&&o>s;return{count:n,start:l,loop:e.loop,ilen:h<l&&!c?n+h-l:h-l}}function gr(t,e,i,n){const{points:r,options:o}=e,{count:a,start:s,loop:l,ilen:h}=fr(r,i,n),c=function(t){return t.stepped?qt:t.tension||"monotone"===t.cubicInterpolationMode?Xt:dr}(o);let u,d,f,{move:g=!0,reverse:p}=n||{};for(u=0;u<=h;++u)d=r[(s+(p?h-u:u))%a],d.skip||(g?(t.moveTo(d.x,d.y),g=!1):c(t,f,d,p,o.stepped),f=d);return l&&(d=r[(s+(p?h:0))%a],c(t,f,d,p,o.stepped)),!!l}function pr(t,e,i,n){const r=e.points,{count:o,start:a,ilen:s}=fr(r,i,n),{move:l=!0,reverse:h}=n||{};let c,u,d,f,g,p,m=0,b=0;const x=t=>(a+(h?s-t:t))%o,y=()=>{f!==g&&(t.lineTo(m,g),t.lineTo(m,f),t.lineTo(m,p))};for(l&&(u=r[x(0)],t.moveTo(u.x,u.y)),c=0;c<=s;++c){if(u=r[x(c)],u.skip)continue;const e=u.x,i=u.y,n=0|e;n===d?(i<f?f=i:i>g&&(g=i),m=(b*m+e)/++b):(y(),t.lineTo(e,i),d=n,b=0,f=g=i),p=i}y()}function mr(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i?gr:pr}cr.id="arc",cr.defaults={borderAlign:"center",borderColor:"#fff",borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},cr.defaultRoutes={backgroundColor:"backgroundColor"};const br="function"==typeof Path2D;class xr extends Mn{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;Ae(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const i=t.points,n=t.options.spanGaps,r=i.length;if(!r)return[];const o=!!t._loop,{start:a,end:s}=function(t,e,i,n){let r=0,o=e-1;if(i&&!n)for(;r<e&&!t[r].skip;)r++;for(;r<e&&t[r].skip;)r++;for(r%=e,i&&(o+=r);o>r&&t[o%e].skip;)o--;return o%=e,{start:r,end:o}}(i,r,o,n);return function(t,e,i,n){return n&&n.setContext&&i?function(t,e,i,n){const r=t._chart.getContext(),o=ii(t.options),{_datasetIndex:a,options:{spanGaps:s}}=t,l=i.length,h=[];let c=o,u=e[0].start,d=u;function f(t,e,n,r){const o=s?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=o;for(;i[e%l].skip;)e+=o;t%l!=e%l&&(h.push({start:t%l,end:e%l,loop:n,style:r}),c=r,u=e%l)}}for(const t of e){u=s?u:t.start;let e,o=i[u%l];for(d=u+1;d<=t.end;d++){const s=i[d%l];e=ii(n.setContext(se(r,{type:"segment",p0:o,p1:s,p0DataIndex:(d-1)%l,p1DataIndex:d%l,datasetIndex:a}))),ni(e,c)&&f(u,d-1,t.loop,c),o=s,c=e}u<d-1&&f(u,d-1,t.loop,c)}return h}(t,e,i,n):e}(t,!0===n?[{start:a,end:s,loop:o}]:function(t,e,i,n){const r=t.length,o=[];let a,s=e,l=t[e];for(a=e+1;a<=i;++a){const i=t[a%r];i.skip||i.stop?l.skip||(n=!1,o.push({start:e%r,end:(a-1)%r,loop:n}),e=s=i.stop?a:null):(s=a,l.skip&&(e=a)),l=i}return null!==s&&o.push({start:e%r,end:s%r,loop:n}),o}(i,a,s<a?s+r:s,!!t._fullLoop&&0===a&&s===r-1),i,e)}(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,n=t[e],r=this.points,o=ei(this,{property:e,start:n,end:n});if(!o.length)return;const a=[],s=function(t){return t.stepped?Ye:t.tension||"monotone"===t.cubicInterpolationMode?$e:je}(i);let l,h;for(l=0,h=o.length;l<h;++l){const{start:h,end:c}=o[l],u=r[h],d=r[c];if(u===d){a.push(u);continue}const f=s(u,d,Math.abs((n-u[e])/(d[e]-u[e])),i.stepped);f[e]=t[e],a.push(f)}return 1===a.length?a[0]:a}pathSegment(t,e,i){return mr(this)(t,this,e,i)}path(t,e,i){const n=this.segments,r=mr(this);let o=this._loop;e=e||0,i=i||this.points.length-e;for(const a of n)o&=r(t,this,a,{start:e,end:e+i-1});return!!o}draw(t,e,i,n){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),function(t,e,i,n){br&&!e.options.segment?function(t,e,i,n){let r=e._path;r||(r=e._path=new Path2D,e.path(r,i,n)&&r.closePath()),ur(t,e.options),t.stroke(r)}(t,e,i,n):function(t,e,i,n){const{segments:r,options:o}=e,a=mr(e);for(const s of r)ur(t,o,s.style),t.beginPath(),a(t,e,s,{start:i,end:i+n-1})&&t.closePath(),t.stroke()}(t,e,i,n)}(t,this,i,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function yr(t,e,i,n){const r=t.options,{[i]:o}=t.getProps([i],n);return Math.abs(e-o)<r.radius+r.hitRadius}xr.id="line",xr.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0},xr.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"},xr.descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};class vr extends Mn{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.options,{x:r,y:o}=this.getProps(["x","y"],i);return Math.pow(t-r,2)+Math.pow(e-o,2)<Math.pow(n.hitRadius+n.radius,2)}inXRange(t,e){return yr(this,t,"x",e)}inYRange(t,e){return yr(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){let e=(t=t||this.options||{}).radius||0;return e=Math.max(e,e&&t.hoverRadius||0),2*(e+(e&&t.borderWidth||0))}draw(t,e){const i=this.options;this.skip||i.radius<.1||!jt(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Vt(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function wr(t,e){const{x:i,y:n,base:r,width:o,height:a}=t.getProps(["x","y","base","width","height"],e);let s,l,h,c,u;return t.horizontal?(u=a/2,s=Math.min(i,r),l=Math.max(i,r),h=n-u,c=n+u):(u=o/2,s=i-u,l=i+u,h=Math.min(n,r),c=Math.max(n,r)),{left:s,top:h,right:l,bottom:c}}function _r(t,e,i,n){return t?0:K(e,i,n)}function Mr(t,e,i,n){const r=null===e,o=null===i,a=t&&!(r&&o)&&wr(t,n);return a&&(r||e>=a.left&&e<=a.right)&&(o||i>=a.top&&i<=a.bottom)}function kr(t,e){t.rect(e.x,e.y,e.w,e.h)}function Cr(t,e,i={}){const n=t.x!==i.x?-e:0,r=t.y!==i.y?-e:0,o=(t.x+t.w!==i.x+i.w?e:0)-n,a=(t.y+t.h!==i.y+i.h?e:0)-r;return{x:t.x+n,y:t.y+r,w:t.w+o,h:t.h+a,radius:t.radius}}vr.id="point",vr.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},vr.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class Tr extends Mn{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:n}}=this,{inner:r,outer:o}=function(t){const e=wr(t),i=e.right-e.left,n=e.bottom-e.top,r=function(t,e,i){const n=t.options.borderWidth,r=t.borderSkipped,o=ie(n);return{t:_r(r.top,o.top,0,i),r:_r(r.right,o.right,0,e),b:_r(r.bottom,o.bottom,0,i),l:_r(r.left,o.left,0,e)}}(t,i/2,n/2),o=function(t,e,i){const{enableBorderRadius:n}=t.getProps(["enableBorderRadius"]),r=t.options.borderRadius,o=ne(r),a=Math.min(e,i),s=t.borderSkipped,l=n||u(r);return{topLeft:_r(!l||s.top||s.left,o.topLeft,0,a),topRight:_r(!l||s.top||s.right,o.topRight,0,a),bottomLeft:_r(!l||s.bottom||s.left,o.bottomLeft,0,a),bottomRight:_r(!l||s.bottom||s.right,o.bottomRight,0,a)}}(t,i/2,n/2);return{outer:{x:e.left,y:e.top,w:i,h:n,radius:o},inner:{x:e.left+r.l,y:e.top+r.t,w:i-r.l-r.r,h:n-r.t-r.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,o.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(r.b,r.r))}}}}(this),a=(s=o.radius).topLeft||s.topRight||s.bottomLeft||s.bottomRight?Kt:kr;var s;t.save(),o.w===r.w&&o.h===r.h||(t.beginPath(),a(t,Cr(o,e,r)),t.clip(),a(t,Cr(r,-e,o)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,Cr(r,e)),t.fillStyle=n,t.fill(),t.restore()}inRange(t,e,i){return Mr(this,t,e,i)}inXRange(t,e){return Mr(this,t,null,e)}inYRange(t,e){return Mr(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:n,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(e+n)/2:e,y:r?i:(i+n)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}Tr.id="bar",Tr.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},Tr.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var Dr=Object.freeze({__proto__:null,ArcElement:cr,LineElement:xr,PointElement:vr,BarElement:Tr});function Sr(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{value:e})}}function Pr(t){t.data.datasets.forEach((t=>{Sr(t)}))}var zr={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled)return void Pr(t);const n=t.width;t.data.datasets.forEach(((e,r)=>{const{_data:o,indexAxis:a}=e,s=t.getDatasetMeta(r),l=o||e.data;if("y"===ae([a,t.options.indexAxis]))return;if("line"!==s.type)return;const c=t.scales[s.xAxisID];if("linear"!==c.type&&"time"!==c.type)return;if(t.options.parsing)return;let u,{start:d,count:f}=function(t,e){const i=e.length;let n,r=0;const{iScale:o}=t,{min:a,max:s,minDefined:l,maxDefined:h}=o.getUserBounds();return l&&(r=K(he(e,o.axis,a).lo,0,i-1)),n=h?K(he(e,o.axis,s).hi+1,r,i)-r:i-r,{start:r,count:n}}(s,l);if(f<=(i.threshold||4*n))Sr(e);else{switch(h(o)&&(e._data=l,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":u=function(t,e,i,n,r){const o=r.samples||n;if(o>=i)return t.slice(e,e+i);const a=[],s=(i-2)/(o-2);let l=0;const h=e+i-1;let c,u,d,f,g,p=e;for(a[l++]=t[p],c=0;c<o-2;c++){let n,r=0,o=0;const h=Math.floor((c+1)*s)+1+e,m=Math.min(Math.floor((c+2)*s)+1,i)+e,b=m-h;for(n=h;n<m;n++)r+=t[n].x,o+=t[n].y;r/=b,o/=b;const x=Math.floor(c*s)+1+e,y=Math.min(Math.floor((c+1)*s)+1,i)+e,{x:v,y:w}=t[p];for(d=f=-1,n=x;n<y;n++)f=.5*Math.abs((v-r)*(t[n].y-w)-(v-t[n].x)*(o-w)),f>d&&(d=f,u=t[n],g=n);a[l++]=u,p=g}return a[l++]=t[h],a}(l,d,f,n,i);break;case"min-max":u=function(t,e,i,n){let r,o,a,s,l,c,u,d,f,g,p=0,m=0;const b=[],x=e+i-1,y=t[e].x,v=t[x].x-y;for(r=e;r<e+i;++r){o=t[r],a=(o.x-y)/v*n,s=o.y;const e=0|a;if(e===l)s<f?(f=s,c=r):s>g&&(g=s,u=r),p=(m*p+o.x)/++m;else{const i=r-1;if(!h(c)&&!h(u)){const e=Math.min(c,u),n=Math.max(c,u);e!==d&&e!==i&&b.push({...t[e],x:p}),n!==d&&n!==i&&b.push({...t[n],x:p})}r>0&&i!==d&&b.push(t[i]),b.push(o),l=e,m=0,f=g=s,c=u=d=r}}return b}(l,d,f,n);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=u}}))},destroy(t){Pr(t)}};function Or(t,e,i){const n=function(t){const e=t.options,i=e.fill;let n=g(i&&i.target,i);return void 0===n&&(n=!!e.backgroundColor),!1!==n&&null!==n&&(!0===n?"origin":n)}(t);if(u(n))return!isNaN(n.value)&&n;let r=parseFloat(n);return d(r)&&Math.floor(r)===r?("-"!==n[0]&&"+"!==n[0]||(r=e+r),!(r===e||r<0||r>=i)&&r):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}class Ar{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:n,y:r,radius:o}=this;return e=e||{start:0,end:O},t.arc(n,r,o,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:n}=this,r=t.angle;return{x:e+Math.cos(r)*n,y:i+Math.sin(r)*n,angle:r}}}function Er(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function Lr(t,e,i){const n=[];for(let r=0;r<i.length;r++){const o=i[r],{first:a,last:s,point:l}=Rr(o,e,"x");if(!(!l||a&&s))if(a)n.unshift(l);else if(t.push(l),!s)break}t.push(...n)}function Rr(t,e,i){const n=t.interpolate(e,i);if(!n)return{};const r=n[i],o=t.segments,a=t.points;let s=!1,l=!1;for(let t=0;t<o.length;t++){const e=o[t],n=a[e.start][i],h=a[e.end][i];if(r>=n&&r<=h){s=r===n,l=r===h;break}}return{first:s,last:l,point:n}}function Fr(t){const{chart:e,fill:i,line:n}=t;if(d(i))return function(t,e){const i=t.getDatasetMeta(e);return i&&t.isDatasetVisible(e)?i.dataset:null}(e,i);if("stack"===i)return function(t){const{scale:e,index:i,line:n}=t,r=[],o=n.segments,a=n.points,s=function(t,e){const i=[],n=t.getMatchingVisibleMetas("line");for(let t=0;t<n.length;t++){const r=n[t];if(r.index===e)break;r.hidden||i.unshift(r.dataset)}return i}(e,i);s.push(Ir({x:null,y:e.bottom},n));for(let t=0;t<o.length;t++){const e=o[t];for(let t=e.start;t<=e.end;t++)Lr(r,a[t],s)}return new xr({points:r,options:{}})}(t);if("shape"===i)return!0;const r=function(t){return(t.scale||{}).getPointPositionForValue?function(t){const{scale:e,fill:i}=t,n=e.options,r=e.getLabels().length,o=[],a=n.reverse?e.max:e.min,s=n.reverse?e.min:e.max;let l,h,c;if(c="start"===i?a:"end"===i?s:u(i)?i.value:e.getBaseValue(),n.grid.circular)return h=e.getPointPositionForValue(0,a),new Ar({x:h.x,y:h.y,radius:e.getDistanceFromCenterForValue(c)});for(l=0;l<r;++l)o.push(e.getPointPositionForValue(l,c));return o}(t):function(t){const{scale:e={},fill:i}=t;let n,r=null;return"start"===i?r=e.bottom:"end"===i?r=e.top:u(i)?r=e.getPixelForValue(i.value):e.getBasePixel&&(r=e.getBasePixel()),d(r)?(n=e.isHorizontal(),{x:n?r:null,y:n?null:r}):null}(t)}(t);return r instanceof Ar?r:Ir(r,n)}function Ir(t,e){let i=[],n=!1;return c(t)?(n=!0,i=t):i=function(t,e){const{x:i=null,y:n=null}=t||{},r=e.points,o=[];return e.segments.forEach((({start:t,end:e})=>{e=Er(t,e,r);const a=r[t],s=r[e];null!==n?(o.push({x:a.x,y:n}),o.push({x:s.x,y:n})):null!==i&&(o.push({x:i,y:a.y}),o.push({x:i,y:s.y}))})),o}(t,e),i.length?new xr({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function Nr(t,e,i){let n=t[e].fill;const r=[e];let o;if(!i)return n;for(;!1!==n&&-1===r.indexOf(n);){if(!d(n))return n;if(o=t[n],!o)return!1;if(o.visible)return n;r.push(n),n=o.fill}return!1}function Hr(t,e,i){t.beginPath(),e.path(t),t.lineTo(e.last().x,i),t.lineTo(e.first().x,i),t.closePath(),t.clip()}function Br(t,e,i,n){if(n)return;let r=e[t],o=i[t];return"angle"===t&&(r=Q(r),o=Q(o)),{property:t,start:r,end:o}}function Wr(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function Ur(t,e,i){const{top:n,bottom:r}=e.chart.chartArea,{property:o,start:a,end:s}=i||{};"x"===o&&(t.beginPath(),t.rect(a,n,s-a,r-n),t.clip())}function Vr(t,e,i,n){const r=e.interpolate(i,n);r&&t.lineTo(r.x,r.y)}function jr(t,e){const{line:i,target:n,property:r,color:o,scale:a}=e,s=function(t,e,i){const n=t.segments,r=t.points,o=e.points,a=[];for(const t of n){let{start:n,end:s}=t;s=Er(n,s,r);const l=Br(i,r[n],r[s],t.loop);if(!e.segments){a.push({source:t,target:l,start:r[n],end:r[s]});continue}const h=ei(e,l);for(const e of h){const n=Br(i,o[e.start],o[e.end],e.loop),s=ti(t,r,n);for(const t of s)a.push({source:t,target:e,start:{[i]:Wr(l,n,"start",Math.max)},end:{[i]:Wr(l,n,"end",Math.min)}})}}return a}(i,n,r);for(const{source:e,target:l,start:h,end:c}of s){const{style:{backgroundColor:s=o}={}}=e,u=!0!==n;t.save(),t.fillStyle=s,Ur(t,a,u&&Br(r,h,c)),t.beginPath();const d=!!i.pathSegment(t,e);let f;if(u){d?t.closePath():Vr(t,n,c,r);const e=!!n.pathSegment(t,l,{move:d,reverse:!0});f=d&&e,f||Vr(t,n,h,r)}t.closePath(),t.fill(f?"evenodd":"nonzero"),t.restore()}}function Yr(t,e,i){const n=Fr(e),{line:r,scale:o,axis:a}=e,s=r.options,l=s.fill,h=s.backgroundColor,{above:c=h,below:u=h}=l||{};n&&r.points.length&&(Yt(t,i),function(t,e){const{line:i,target:n,above:r,below:o,area:a,scale:s}=e,l=i._loop?"angle":e.axis;t.save(),"x"===l&&o!==r&&(Hr(t,n,a.top),jr(t,{line:i,target:n,color:r,scale:s,property:l}),t.restore(),t.save(),Hr(t,n,a.bottom)),jr(t,{line:i,target:n,color:o,scale:s,property:l}),t.restore()}(t,{line:r,target:n,above:c,below:u,area:i,scale:o,axis:a}),$t(t))}var $r={id:"filler",afterDatasetsUpdate(t,e,i){const n=(t.data.datasets||[]).length,r=[];let o,a,s,l;for(a=0;a<n;++a)o=t.getDatasetMeta(a),s=o.dataset,l=null,s&&s.options&&s instanceof xr&&(l={visible:t.isDatasetVisible(a),index:a,fill:Or(s,a,n),chart:t,axis:o.controller.options.indexAxis,scale:o.vScale,line:s}),o.$filler=l,r.push(l);for(a=0;a<n;++a)l=r[a],l&&!1!==l.fill&&(l.fill=Nr(r,a,i.propagate))},beforeDraw(t,e,i){const n="beforeDraw"===i.drawTime,r=t.getSortedVisibleDatasetMetas(),o=t.chartArea;for(let e=r.length-1;e>=0;--e){const i=r[e].$filler;i&&(i.line.updateControlPoints(o,i.axis),n&&Yr(t.ctx,i,o))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const n=t.getSortedVisibleDatasetMetas();for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;i&&Yr(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const n=e.meta.$filler;n&&!1!==n.fill&&"beforeDatasetDraw"===i.drawTime&&Yr(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const qr=(t,e)=>{let{boxHeight:i=e,boxWidth:n=e}=t;return t.usePointStyle&&(i=Math.min(i,e),n=Math.min(n,e)),{boxWidth:n,boxHeight:i,itemHeight:Math.max(e,i)}};class Xr extends Mn{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=m(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter((e=>t.filter(e,this.chart.data)))),t.sort&&(e=e.sort(((e,i)=>t.sort(e,i,this.chart.data)))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,n=oe(i.font),r=n.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:s}=qr(i,r);let l,h;e.font=n.string,this.isHorizontal()?(l=this.maxWidth,h=this._fitRows(o,r,a,s)+10):(h=this.maxHeight,l=this._fitCols(o,r,a,s)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,n){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,s=this.legendHitBoxes=[],l=this.lineWidths=[0],h=n+a;let c=t;r.textAlign="left",r.textBaseline="middle";let u=-1,d=-h;return this.legendItems.forEach(((t,f)=>{const g=i+e/2+r.measureText(t.text).width;(0===f||l[l.length-1]+g+2*a>o)&&(c+=h,l[l.length-(f>0?0:1)]=0,d+=h,u++),s[f]={left:0,top:d,row:u,width:g,height:n},l[l.length-1]+=g+a})),c}_fitCols(t,e,i,n){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,s=this.legendHitBoxes=[],l=this.columnSizes=[],h=o-t;let c=a,u=0,d=0,f=0,g=0;return this.legendItems.forEach(((t,o)=>{const p=i+e/2+r.measureText(t.text).width;o>0&&d+n+2*a>h&&(c+=u+a,l.push({width:u,height:d}),f+=u+a,g++,u=d=0),s[o]={left:f,top:d,col:g,width:p,height:n},u=Math.max(u,p),d+=n+a})),c+=u,l.push({width:u,height:d}),c}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:n},rtl:r}}=this,o=Qe(r,this.left,this.width);if(this.isHorizontal()){let r=0,s=a(i,this.left+n,this.right-this.lineWidths[r]);for(const l of e)r!==l.row&&(r=l.row,s=a(i,this.left+n,this.right-this.lineWidths[r])),l.top+=this.top+t+n,l.left=o.leftForLtr(o.x(s),l.width),s+=l.width+n}else{let r=0,s=a(i,this.top+t+n,this.bottom-this.columnSizes[r].height);for(const l of e)l.col!==r&&(r=l.col,s=a(i,this.top+t+n,this.bottom-this.columnSizes[r].height)),l.top=s,l.left+=this.left+n,l.left=o.leftForLtr(o.x(l.left),l.width),s+=l.height+n}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;Yt(t,this),this._draw(),$t(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:n}=this,{align:r,labels:o}=t,s=Nt.color,l=Qe(t.rtl,this.left,this.width),h=oe(o.font),{color:c,padding:u}=o,d=h.size,f=d/2;let p;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=h.string;const{boxWidth:m,boxHeight:b,itemHeight:x}=qr(o,d),y=this.isHorizontal(),v=this._computeTitleHeight();p=y?{x:a(r,this.left+u,this.right-i[0]),y:this.top+u+v,line:0}:{x:this.left+u,y:a(r,this.top+v+u,this.bottom-e[0].height),line:0},Ge(this.ctx,t.textDirection);const w=x+u;this.legendItems.forEach(((_,M)=>{n.strokeStyle=_.fontColor||c,n.fillStyle=_.fontColor||c;const k=n.measureText(_.text).width,C=l.textAlign(_.textAlign||(_.textAlign=o.textAlign)),T=m+f+k;let D=p.x,S=p.y;l.setWidth(this.width),y?M>0&&D+T+u>this.right&&(S=p.y+=w,p.line++,D=p.x=a(r,this.left+u,this.right-i[p.line])):M>0&&S+w>this.bottom&&(D=p.x=D+e[p.line].width+u,p.line++,S=p.y=a(r,this.top+v+u,this.bottom-e[p.line].height)),function(t,e,i){if(isNaN(m)||m<=0||isNaN(b)||b<0)return;n.save();const r=g(i.lineWidth,1);if(n.fillStyle=g(i.fillStyle,s),n.lineCap=g(i.lineCap,"butt"),n.lineDashOffset=g(i.lineDashOffset,0),n.lineJoin=g(i.lineJoin,"miter"),n.lineWidth=r,n.strokeStyle=g(i.strokeStyle,s),n.setLineDash(g(i.lineDash,[])),o.usePointStyle){const o={radius:m*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:r},a=l.xPlus(t,m/2);Vt(n,o,a,e+f)}else{const o=e+Math.max((d-b)/2,0),a=l.leftForLtr(t,m),s=ne(i.borderRadius);n.beginPath(),Object.values(s).some((t=>0!==t))?Kt(n,{x:a,y:o,w:m,h:b,radius:s}):n.rect(a,o,m,b),n.fill(),0!==r&&n.stroke()}n.restore()}(l.x(D),S,_),D=((t,e,i,n)=>t===(n?"left":"right")?i:"center"===t?(e+i)/2:e)(C,D+m+f,y?D+T:this.right,t.rtl),function(t,e,i){Qt(n,i.text,t,e+x/2,h,{strikethrough:i.hidden,textAlign:l.textAlign(i.textAlign)})}(l.x(D),S,_),y?p.x+=T+u:p.y+=w})),Ke(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=oe(e.font),n=re(e.padding);if(!e.display)return;const r=Qe(t.rtl,this.left,this.width),s=this.ctx,l=e.position,h=i.size/2,c=n.top+h;let u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=a(t.align,d,this.right-f);else{const e=this.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);u=c+a(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const g=a(l,d,d+f);s.textAlign=r.textAlign(o(l)),s.textBaseline="middle",s.strokeStyle=e.color,s.fillStyle=e.color,s.font=i.string,Qt(s,e.text,g,u,i)}_computeTitleHeight(){const t=this.options.title,e=oe(t.font),i=re(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,n,r;if(t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom)for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(n=r[i],t>=n.left&&t<=n.left+n.width&&e>=n.top&&e<=n.top+n.height)return this.legendItems[i];return null}handleEvent(t){const e=this.options;if(!function(t,e){return!("mousemove"!==t||!e.onHover&&!e.onLeave)||!(!e.onClick||"click"!==t&&"mouseup"!==t)}(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type){const o=this._hoveredItem,a=(r=i,null!==(n=o)&&null!==r&&n.datasetIndex===r.datasetIndex&&n.index===r.index);o&&!a&&m(e.onLeave,[t,o,this],this),this._hoveredItem=i,i&&!a&&m(e.onHover,[t,i,this],this)}else i&&m(e.onClick,[t,i,this],this);var n,r}}var Qr={id:"legend",_element:Xr,start(t,e,i){const n=t.legend=new Xr({ctx:t.ctx,options:i,chart:t});sn.configure(t,n,i),sn.addBox(t,n)},stop(t){sn.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){const n=t.legend;sn.configure(t,n,i),n.options=i},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){const n=e.datasetIndex,r=i.chart;r.isDatasetVisible(n)?(r.hide(n),e.hidden=!0):(r.show(n),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:n,textAlign:r,color:o}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const a=t.controller.getStyle(i?0:void 0),s=re(a.borderWidth);return{text:e[t.index].label,fillStyle:a.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(s.width+s.height)/4,strokeStyle:a.borderColor,pointStyle:n||a.pointStyle,rotation:a.rotation,textAlign:r||a.textAlign,borderRadius:0,datasetIndex:t.index}}),this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class Gr extends Mn{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const n=c(i.text)?i.text.length:1;this._padding=re(i.padding);const r=n*oe(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:n,right:r,options:o}=this,s=o.align;let l,h,c,u=0;return this.isHorizontal()?(h=a(s,i,r),c=e+t,l=r-i):("left"===o.position?(h=i+t,c=a(s,n,e),u=-.5*z):(h=r-t,c=a(s,e,n),u=.5*z),l=n-e),{titleX:h,titleY:c,maxWidth:l,rotation:u}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=oe(e.font),n=i.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:s,rotation:l}=this._drawArgs(n);Qt(t,e.text,0,0,i,{color:e.color,maxWidth:s,rotation:l,textAlign:o(e.align),textBaseline:"middle",translation:[r,a]})}}var Kr={id:"title",_element:Gr,start(t,e,i){!function(t,e){const i=new Gr({ctx:t.ctx,options:e,chart:t});sn.configure(t,i,e),sn.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){const e=t.titleBlock;sn.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const n=t.titleBlock;sn.configure(t,n,i),n.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Zr=new WeakMap;var Jr={id:"subtitle",start(t,e,i){const n=new Gr({ctx:t.ctx,options:i,chart:t});sn.configure(t,n,i),sn.addBox(t,n),Zr.set(t,n)},stop(t){sn.removeBox(t,Zr.get(t)),Zr.delete(t)},beforeUpdate(t,e,i){const n=Zr.get(t);sn.configure(t,n,i),n.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const to={average(t){if(!t.length)return!1;let e,i,n=0,r=0,o=0;for(e=0,i=t.length;e<i;++e){const i=t[e].element;if(i&&i.hasValue()){const t=i.tooltipPosition();n+=t.x,r+=t.y,++o}}return{x:n/o,y:r/o}},nearest(t,e){if(!t.length)return!1;let i,n,r,o=e.x,a=e.y,s=Number.POSITIVE_INFINITY;for(i=0,n=t.length;i<n;++i){const n=t[i].element;if(n&&n.hasValue()){const t=q(e,n.getCenterPoint());t<s&&(s=t,r=n)}}if(r){const t=r.tooltipPosition();o=t.x,a=t.y}return{x:o,y:a}}};function eo(t,e){return e&&(c(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function io(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function no(t,e){const{element:i,datasetIndex:n,index:r}=e,o=t.getDatasetMeta(n).controller,{label:a,value:s}=o.getLabelAndValue(r);return{chart:t,label:a,parsed:o.getParsed(r),raw:t.data.datasets[n].data[r],formattedValue:s,dataset:o.getDataset(),dataIndex:r,datasetIndex:n,element:i}}function ro(t,e){const i=t._chart.ctx,{body:n,footer:r,title:o}=t,{boxWidth:a,boxHeight:s}=e,l=oe(e.bodyFont),h=oe(e.titleFont),c=oe(e.footerFont),u=o.length,d=r.length,f=n.length,g=re(e.padding);let p=g.height,m=0,x=n.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);x+=t.beforeBody.length+t.afterBody.length,u&&(p+=u*h.lineHeight+(u-1)*e.titleSpacing+e.titleMarginBottom),x&&(p+=f*(e.displayColors?Math.max(s,l.lineHeight):l.lineHeight)+(x-f)*l.lineHeight+(x-1)*e.bodySpacing),d&&(p+=e.footerMarginTop+d*c.lineHeight+(d-1)*e.footerSpacing);let y=0;const v=function(t){m=Math.max(m,i.measureText(t).width+y)};return i.save(),i.font=h.string,b(t.title,v),i.font=l.string,b(t.beforeBody.concat(t.afterBody),v),y=e.displayColors?a+2+e.boxPadding:0,b(n,(t=>{b(t.before,v),b(t.lines,v),b(t.after,v)})),y=0,i.font=c.string,b(t.footer,v),i.restore(),m+=g.width,{width:m,height:p}}function oo(t,e,i,n){const{x:r,width:o}=i,{width:a,chartArea:{left:s,right:l}}=t;let h="center";return"center"===n?h=r<=(s+l)/2?"left":"right":r<=o/2?h="left":r>=a-o/2&&(h="right"),function(t,e,i,n){const{x:r,width:o}=n,a=i.caretSize+i.caretPadding;return"left"===t&&r+o+a>e.width||"right"===t&&r-o-a<0||void 0}(h,t,e,i)&&(h="center"),h}function ao(t,e,i){const n=e.yAlign||function(t,e){const{y:i,height:n}=e;return i<n/2?"top":i>t.height-n/2?"bottom":"center"}(t,i);return{xAlign:e.xAlign||oo(t,e,i,n),yAlign:n}}function so(t,e,i,n){const{caretSize:r,caretPadding:o,cornerRadius:a}=t,{xAlign:s,yAlign:l}=i,h=r+o,{topLeft:c,topRight:u,bottomLeft:d,bottomRight:f}=ne(a);let g=function(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,s);const p=function(t,e,i){let{y:n,height:r}=t;return"top"===e?n+=i:n-="bottom"===e?r+i:r/2,n}(e,l,h);return"center"===l?"left"===s?g+=h:"right"===s&&(g-=h):"left"===s?g-=Math.max(c,d)+o:"right"===s&&(g+=Math.max(u,f)+o),{x:K(g,0,n.width-e.width),y:K(p,0,n.height-e.height)}}function lo(t,e,i){const n=re(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function ho(t){return eo([],io(t))}function co(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}class uo extends Mn{constructor(t){super(),this.opacity=0,this._active=[],this._chart=t._chart,this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this._chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,r=new hi(this._chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=(this,se(this._chart.getContext(),{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"})))}getTitle(t,e){const{callbacks:i}=e,n=i.beforeTitle.apply(this,[t]),r=i.title.apply(this,[t]),o=i.afterTitle.apply(this,[t]);let a=[];return a=eo(a,io(n)),a=eo(a,io(r)),a=eo(a,io(o)),a}getBeforeBody(t,e){return ho(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:i}=e,n=[];return b(t,(t=>{const e={before:[],lines:[],after:[]},r=co(i,t);eo(e.before,io(r.beforeLabel.call(this,t))),eo(e.lines,r.label.call(this,t)),eo(e.after,io(r.afterLabel.call(this,t))),n.push(e)})),n}getAfterBody(t,e){return ho(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:i}=e,n=i.beforeFooter.apply(this,[t]),r=i.footer.apply(this,[t]),o=i.afterFooter.apply(this,[t]);let a=[];return a=eo(a,io(n)),a=eo(a,io(r)),a=eo(a,io(o)),a}_createItems(t){const e=this._active,i=this._chart.data,n=[],r=[],o=[];let a,s,l=[];for(a=0,s=e.length;a<s;++a)l.push(no(this._chart,e[a]));return t.filter&&(l=l.filter(((e,n,r)=>t.filter(e,n,r,i)))),t.itemSort&&(l=l.sort(((e,n)=>t.itemSort(e,n,i)))),b(l,(e=>{const i=co(t.callbacks,e);n.push(i.labelColor.call(this,e)),r.push(i.labelPointStyle.call(this,e)),o.push(i.labelTextColor.call(this,e))})),this.labelColors=n,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let r,o=[];if(n.length){const t=to[i.position].call(this,n,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const e=this._size=ro(this,i),a=Object.assign({},t,e),s=ao(this._chart,i,a),l=so(i,a,s,this._chart);this.xAlign=s.xAlign,this.yAlign=s.yAlign,r={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(r={opacity:0});this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this._chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const r=this.getCaretPosition(t,i,n);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:r}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:s,topRight:l,bottomLeft:h,bottomRight:c}=ne(a),{x:u,y:d}=t,{width:f,height:g}=e;let p,m,b,x,y,v;return"center"===r?(y=d+g/2,"left"===n?(p=u,m=p-o,x=y+o,v=y-o):(p=u+f,m=p+o,x=y-o,v=y+o),b=p):(m="left"===n?u+Math.max(s,h)+o:"right"===n?u+f-Math.max(l,c)-o:this.caretX,"top"===r?(x=d,y=x-o,p=m-o,b=m+o):(x=d+g,y=x+o,p=m+o,b=m-o),v=x),{x1:p,x2:m,x3:b,y1:x,y2:y,y3:v}}drawTitle(t,e,i){const n=this.title,r=n.length;let o,a,s;if(r){const l=Qe(i.rtl,this.x,this.width);for(t.x=lo(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",o=oe(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,s=0;s<r;++s)e.fillText(n[s],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,s+1===r&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,e,i,n,r){const o=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:s,boxWidth:l,boxPadding:h}=r,c=oe(r.bodyFont),u=lo(this,"left",r),d=n.x(u),f=s<c.lineHeight?(c.lineHeight-s)/2:0,g=e.y+f;if(r.usePointStyle){const e={radius:Math.min(l,s)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},i=n.leftForLtr(d,l)+l/2,h=g+s/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Vt(t,e,i,h),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,Vt(t,e,i,h)}else{t.lineWidth=o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const e=n.leftForLtr(d,l-h),i=n.leftForLtr(n.xPlus(d,1),l-h-2),a=ne(o.borderRadius);Object.values(a).some((t=>0!==t))?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Kt(t,{x:e,y:g,w:l,h:s,radius:a}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Kt(t,{x:i,y:g+1,w:l-2,h:s-2,radius:a}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(e,g,l,s),t.strokeRect(e,g,l,s),t.fillStyle=o.backgroundColor,t.fillRect(i,g+1,l-2,s-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:s,boxWidth:l,boxPadding:h}=i,c=oe(i.bodyFont);let u=c.lineHeight,d=0;const f=Qe(i.rtl,this.x,this.width),g=function(i){e.fillText(i,f.x(t.x+d),t.y+u/2),t.y+=u+r},p=f.textAlign(o);let m,x,y,v,w,_,M;for(e.textAlign=o,e.textBaseline="middle",e.font=c.string,t.x=lo(this,p,i),e.fillStyle=i.bodyColor,b(this.beforeBody,g),d=a&&"right"!==p?"center"===o?l/2+h:l+2+h:0,v=0,_=n.length;v<_;++v){for(m=n[v],x=this.labelTextColors[v],e.fillStyle=x,b(m.before,g),y=m.lines,a&&y.length&&(this._drawColorBox(e,t,v,f,i),u=Math.max(c.lineHeight,s)),w=0,M=y.length;w<M;++w)g(y[w]),u=c.lineHeight;b(m.after,g)}d=0,u=c.lineHeight,b(this.afterBody,g),t.y-=r}drawFooter(t,e,i){const n=this.footer,r=n.length;let o,a;if(r){const s=Qe(i.rtl,this.x,this.width);for(t.x=lo(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=s.textAlign(i.footerAlign),e.textBaseline="middle",o=oe(i.footerFont),e.fillStyle=i.footerColor,e.font=o.string,a=0;a<r;++a)e.fillText(n[a],s.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+i.footerSpacing}}drawBackground(t,e,i,n){const{xAlign:r,yAlign:o}=this,{x:a,y:s}=t,{width:l,height:h}=i,{topLeft:c,topRight:u,bottomLeft:d,bottomRight:f}=ne(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(a+c,s),"top"===o&&this.drawCaret(t,e,i,n),e.lineTo(a+l-u,s),e.quadraticCurveTo(a+l,s,a+l,s+u),"center"===o&&"right"===r&&this.drawCaret(t,e,i,n),e.lineTo(a+l,s+h-f),e.quadraticCurveTo(a+l,s+h,a+l-f,s+h),"bottom"===o&&this.drawCaret(t,e,i,n),e.lineTo(a+d,s+h),e.quadraticCurveTo(a,s+h,a,s+h-d),"center"===o&&"left"===r&&this.drawCaret(t,e,i,n),e.lineTo(a,s+c),e.quadraticCurveTo(a,s,a+c,s),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this._chart,i=this.$animations,n=i&&i.x,r=i&&i.y;if(n||r){const i=to[t.position].call(this,this._active,this._eventPosition);if(!i)return;const o=this._size=ro(this,t),a=Object.assign({},i,this._size),s=ao(e,t,a),l=so(t,a,s,e);n._to===l.x&&r._to===l.y||(this.xAlign=s.xAlign,this.yAlign=s.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=re(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,n,e),Ge(t,e.textDirection),r.y+=o.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),Ke(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map((({datasetIndex:t,index:e})=>{const i=this._chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}})),r=!x(i,n),o=this._positionChanged(n,e);(r||o)&&(this._active=n,this._eventPosition=e,this.update(!0))}handleEvent(t,e){const i=this.options,n=this._active||[];let r=!1,o=[];"mouseout"!==t.type&&(o=this._chart.getElementsAtEventForMode(t,i.mode,i,e),i.reverse&&o.reverse());const a=this._positionChanged(o,t);return r=e||!x(o,n)||a,r&&(this._active=o,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),r}_positionChanged(t,e){const{caretX:i,caretY:n,options:r}=this,o=to[r.position].call(this,t,e);return!1!==o&&(i!==o.x||n!==o.y)}}uo.positioners=to;var fo={id:"tooltip",_element:uo,positioners:to,afterInit(t,e,i){i&&(t.tooltip=new uo({_chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip,i={tooltip:e};!1!==t.notifyPlugins("beforeTooltipDraw",i)&&(e&&e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i))},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:s,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex<n)return i[e.dataIndex]}return""},afterTitle:s,beforeBody:s,beforeLabel:s,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const i=t.formattedValue;return h(i)||(e+=i),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:s,afterBody:s,beforeFooter:s,footer:s,afterFooter:s}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},go=Object.freeze({__proto__:null,Decimation:zr,Filler:$r,Legend:Qr,SubTitle:Jr,Title:Kr,Tooltip:fo});class po extends En{constructor(t){super(t),this._startValue=void 0,this._valueRange=0}parse(t,e){if(h(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:K(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:function(t,e,i){const n=t.indexOf(e);return-1===n?((t,e,i)=>"string"==typeof e?t.push(e)-1:isNaN(e)?null:i)(t,e,i):n!==t.lastIndexOf(e)?i:n}(i,t,g(e,t)),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let r=this.getLabels();r=0===t&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)n.push({value:i});return n}getLabelForValue(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function mo(t,e,{horizontal:i,minRotation:n}){const r=j(n),o=(i?Math.sin(r):Math.cos(r))||.001,a=.75*e*(""+t).length;return Math.min(e/o,a)}po.id="category",po.defaults={ticks:{callback:po.prototype.getLabelForValue}};class bo extends En{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return h(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:r}=this;const o=t=>n=e?n:t,a=t=>r=i?r:t;if(t){const t=H(n),e=H(r);t<0&&e<0?a(0):t>0&&e>0&&o(0)}if(n===r){let e=1;(r>=Number.MAX_SAFE_INTEGER||n<=Number.MIN_SAFE_INTEGER)&&(e=Math.abs(.05*r)),a(r+e),t||o(n-e)}this.min=n,this.max=r}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:n}=t;return n?(e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n=function(t,e){const i=[],{bounds:n,step:r,min:o,max:a,precision:s,count:l,maxTicks:c,maxDigits:u,includeBounds:d}=t,f=r||1,g=c-1,{min:p,max:m}=e,b=!h(o),x=!h(a),y=!h(l),v=(m-p)/(u+1);let w,_,M,k,C=B((m-p)/g/f)*f;if(C<1e-14&&!b&&!x)return[{value:p},{value:m}];k=Math.ceil(m/C)-Math.floor(p/C),k>g&&(C=B(k*C/g/f)*f),h(s)||(w=Math.pow(10,s),C=Math.ceil(C*w)/w),"ticks"===n?(_=Math.floor(p/C)*C,M=Math.ceil(m/C)*C):(_=p,M=m),b&&x&&r&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((a-o)/r,C/1e3)?(k=Math.round(Math.min((a-o)/C,c)),C=(a-o)/k,_=o,M=a):y?(_=b?o:_,M=x?a:M,k=l-1,C=(M-_)/k):(k=(M-_)/C,k=U(k,Math.round(k),C/1e3)?Math.round(k):Math.ceil(k));const T=Math.max($(C),$(_));w=Math.pow(10,h(s)?T:s),_=Math.round(_*w)/w,M=Math.round(M*w)/w;let D=0;for(b&&(d&&_!==o?(i.push({value:o}),_<o&&D++,U(Math.round((_+D*C)*w)/w,o,mo(o,v,t))&&D++):_<o&&D++);D<k;++D)i.push({value:Math.round((_+D*C)*w)/w});return x&&d&&M!==a?i.length&&U(i[i.length-1].value,a,mo(a,v,t))?i[i.length-1].value=a:i.push({value:a}):x&&M!==a||i.push({value:M}),i}({maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&V(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Xe(t,this.chart.options.locale)}}class xo extends bo{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=d(t)?t:0,this.max=d(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=j(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/n))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}function yo(t){return 1==t/Math.pow(10,Math.floor(N(t)))}xo.id="linear",xo.defaults={ticks:{callback:Cn.formatters.numeric}};class vo extends En{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=bo.prototype.parse.apply(this,[t,e]);if(0!==i)return d(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=d(t)?Math.max(0,t):null,this.max=d(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,n=this.max;const r=e=>i=t?i:e,o=t=>n=e?n:t,a=(t,e)=>Math.pow(10,Math.floor(N(t))+e);i===n&&(i<=0?(r(1),o(10)):(r(a(i,-1)),o(a(n,1)))),i<=0&&r(a(n,-1)),n<=0&&o(a(i,1)),this._zero&&this.min!==this._suggestedMin&&i===a(this.min,0)&&r(a(i,-1)),this.min=i,this.max=n}buildTicks(){const t=this.options,e=function(t,e){const i=Math.floor(N(e.max)),n=Math.ceil(e.max/Math.pow(10,i)),r=[];let o=f(t.min,Math.pow(10,Math.floor(N(e.min)))),a=Math.floor(N(o)),s=Math.floor(o/Math.pow(10,a)),l=a<0?Math.pow(10,Math.abs(a)):1;do{r.push({value:o,major:yo(o)}),++s,10===s&&(s=1,++a,l=a>=0?1:l),o=Math.round(s*Math.pow(10,a)*l)/l}while(a<i||a===i&&s<n);const h=f(t.max,o);return r.push({value:h,major:yo(o)}),r}({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&V(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":Xe(t,this.chart.options.locale)}configure(){const t=this.min;super.configure(),this._startValue=N(t),this._valueRange=N(this.max)-N(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(N(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function wo(t){const e=t.ticks;if(e.display&&t.display){const t=re(e.backdropPadding);return g(e.font&&e.font.size,Nt.font.size)+t.height}return 0}function _o(t,e,i,n,r){return t===n||t===r?{start:e-i/2,end:e+i/2}:t<n||t>r?{start:e-i,end:e}:{start:e,end:e+i}}function Mo(t){return 0===t||180===t?"center":t<180?"left":"right"}function ko(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}function Co(t,e,i,n){const{ctx:r}=t;if(i)r.arc(t.xCenter,t.yCenter,e,0,O);else{let i=t.getPointPosition(0,e);r.moveTo(i.x,i.y);for(let o=1;o<n;o++)i=t.getPointPosition(o,e),r.lineTo(i.x,i.y)}}function To(t){return W(t)?t:0}vo.id="logarithmic",vo.defaults={ticks:{callback:Cn.formatters.logarithmic,major:{enabled:!0}}};class Do extends bo{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){this.width=this.maxWidth,this.height=this.maxHeight,this.paddingTop=wo(this.options)/2,this.xCenter=Math.floor(this.width/2),this.yCenter=Math.floor((this.height-this.paddingTop)/2),this.drawingArea=Math.min(this.height-this.paddingTop,this.width)/2}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=d(t)&&!isNaN(t)?t:0,this.max=d(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/wo(this.options))}generateTickLabels(t){bo.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map(((t,e)=>{const i=m(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""}))}fit(){const t=this.options;t.display&&t.pointLabels.display?function(t){const e={l:0,r:t.width,t:0,b:t.height-t.paddingTop},i={},n=[],r=[],o=t.getLabels().length;for(let h=0;h<o;h++){const o=t.options.pointLabels.setContext(t.getPointLabelContext(h));r[h]=o.padding;const u=t.getPointPosition(h,t.drawingArea+r[h]),d=oe(o.font),f=(a=t.ctx,s=d,l=c(l=t._pointLabels[h])?l:[l],{w:Bt(a,s.string,l),h:l.length*s.lineHeight});n[h]=f;const g=t.getIndexAngle(h),p=Y(g),m=_o(p,u.x,f.w,0,180),b=_o(p,u.y,f.h,90,270);m.start<e.l&&(e.l=m.start,i.l=g),m.end>e.r&&(e.r=m.end,i.r=g),b.start<e.t&&(e.t=b.start,i.t=g),b.end>e.b&&(e.b=b.end,i.b=g)}var a,s,l;t._setReductions(t.drawingArea,e,i),t._pointLabelItems=function(t,e,i){const n=[],r=t.getLabels().length,o=t.options,a=wo(o),s=t.getDistanceFromCenterForValue(o.ticks.reverse?t.min:t.max);for(let o=0;o<r;o++){const r=0===o?a/2:0,u=t.getPointPosition(o,s+r+i[o]),d=Y(t.getIndexAngle(o)),f=e[o],g=ko(u.y,f.h,d),p=Mo(d),m=(l=u.x,h=f.w,"right"===(c=p)?l-=h:"center"===c&&(l-=h/2),l);n.push({x:u.x,y:g,textAlign:p,left:m,top:g,right:m+f.w,bottom:g+f.h})}var l,h,c;return n}(t,n,r)}(this):this.setCenterPoint(0,0,0,0)}_setReductions(t,e,i){let n=e.l/Math.sin(i.l),r=Math.max(e.r-this.width,0)/Math.sin(i.r),o=-e.t/Math.cos(i.t),a=-Math.max(e.b-(this.height-this.paddingTop),0)/Math.cos(i.b);n=To(n),r=To(r),o=To(o),a=To(a),this.drawingArea=Math.max(t/2,Math.min(Math.floor(t-(n+r)/2),Math.floor(t-(o+a)/2))),this.setCenterPoint(n,r,o,a)}setCenterPoint(t,e,i,n){const r=this.width-e-this.drawingArea,o=t+this.drawingArea,a=i+this.drawingArea,s=this.height-this.paddingTop-n-this.drawingArea;this.xCenter=Math.floor((o+r)/2+this.left),this.yCenter=Math.floor((a+s)/2+this.top+this.paddingTop)}getIndexAngle(t){return Q(t*(O/this.getLabels().length)+j(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(h(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(h(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return function(t,e,i){return se(t,{label:i,index:e,type:"pointLabel"})}(this.getContext(),t,i)}}getPointPosition(t,e){const i=this.getIndexAngle(t)-R;return{x:Math.cos(i)*e+this.xCenter,y:Math.sin(i)*e+this.yCenter,angle:i}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:n,bottom:r}=this._pointLabelItems[t];return{left:e,top:i,right:n,bottom:r}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Co(this,this.getDistanceFromCenterForValue(this._endValue),e,this.getLabels().length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:n}=e,r=this.getLabels().length;let o,a,s;if(e.pointLabels.display&&function(t,e){const{ctx:i,options:{pointLabels:n}}=t;for(let r=e-1;r>=0;r--){const e=n.setContext(t.getPointLabelContext(r)),o=oe(e.font),{x:a,y:s,textAlign:l,left:c,top:u,right:d,bottom:f}=t._pointLabelItems[r],{backdropColor:g}=e;if(!h(g)){const t=re(e.backdropPadding);i.fillStyle=g,i.fillRect(c-t.left,u-t.top,d-c+t.width,f-u+t.height)}Qt(i,t._pointLabels[r],a,s+o.lineHeight/2,o,{color:e.color,textAlign:l,textBaseline:"middle"})}}(this,r),n.display&&this.ticks.forEach(((t,e)=>{0!==e&&(a=this.getDistanceFromCenterForValue(t.value),function(t,e,i,n){const r=t.ctx,o=e.circular,{color:a,lineWidth:s}=e;!o&&!n||!a||!s||i<0||(r.save(),r.strokeStyle=a,r.lineWidth=s,r.setLineDash(e.borderDash),r.lineDashOffset=e.borderDashOffset,r.beginPath(),Co(t,i,o,n),r.closePath(),r.stroke(),r.restore())}(this,n.setContext(this.getContext(e-1)),a,r))})),i.display){for(t.save(),o=this.getLabels().length-1;o>=0;o--){const n=i.setContext(this.getPointLabelContext(o)),{color:r,lineWidth:l}=n;l&&r&&(t.lineWidth=l,t.strokeStyle=r,t.setLineDash(n.borderDash),t.lineDashOffset=n.borderDashOffset,a=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),s=this.getPointPosition(o,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(s.x,s.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const n=this.getIndexAngle(0);let r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach(((n,a)=>{if(0===a&&!e.reverse)return;const s=i.setContext(this.getContext(a)),l=oe(s.font);if(r=this.getDistanceFromCenterForValue(this.ticks[a].value),s.showLabelBackdrop){t.font=l.string,o=t.measureText(n.label).width,t.fillStyle=s.backdropColor;const e=re(s.backdropPadding);t.fillRect(-o/2-e.left,-r-l.size/2-e.top,o+e.width,l.size+e.height)}Qt(t,n.label,0,-r,l,{color:s.color})})),t.restore()}drawTitle(){}}Do.id="radialLinear",Do.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Cn.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5}},Do.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},Do.descriptors={angleLines:{_fallback:"grid"}};const So={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}},Po=Object.keys(So);function zo(t,e){return t-e}function Oo(t,e){if(h(e))return null;const i=t._adapter,{parser:n,round:r,isoWeekday:o}=t._parseOpts;let a=e;return"function"==typeof n&&(a=n(a)),d(a)||(a="string"==typeof n?i.parse(a,n):i.parse(a)),null===a?null:(r&&(a="week"!==r||!W(o)&&!0!==o?i.startOf(a,r):i.startOf(a,"isoWeek",o)),+a)}function Ao(t,e,i,n){const r=Po.length;for(let o=Po.indexOf(t);o<r-1;++o){const t=So[Po[o]],r=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((i-e)/(r*t.size))<=n)return Po[o]}return Po[r-1]}function Eo(t,e,i){if(i){if(i.length){const{lo:n,hi:r}=le(i,e);t[i[n]>=e?i[n]:i[r]]=!0}}else t[e]=!0}function Lo(t,e,i){const n=[],r={},o=e.length;let a,s;for(a=0;a<o;++a)s=e[a],r[s]=a,n.push({value:s,major:!1});return 0!==o&&i?function(t,e,i,n){const r=t._adapter,o=+r.startOf(e[0].value,n),a=e[e.length-1].value;let s,l;for(s=o;s<=a;s=+r.add(s,1,n))l=i[s],l>=0&&(e[l].major=!0);return e}(t,n,r,i):n}class Ro extends En{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e){const i=t.time||(t.time={}),n=this._adapter=new Wi._date(t.adapters.date);M(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:Oo(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:n,max:r,minDefined:o,maxDefined:a}=this.getUserBounds();function s(t){o||isNaN(t.min)||(n=Math.min(n,t.min)),a||isNaN(t.max)||(r=Math.max(r,t.max))}o&&a||(s(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||s(this.getMinMax(!1))),n=d(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),r=d(r)&&!isNaN(r)?r:+e.endOf(Date.now(),i)+1,this.min=Math.min(n,r-1),this.max=Math.max(n+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,n="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const r=this.min,o=function(t,e,i){let n=0,r=t.length;for(;n<r&&t[n]<e;)n++;for(;r>n&&t[r-1]>i;)r--;return n>0||r<t.length?t.slice(n,r):t}(n,r,this.max);return this._unit=e.unit||(i.autoSkip?Ao(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):function(t,e,i,n,r){for(let o=Po.length-1;o>=Po.indexOf(i);o--){const i=Po[o];if(So[i].common&&t._adapter.diff(r,n,i)>=e-1)return i}return Po[i?Po.indexOf(i):0]}(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=Po.indexOf(t)+1,i=Po.length;e<i;++e)if(So[Po[e]].common)return Po[e]}(this._unit):void 0,this.initOffsets(n),t.reverse&&o.reverse(),Lo(this,o,this._majorUnit)}initOffsets(t){let e,i,n=0,r=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),n=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),r=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=K(n,0,o),r=K(r,0,o),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,e=this.min,i=this.max,n=this.options,r=n.time,o=r.unit||Ao(r.minUnit,e,i,this._getLabelCapacity(e)),a=g(r.stepSize,1),s="week"===o&&r.isoWeekday,l=W(s)||!0===s,h={};let c,u,d=e;if(l&&(d=+t.startOf(d,"isoWeek",s)),d=+t.startOf(d,l?"day":o),t.diff(i,e,o)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+o);const f="data"===n.ticks.source&&this.getDataTimestamps();for(c=d,u=0;c<i;c=+t.add(c,a,o),u++)Eo(h,c,f);return c!==i&&"ticks"!==n.bounds&&1!==u||Eo(h,c,f),Object.keys(h).sort(((t,e)=>t-e)).map((t=>+t))}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,n){const r=this.options,o=r.time.displayFormats,a=this._unit,s=this._majorUnit,l=a&&o[a],h=s&&o[s],c=i[e],u=s&&h&&c&&c.major,d=this._adapter.format(t,n||(u?h:l)),f=r.ticks.callback;return f?m(f,[d,e,i],this):d}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e<i;++e)n=t[e],n.label=this._tickFormatFunction(n.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,n=j(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(n),o=Math.sin(n),a=this._resolveTickFontOptions(0).size;return{w:i*r+a*o,h:i*o+a*r}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,n=i[e.unit]||i.millisecond,r=this._tickFormatFunction(t,0,Lo(this,[t],this._majorUnit),n),o=this._getLabelSize(r),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t<e;++t)i=i.concat(n[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(i)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const n=this.getLabels();for(e=0,i=n.length;e<i;++e)t.push(Oo(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return fe(t.sort(zo))}}function Fo(t,e,i){let n,r,o,a,s=0,l=t.length-1;i?(e>=t[s].pos&&e<=t[l].pos&&({lo:s,hi:l}=he(t,"pos",e)),({pos:n,time:o}=t[s]),({pos:r,time:a}=t[l])):(e>=t[s].time&&e<=t[l].time&&({lo:s,hi:l}=he(t,"time",e)),({time:n,pos:o}=t[s]),({time:r,pos:a}=t[l]));const h=r-n;return h?o+(a-o)*(e-n)/h:o}Ro.id="time",Ro.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class Io extends Ro{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Fo(e,this.min),this._tableRange=Fo(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],r=[];let o,a,s,l,h;for(o=0,a=t.length;o<a;++o)l=t[o],l>=e&&l<=i&&n.push(l);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,a=n.length;o<a;++o)h=n[o+1],s=n[o-1],l=n[o],Math.round((h+s)/2)!==l&&r.push({time:l,pos:o/(a-1)});return r}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Fo(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Fo(this._table,i*this._tableRange+this._minPos,!0)}}Io.id="timeseries",Io.defaults=Ro.defaults;const No=[Ni,Dr,go,Object.freeze({__proto__:null,CategoryScale:po,LinearScale:xo,LogarithmicScale:vo,RadialLinearScale:Do,TimeScale:Ro,TimeSeriesScale:Io})];rr.register(...No);const Ho=rr;function Bo(t,e){if(e.length<t)throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+e.length+" present")}function Wo(t){Bo(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"==typeof t&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}var Uo={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function Vo(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.width?String(e.width):t.defaultWidth,n=t.formats[i]||t.formats[t.defaultWidth];return n}}var jo,Yo={date:Vo({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Vo({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:Vo({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},$o={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function qo(t){return function(e,i){var n,r=i||{};if("formatting"===(r.context?String(r.context):"standalone")&&t.formattingValues){var o=t.defaultFormattingWidth||t.defaultWidth,a=r.width?String(r.width):o;n=t.formattingValues[a]||t.formattingValues[o]}else{var s=t.defaultWidth,l=r.width?String(r.width):t.defaultWidth;n=t.values[l]||t.values[s]}return n[t.argumentCallback?t.argumentCallback(e):e]}}function Xo(t){return function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.width,r=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],o=e.match(r);if(!o)return null;var a,s=o[0],l=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],h=Array.isArray(l)?Go(l,(function(t){return t.test(s)})):Qo(l,(function(t){return t.test(s)}));a=t.valueCallback?t.valueCallback(h):h,a=i.valueCallback?i.valueCallback(a):a;var c=e.slice(s.length);return{value:a,rest:c}}}function Qo(t,e){for(var i in t)if(t.hasOwnProperty(i)&&e(t[i]))return i}function Go(t,e){for(var i=0;i<t.length;i++)if(e(t[i]))return i}const Ko={code:"en-US",formatDistance:function(t,e,i){var n,r=Uo[t];return n="string"==typeof r?r:1===e?r.one:r.other.replace("{{count}}",e.toString()),null!=i&&i.addSuffix?i.comparison&&i.comparison>0?"in "+n:n+" ago":n},formatLong:Yo,formatRelative:function(t,e,i,n){return $o[t]},localize:{ordinalNumber:function(t,e){var i=Number(t),n=i%100;if(n>20||n<10)switch(n%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},era:qo({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:qo({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:qo({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:qo({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:qo({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(jo={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.match(jo.matchPattern);if(!i)return null;var n=i[0],r=t.match(jo.parsePattern);if(!r)return null;var o=jo.valueCallback?jo.valueCallback(r[0]):r[0];o=e.valueCallback?e.valueCallback(o):o;var a=t.slice(n.length);return{value:o,rest:a}}),era:Xo({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:Xo({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:Xo({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:Xo({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:Xo({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function Zo(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function Jo(t,e){Bo(2,arguments);var i=Wo(t).getTime(),n=Zo(e);return new Date(i+n)}function ta(t,e){Bo(2,arguments);var i=Zo(e);return Jo(t,-i)}function ea(t,e){if(null==t)throw new TypeError("assign requires that input parameter not be null or undefined");for(var i in e=e||{})Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}function ia(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}}function na(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}}var ra={p:na,P:function(t,e){var i,n=t.match(/(P+)(p+)?/),r=n[1],o=n[2];if(!o)return ia(t,e);switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;default:i=e.dateTime({width:"full"})}return i.replace("{{date}}",ia(r,e)).replace("{{time}}",na(o,e))}};const oa=ra;function aa(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}var sa=["D","DD"],la=["YY","YYYY"];function ha(t){return-1!==sa.indexOf(t)}function ca(t){return-1!==la.indexOf(t)}function ua(t,e,i){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://git.io/fxCyr"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://git.io/fxCyr"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://git.io/fxCyr"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://git.io/fxCyr"))}function da(t,e){Bo(1,arguments);var i=e||{},n=i.locale,r=n&&n.options&&n.options.weekStartsOn,o=null==r?0:Zo(r),a=null==i.weekStartsOn?o:Zo(i.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var s=Wo(t),l=s.getUTCDay(),h=(l<a?7:0)+l-a;return s.setUTCDate(s.getUTCDate()-h),s.setUTCHours(0,0,0,0),s}function fa(t,e){Bo(1,arguments);var i=Wo(t,e),n=i.getUTCFullYear(),r=e||{},o=r.locale,a=o&&o.options&&o.options.firstWeekContainsDate,s=null==a?1:Zo(a),l=null==r.firstWeekContainsDate?s:Zo(r.firstWeekContainsDate);if(!(l>=1&&l<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var h=new Date(0);h.setUTCFullYear(n+1,0,l),h.setUTCHours(0,0,0,0);var c=da(h,e),u=new Date(0);u.setUTCFullYear(n,0,l),u.setUTCHours(0,0,0,0);var d=da(u,e);return i.getTime()>=c.getTime()?n+1:i.getTime()>=d.getTime()?n:n-1}function ga(t,e,i){Bo(2,arguments);var n=i||{},r=n.locale,o=r&&r.options&&r.options.weekStartsOn,a=null==o?0:Zo(o),s=null==n.weekStartsOn?a:Zo(n.weekStartsOn);if(!(s>=0&&s<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var l=Wo(t),h=Zo(e),c=l.getUTCDay(),u=h%7,d=(u+7)%7,f=(d<s?7:0)+h-c;return l.setUTCDate(l.getUTCDate()+f),l}function pa(t){Bo(1,arguments);var e=1,i=Wo(t),n=i.getUTCDay(),r=(n<e?7:0)+n-e;return i.setUTCDate(i.getUTCDate()-r),i.setUTCHours(0,0,0,0),i}function ma(t){Bo(1,arguments);var e=Wo(t),i=e.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(i+1,0,4),n.setUTCHours(0,0,0,0);var r=pa(n),o=new Date(0);o.setUTCFullYear(i,0,4),o.setUTCHours(0,0,0,0);var a=pa(o);return e.getTime()>=r.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function ba(t){Bo(1,arguments);var e=ma(t),i=new Date(0);i.setUTCFullYear(e,0,4),i.setUTCHours(0,0,0,0);var n=pa(i);return n}var xa=6048e5;function ya(t){Bo(1,arguments);var e=Wo(t),i=pa(e).getTime()-ba(e).getTime();return Math.round(i/xa)+1}function va(t,e){Bo(1,arguments);var i=e||{},n=i.locale,r=n&&n.options&&n.options.firstWeekContainsDate,o=null==r?1:Zo(r),a=null==i.firstWeekContainsDate?o:Zo(i.firstWeekContainsDate),s=fa(t,e),l=new Date(0);l.setUTCFullYear(s,0,a),l.setUTCHours(0,0,0,0);var h=da(l,e);return h}var wa=6048e5;function _a(t,e){Bo(1,arguments);var i=Wo(t),n=da(i,e).getTime()-va(i,e).getTime();return Math.round(n/wa)+1}var Ma=/^(1[0-2]|0?\d)/,ka=/^(3[0-1]|[0-2]?\d)/,Ca=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,Ta=/^(5[0-3]|[0-4]?\d)/,Da=/^(2[0-3]|[0-1]?\d)/,Sa=/^(2[0-4]|[0-1]?\d)/,Pa=/^(1[0-1]|0?\d)/,za=/^(1[0-2]|0?\d)/,Oa=/^[0-5]?\d/,Aa=/^[0-5]?\d/,Ea=/^\d/,La=/^\d{1,2}/,Ra=/^\d{1,3}/,Fa=/^\d{1,4}/,Ia=/^-?\d+/,Na=/^-?\d/,Ha=/^-?\d{1,2}/,Ba=/^-?\d{1,3}/,Wa=/^-?\d{1,4}/,Ua=/^([+-])(\d{2})(\d{2})?|Z/,Va=/^([+-])(\d{2})(\d{2})|Z/,ja=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,Ya=/^([+-])(\d{2}):(\d{2})|Z/,$a=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function qa(t,e,i){var n=e.match(t);if(!n)return null;var r=parseInt(n[0],10);return{value:i?i(r):r,rest:e.slice(n[0].length)}}function Xa(t,e){var i=e.match(t);return i?"Z"===i[0]?{value:0,rest:e.slice(1)}:{value:("+"===i[1]?1:-1)*(36e5*(i[2]?parseInt(i[2],10):0)+6e4*(i[3]?parseInt(i[3],10):0)+1e3*(i[5]?parseInt(i[5],10):0)),rest:e.slice(i[0].length)}:null}function Qa(t,e){return qa(Ia,t,e)}function Ga(t,e,i){switch(t){case 1:return qa(Ea,e,i);case 2:return qa(La,e,i);case 3:return qa(Ra,e,i);case 4:return qa(Fa,e,i);default:return qa(new RegExp("^\\d{1,"+t+"}"),e,i)}}function Ka(t,e,i){switch(t){case 1:return qa(Na,e,i);case 2:return qa(Ha,e,i);case 3:return qa(Ba,e,i);case 4:return qa(Wa,e,i);default:return qa(new RegExp("^-?\\d{1,"+t+"}"),e,i)}}function Za(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function Ja(t,e){var i,n=e>0,r=n?e:1-e;if(r<=50)i=t||100;else{var o=r+50;i=t+100*Math.floor(o/100)-(t>=o%100?100:0)}return n?i:1-i}var ts=[31,28,31,30,31,30,31,31,30,31,30,31],es=[31,29,31,30,31,30,31,31,30,31,30,31];function is(t){return t%400==0||t%4==0&&t%100!=0}const ns={G:{priority:140,parse:function(t,e,i,n){switch(e){case"G":case"GG":case"GGG":return i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"});case"GGGGG":return i.era(t,{width:"narrow"});default:return i.era(t,{width:"wide"})||i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"})}},set:function(t,e,i,n){return e.era=i,t.setUTCFullYear(i,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["R","u","t","T"]},y:{priority:130,parse:function(t,e,i,n){var r=function(t){return{year:t,isTwoDigitYear:"yy"===e}};switch(e){case"y":return Ga(4,t,r);case"yo":return i.ordinalNumber(t,{unit:"year",valueCallback:r});default:return Ga(e.length,t,r)}},validate:function(t,e,i){return e.isTwoDigitYear||e.year>0},set:function(t,e,i,n){var r=t.getUTCFullYear();if(i.isTwoDigitYear){var o=Ja(i.year,r);return t.setUTCFullYear(o,0,1),t.setUTCHours(0,0,0,0),t}var a="era"in e&&1!==e.era?1-i.year:i.year;return t.setUTCFullYear(a,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","u","w","I","i","e","c","t","T"]},Y:{priority:130,parse:function(t,e,i,n){var r=function(t){return{year:t,isTwoDigitYear:"YY"===e}};switch(e){case"Y":return Ga(4,t,r);case"Yo":return i.ordinalNumber(t,{unit:"year",valueCallback:r});default:return Ga(e.length,t,r)}},validate:function(t,e,i){return e.isTwoDigitYear||e.year>0},set:function(t,e,i,n){var r=fa(t,n);if(i.isTwoDigitYear){var o=Ja(i.year,r);return t.setUTCFullYear(o,0,n.firstWeekContainsDate),t.setUTCHours(0,0,0,0),da(t,n)}var a="era"in e&&1!==e.era?1-i.year:i.year;return t.setUTCFullYear(a,0,n.firstWeekContainsDate),t.setUTCHours(0,0,0,0),da(t,n)},incompatibleTokens:["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:{priority:130,parse:function(t,e,i,n){return Ka("R"===e?4:e.length,t)},set:function(t,e,i,n){var r=new Date(0);return r.setUTCFullYear(i,0,4),r.setUTCHours(0,0,0,0),pa(r)},incompatibleTokens:["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:{priority:130,parse:function(t,e,i,n){return Ka("u"===e?4:e.length,t)},set:function(t,e,i,n){return t.setUTCFullYear(i,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["G","y","Y","R","w","I","i","e","c","t","T"]},Q:{priority:120,parse:function(t,e,i,n){switch(e){case"Q":case"QQ":return Ga(e.length,t);case"Qo":return i.ordinalNumber(t,{unit:"quarter"});case"QQQ":return i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return i.quarter(t,{width:"narrow",context:"formatting"});default:return i.quarter(t,{width:"wide",context:"formatting"})||i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,i){return e>=1&&e<=4},set:function(t,e,i,n){return t.setUTCMonth(3*(i-1),1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:{priority:120,parse:function(t,e,i,n){switch(e){case"q":case"qq":return Ga(e.length,t);case"qo":return i.ordinalNumber(t,{unit:"quarter"});case"qqq":return i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return i.quarter(t,{width:"narrow",context:"standalone"});default:return i.quarter(t,{width:"wide",context:"standalone"})||i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,i){return e>=1&&e<=4},set:function(t,e,i,n){return t.setUTCMonth(3*(i-1),1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:{priority:110,parse:function(t,e,i,n){var r=function(t){return t-1};switch(e){case"M":return qa(Ma,t,r);case"MM":return Ga(2,t,r);case"Mo":return i.ordinalNumber(t,{unit:"month",valueCallback:r});case"MMM":return i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return i.month(t,{width:"narrow",context:"formatting"});default:return i.month(t,{width:"wide",context:"formatting"})||i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,i){return e>=0&&e<=11},set:function(t,e,i,n){return t.setUTCMonth(i,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]},L:{priority:110,parse:function(t,e,i,n){var r=function(t){return t-1};switch(e){case"L":return qa(Ma,t,r);case"LL":return Ga(2,t,r);case"Lo":return i.ordinalNumber(t,{unit:"month",valueCallback:r});case"LLL":return i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return i.month(t,{width:"narrow",context:"standalone"});default:return i.month(t,{width:"wide",context:"standalone"})||i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,i){return e>=0&&e<=11},set:function(t,e,i,n){return t.setUTCMonth(i,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:{priority:100,parse:function(t,e,i,n){switch(e){case"w":return qa(Ta,t);case"wo":return i.ordinalNumber(t,{unit:"week"});default:return Ga(e.length,t)}},validate:function(t,e,i){return e>=1&&e<=53},set:function(t,e,i,n){return da(function(t,e,i){Bo(2,arguments);var n=Wo(t),r=Zo(e),o=_a(n,i)-r;return n.setUTCDate(n.getUTCDate()-7*o),n}(t,i,n),n)},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:{priority:100,parse:function(t,e,i,n){switch(e){case"I":return qa(Ta,t);case"Io":return i.ordinalNumber(t,{unit:"week"});default:return Ga(e.length,t)}},validate:function(t,e,i){return e>=1&&e<=53},set:function(t,e,i,n){return pa(function(t,e){Bo(2,arguments);var i=Wo(t),n=Zo(e),r=ya(i)-n;return i.setUTCDate(i.getUTCDate()-7*r),i}(t,i,n),n)},incompatibleTokens:["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:{priority:90,subPriority:1,parse:function(t,e,i,n){switch(e){case"d":return qa(ka,t);case"do":return i.ordinalNumber(t,{unit:"date"});default:return Ga(e.length,t)}},validate:function(t,e,i){var n=is(t.getUTCFullYear()),r=t.getUTCMonth();return n?e>=1&&e<=es[r]:e>=1&&e<=ts[r]},set:function(t,e,i,n){return t.setUTCDate(i),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:{priority:90,subPriority:1,parse:function(t,e,i,n){switch(e){case"D":case"DD":return qa(Ca,t);case"Do":return i.ordinalNumber(t,{unit:"date"});default:return Ga(e.length,t)}},validate:function(t,e,i){return is(t.getUTCFullYear())?e>=1&&e<=366:e>=1&&e<=365},set:function(t,e,i,n){return t.setUTCMonth(0,i),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:{priority:90,parse:function(t,e,i,n){switch(e){case"E":case"EE":case"EEE":return i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return i.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});default:return i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,i){return e>=0&&e<=6},set:function(t,e,i,n){return(t=ga(t,i,n)).setUTCHours(0,0,0,0),t},incompatibleTokens:["D","i","e","c","t","T"]},e:{priority:90,parse:function(t,e,i,n){var r=function(t){var e=7*Math.floor((t-1)/7);return(t+n.weekStartsOn+6)%7+e};switch(e){case"e":case"ee":return Ga(e.length,t,r);case"eo":return i.ordinalNumber(t,{unit:"day",valueCallback:r});case"eee":return i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"eeeee":return i.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});default:return i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,i){return e>=0&&e<=6},set:function(t,e,i,n){return(t=ga(t,i,n)).setUTCHours(0,0,0,0),t},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:{priority:90,parse:function(t,e,i,n){var r=function(t){var e=7*Math.floor((t-1)/7);return(t+n.weekStartsOn+6)%7+e};switch(e){case"c":case"cc":return Ga(e.length,t,r);case"co":return i.ordinalNumber(t,{unit:"day",valueCallback:r});case"ccc":return i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});case"ccccc":return i.day(t,{width:"narrow",context:"standalone"});case"cccccc":return i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});default:return i.day(t,{width:"wide",context:"standalone"})||i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,i){return e>=0&&e<=6},set:function(t,e,i,n){return(t=ga(t,i,n)).setUTCHours(0,0,0,0),t},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:{priority:90,parse:function(t,e,i,n){var r=function(t){return 0===t?7:t};switch(e){case"i":case"ii":return Ga(e.length,t);case"io":return i.ordinalNumber(t,{unit:"day"});case"iii":return i.day(t,{width:"abbreviated",context:"formatting",valueCallback:r})||i.day(t,{width:"short",context:"formatting",valueCallback:r})||i.day(t,{width:"narrow",context:"formatting",valueCallback:r});case"iiiii":return i.day(t,{width:"narrow",context:"formatting",valueCallback:r});case"iiiiii":return i.day(t,{width:"short",context:"formatting",valueCallback:r})||i.day(t,{width:"narrow",context:"formatting",valueCallback:r});default:return i.day(t,{width:"wide",context:"formatting",valueCallback:r})||i.day(t,{width:"abbreviated",context:"formatting",valueCallback:r})||i.day(t,{width:"short",context:"formatting",valueCallback:r})||i.day(t,{width:"narrow",context:"formatting",valueCallback:r})}},validate:function(t,e,i){return e>=1&&e<=7},set:function(t,e,i,n){return t=function(t,e){Bo(2,arguments);var i=Zo(e);i%7==0&&(i-=7);var n=1,r=Wo(t),o=r.getUTCDay(),a=((i%7+7)%7<n?7:0)+i-o;return r.setUTCDate(r.getUTCDate()+a),r}(t,i,n),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:{priority:80,parse:function(t,e,i,n){switch(e){case"a":case"aa":case"aaa":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}},set:function(t,e,i,n){return t.setUTCHours(Za(i),0,0,0),t},incompatibleTokens:["b","B","H","K","k","t","T"]},b:{priority:80,parse:function(t,e,i,n){switch(e){case"b":case"bb":case"bbb":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}},set:function(t,e,i,n){return t.setUTCHours(Za(i),0,0,0),t},incompatibleTokens:["a","B","H","K","k","t","T"]},B:{priority:80,parse:function(t,e,i,n){switch(e){case"B":case"BB":case"BBB":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}},set:function(t,e,i,n){return t.setUTCHours(Za(i),0,0,0),t},incompatibleTokens:["a","b","t","T"]},h:{priority:70,parse:function(t,e,i,n){switch(e){case"h":return qa(za,t);case"ho":return i.ordinalNumber(t,{unit:"hour"});default:return Ga(e.length,t)}},validate:function(t,e,i){return e>=1&&e<=12},set:function(t,e,i,n){var r=t.getUTCHours()>=12;return r&&i<12?t.setUTCHours(i+12,0,0,0):r||12!==i?t.setUTCHours(i,0,0,0):t.setUTCHours(0,0,0,0),t},incompatibleTokens:["H","K","k","t","T"]},H:{priority:70,parse:function(t,e,i,n){switch(e){case"H":return qa(Da,t);case"Ho":return i.ordinalNumber(t,{unit:"hour"});default:return Ga(e.length,t)}},validate:function(t,e,i){return e>=0&&e<=23},set:function(t,e,i,n){return t.setUTCHours(i,0,0,0),t},incompatibleTokens:["a","b","h","K","k","t","T"]},K:{priority:70,parse:function(t,e,i,n){switch(e){case"K":return qa(Pa,t);case"Ko":return i.ordinalNumber(t,{unit:"hour"});default:return Ga(e.length,t)}},validate:function(t,e,i){return e>=0&&e<=11},set:function(t,e,i,n){return t.getUTCHours()>=12&&i<12?t.setUTCHours(i+12,0,0,0):t.setUTCHours(i,0,0,0),t},incompatibleTokens:["a","b","h","H","k","t","T"]},k:{priority:70,parse:function(t,e,i,n){switch(e){case"k":return qa(Sa,t);case"ko":return i.ordinalNumber(t,{unit:"hour"});default:return Ga(e.length,t)}},validate:function(t,e,i){return e>=1&&e<=24},set:function(t,e,i,n){var r=i<=24?i%24:i;return t.setUTCHours(r,0,0,0),t},incompatibleTokens:["a","b","h","H","K","t","T"]},m:{priority:60,parse:function(t,e,i,n){switch(e){case"m":return qa(Oa,t);case"mo":return i.ordinalNumber(t,{unit:"minute"});default:return Ga(e.length,t)}},validate:function(t,e,i){return e>=0&&e<=59},set:function(t,e,i,n){return t.setUTCMinutes(i,0,0),t},incompatibleTokens:["t","T"]},s:{priority:50,parse:function(t,e,i,n){switch(e){case"s":return qa(Aa,t);case"so":return i.ordinalNumber(t,{unit:"second"});default:return Ga(e.length,t)}},validate:function(t,e,i){return e>=0&&e<=59},set:function(t,e,i,n){return t.setUTCSeconds(i,0),t},incompatibleTokens:["t","T"]},S:{priority:30,parse:function(t,e,i,n){return Ga(e.length,t,(function(t){return Math.floor(t*Math.pow(10,3-e.length))}))},set:function(t,e,i,n){return t.setUTCMilliseconds(i),t},incompatibleTokens:["t","T"]},X:{priority:10,parse:function(t,e,i,n){switch(e){case"X":return Xa(Ua,t);case"XX":return Xa(Va,t);case"XXXX":return Xa(ja,t);case"XXXXX":return Xa($a,t);default:return Xa(Ya,t)}},set:function(t,e,i,n){return e.timestampIsSet?t:new Date(t.getTime()-i)},incompatibleTokens:["t","T","x"]},x:{priority:10,parse:function(t,e,i,n){switch(e){case"x":return Xa(Ua,t);case"xx":return Xa(Va,t);case"xxxx":return Xa(ja,t);case"xxxxx":return Xa($a,t);default:return Xa(Ya,t)}},set:function(t,e,i,n){return e.timestampIsSet?t:new Date(t.getTime()-i)},incompatibleTokens:["t","T","X"]},t:{priority:40,parse:function(t,e,i,n){return Qa(t)},set:function(t,e,i,n){return[new Date(1e3*i),{timestampIsSet:!0}]},incompatibleTokens:"*"},T:{priority:20,parse:function(t,e,i,n){return Qa(t)},set:function(t,e,i,n){return[new Date(i),{timestampIsSet:!0}]},incompatibleTokens:"*"}};var rs=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,os=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,as=/^'([^]*?)'?$/,ss=/''/g,ls=/\S/,hs=/[a-zA-Z]/;function cs(t,e){if(e.timestampIsSet)return t;var i=new Date(0);return i.setFullYear(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()),i.setHours(t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds()),i}function us(t){return t.match(as)[1].replace(ss,"'")}var ds=36e5,fs={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},gs=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ps=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,ms=/^([+-])(\d{2})(?::?(\d{2}))?$/;function bs(t){var e,i={},n=t.split(fs.dateTimeDelimiter);if(n.length>2)return i;if(/:/.test(n[0])?(i.date=null,e=n[0]):(i.date=n[0],e=n[1],fs.timeZoneDelimiter.test(i.date)&&(i.date=t.split(fs.timeZoneDelimiter)[0],e=t.substr(i.date.length,t.length))),e){var r=fs.timezone.exec(e);r?(i.time=e.replace(r[1],""),i.timezone=r[1]):i.time=e}return i}function xs(t,e){var i=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),n=t.match(i);if(!n)return{year:null};var r=n[1]&&parseInt(n[1]),o=n[2]&&parseInt(n[2]);return{year:null==o?r:100*o,restDateString:t.slice((n[1]||n[2]).length)}}function ys(t,e){if(null===e)return null;var i=t.match(gs);if(!i)return null;var n=!!i[4],r=vs(i[1]),o=vs(i[2])-1,a=vs(i[3]),s=vs(i[4]),l=vs(i[5])-1;if(n)return function(t,e,i){return e>=1&&e<=53&&i>=0&&i<=6}(0,s,l)?function(t,e,i){var n=new Date(0);n.setUTCFullYear(t,0,4);var r=7*(e-1)+i+1-(n.getUTCDay()||7);return n.setUTCDate(n.getUTCDate()+r),n}(e,s,l):new Date(NaN);var h=new Date(0);return function(t,e,i){return e>=0&&e<=11&&i>=1&&i<=(ks[e]||(Cs(t)?29:28))}(e,o,a)&&function(t,e){return e>=1&&e<=(Cs(t)?366:365)}(e,r)?(h.setUTCFullYear(e,o,Math.max(r,a)),h):new Date(NaN)}function vs(t){return t?parseInt(t):1}function ws(t){var e=t.match(ps);if(!e)return null;var i=_s(e[1]),n=_s(e[2]),r=_s(e[3]);return function(t,e,i){return 24===t?0===e&&0===i:i>=0&&i<60&&e>=0&&e<60&&t>=0&&t<25}(i,n,r)?i*ds+6e4*n+1e3*r:NaN}function _s(t){return t&&parseFloat(t.replace(",","."))||0}function Ms(t){if("Z"===t)return 0;var e=t.match(ms);if(!e)return 0;var i="+"===e[1]?-1:1,n=parseInt(e[2]),r=e[3]&&parseInt(e[3])||0;return function(t,e){return e>=0&&e<=59}(0,r)?i*(n*ds+6e4*r):NaN}var ks=[31,null,31,30,31,30,31,31,30,31,30,31];function Cs(t){return t%400==0||t%4==0&&t%100}function Ts(t){return Bo(1,arguments),t instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)}function Ds(t){if(Bo(1,arguments),!Ts(t)&&"number"!=typeof t)return!1;var e=Wo(t);return!isNaN(Number(e))}function Ss(t,e){for(var i=t<0?"-":"",n=Math.abs(t).toString();n.length<e;)n="0"+n;return i+n}const Ps=function(t,e){var i=t.getUTCFullYear(),n=i>0?i:1-i;return Ss("yy"===e?n%100:n,e.length)},zs=function(t,e){var i=t.getUTCMonth();return"M"===e?String(i+1):Ss(i+1,2)},Os=function(t,e){return Ss(t.getUTCDate(),e.length)},As=function(t,e){return Ss(t.getUTCHours()%12||12,e.length)},Es=function(t,e){return Ss(t.getUTCHours(),e.length)},Ls=function(t,e){return Ss(t.getUTCMinutes(),e.length)},Rs=function(t,e){return Ss(t.getUTCSeconds(),e.length)},Fs=function(t,e){var i=e.length,n=t.getUTCMilliseconds();return Ss(Math.floor(n*Math.pow(10,i-3)),e.length)};var Is=864e5;function Ns(t,e){var i=t>0?"-":"+",n=Math.abs(t),r=Math.floor(n/60),o=n%60;if(0===o)return i+String(r);var a=e||"";return i+String(r)+a+Ss(o,2)}function Hs(t,e){return t%60==0?(t>0?"-":"+")+Ss(Math.abs(t)/60,2):Bs(t,e)}function Bs(t,e){var i=e||"",n=t>0?"-":"+",r=Math.abs(t);return n+Ss(Math.floor(r/60),2)+i+Ss(r%60,2)}const Ws={G:function(t,e,i){var n=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return i.era(n,{width:"abbreviated"});case"GGGGG":return i.era(n,{width:"narrow"});default:return i.era(n,{width:"wide"})}},y:function(t,e,i){if("yo"===e){var n=t.getUTCFullYear(),r=n>0?n:1-n;return i.ordinalNumber(r,{unit:"year"})}return Ps(t,e)},Y:function(t,e,i,n){var r=fa(t,n),o=r>0?r:1-r;return"YY"===e?Ss(o%100,2):"Yo"===e?i.ordinalNumber(o,{unit:"year"}):Ss(o,e.length)},R:function(t,e){return Ss(ma(t),e.length)},u:function(t,e){return Ss(t.getUTCFullYear(),e.length)},Q:function(t,e,i){var n=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return Ss(n,2);case"Qo":return i.ordinalNumber(n,{unit:"quarter"});case"QQQ":return i.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(n,{width:"narrow",context:"formatting"});default:return i.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,i){var n=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return Ss(n,2);case"qo":return i.ordinalNumber(n,{unit:"quarter"});case"qqq":return i.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(n,{width:"narrow",context:"standalone"});default:return i.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,i){var n=t.getUTCMonth();switch(e){case"M":case"MM":return zs(t,e);case"Mo":return i.ordinalNumber(n+1,{unit:"month"});case"MMM":return i.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(n,{width:"narrow",context:"formatting"});default:return i.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,i){var n=t.getUTCMonth();switch(e){case"L":return String(n+1);case"LL":return Ss(n+1,2);case"Lo":return i.ordinalNumber(n+1,{unit:"month"});case"LLL":return i.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(n,{width:"narrow",context:"standalone"});default:return i.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,i,n){var r=_a(t,n);return"wo"===e?i.ordinalNumber(r,{unit:"week"}):Ss(r,e.length)},I:function(t,e,i){var n=ya(t);return"Io"===e?i.ordinalNumber(n,{unit:"week"}):Ss(n,e.length)},d:function(t,e,i){return"do"===e?i.ordinalNumber(t.getUTCDate(),{unit:"date"}):Os(t,e)},D:function(t,e,i){var n=function(t){Bo(1,arguments);var e=Wo(t),i=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var n=e.getTime(),r=i-n;return Math.floor(r/Is)+1}(t);return"Do"===e?i.ordinalNumber(n,{unit:"dayOfYear"}):Ss(n,e.length)},E:function(t,e,i){var n=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return i.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(n,{width:"short",context:"formatting"});default:return i.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,i,n){var r=t.getUTCDay(),o=(r-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return Ss(o,2);case"eo":return i.ordinalNumber(o,{unit:"day"});case"eee":return i.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(r,{width:"short",context:"formatting"});default:return i.day(r,{width:"wide",context:"formatting"})}},c:function(t,e,i,n){var r=t.getUTCDay(),o=(r-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return Ss(o,e.length);case"co":return i.ordinalNumber(o,{unit:"day"});case"ccc":return i.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(r,{width:"narrow",context:"standalone"});case"cccccc":return i.day(r,{width:"short",context:"standalone"});default:return i.day(r,{width:"wide",context:"standalone"})}},i:function(t,e,i){var n=t.getUTCDay(),r=0===n?7:n;switch(e){case"i":return String(r);case"ii":return Ss(r,e.length);case"io":return i.ordinalNumber(r,{unit:"day"});case"iii":return i.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(n,{width:"short",context:"formatting"});default:return i.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,i){var n=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(n,{width:"narrow",context:"formatting"});default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(t,e,i){var n,r=t.getUTCHours();switch(n=12===r?"noon":0===r?"midnight":r/12>=1?"pm":"am",e){case"b":case"bb":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(n,{width:"narrow",context:"formatting"});default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(t,e,i){var n,r=t.getUTCHours();switch(n=r>=17?"evening":r>=12?"afternoon":r>=4?"morning":"night",e){case"B":case"BB":case"BBB":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(n,{width:"narrow",context:"formatting"});default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(t,e,i){if("ho"===e){var n=t.getUTCHours()%12;return 0===n&&(n=12),i.ordinalNumber(n,{unit:"hour"})}return As(t,e)},H:function(t,e,i){return"Ho"===e?i.ordinalNumber(t.getUTCHours(),{unit:"hour"}):Es(t,e)},K:function(t,e,i){var n=t.getUTCHours()%12;return"Ko"===e?i.ordinalNumber(n,{unit:"hour"}):Ss(n,e.length)},k:function(t,e,i){var n=t.getUTCHours();return 0===n&&(n=24),"ko"===e?i.ordinalNumber(n,{unit:"hour"}):Ss(n,e.length)},m:function(t,e,i){return"mo"===e?i.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):Ls(t,e)},s:function(t,e,i){return"so"===e?i.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):Rs(t,e)},S:function(t,e){return Fs(t,e)},X:function(t,e,i,n){var r=(n._originalDate||t).getTimezoneOffset();if(0===r)return"Z";switch(e){case"X":return Hs(r);case"XXXX":case"XX":return Bs(r);default:return Bs(r,":")}},x:function(t,e,i,n){var r=(n._originalDate||t).getTimezoneOffset();switch(e){case"x":return Hs(r);case"xxxx":case"xx":return Bs(r);default:return Bs(r,":")}},O:function(t,e,i,n){var r=(n._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Ns(r,":");default:return"GMT"+Bs(r,":")}},z:function(t,e,i,n){var r=(n._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Ns(r,":");default:return"GMT"+Bs(r,":")}},t:function(t,e,i,n){var r=n._originalDate||t;return Ss(Math.floor(r.getTime()/1e3),e.length)},T:function(t,e,i,n){return Ss((n._originalDate||t).getTime(),e.length)}};var Us=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Vs=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,js=/^'([^]*?)'?$/,Ys=/''/g,$s=/[a-zA-Z]/;function qs(t){return t.match(js)[1].replace(Ys,"'")}var Xs=36e5;function Qs(t,e){Bo(2,arguments);var i=Wo(t),n=Zo(e);return isNaN(n)?new Date(NaN):n?(i.setDate(i.getDate()+n),i):i}function Gs(t,e){Bo(2,arguments);var i=Wo(t),n=Zo(e);if(isNaN(n))return new Date(NaN);if(!n)return i;var r=i.getDate(),o=new Date(i.getTime());o.setMonth(i.getMonth()+n+1,0);var a=o.getDate();return r>=a?o:(i.setFullYear(o.getFullYear(),o.getMonth(),r),i)}function Ks(t,e){return Bo(2,arguments),Wo(t).getTime()-Wo(e).getTime()}var Zs={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}};function Js(t){return t?Zs[t]:Zs.trunc}Math.pow(10,8);var tl=36e5;function el(t){Bo(1,arguments);var e=Wo(t);return e.setHours(0,0,0,0),e}var il=864e5;function nl(t,e){Bo(2,arguments);var i=el(t),n=el(e),r=i.getTime()-aa(i),o=n.getTime()-aa(n);return Math.round((r-o)/il)}function rl(t,e){var i=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return i<0?-1:i>0?1:i}function ol(t,e){Bo(2,arguments);var i=Wo(t),n=Wo(e),r=rl(i,n),o=Math.abs(nl(i,n));i.setDate(i.getDate()-r*o);var a=Number(rl(i,n)===-r),s=r*(o-a);return 0===s?0:s}function al(t,e){Bo(2,arguments);var i=Wo(t),n=Wo(e),r=i.getFullYear()-n.getFullYear(),o=i.getMonth()-n.getMonth();return 12*r+o}function sl(t,e){Bo(2,arguments);var i=Wo(t),n=Wo(e),r=i.getTime()-n.getTime();return r<0?-1:r>0?1:r}function ll(t){Bo(1,arguments);var e=Wo(t);return e.setHours(23,59,59,999),e}function hl(t){Bo(1,arguments);var e=Wo(t),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function cl(t){Bo(1,arguments);var e=Wo(t);return ll(e).getTime()===hl(e).getTime()}function ul(t,e){Bo(2,arguments);var i,n=Wo(t),r=Wo(e),o=sl(n,r),a=Math.abs(al(n,r));if(a<1)i=0;else{1===n.getMonth()&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-o*a);var s=sl(n,r)===-o;cl(Wo(t))&&1===a&&1===sl(t,r)&&(s=!1),i=o*(a-Number(s))}return 0===i?0:i}function dl(t,e){Bo(2,arguments);var i=Wo(t),n=Wo(e);return i.getFullYear()-n.getFullYear()}function fl(t,e){Bo(1,arguments);var i=e||{},n=i.locale,r=n&&n.options&&n.options.weekStartsOn,o=null==r?0:Zo(r),a=null==i.weekStartsOn?o:Zo(i.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var s=Wo(t),l=s.getDay(),h=(l<a?7:0)+l-a;return s.setDate(s.getDate()-h),s.setHours(0,0,0,0),s}const gl={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};Wi._date.override({_id:"date-fns",formats:function(){return gl},parse:function(t,e){if(null==t)return null;const i=typeof t;return"number"===i||t instanceof Date?t=Wo(t):"string"===i&&(t="string"==typeof e?function(t,e,i,n){Bo(3,arguments);var r=String(t),o=String(e),a=n||{},s=a.locale||Ko;if(!s.match)throw new RangeError("locale must contain match property");var l=s.options&&s.options.firstWeekContainsDate,h=null==l?1:Zo(l),c=null==a.firstWeekContainsDate?h:Zo(a.firstWeekContainsDate);if(!(c>=1&&c<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var u=s.options&&s.options.weekStartsOn,d=null==u?0:Zo(u),f=null==a.weekStartsOn?d:Zo(a.weekStartsOn);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(""===o)return""===r?Wo(i):new Date(NaN);var g,p={firstWeekContainsDate:c,weekStartsOn:f,locale:s},m=[{priority:10,subPriority:-1,set:cs,index:0}],b=o.match(os).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,oa[e])(t,s.formatLong,p):t})).join("").match(rs),x=[];for(g=0;g<b.length;g++){var y=b[g];!a.useAdditionalWeekYearTokens&&ca(y)&&ua(y,o,t),!a.useAdditionalDayOfYearTokens&&ha(y)&&ua(y,o,t);var v=y[0],w=ns[v];if(w){var _=w.incompatibleTokens;if(Array.isArray(_)){for(var M=void 0,k=0;k<x.length;k++){var C=x[k].token;if(-1!==_.indexOf(C)||C===v){M=x[k];break}}if(M)throw new RangeError("The format string mustn't contain `".concat(M.fullToken,"` and `").concat(y,"` at the same time"))}else if("*"===w.incompatibleTokens&&x.length)throw new RangeError("The format string mustn't contain `".concat(y,"` and any other token at the same time"));x.push({token:v,fullToken:y});var T=w.parse(r,y,s.match,p);if(!T)return new Date(NaN);m.push({priority:w.priority,subPriority:w.subPriority||0,set:w.set,validate:w.validate,value:T.value,index:m.length}),r=T.rest}else{if(v.match(hs))throw new RangeError("Format string contains an unescaped latin alphabet character `"+v+"`");if("''"===y?y="'":"'"===v&&(y=us(y)),0!==r.indexOf(y))return new Date(NaN);r=r.slice(y.length)}}if(r.length>0&&ls.test(r))return new Date(NaN);var D=m.map((function(t){return t.priority})).sort((function(t,e){return e-t})).filter((function(t,e,i){return i.indexOf(t)===e})).map((function(t){return m.filter((function(e){return e.priority===t})).sort((function(t,e){return e.subPriority-t.subPriority}))})).map((function(t){return t[0]})),S=Wo(i);if(isNaN(S))return new Date(NaN);var P=ta(S,aa(S)),z={};for(g=0;g<D.length;g++){var O=D[g];if(O.validate&&!O.validate(P,O.value,p))return new Date(NaN);var A=O.set(P,z,O.value,p);A[0]?(P=A[0],ea(z,A[1])):P=A}return P}(t,e,new Date,this.options):function(t,e){Bo(1,arguments);var i=e||{},n=null==i.additionalDigits?2:Zo(i.additionalDigits);if(2!==n&&1!==n&&0!==n)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof t&&"[object String]"!==Object.prototype.toString.call(t))return new Date(NaN);var r,o=bs(t);if(o.date){var a=xs(o.date,n);r=ys(a.restDateString,a.year)}if(isNaN(r)||!r)return new Date(NaN);var s,l=r.getTime(),h=0;if(o.time&&(h=ws(o.time),isNaN(h)||null===h))return new Date(NaN);if(!o.timezone){var c=new Date(l+h),u=new Date(0);return u.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),u.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),u}return s=Ms(o.timezone),isNaN(s)?new Date(NaN):new Date(l+h+s)}(t,this.options)),Ds(t)?t.getTime():null},format:function(t,e){return function(t,e,i){Bo(2,arguments);var n=String(e),r=i||{},o=r.locale||Ko,a=o.options&&o.options.firstWeekContainsDate,s=null==a?1:Zo(a),l=null==r.firstWeekContainsDate?s:Zo(r.firstWeekContainsDate);if(!(l>=1&&l<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var h=o.options&&o.options.weekStartsOn,c=null==h?0:Zo(h),u=null==r.weekStartsOn?c:Zo(r.weekStartsOn);if(!(u>=0&&u<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!o.localize)throw new RangeError("locale must contain localize property");if(!o.formatLong)throw new RangeError("locale must contain formatLong property");var d=Wo(t);if(!Ds(d))throw new RangeError("Invalid time value");var f=aa(d),g=ta(d,f),p={firstWeekContainsDate:l,weekStartsOn:u,locale:o,_originalDate:d};return n.match(Vs).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,oa[e])(t,o.formatLong,p):t})).join("").match(Us).map((function(i){if("''"===i)return"'";var n=i[0];if("'"===n)return qs(i);var a=Ws[n];if(a)return!r.useAdditionalWeekYearTokens&&ca(i)&&ua(i,e,t),!r.useAdditionalDayOfYearTokens&&ha(i)&&ua(i,e,t),a(g,i,o.localize,p);if(n.match($s))throw new RangeError("Format string contains an unescaped latin alphabet character `"+n+"`");return i})).join("")}(t,e,this.options)},add:function(t,e,i){switch(i){case"millisecond":return Jo(t,e);case"second":return function(t,e){Bo(2,arguments);var i=Zo(e);return Jo(t,1e3*i)}(t,e);case"minute":return function(t,e){Bo(2,arguments);var i=Zo(e);return Jo(t,6e4*i)}(t,e);case"hour":return function(t,e){Bo(2,arguments);var i=Zo(e);return Jo(t,i*Xs)}(t,e);case"day":return Qs(t,e);case"week":return function(t,e){Bo(2,arguments);var i=Zo(e);return Qs(t,7*i)}(t,e);case"month":return Gs(t,e);case"quarter":return function(t,e){Bo(2,arguments);var i=Zo(e);return Gs(t,3*i)}(t,e);case"year":return function(t,e){Bo(2,arguments);var i=Zo(e);return Gs(t,12*i)}(t,e);default:return t}},diff:function(t,e,i){switch(i){case"millisecond":return Ks(t,e);case"second":return function(t,e,i){Bo(2,arguments);var n=Ks(t,e)/1e3;return Js(null==i?void 0:i.roundingMethod)(n)}(t,e);case"minute":return function(t,e,i){Bo(2,arguments);var n=Ks(t,e)/6e4;return Js(null==i?void 0:i.roundingMethod)(n)}(t,e);case"hour":return function(t,e,i){Bo(2,arguments);var n=Ks(t,e)/tl;return Js(null==i?void 0:i.roundingMethod)(n)}(t,e);case"day":return ol(t,e);case"week":return function(t,e,i){Bo(2,arguments);var n=ol(t,e)/7;return Js(null==i?void 0:i.roundingMethod)(n)}(t,e);case"month":return ul(t,e);case"quarter":return function(t,e,i){Bo(2,arguments);var n=ul(t,e)/3;return Js(null==i?void 0:i.roundingMethod)(n)}(t,e);case"year":return function(t,e){Bo(2,arguments);var i=Wo(t),n=Wo(e),r=sl(i,n),o=Math.abs(dl(i,n));i.setFullYear(1584),n.setFullYear(1584);var a=sl(i,n)===-r,s=r*(o-Number(a));return 0===s?0:s}(t,e);default:return 0}},startOf:function(t,e,i){switch(e){case"second":return function(t){Bo(1,arguments);var e=Wo(t);return e.setMilliseconds(0),e}(t);case"minute":return function(t){Bo(1,arguments);var e=Wo(t);return e.setSeconds(0,0),e}(t);case"hour":return function(t){Bo(1,arguments);var e=Wo(t);return e.setMinutes(0,0,0),e}(t);case"day":return el(t);case"week":return fl(t);case"isoWeek":return fl(t,{weekStartsOn:+i});case"month":return function(t){Bo(1,arguments);var e=Wo(t);return e.setDate(1),e.setHours(0,0,0,0),e}(t);case"quarter":return function(t){Bo(1,arguments);var e=Wo(t),i=e.getMonth(),n=i-i%3;return e.setMonth(n,1),e.setHours(0,0,0,0),e}(t);case"year":return function(t){Bo(1,arguments);var e=Wo(t),i=new Date(0);return i.setFullYear(e.getFullYear(),0,1),i.setHours(0,0,0,0),i}(t);default:return t}},endOf:function(t,e){switch(e){case"second":return function(t){Bo(1,arguments);var e=Wo(t);return e.setMilliseconds(999),e}(t);case"minute":return function(t){Bo(1,arguments);var e=Wo(t);return e.setSeconds(59,999),e}(t);case"hour":return function(t){Bo(1,arguments);var e=Wo(t);return e.setMinutes(59,59,999),e}(t);case"day":return ll(t);case"week":return function(t,e){Bo(1,arguments);var i=e||{},n=i.locale,r=n&&n.options&&n.options.weekStartsOn,o=null==r?0:Zo(r),a=null==i.weekStartsOn?o:Zo(i.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var s=Wo(t),l=s.getDay(),h=6+(l<a?-7:0)-(l-a);return s.setDate(s.getDate()+h),s.setHours(23,59,59,999),s}(t);case"month":return hl(t);case"quarter":return function(t){Bo(1,arguments);var e=Wo(t),i=e.getMonth(),n=i-i%3+3;return e.setMonth(n,0),e.setHours(23,59,59,999),e}(t);case"year":return function(t){Bo(1,arguments);var e=Wo(t),i=e.getFullYear();return e.setFullYear(i+1,0,0),e.setHours(23,59,59,999),e}(t);default:return t}}}),e().use(Ho)})()})();
\ No newline at end of file