!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(function(){try{return require("moment")}catch(n){}}()):"function"==typeof define&&define.amd?define(["require"],function(n){return t(function(){try{return n("moment")}catch(n){}}())}):(n=n||self).Chart=t(n.moment)}(this,function(n){"use strict";function rh(n){var t=function(){for(var t={},i=Object.keys(e),r=i.length,n=0;n<r;n++)t[i[n]]={distance:-1,parent:null};return t}(),r=[n],o,i;for(t[n].distance=0;r.length;)for(var u=r.pop(),s=Object.keys(e[u]),h=s.length,f=0;f<h;f++)o=s[f],i=t[o],-1===i.distance&&(i.distance=t[u].distance+1,i.parent=u,r.unshift(o));return t}function uh(n,t){return function(i){return t(n(i))}}function fh(n,t){for(var u=[t[n].parent,n],r=e[t[n].parent][n],i=t[n].parent;t[i].parent;)u.unshift(t[i].parent),r=uh(e[t[i].parent][i],r),i=t[i].parent;return r.conversion=u,r}function gr(n){var t;if(n){var r=[0,0,0],u=1,i=n.match(/^#([a-fA-F0-9]{3,4})$/i),f="";if(i){for(f=(i=i[1])[3],t=0;t<r.length;t++)r[t]=parseInt(i[t]+i[t],16);f&&(u=Math.round(parseInt(f+f,16)/255*100)/100)}else if(i=n.match(/^#([a-fA-F0-9]{6}([a-fA-F0-9]{2})?)$/i)){for(f=i[2],i=i[1],t=0;t<r.length;t++)r[t]=parseInt(i.slice(2*t,2*t+2),16);f&&(u=Math.round(parseInt(f,16)/255*100)/100)}else if(i=n.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(t=0;t<r.length;t++)r[t]=parseInt(i[t+1]);u=parseFloat(i[4])}else if(i=n.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(t=0;t<r.length;t++)r[t]=Math.round(2.55*parseFloat(i[t+1]));u=parseFloat(i[4])}else if(i=n.match(/(\w+)/)){if("transparent"==i[1])return[0,0,0,0];if(!(r=dr[i[1]]))return}for(t=0;t<r.length;t++)r[t]=g(r[t],0,255);return u=u||0==u?g(u,0,1):1,r[3]=u,r}}function nu(n){var t,i;if(n&&(t=n.match(/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/),t))return i=parseFloat(t[4]),[g(parseInt(t[1]),0,360),g(parseFloat(t[2]),0,100),g(parseFloat(t[3]),0,100),g(isNaN(i)?1:i,0,1)]}function fe(n){var t,i;if(n&&(t=n.match(/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/),t))return i=parseFloat(t[4]),[g(parseInt(t[1]),0,360),g(parseFloat(t[2]),0,100),g(parseFloat(t[3]),0,100),g(isNaN(i)?1:i,0,1)]}function ee(n,t){return void 0===t&&(t=void 0!==n[3]?n[3]:1),"rgba("+n[0]+", "+n[1]+", "+n[2]+", "+t+")"}function oe(n,t){return"rgba("+Math.round(n[0]/255*100)+"%, "+Math.round(n[1]/255*100)+"%, "+Math.round(n[2]/255*100)+"%, "+(t||n[3]||1)+")"}function se(n,t){return void 0===t&&(t=void 0!==n[3]?n[3]:1),"hsla("+n[0]+", "+n[1]+"%, "+n[2]+"%, "+t+")"}function g(n,t,i){return Math.min(Math.max(t,n),i)}function di(n){var t=n.toString(16).toUpperCase();return t.length<2?"0"+t:t}function ye(n,t){var u=n._chartjs,i,r;u&&(i=u.listeners,r=i.indexOf(t),-1!==r&&i.splice(r,1),i.length>0||(ve.forEach(function(t){delete n[t]}),delete n._chartjs))}function pe(n,t){var u=t.startAngle,f=t.endAngle,i=t.pixelMargin,r=i/t.outerRadius,e=t.x,o=t.y;n.beginPath();n.arc(e,o,t.outerRadius,u-r,f+r);t.innerRadius>i?(r=i/t.innerRadius,n.arc(e,o,t.innerRadius-i,f+r,u-r,!0)):n.arc(e,o,i,f+Math.PI/2,u-Math.PI/2);n.closePath();n.clip()}function bh(n,t,i){var r="inner"===t.borderAlign;r?(n.lineWidth=2*t.borderWidth,n.lineJoin="round"):(n.lineWidth=t.borderWidth,n.lineJoin="bevel");i.fullCircles&&function(n,t,i,r){var u,f=i.endAngle;for(r&&(i.endAngle=i.startAngle+d,pe(n,i),i.endAngle=f,i.endAngle===i.startAngle&&i.fullCircles&&(i.endAngle+=d,i.fullCircles--)),n.beginPath(),n.arc(i.x,i.y,i.innerRadius,i.startAngle+d,i.startAngle,!0),u=0;u<i.fullCircles;++u)n.stroke();for(n.beginPath(),n.arc(i.x,i.y,t.outerRadius,i.startAngle,i.startAngle+d),u=0;u<i.fullCircles;++u)n.stroke()}(n,t,i,r);r&&pe(n,i);n.beginPath();n.arc(i.x,i.y,t.outerRadius,i.startAngle,i.endAngle);n.arc(i.x,i.y,i.innerRadius,i.endAngle,i.startAngle,!0);n.closePath();n.stroke()}function de(n){var t=this._view;return!!t&&Math.abs(n-t.x)<t.radius+t.hitRadius}function ur(n){return n&&void 0!==n.width}function no(n){var i,r,u,f,t;return ur(n)?(t=n.width/2,i=n.x-t,r=n.x+t,u=Math.min(n.y,n.base),f=Math.max(n.y,n.base)):(t=n.height/2,i=Math.min(n.x,n.base),r=Math.max(n.x,n.base),u=n.y-t,f=n.y+t),{left:i,top:u,right:r,bottom:f}}function to(n,t,i){return n===t?i:n===i?t:n}function nc(n,i,r){var f,e,o,s,u=n.borderWidth,h=function(n){var t=n.borderSkipped,i={};return t?(n.horizontal?n.base>n.x&&(t=to(t,"left","right")):n.base<n.y&&(t=to(t,"bottom","top")),i[t]=!0,i):i}(n);return t.isObject(u)?(f=+u.top||0,e=+u.right||0,o=+u.bottom||0,s=+u.left||0):f=e=o=s=+u||0,{t:h.top||f<0?0:f>r?r:f,r:h.right||e<0?0:e>i?i:e,b:h.bottom||o<0?0:o>r?r:o,l:h.left||s<0?0:s>i?i:s}}function ci(n,t,i){var u=null===t,f=null===i,r=!(!n||u&&f)&&no(n);return r&&(u||t>=r.left&&t<=r.right)&&(f||i>=r.top&&i<=r.bottom)}function ec(n,i,r){var u,f,e=r.barThickness,o=i.stackCount,s=i.pixels[n],h=t.isNullOrUndef(e)?function(n,t){for(var e,f,r=n._length,i=1,u=t.length;i<u;++i)r=Math.min(r,Math.abs(t[i]-t[i-1]));for(i=0,u=n.getTicks().length;i<u;++i)f=n.getPixelForTick(i),r=i>0?Math.min(r,Math.abs(f-e)):r,e=f;return r}(i.scale,i.pixels):-1;return t.isNullOrUndef(e)?(u=h*r.categoryPercentage,f=r.barPercentage):(u=e*o,f=1),{chunk:u/o,ratio:f,start:s-u/2}}function ro(n,t){var i=n&&n.options.ticks||{},r=i.reverse,u=void 0===i.min?t:0,f=void 0===i.max?t:0;return{start:r?f:u,end:r?u:f}}function lc(n,t,i){var r=i/2,u=ro(n,r),f=ro(t,r);return{top:f.end,right:u.end,bottom:f.start,left:u.start}}function ac(n){var i,r,u,f;return t.isObject(n)?(i=n.top,r=n.right,u=n.bottom,f=n.left):i=r=u=f=n,{top:i,right:r,bottom:u,left:f}}function bt(n,i){return n.native?{x:n.x,y:n.y}:t.getRelativePosition(n,i)}function li(n,t){for(var u,r,e,o,s=n._getSortedVisibleDatasetMetas(),i=0,f=s.length;i<f;++i)for(r=0,e=(u=s[i].data).length;r<e;++r)(o=u[r])._view.skip||t(o)}function vu(n,t){var i=[];return li(n,function(n){n.inRange(t.x,t.y)&&i.push(n)}),i}function yu(n,t,i,r){var u=Number.POSITIVE_INFINITY,f=[];return li(n,function(n){if(!i||n.inRange(t.x,t.y)){var o=n.getCenterPoint(),e=r(t,o);e<u?(f=[n],u=e):e===u&&f.push(n)}}),f}function pu(n){var t=-1!==n.indexOf("x"),i=-1!==n.indexOf("y");return function(n,r){var u=t?Math.abs(n.x-r.x):0,f=i?Math.abs(n.y-r.y):0;return Math.sqrt(Math.pow(u,2)+Math.pow(f,2))}}function wu(n,t,i){var r=bt(t,n);i.axis=i.axis||"x";var e=pu(i.axis),u=i.intersect?vu(n,r):yu(n,r,!1,e),f=[];return u.length?(n._getSortedVisibleDatasetMetas().forEach(function(n){var t=n.data[u[0]._index];t&&!t._view.skip&&f.push(t)}),f):[]}function ai(n,i){return t.where(n,function(n){return n.pos===i})}function or(n,t){return n.sort(function(n,i){var r=t?i:n,u=t?n:i;return r.weight===u.weight?r.index-u.index:r.weight-u.weight})}function so(n,t,i,r){return Math.max(n[i],t[i])+Math.max(n[r],t[r])}function vc(n,t,i){var f,e,o=i.box,r=n.maxPadding,u;return(i.size&&(n[i.pos]-=i.size),i.size=i.horizontal?o.height:o.width,n[i.pos]+=i.size,o.getPadding)&&(u=o.getPadding(),r.top=Math.max(r.top,u.top),r.left=Math.max(r.left,u.left),r.bottom=Math.max(r.bottom,u.bottom),r.right=Math.max(r.right,u.right)),(f=t.outerWidth-so(r,n,"left","right"),e=t.outerHeight-so(r,n,"top","bottom"),f!==n.w||e!==n.h)?(n.w=f,n.h=e,i.horizontal?f!==n.w:e!==n.h):void 0}function yc(n,t){function r(n){var r={left:0,top:0,right:0,bottom:0};return n.forEach(function(n){r[n]=Math.max(t[n],i[n])}),r}var i=t.maxPadding;return r(n?["left","right"]:["top","bottom"])}function sr(n,t,i){for(var r,o,s,h,f=[],u=0,e=n.length;u<e;++u)(o=(r=n[u]).box).update(r.width||t.w,r.height||t.h,yc(r.horizontal,t)),vc(t,i,r)&&(h=!0,f.length&&(s=!0)),o.fullWidth||f.push(r);return s&&sr(f,t,i)||h}function ho(n,t,i){for(var s,r,h=i.padding,f=t.x,e=t.y,u=0,o=n.length;u<o;++u)r=(s=n[u]).box,s.horizontal?(r.left=r.fullWidth?h.left:t.left,r.right=r.fullWidth?i.outerWidth-h.right:t.left+t.w,r.top=e,r.bottom=e+r.height,r.width=r.right-r.left,e=r.bottom):(r.left=f,r.right=f+r.width,r.top=t.top,r.bottom=t.top+t.h,r.height=r.bottom-r.top,f=r.right);t.x=f;t.y=e}function ao(n,i){var r=t.getStyle(n,i),u=r&&r.match(/^(\d+)(\.\d+)?px$/);if(u)return Number(u[1])}function vi(n,t,i){n.addEventListener(t,i,du)}function gu(n,t,i){n.removeEventListener(t,i,du)}function nf(n,t,i,r,u){return{type:n,chart:t,"native":u||null,x:void 0!==i?i:null,y:void 0!==r?r:null}}function yi(n){var t=document.createElement("div");return t.className=n||"",t}function kc(n,i,r){var c,f,u,e,s=n[o]||(n[o]={}),h=s.resizer=function(n){var r=yi(ku),t=yi(ku+"-expand"),i=yi(ku+"-shrink"),u;return t.appendChild(yi()),i.appendChild(yi()),r.appendChild(t),r.appendChild(i),r._reset=function(){t.scrollLeft=1e6;t.scrollTop=1e6;i.scrollLeft=1e6;i.scrollTop=1e6},u=function(){r._reset();n()},vi(t,"scroll",u.bind(t,"expand")),vi(i,"scroll",u.bind(i,"shrink")),r}((c=function(){if(s.resizer){var t=r.options.maintainAspectRatio&&n.parentNode,u=t?t.clientWidth:0;i(nf("resize",r));t&&t.clientWidth<u&&r.canvas&&i(nf("resize",r))}},u=!1,e=[],function(){e=Array.prototype.slice.call(arguments);f=f||this;u||(u=!0,t.requestAnimFrame.call(window,function(){u=!1;c.apply(f,e)}))}));!function(n,i){var r=n[o]||(n[o]={}),u=r.renderProxy=function(n){n.animationName===wc&&i()};t.each(lo,function(t){vi(n,t,u)});r.reflow=!!n.offsetParent;n.classList.add(co)}(n,function(){if(s.resizer){var t=n.parentNode;t&&t!==h.parentNode&&t.insertBefore(h,t.firstChild);h._reset()}})}function dc(n){var r=n[o]||{},i=r.resizer;delete r.resizer,function(n){var i=n[o]||{},r=i.renderProxy;r&&(t.each(lo,function(t){gu(n,t,r)}),delete i.renderProxy);n.classList.remove(co)}(n);i&&i.parentNode&&i.parentNode.removeChild(i)}function tt(n,i){return i&&(t.isArray(i)?Array.prototype.push.apply(n,i):n.push(i)),n}function et(n){return("string"==typeof n||n instanceof String)&&n.indexOf("\n")>-1?n.split("\n"):n}function yo(n){var t=i.global;return{xPadding:n.xPadding,yPadding:n.yPadding,xAlign:n.xAlign,yAlign:n.yAlign,rtl:n.rtl,textDirection:n.textDirection,bodyFontColor:n.bodyFontColor,_bodyFontFamily:ft(n.bodyFontFamily,t.defaultFontFamily),_bodyFontStyle:ft(n.bodyFontStyle,t.defaultFontStyle),_bodyAlign:n.bodyAlign,bodyFontSize:ft(n.bodyFontSize,t.defaultFontSize),bodySpacing:n.bodySpacing,titleFontColor:n.titleFontColor,_titleFontFamily:ft(n.titleFontFamily,t.defaultFontFamily),_titleFontStyle:ft(n.titleFontStyle,t.defaultFontStyle),titleFontSize:ft(n.titleFontSize,t.defaultFontSize),_titleAlign:n.titleAlign,titleSpacing:n.titleSpacing,titleMarginBottom:n.titleMarginBottom,footerFontColor:n.footerFontColor,_footerFontFamily:ft(n.footerFontFamily,t.defaultFontFamily),_footerFontStyle:ft(n.footerFontStyle,t.defaultFontStyle),footerFontSize:ft(n.footerFontSize,t.defaultFontSize),_footerAlign:n.footerAlign,footerSpacing:n.footerSpacing,footerMarginTop:n.footerMarginTop,caretSize:n.caretSize,cornerRadius:n.cornerRadius,backgroundColor:n.backgroundColor,opacity:0,legendColorBackground:n.multiKeyBackground,displayColors:n.displayColors,borderColor:n.borderColor,borderWidth:n.borderWidth}}function hr(n,t){return"center"===t?n.x+n.width/2:"right"===t?n.x+n.width-n.xPadding:n.x+n.xPadding}function po(n){return tt([],et(n))}function wo(){return t.merge({},[].slice.call(arguments),{merger:function(n,i,r,u){if("xAxes"===n||"yAxes"===n){var f,o,e,s=r[n].length;for(i[n]||(i[n]=[]),f=0;f<s;++f)e=r[n][f],o=cr(e.type,"xAxes"===n?"category":"linear"),f>=i[n].length&&i[n].push({}),!i[n][f].type||e.type&&e.type!==i[n][f].type?t.merge(i[n][f],[pi.getScaleDefaults(o),e]):t.merge(i[n][f],e)}else t._merger(n,i,r,u)}})}function ef(){return t.merge({},[].slice.call(arguments),{merger:function(n,i,r,u){var e=i[n]||{},f=r[n];"scales"===n?i[n]=wo(e,f):"scale"===n?i[n]=t.merge(e,[pi.getScaleDefaults(f.type),f]):t._merger(n,i,r,u)}})}function tl(n){var r=n.options;t.each(n.scales,function(t){b.removeBox(n,t)});r=ef(i.global,i[n.config.type],r);n.options=n.config.options=r;n.ensureScalesHaveIDs();n.buildOrUpdateScales();n.tooltip._options=r.tooltips;n.tooltip.initialize()}function bo(n,i,r){var u,f=function(n){return n.id===u};do u=i+r++;while(t.findIndex(n,f)>=0);return u}function ko(n){return"top"===n||"bottom"===n}function go(n,t){return function(i,r){return i[n]===r[n]?i[t]-r[t]:i[n]-r[n]}}function gt(){throw new Error("This method is not implemented: either no adapter can be found or an incomplete integration was provided.");}function lr(n){this.options=n||{}}function il(n,t,i){var u,e=n.getTicks().length,f=Math.min(t,e-1),r=n.getPixelForTick(f),o=n._startPixel,s=n._endPixel;if(!(i&&(u=1===e?Math.max(r-o,s-r):0===t?(n.getPixelForTick(1)-r)/2:(r-n.getPixelForTick(f-1))/2,(r+=f<t?u:-u)<o-1e-6||r>s+1e-6)))return r}function rl(n,i,r,u){function p(n){return{width:v[n]||0,height:y[n]||0,offset:tt[n]||0}}for(var h,d,f,w,b,s,c,e,l,a,g,nt,k=r.length,v=[],y=[],tt=[],o=0;o<k;++o){if(f=r[o].label,w=r[o].major?i.major:i.minor,n.font=b=w.string,s=u[b]=u[b]||{data:{},gc:[]},c=w.lineHeight,e=l=0,bi(f)||ni(f)){if(ni(f))for(h=0,d=f.length;h<d;++h)a=f[h],bi(a)||ni(a)||(e=t.measureText(n,s.data,s.gc,e,a),l+=c)}else e=t.measureText(n,s.data,s.gc,e,f),l=c;v.push(e);y.push(l);tt.push(c/2)}return function(n,i){t.each(n,function(n){var t,r=n.gc,u=r.length/2;if(u>i){for(t=0;t<u;++t)delete n.data[r[t]];r.splice(0,u)}})}(u,k),g=v.indexOf(Math.max.apply(null,v)),nt=y.indexOf(Math.max.apply(null,y)),{first:p(0),last:p(k-1),widest:p(g),highest:p(nt)}}function ki(n){return n.drawTicks?n.tickMarkLength:0}function sf(n){var i,r;return n.display?(i=t.options._parseFont(n),r=t.options.toPadding(n.padding),i.lineHeight+r.height):0}function ns(n,r){return t.extend(t.options._parseFont({fontFamily:ti(r.fontFamily,n.fontFamily),fontSize:ti(r.fontSize,n.fontSize),fontStyle:ti(r.fontStyle,n.fontStyle),lineHeight:ti(r.lineHeight,n.lineHeight)}),{color:t.options.resolve([r.fontColor,n.fontColor,i.global.defaultFontColor])})}function hf(n){var t=ns(n,n.minor);return{minor:t,major:n.major.enabled?ns(n,n.major):t}}function cf(n){for(var i,u=[],t=0,r=n.length;t<r;++t)void 0!==(i=n[t])._index&&u.push(i);return u}function ar(n,t,i,r){var h,u,s,f,e=ti(i,0),c=Math.min(ti(r,n.length),n.length),o=0;for(t=Math.ceil(t),r&&(t=(h=r-i)/Math.floor(h/t)),f=e;f<0;)o++,f=Math.round(e+o*t);for(u=Math.max(e,0);u<c;u++)s=n[u],u===f?(s._index=u,o++,f=Math.round(e+o*t)):delete s.label}function el(n,t,i,r){for(var f,s=n.options,h=function(n,t,i){var r=[i.type,void 0===t&&void 0===i.stack?i.index:"",i.stack].join(".");return void 0===n[r]&&(n[r]={pos:[],neg:[]}),n[r]}(t,s.stacked,i),e=h.pos,o=h.neg,c=r.length,u=0;u<c;++u)f=n._parseValue(r[u]),isNaN(f.min)||isNaN(f.max)||i.data[u].hidden||(e[u]=e[u]||0,o[u]=o[u]||0,s.relativePoints?e[u]=100:f.min<0||f.max<0?o[u]+=f.min:e[u]+=f.max)}function ol(n,t,i){for(var u,f=i.length,r=0;r<f;++r)u=n._parseValue(i[r]),isNaN(u.min)||isNaN(u.max)||t.data[r].hidden||(n.min=Math.min(n.min,u.min),n.max=Math.max(n.max,u.max))}function pr(n,i){return t.isFinite(n)&&n>=0?n:i}function wf(n){var t=n.ticks;return t.display&&n.display?wr(t.fontSize,i.global.defaultFontSize)+2*t.backdropPaddingY:0}function fs(n,t,i,r,u){return n===r||n===u?{start:t-i/2,end:t+i/2}:n<r||n>u?{start:t-i,end:t}:{start:t,end:t+i}}function cl(n){return 0===n||180===n?"center":n<180?"left":"right"}function ll(n,i,r,u){var f,o,e=r.y+u/2;if(t.isArray(i))for(f=0,o=i.length;f<o;++f)n.fillText(i[f],r.x,e),e+=u;else n.fillText(i,r.x,e)}function al(n,t,i){90===n||270===n?i.y-=t.h/2:(n>270||n<90)&&(i.y-=t.h)}function br(n){return t.isNumber(n)?n:0}function hs(n,t){return n-t}function cs(n){return t.valueOrDefault(n.time.min,n.ticks.min)}function ls(n){return t.valueOrDefault(n.time.max,n.ticks.max)}function si(n,t,i,r){var u=function(n,t,i){for(var u,f,r,e=0,o=n.length-1;e>=0&&e<=o;){if(f=n[(u=e+o>>1)-1]||null,r=n[u],!f)return{lo:null,hi:r};if(r[t]<i)e=u+1;else{if(!(f[t]>i))return{lo:f,hi:r};o=u-1}}return{lo:r,hi:null}}(n,t,i),f=u.lo?u.hi?u.lo:n[n.length-2]:n[0],e=u.lo?u.hi?u.hi:n[n.length-1]:n[1],o=e[t]-f[t],s=o?(i-f[t])/o:0,h=(e[r]-f[r])*s;return f[r]+h}function gf(n,i){var e=n._adapter,o=n.options.time,u=o.parser,f=u||o.format,r=i;return"function"==typeof u&&(r=u(r)),t.isFinite(r)||(r="string"==typeof f?e.parse(r,f):e.parse(r)),null!==r?+r:(u||"function"!=typeof f||(r=f(i),t.isFinite(r)||(r=e.parse(r))),r)}function ri(n,i){if(t.isNullOrUndef(i))return null;var u=n.options.time,r=gf(n,n.getRightValue(i));return null===r?r:(u.round&&(r=+n._adapter.startOf(r,u.round)),r)}function as(n,t,i,r){for(var f,e,o=v.length,u=v.indexOf(n);u<o-1;++u)if(e=(f=kr[v[u]]).steps?f.steps:df,f.common&&Math.ceil((i-t)/(e*f.size))<=r)return v[u];return v[o-1]}function vs(n,t,i){for(var f,u=[],e={},o=t.length,r=0;r<o;++r)e[f=t[r]]=r,u.push({value:f,major:!1});return 0!==o&&i?function(n,t,i,r){for(var f,e=n._adapter,o=+e.startOf(t[0].value,r),s=t[t.length-1].value,u=o;u<=s;u=+e.add(u,1,r))(f=i[u])>=0&&(t[f].major=!0);return t}(n,u,e,i):u}function yl(n,t,i){var r,f=n._model||{},u=f.fill;if(void 0===u&&(u=!!f.backgroundColor),!1===u||null===u)return!1;if(!0===u)return"origin";if(r=parseFloat(u,10),isFinite(r)&&Math.floor(r)===r)return"-"!==u[0]&&"+"!==u[0]||(r=t+r),!(r===t||r<0||r>=i)&&r;switch(u){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return u;default:return!1}}function pl(n){return(n.el._scale||{}).getPointPositionForValue?function(n){var u,s,f,i,r,t=n.el._scale,e=t.options,h=t.chart.data.labels.length,o=n.fill,c=[];if(!h)return null;for(u=e.ticks.reverse?t.max:t.min,s=e.ticks.reverse?t.min:t.max,f=t.getPointPositionForValue(0,u),i=0;i<h;++i)r="start"===o||"end"===o?t.getPointPositionForValue(i,"start"===o?u:s):t.getBasePosition(i),e.gridLines.circular&&(r.cx=f.x,r.cy=f.y,r.angle=t.getIndexAngle(i)-Math.PI/2),c.push(r);return c}(n):function(n){var e,r=n.el._model||{},u=n.el._scale||{},f=n.fill,i=null;if(isFinite(f))return null;if("start"===f?i=void 0===r.scaleBottom?u.bottom:r.scaleBottom:"end"===f?i=void 0===r.scaleTop?u.top:r.scaleTop:void 0!==r.scaleZero?i=r.scaleZero:u.getBasePixel&&(i=u.getBasePixel()),null!=i){if(void 0!==i.x&&void 0!==i.y)return i;if(t.isFinite(i))return{x:(e=u.isHorizontal())?i:null,y:e?null:i}}return null}(n)}function wl(n,t,i){var u,r=n[t].fill,f=[t];if(!i)return r;for(;!1!==r&&-1===f.indexOf(r);){if(!isFinite(r))return r;if(!(u=n[r]))return!1;if(u.visible)return r;f.push(r);r=u.fill}return!1}function bl(n){var t=n.fill,i="dataset";return!1===t?null:(isFinite(t)||(i="boundary"),bs[i](n))}function ks(n){return n&&!n.skip}function ds(n,i,r,u,f){var e,o,s,h;if(u&&f){for(n.moveTo(i[0].x,i[0].y),e=1;e<u;++e)t.canvas.lineTo(n,i[e-1],i[e]);if(void 0===r[0].angle)for(n.lineTo(r[f-1].x,r[f-1].y),e=f-1;e>0;--e)t.canvas.lineTo(n,r[e],r[e-1],!0);else for(o=r[0].cx,s=r[0].cy,h=Math.sqrt(Math.pow(r[0].x-o,2)+Math.pow(r[0].y-s,2)),e=f-1;e>0;--e)n.arc(o,s,h,r[e].angle,r[e-1].angle,!0)}}function kl(n,t,i,r,u,f){var e,y,b,l,a,v,p,k,w=t.length,d=r.spanGaps,o=[],s=[],h=0,c=0;for(n.beginPath(),e=0,y=w;e<y;++e)a=i(l=t[b=e%w]._view,b,r),v=ks(l),p=ks(a),f&&void 0===k&&v&&(y=w+(k=e+1)),v&&p?(h=o.push(l),c=s.push(a)):h&&c&&(d?(v&&o.push(l),p&&s.push(a)):(ds(n,o,s,h,c),h=c=0,o=[],s=[]));ds(n,o,s,h,c);n.closePath();n.fillStyle=u;n.fill()}function te(n,t){return n.usePointStyle&&n.boxWidth>t?t:n.boxWidth}function gs(n,t){var i=new ie({ctx:n.ctx,options:t,chart:n});b.configure(n,i,t);b.addBox(n,i);n.legend=i}function th(n,t){var i=new re({ctx:n.ctx,options:t,chart:n});b.configure(n,i,t);b.addBox(n,i);n.titleBlock=i}var st,e,vt,tu,iu,s,ui,ce,ru,ir,rr,y,d,ge,ou,ei,yt,hu,lu,uo,fo,eo,ht,oo,au,kt,er,du,tf,vo,dt,uf,cr,ot,r,vr,af,is,yf,rs,bf,es,ne,ys,ps,ws,bs,ie,nh,it,re,ue,ih;n=n&&n.hasOwnProperty("default")?n.default:n;st={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};e=function(n,t){return n(t={exports:{}},t.exports),t.exports}(function(n){var u={},r,t,i,f,e;for(r in st)st.hasOwnProperty(r)&&(u[st[r]]=r);t=n.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(i in t)if(t.hasOwnProperty(i)){if(!("channels"in t[i]))throw new Error("missing channels property: "+i);if(!("labels"in t[i]))throw new Error("missing channel labels property: "+i);if(t[i].labels.length!==t[i].channels)throw new Error("channel and label counts mismatch: "+i);f=t[i].channels;e=t[i].labels;delete t[i].channels;delete t[i].labels;Object.defineProperty(t[i],"channels",{value:f});Object.defineProperty(t[i],"labels",{value:e})}t.rgb.hsl=function(n){var i,s,u=n[0]/255,f=n[1]/255,e=n[2]/255,r=Math.min(u,f,e),t=Math.max(u,f,e),o=t-r;return t===r?i=0:u===t?i=(f-e)/o:f===t?i=2+(e-u)/o:e===t&&(i=4+(u-f)/o),(i=Math.min(60*i,360))<0&&(i+=360),s=(r+t)/2,[i,100*(t===r?0:s<=.5?o/(t+r):o/(2-t-r)),100*s]};t.rgb.hsv=function(n){var e,o,s,t,h,r=n[0]/255,u=n[1]/255,f=n[2]/255,i=Math.max(r,u,f),c=i-Math.min(r,u,f),l=function(n){return(i-n)/6/c+.5};return 0===c?t=h=0:(h=c/i,e=l(r),o=l(u),s=l(f),r===i?t=s-o:u===i?t=1/3+e-s:f===i&&(t=2/3+o-e),t<0?t+=1:t>1&&(t-=1)),[360*t,100*h,100*i]};t.rgb.hwb=function(n){var r=n[0],u=n[1],i=n[2];return[t.rgb.hsl(n)[0],100*1/255*Math.min(r,Math.min(u,i)),100*(i=1-1/255*Math.max(r,Math.max(u,i)))]};t.rgb.cmyk=function(n){var t,i=n[0]/255,r=n[1]/255,u=n[2]/255;return[100*((1-i-(t=Math.min(1-i,1-r,1-u)))/(1-t)||0),100*((1-r-t)/(1-t)||0),100*((1-u-t)/(1-t)||0),100*t]};t.rgb.keyword=function(n){var o=u[n],s,t,i,f,r,h,e;if(o)return o;f=1/0;for(r in st)st.hasOwnProperty(r)&&(h=st[r],e=(t=n,i=h,Math.pow(t[0]-i[0],2)+Math.pow(t[1]-i[1],2)+Math.pow(t[2]-i[2],2)),e<f&&(f=e,s=r));return s};t.keyword.rgb=function(n){return st[n]};t.rgb.xyz=function(n){var t=n[0]/255,i=n[1]/255,r=n[2]/255;return[100*(.4124*(t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)+.3576*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)+.1805*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)),100*(.2126*t+.7152*i+.0722*r),100*(.0193*t+.1192*i+.9505*r)]};t.rgb.lab=function(n){var f=t.rgb.xyz(n),r=f[0],i=f[1],u=f[2];return i/=100,u/=108.883,r=(r/=95.047)>.008856?Math.pow(r,1/3):7.787*r+16/116,[116*(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116)-16,500*(r-i),200*(i-(u=u>.008856?Math.pow(u,1/3):7.787*u+16/116))]};t.hsl.rgb=function(n){var i,e,t,s,u,h=n[0]/360,o=n[1]/100,r=n[2]/100,f;if(0===o)return[u=255*r,u,u];for(i=2*r-(e=r<.5?r*(1+o):r+o-r*o),s=[0,0,0],f=0;f<3;f++)(t=h+1/3*-(f-1))<0&&t++,t>1&&t--,u=6*t<1?i+6*(e-i)*t:2*t<1?e:3*t<2?i+(e-i)*(2/3-t)*6:i,s[f]=255*u;return s};t.hsl.hsv=function(n){var f=n[0],i=n[1]/100,t=n[2]/100,u=i,r=Math.max(t,.01);return i*=(t*=2)<=1?t:2-t,u*=r<=1?r:2-r,[f,100*(0===t?2*u/(r+u):2*i/(t+i)),50*(t+i)]};t.hsv.rgb=function(n){var r=n[0]/60,u=n[1]/100,t=n[2]/100,s=Math.floor(r)%6,o=r-Math.floor(r),i=255*t*(1-u),f=255*t*(1-u*o),e=255*t*(1-u*(1-o));switch(t*=255,s){case 0:return[t,e,i];case 1:return[f,t,i];case 2:return[i,t,e];case 3:return[i,f,t];case 4:return[e,i,t];case 5:return[t,i,f]}};t.hsv.hsl=function(n){var t,i,u,o=n[0],r=n[1]/100,f=n[2]/100,e=Math.max(f,.01);return u=(2-r)*f,i=r*e,[o,100*(i=(i/=(t=(2-r)*e)<=1?t:2-t)||0),100*(u/=2)]};t.hwb.rgb=function(n){var s,i,o,r,u,f,e,l=n[0]/360,t=n[1]/100,h=n[2]/100,c=t+h;switch(c>1&&(t/=c,h/=c),o=6*l-(s=Math.floor(6*l)),0!=(1&s)&&(o=1-o),r=t+o*((i=1-h)-t),s){default:case 6:case 0:u=i;f=r;e=t;break;case 1:u=r;f=i;e=t;break;case 2:u=t;f=i;e=r;break;case 3:u=t;f=r;e=i;break;case 4:u=r;f=t;e=i;break;case 5:u=i;f=t;e=r}return[255*u,255*f,255*e]};t.cmyk.rgb=function(n){var i=n[0]/100,r=n[1]/100,u=n[2]/100,t=n[3]/100;return[255*(1-Math.min(1,i*(1-t)+t)),255*(1-Math.min(1,r*(1-t)+t)),255*(1-Math.min(1,u*(1-t)+t))]};t.xyz.rgb=function(n){var r,t,i,u=n[0]/100,f=n[1]/100,e=n[2]/100;return t=-.9689*u+1.8758*f+.0415*e,i=.0557*u+-.204*f+1.057*e,r=(r=3.2406*u+-1.5372*f+-.4986*e)>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,t=t>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:12.92*i,[255*(r=Math.min(Math.max(0,r),1)),255*(t=Math.min(Math.max(0,t),1)),255*(i=Math.min(Math.max(0,i),1))]};t.xyz.lab=function(n){var i=n[0],t=n[1],r=n[2];return t/=100,r/=108.883,i=(i/=95.047)>.008856?Math.pow(i,1/3):7.787*i+16/116,[116*(t=t>.008856?Math.pow(t,1/3):7.787*t+16/116)-16,500*(i-t),200*(t-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]};t.lab.xyz=function(n){var i,t,r,o=n[0];i=n[1]/500+(t=(o+16)/116);r=t-n[2]/200;var u=Math.pow(t,3),f=Math.pow(i,3),e=Math.pow(r,3);return t=u>.008856?u:(t-16/116)/7.787,i=f>.008856?f:(i-16/116)/7.787,r=e>.008856?e:(r-16/116)/7.787,[i*=95.047,t*=100,r*=108.883]};t.lab.lch=function(n){var t,u=n[0],i=n[1],r=n[2];return(t=180*Math.atan2(r,i)/Math.PI)<0&&(t+=360),[u,Math.sqrt(i*i+r*r),t]};t.lch.lab=function(n){var t,r=n[0],i=n[1];return t=n[2]/180*Math.PI,[r,i*Math.cos(t),i*Math.sin(t)]};t.rgb.ansi16=function(n){var u=n[0],f=n[1],e=n[2],i=1 in arguments?arguments[1]:t.rgb.hsv(n)[2],r;return 0===(i=Math.round(i/50))?30:(r=30+(Math.round(e/255)<<2|Math.round(f/255)<<1|Math.round(u/255)),2===i&&(r+=60),r)};t.hsv.ansi16=function(n){return t.rgb.ansi16(t.hsv.rgb(n),n[2])};t.rgb.ansi256=function(n){var t=n[0],i=n[1],r=n[2];return t===i&&i===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/51)+6*Math.round(i/51)+Math.round(r/51)};t.ansi16.rgb=function(n){var t=n%10,i;return 0===t||7===t?(n>50&&(t+=3.5),[t=t/10.5*255,t,t]):(i=.5*(1+~~(n>50)),[(1&t)*i*255,(t>>1&1)*i*255,(t>>2&1)*i*255])};t.ansi256.rgb=function(n){var t,i;return n>=232?(t=10*(n-232)+8,[t,t,t]):(n-=16,[Math.floor(n/36)*51,Math.floor((i=n%36)/6)*51,i%6*51])};t.rgb.hex=function(n){var t=(((255&Math.round(n[0]))<<16)+((255&Math.round(n[1]))<<8)+(255&Math.round(n[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t};t.hex.rgb=function(n){var r=n.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i),t,i;return r?(t=r[0],3===r[0].length&&(t=t.split("").map(function(n){return n+n}).join("")),i=parseInt(t,16),[i>>16&255,i>>8&255,255&i]):[0,0,0]};t.rgb.hcg=function(n){var f,i=n[0]/255,r=n[1]/255,u=n[2]/255,e=Math.max(Math.max(i,r),u),o=Math.min(Math.min(i,r),u),t=e-o;return f=t<=0?0:e===i?(r-u)/t%6:e===r?2+(u-i)/t:4+(i-r)/t+4,f/=6,[360*(f%=1),100*t,100*(t<1?o/(1-t):0)]};t.hsl.hcg=function(n){var r=n[1]/100,t=n[2]/100,i=1,u=0;return(i=t<.5?2*r*t:2*r*(1-t))<1&&(u=(t-.5*i)/(1-i)),[n[0],100*i,100*u]};t.hsv.hcg=function(n){var u=n[1]/100,i=n[2]/100,t=u*i,r=0;return t<1&&(r=(i-t)/(1-t)),[n[0],100*t,100*r]};t.hcg.rgb=function(n){var s=n[0]/360,i=n[1]/100,r=n[2]/100;if(0===i)return[255*r,255*r,255*r];var u,t=[0,0,0],o=s%1*6,f=o%1,e=1-f;switch(Math.floor(o)){case 0:t[0]=1;t[1]=f;t[2]=0;break;case 1:t[0]=e;t[1]=1;t[2]=0;break;case 2:t[0]=0;t[1]=1;t[2]=f;break;case 3:t[0]=0;t[1]=e;t[2]=1;break;case 4:t[0]=f;t[1]=0;t[2]=1;break;default:t[0]=1;t[1]=0;t[2]=e}return u=(1-i)*r,[255*(i*t[0]+u),255*(i*t[1]+u),255*(i*t[2]+u)]};t.hcg.hsv=function(n){var t=n[1]/100,i=t+n[2]/100*(1-t),r=0;return i>0&&(r=t/i),[n[0],100*r,100*i]};t.hcg.hsl=function(n){var i=n[1]/100,t=n[2]/100*(1-i)+.5*i,r=0;return t>0&&t<.5?r=i/(2*t):t>=.5&&t<1&&(r=i/(2*(1-t))),[n[0],100*r,100*t]};t.hcg.hwb=function(n){var t=n[1]/100,i=t+n[2]/100*(1-t);return[n[0],100*(i-t),100*(1-i)]};t.hwb.hcg=function(n){var u=n[1]/100,i=1-n[2]/100,t=i-u,r=0;return t<1&&(r=(i-t)/(1-t)),[n[0],100*t,100*r]};t.apple.rgb=function(n){return[n[0]/257,n[1]/257,n[2]/257]};t.rgb.apple=function(n){return[n[0]*257,n[1]*257,n[2]*257]};t.gray.rgb=function(n){return[n[0]/100*255,n[0]/100*255,n[0]/100*255]};t.gray.hsl=t.gray.hsv=function(n){return[0,0,n[0]]};t.gray.hwb=function(n){return[0,100,n[0]]};t.gray.cmyk=function(n){return[0,0,0,n[0]]};t.gray.lab=function(n){return[n[0],0,0]};t.gray.hex=function(n){var t=255&Math.round(n[0]/100*255),i=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(i.length)+i};t.rgb.gray=function(n){return[(n[0]+n[1]+n[2])/765*100]}});e.rgb;e.hsl;e.hsv;e.hwb;e.cmyk;e.xyz;e.lab;e.lch;e.hex;e.keyword;e.ansi16;e.ansi256;e.hcg;e.apple;e.gray;vt={};Object.keys(e).forEach(function(n){vt[n]={};Object.defineProperty(vt[n],"channels",{value:e[n].channels});Object.defineProperty(vt[n],"labels",{value:e[n].labels});var t=function(n){for(var t,i=rh(n),u={},f=Object.keys(i),e=f.length,r=0;r<e;r++)t=f[r],null!==i[t].parent&&(u[t]=fh(t,i));return u}(n);Object.keys(t).forEach(function(i){var r=t[i];vt[n][i]=function(n){var t=function(t){var i,u,r;if(null==t)return t;if(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),i=n(t),"object"==typeof i)for(u=i.length,r=0;r<u;r++)i[r]=Math.round(i[r]);return i};return"conversion"in n&&(t.conversion=n.conversion),t}(r);vt[n][i].raw=function(n){var t=function(t){return null==t?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),n(t))};return"conversion"in n&&(t.conversion=n.conversion),t}(r)})});var eh=vt,dr={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},k={getRgba:gr,getHsla:nu,getRgb:function(n){var t=gr(n);return t&&t.slice(0,3)},getHsl:function(n){var t=nu(n);return t&&t.slice(0,3)},getHwb:fe,getAlpha:function(n){var t=gr(n);return t?t[3]:(t=nu(n))?t[3]:(t=fe(n))?t[3]:void 0},hexString:function(n,t){return t=void 0!==t&&3===n.length?t:n[3],"#"+di(n[0])+di(n[1])+di(n[2])+(t>=0&&t<1?di(Math.round(255*t)):"")},rgbString:function(n,t){return t<1||n[3]&&n[3]<1?ee(n,t):"rgb("+n[0]+", "+n[1]+", "+n[2]+")"},rgbaString:ee,percentString:function(n,t){if(t<1||n[3]&&n[3]<1)return oe(n,t);var i=Math.round(n[0]/255*100),r=Math.round(n[1]/255*100),u=Math.round(n[2]/255*100);return"rgb("+i+"%, "+r+"%, "+u+"%)"},percentaString:oe,hslString:function(n,t){return t<1||n[3]&&n[3]<1?se(n,t):"hsl("+n[0]+", "+n[1]+"%, "+n[2]+"%)"},hslaString:se,hwbString:function(n,t){return void 0===t&&(t=void 0!==n[3]?n[3]:1),"hwb("+n[0]+", "+n[1]+"%, "+n[2]+"%"+(void 0!==t&&1!==t?", "+t:"")+")"},keyword:function(n){return tu[n.slice(0,3)]}};tu={};for(iu in dr)tu[dr[iu]]=iu;s=function(n){return n instanceof s?n:this instanceof s?(this.valid=!1,this.values={rgb:[0,0,0],hsl:[0,0,0],hsv:[0,0,0],hwb:[0,0,0],cmyk:[0,0,0,0],alpha:1},void("string"==typeof n?(t=k.getRgba(n))?this.setValues("rgb",t):(t=k.getHsla(n))?this.setValues("hsl",t):(t=k.getHwb(n))&&this.setValues("hwb",t):"object"==typeof n&&(void 0!==(t=n).r||void 0!==t.red?this.setValues("rgb",t):void 0!==t.l||void 0!==t.lightness?this.setValues("hsl",t):void 0!==t.v||void 0!==t.value?this.setValues("hsv",t):void 0!==t.w||void 0!==t.whiteness?this.setValues("hwb",t):void 0===t.c&&void 0===t.cyan||this.setValues("cmyk",t)))):new s(n);var t};s.prototype={isValid:function(){return this.valid},rgb:function(){return this.setSpace("rgb",arguments)},hsl:function(){return this.setSpace("hsl",arguments)},hsv:function(){return this.setSpace("hsv",arguments)},hwb:function(){return this.setSpace("hwb",arguments)},cmyk:function(){return this.setSpace("cmyk",arguments)},rgbArray:function(){return this.values.rgb},hslArray:function(){return this.values.hsl},hsvArray:function(){return this.values.hsv},hwbArray:function(){var n=this.values;return 1!==n.alpha?n.hwb.concat([n.alpha]):n.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var n=this.values;return n.rgb.concat([n.alpha])},hslaArray:function(){var n=this.values;return n.hsl.concat([n.alpha])},alpha:function(n){return void 0===n?this.values.alpha:(this.setValues("alpha",n),this)},red:function(n){return this.setChannel("rgb",0,n)},green:function(n){return this.setChannel("rgb",1,n)},blue:function(n){return this.setChannel("rgb",2,n)},hue:function(n){return n&&(n=(n%=360)<0?360+n:n),this.setChannel("hsl",0,n)},saturation:function(n){return this.setChannel("hsl",1,n)},lightness:function(n){return this.setChannel("hsl",2,n)},saturationv:function(n){return this.setChannel("hsv",1,n)},whiteness:function(n){return this.setChannel("hwb",1,n)},blackness:function(n){return this.setChannel("hwb",2,n)},value:function(n){return this.setChannel("hsv",2,n)},cyan:function(n){return this.setChannel("cmyk",0,n)},magenta:function(n){return this.setChannel("cmyk",1,n)},yellow:function(n){return this.setChannel("cmyk",2,n)},black:function(n){return this.setChannel("cmyk",3,n)},hexString:function(){return k.hexString(this.values.rgb)},rgbString:function(){return k.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return k.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return k.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return k.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return k.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return k.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return k.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){var n=this.values.rgb;return n[0]<<16|n[1]<<8|n[2]},luminosity:function(){for(var i,r=this.values.rgb,n=[],t=0;t<r.length;t++)i=r[t]/255,n[t]=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4);return.2126*n[0]+.7152*n[1]+.0722*n[2]},contrast:function(n){var t=this.luminosity(),i=n.luminosity();return t>i?(t+.05)/(i+.05):(i+.05)/(t+.05)},level:function(n){var t=this.contrast(n);return t>=7.1?"AAA":t>=4.5?"AA":""},dark:function(){var n=this.values.rgb;return(299*n[0]+587*n[1]+114*n[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var t=[],n=0;n<3;n++)t[n]=255-this.values.rgb[n];return this.setValues("rgb",t),this},lighten:function(n){var t=this.values.hsl;return t[2]+=t[2]*n,this.setValues("hsl",t),this},darken:function(n){var t=this.values.hsl;return t[2]-=t[2]*n,this.setValues("hsl",t),this},saturate:function(n){var t=this.values.hsl;return t[1]+=t[1]*n,this.setValues("hsl",t),this},desaturate:function(n){var t=this.values.hsl;return t[1]-=t[1]*n,this.setValues("hsl",t),this},whiten:function(n){var t=this.values.hwb;return t[1]+=t[1]*n,this.setValues("hwb",t),this},blacken:function(n){var t=this.values.hwb;return t[2]+=t[2]*n,this.setValues("hwb",t),this},greyscale:function(){var n=this.values.rgb,t=.3*n[0]+.59*n[1]+.11*n[2];return this.setValues("rgb",[t,t,t]),this},clearer:function(n){var t=this.values.alpha;return this.setValues("alpha",t-t*n),this},opaquer:function(n){var t=this.values.alpha;return this.setValues("alpha",t+t*n),this},rotate:function(n){var t=this.values.hsl,i=(t[0]+n)%360;return t[0]=i<0?360+i:i,this.setValues("hsl",t),this},mix:function(n,t){var i=n,f=void 0===t?.5:t,r=2*f-1,e=this.alpha()-i.alpha(),u=((r*e==-1?r:(r+e)/(1+r*e))+1)/2,o=1-u;return this.rgb(u*this.red()+o*i.red(),u*this.green()+o*i.green(),u*this.blue()+o*i.blue()).alpha(this.alpha()*f+i.alpha()*(1-f))},toJSON:function(){return this.rgb()},clone:function(){var n,r,u=new s,i=this.values,f=u.values;for(var t in i)i.hasOwnProperty(t)&&(n=i[t],"[object Array]"===(r={}.toString.call(n))?f[t]=n.slice(0):"[object Number]"===r?f[t]=n:console.error("unexpected color value:",n));return u}};s.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]};s.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]};s.prototype.getValues=function(n){for(var i=this.values,r={},t=0;t<n.length;t++)r[n.charAt(t)]=i[n][t];return 1!==i.alpha&&(r.a=i.alpha),r};s.prototype.setValues=function(n,t){var i,o,r=this.values,e=this.spaces,h=this.maxes,u=1,s,f;if(this.valid=!0,"alpha"===n)u=t;else if(t.length)r[n]=t.slice(0,n.length),u=t[n.length];else if(void 0!==t[n.charAt(0)]){for(i=0;i<n.length;i++)r[n][i]=t[n.charAt(i)];u=t.a}else if(void 0!==t[e[n][0]]){for(s=e[n],i=0;i<n.length;i++)r[n][i]=t[s[i]];u=t.alpha}if(r.alpha=Math.max(0,Math.min(1,void 0===u?r.alpha:u)),"alpha"===n)return!1;for(i=0;i<n.length;i++)o=Math.max(0,Math.min(h[n][i],r[n][i])),r[n][i]=Math.round(o);for(f in e)f!==n&&(r[f]=eh[n][f](r[n]));return!0};s.prototype.setSpace=function(n,t){var i=t[0];return void 0===i?this.getValues(n):("number"==typeof i&&(i=Array.prototype.slice.call(t)),this.setValues(n,i),this)};s.prototype.setChannel=function(n,t,i){var r=this.values[n];return void 0===i?r[t]:i===r[t]?this:(r[t]=i,this.setValues(n,r),this)};"undefined"!=typeof window&&(window.Color=s);var he,gi=s,u={noop:function(){},uid:(he=0,function(){return he++}),isNullOrUndef:function(n){return null==n},isArray:function(n){if(Array.isArray&&Array.isArray(n))return!0;var t=Object.prototype.toString.call(n);return"[object"===t.substr(0,7)&&"Array]"===t.substr(-6)},isObject:function(n){return null!==n&&"[object Object]"===Object.prototype.toString.call(n)},isFinite:function(n){return("number"==typeof n||n instanceof Number)&&isFinite(n)},valueOrDefault:function(n,t){return void 0===n?t:n},valueAtIndexOrDefault:function(n,t,i){return u.valueOrDefault(u.isArray(n)?n[t]:n,i)},callback:function(n,t,i){if(n&&"function"==typeof n.call)return n.apply(i,t)},each:function(n,t,i,r){var f,e,o;if(u.isArray(n))if(e=n.length,r)for(f=e-1;f>=0;f--)t.call(i,n[f],f);else for(f=0;f<e;f++)t.call(i,n[f],f);else if(u.isObject(n))for(e=(o=Object.keys(n)).length,f=0;f<e;f++)t.call(i,n[o[f]],o[f])},arrayEquals:function(n,t){var i,e,r,f;if(!n||!t||n.length!==t.length)return!1;for(i=0,e=n.length;i<e;++i)if(r=n[i],f=t[i],r instanceof Array&&f instanceof Array){if(!u.arrayEquals(r,f))return!1}else if(r!==f)return!1;return!0},clone:function(n){if(u.isArray(n))return n.map(u.clone);if(u.isObject(n)){for(var r={},i=Object.keys(n),f=i.length,t=0;t<f;++t)r[i[t]]=u.clone(n[i[t]]);return r}return n},_merger:function(n,t,i,r){var e=t[n],f=i[n];u.isObject(e)&&u.isObject(f)?u.merge(e,f,r):t[n]=u.clone(f)},_mergerIf:function(n,t,i){var f=t[n],r=i[n];u.isObject(f)&&u.isObject(r)?u.mergeIf(f,r):t.hasOwnProperty(n)||(t[n]=u.clone(r))},merge:function(n,t,i){var e,r,o,s,f,h=u.isArray(t)?t:[t],c=h.length;if(!u.isObject(n))return n;for(e=(i=i||{}).merger||u._merger,r=0;r<c;++r)if(t=h[r],u.isObject(t))for(f=0,s=(o=Object.keys(t)).length;f<s;++f)e(o[f],n,t,i);return n},mergeIf:function(n,t){return u.merge(n,t,{merger:u._mergerIf})},extend:Object.assign||function(n){return u.merge(n,[].slice.call(arguments,1),{merger:function(n,t,i){t[n]=i[n]}})},inherits:function(n){var i=this,t=n&&n.hasOwnProperty("constructor")?n.constructor:function(){return i.apply(this,arguments)},r=function(){this.constructor=t};return r.prototype=i.prototype,t.prototype=new r,t.extend=u.inherits,n&&u.extend(t.prototype,n),t.__super__=i.prototype,t},_deprecated:function(n,t,i,r){void 0!==t&&console.warn(n+': "'+i+'" is deprecated. Please use "'+r+'" instead')}},p=u;u.callCallback=u.callback;u.indexOf=function(n,t,i){return Array.prototype.indexOf.call(n,t,i)};u.getValueOrDefault=u.valueOrDefault;u.getValueAtIndexOrDefault=u.valueAtIndexOrDefault;ui={linear:function(n){return n},easeInQuad:function(n){return n*n},easeOutQuad:function(n){return-n*(n-2)},easeInOutQuad:function(n){return(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1)},easeInCubic:function(n){return n*n*n},easeOutCubic:function(n){return(n-=1)*n*n+1},easeInOutCubic:function(n){return(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2)},easeInQuart:function(n){return n*n*n*n},easeOutQuart:function(n){return-((n-=1)*n*n*n-1)},easeInOutQuart:function(n){return(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2)},easeInQuint:function(n){return n*n*n*n*n},easeOutQuint:function(n){return(n-=1)*n*n*n*n+1},easeInOutQuint:function(n){return(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2)},easeInSine:function(n){return 1-Math.cos(n*(Math.PI/2))},easeOutSine:function(n){return Math.sin(n*(Math.PI/2))},easeInOutSine:function(n){return-.5*(Math.cos(Math.PI*n)-1)},easeInExpo:function(n){return 0===n?0:Math.pow(2,10*(n-1))},easeOutExpo:function(n){return 1===n?1:1-Math.pow(2,-10*n)},easeInOutExpo:function(n){return 0===n?0:1===n?1:(n/=.5)<1?.5*Math.pow(2,10*(n-1)):.5*(2-Math.pow(2,-10*--n))},easeInCirc:function(n){return n>=1?n:-(Math.sqrt(1-n*n)-1)},easeOutCirc:function(n){return Math.sqrt(1-(n-=1)*n)},easeInOutCirc:function(n){return(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1)},easeInElastic:function(n){var r=1.70158,t=0,i=1;return 0===n?0:1===n?1:(t||(t=.3),i<1?(i=1,r=t/4):r=t/(2*Math.PI)*Math.asin(1/i),-i*Math.pow(2,10*(n-=1))*Math.sin((n-r)*2*Math.PI/t))},easeOutElastic:function(n){var r=1.70158,t=0,i=1;return 0===n?0:1===n?1:(t||(t=.3),i<1?(i=1,r=t/4):r=t/(2*Math.PI)*Math.asin(1/i),i*Math.pow(2,-10*n)*Math.sin((n-r)*2*Math.PI/t)+1)},easeInOutElastic:function(n){var r=1.70158,t=0,i=1;return 0===n?0:2==(n/=.5)?1:(t||(t=.45),i<1?(i=1,r=t/4):r=t/(2*Math.PI)*Math.asin(1/i),n<1?i*Math.pow(2,10*(n-=1))*Math.sin((n-r)*2*Math.PI/t)*-.5:i*Math.pow(2,-10*(n-=1))*Math.sin((n-r)*2*Math.PI/t)*.5+1)},easeInBack:function(n){var t=1.70158;return n*n*((t+1)*n-t)},easeOutBack:function(n){var t=1.70158;return(n-=1)*n*((t+1)*n+t)+1},easeInOutBack:function(n){var t=1.70158;return(n/=.5)<1?n*n*((1+(t*=1.525))*n-t)*.5:.5*((n-=2)*n*((1+(t*=1.525))*n+t)+2)},easeInBounce:function(n){return 1-ui.easeOutBounce(1-n)},easeOutBounce:function(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:function(n){return n<.5?.5*ui.easeInBounce(2*n):.5*ui.easeOutBounce(2*n-1)+.5}};ce={effects:ui};p.easingEffects=ui;var h=Math.PI,oh=h/180,sh=2*h,w=h/2,hi=h/4,le=2*h/3,nr={clear:function(n){n.ctx.clearRect(0,0,n.width,n.height)},roundedRect:function(n,t,i,r,u,f){if(f){var e=Math.min(f,u/2,r/2),o=t+e,s=i+e,c=t+r-e,l=i+u-e;n.moveTo(t,s);o<c&&s<l?(n.arc(o,s,e,-h,-w),n.arc(c,s,e,-w,0),n.arc(c,l,e,0,w),n.arc(o,l,e,w,h)):o<c?(n.moveTo(o,i),n.arc(c,s,e,-w,w),n.arc(o,s,e,w,h+w)):s<l?(n.arc(o,s,e,-h,0),n.arc(o,l,e,0,h)):n.arc(o,s,e,-h,h);n.closePath();n.moveTo(t,i)}else n.rect(t,i,r,u)},drawPoint:function(n,t,i,r,u,f){var a,o,s,c,l,e=(f||0)*oh;if(t&&"object"==typeof t&&("[object HTMLImageElement]"===(a=t.toString())||"[object HTMLCanvasElement]"===a))return n.save(),n.translate(r,u),n.rotate(e),n.drawImage(t,-t.width/2,-t.height/2,t.width,t.height),void n.restore();if(!(isNaN(i)||i<=0)){switch(n.beginPath(),t){default:n.arc(r,u,i,0,sh);n.closePath();break;case"triangle":n.moveTo(r+Math.sin(e)*i,u-Math.cos(e)*i);e+=le;n.lineTo(r+Math.sin(e)*i,u-Math.cos(e)*i);e+=le;n.lineTo(r+Math.sin(e)*i,u-Math.cos(e)*i);n.closePath();break;case"rectRounded":c=i-(l=.516*i);o=Math.cos(e+hi)*c;s=Math.sin(e+hi)*c;n.arc(r-o,u-s,l,e-h,e-w);n.arc(r+s,u-o,l,e-w,e);n.arc(r+o,u+s,l,e,e+w);n.arc(r-s,u+o,l,e+w,e+h);n.closePath();break;case"rect":if(!f){c=Math.SQRT1_2*i;n.rect(r-c,u-c,2*c,2*c);break}e+=hi;case"rectRot":o=Math.cos(e)*i;s=Math.sin(e)*i;n.moveTo(r-o,u-s);n.lineTo(r+s,u-o);n.lineTo(r+o,u+s);n.lineTo(r-s,u+o);n.closePath();break;case"crossRot":e+=hi;case"cross":o=Math.cos(e)*i;s=Math.sin(e)*i;n.moveTo(r-o,u-s);n.lineTo(r+o,u+s);n.moveTo(r+s,u-o);n.lineTo(r-s,u+o);break;case"star":o=Math.cos(e)*i;s=Math.sin(e)*i;n.moveTo(r-o,u-s);n.lineTo(r+o,u+s);n.moveTo(r+s,u-o);n.lineTo(r-s,u+o);e+=hi;o=Math.cos(e)*i;s=Math.sin(e)*i;n.moveTo(r-o,u-s);n.lineTo(r+o,u+s);n.moveTo(r+s,u-o);n.lineTo(r-s,u+o);break;case"line":o=Math.cos(e)*i;s=Math.sin(e)*i;n.moveTo(r-o,u-s);n.lineTo(r+o,u+s);break;case"dash":n.moveTo(r,u);n.lineTo(r+Math.cos(e)*i,u+Math.sin(e)*i)}n.fill();n.stroke()}},_isPointInArea:function(n,t){return n.x>t.left-1e-6&&n.x<t.right+1e-6&&n.y>t.top-1e-6&&n.y<t.bottom+1e-6},clipArea:function(n,t){n.save();n.beginPath();n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top);n.clip()},unclipArea:function(n){n.restore()},lineTo:function(n,t,i,r){var u=i.steppedLine,f;u?("middle"===u?(f=(t.x+i.x)/2,n.lineTo(f,r?i.y:t.y),n.lineTo(f,r?t.y:i.y)):"after"===u&&!r||"after"!==u&&r?n.lineTo(t.x,i.y):n.lineTo(i.x,t.y),n.lineTo(i.x,i.y)):i.tension?n.bezierCurveTo(r?t.controlPointPreviousX:t.controlPointNextX,r?t.controlPointPreviousY:t.controlPointNextY,r?i.controlPointNextX:i.controlPointPreviousX,r?i.controlPointNextY:i.controlPointPreviousY,i.x,i.y):n.lineTo(i.x,i.y)}},hh=nr;p.clear=nr.clear;p.drawRoundedRectangle=function(n){n.beginPath();nr.roundedRect.apply(nr,arguments)};ru={_set:function(n,t){return p.merge(this[n]||(this[n]={}),t)}};ru._set("global",{defaultColor:"rgba(0,0,0,0.1)",defaultFontColor:"#666",defaultFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",defaultFontSize:12,defaultFontStyle:"normal",defaultLineHeight:1.2,showLines:!0});var i=ru,tr=p.valueOrDefault,ch={toLineHeight:function(n,t){var i=(""+n).match(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/);if(!i||"normal"===i[1])return 1.2*t;switch(n=+i[2],i[3]){case"px":return n;case"%":n/=100}return t*n},toPadding:function(n){var t,i,r,u;return p.isObject(n)?(t=+n.top||0,i=+n.right||0,r=+n.bottom||0,u=+n.left||0):t=i=r=u=+n||0,{top:t,right:i,bottom:r,left:u,height:t+r,width:u+i}},_parseFont:function(n){var t=i.global,u=tr(n.fontSize,t.defaultFontSize),r={family:tr(n.fontFamily,t.defaultFontFamily),lineHeight:p.options.toLineHeight(tr(n.lineHeight,t.defaultLineHeight),u),size:u,style:tr(n.fontStyle,t.defaultFontStyle),weight:null,string:""};return r.string=function(n){return!n||p.isNullOrUndef(n.size)||p.isNullOrUndef(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}(r),r},resolve:function(n,t,i,r){for(var u,e=!0,f=0,o=n.length;f<o;++f)if(void 0!==(u=n[f])&&(void 0!==t&&"function"==typeof u&&(u=u(t),e=!1),void 0!==i&&p.isArray(u)&&(u=u[i],e=!1),void 0!==u))return r&&!e&&(r.cacheable=!1),u}},ae={_factorize:function(n){for(var i=[],r=Math.sqrt(n),t=1;t<r;t++)n%t==0&&(i.push(t),i.push(n/t));return r===(0|r)&&i.push(r),i.sort(function(n,t){return n-t}).pop(),i},log10:Math.log10||function(n){var t=Math.log(n)*Math.LOG10E,i=Math.round(t);return n===Math.pow(10,i)?i:t}},lh=ae;p.log10=ae.log10;var t=p,ah=ce,vh=hh,yh=ch,ph=lh,wh={getRtlAdapter:function(n,t,i){return n?function(n,t){return{x:function(i){return n+n+t-i},setWidth:function(n){t=n},textAlign:function(n){return"center"===n?n:"right"===n?"left":"right"},xPlus:function(n,t){return n-t},leftForLtr:function(n,t){return n-t}}}(t,i):{x:function(n){return n},setWidth:function(){},textAlign:function(n){return n},xPlus:function(n,t){return n+t},leftForLtr:function(n){return n}}},overrideTextDirection:function(n,t){var i,r;"ltr"!==t&&"rtl"!==t||(r=[(i=n.canvas.style).getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",t,"important"),n.prevTextDirection=r)},restoreTextDirection:function(n){var t=n.prevTextDirection;void 0!==t&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}};t.easing=ah;t.canvas=vh;t.options=yh;t.math=ph;t.rtl=wh;ir=function(n){t.extend(this,n);this.initialize.apply(this,arguments)};t.extend(ir.prototype,{_type:void 0,initialize:function(){this.hidden=!1},pivot:function(){var n=this;return n._view||(n._view=t.extend({},n._model)),n._start={},n},transition:function(n){var i=this,r=i._model,u=i._start,f=i._view;return r&&1!==n?(f||(f=i._view={}),u||(u=i._start={}),function(n,i,r,u){for(var f,c,o,e,l,a,v,y=Object.keys(r),s=0,h=y.length;s<h;++s)if(e=r[f=y[s]],i.hasOwnProperty(f)||(i[f]=e),(c=i[f])!==e&&"_"!==f[0]){if(n.hasOwnProperty(f)||(n[f]=c),(l=typeof e)==typeof(o=n[f]))if("string"===l){if((a=gi(o)).valid&&(v=gi(e)).valid){i[f]=v.mix(a,u).rgbString();continue}}else if(t.isFinite(o)&&t.isFinite(e)){i[f]=o+(e-o)*u;continue}i[f]=e}}(u,f,r,n),i):(i._view=t.extend({},r),i._start=null,i)},tooltipPosition:function(){return{x:this._model.x,y:this._model.y}},hasValue:function(){return t.isNumber(this._model.x)&&t.isNumber(this._model.y)}});ir.extend=t.inherits;var nt=ir,uu=nt.extend({chart:null,currentStep:0,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),fu=uu;Object.defineProperty(uu.prototype,"animationObject",{get:function(){return this}});Object.defineProperty(uu.prototype,"chartInstance",{get:function(){return this.chart},set:function(n){this.chart=n}});i._set("global",{animation:{duration:1e3,easing:"easeOutQuart",onProgress:t.noop,onComplete:t.noop}});var eu={animations:[],request:null,addAnimation:function(n,t,i,r){var u,e,f=this.animations;for(t.chart=n,t.startTime=Date.now(),t.duration=i,r||(n.animating=!0),u=0,e=f.length;u<e;++u)if(f[u].chart===n)return void(f[u]=t);f.push(t);1===f.length&&this.requestAnimationFrame()},cancelAnimation:function(n){var i=t.findIndex(this.animations,function(t){return t.chart===n});-1!==i&&(this.animations.splice(i,1),n.animating=!1)},requestAnimationFrame:function(){var n=this;null===n.request&&(n.request=t.requestAnimFrame.call(window,function(){n.request=null;n.startDigest()}))},startDigest:function(){this.advance();this.animations.length>0&&this.requestAnimationFrame()},advance:function(){for(var n,i,r,e,f=this.animations,u=0;u<f.length;)i=(n=f[u]).chart,r=n.numSteps,e=Math.floor((Date.now()-n.startTime)/n.duration*r)+1,n.currentStep=Math.min(e,r),t.callback(n.render,[i,n],i),t.callback(n.onAnimationProgress,[n],i),n.currentStep>=r?(t.callback(n.onAnimationComplete,[n],i),i.animating=!1,f.splice(u,1)):++u}},fi=t.options.resolve,ve=["push","pop","shift","splice","unshift"];rr=function(n,t){this.initialize(n,t)};t.extend(rr.prototype,{datasetElementType:null,dataElementType:null,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth"],_dataElementOptions:["backgroundColor","borderColor","borderWidth","pointStyle"],initialize:function(n,t){var i=this;i.chart=n;i.index=t;i.linkScales();i.addElements();i._type=i.getMeta().type},updateIndex:function(n){this.index=n},linkScales:function(){var n=this.getMeta(),i=this.chart,r=i.scales,t=this.getDataset(),u=i.options.scales;null!==n.xAxisID&&n.xAxisID in r&&!t.xAxisID||(n.xAxisID=t.xAxisID||u.xAxes[0].id);null!==n.yAxisID&&n.yAxisID in r&&!t.yAxisID||(n.yAxisID=t.yAxisID||u.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(n){return this.chart.scales[n]},_getValueScaleId:function(){return this.getMeta().yAxisID},_getIndexScaleId:function(){return this.getMeta().xAxisID},_getValueScale:function(){return this.getScaleForId(this._getValueScaleId())},_getIndexScale:function(){return this.getScaleForId(this._getIndexScaleId())},reset:function(){this._update(!0)},destroy:function(){this._data&&ye(this._data,this)},createMetaDataset:function(){var n=this.datasetElementType;return n&&new n({_chart:this.chart,_datasetIndex:this.index})},createMetaData:function(n){var t=this.dataElementType;return t&&new t({_chart:this.chart,_datasetIndex:this.index,_index:n})},addElements:function(){for(var t=this.getMeta(),u=this.getDataset().data||[],r=t.data,n=0,i=u.length;n<i;++n)r[n]=r[n]||this.createMetaData(n);t.dataset=t.dataset||this.createMetaDataset()},addElementAndReset:function(n){var t=this.createMetaData(n);this.getMeta().data.splice(n,0,t);this.updateElement(t,n,!0)},buildOrUpdateElements:function(){var i,u,n=this,f=n.getDataset(),r=f.data||(f.data=[]);n._data!==r&&(n._data&&ye(n._data,n),r&&Object.isExtensible(r)&&(u=n,(i=r)._chartjs?i._chartjs.listeners.push(u):(Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[u]}}),ve.forEach(function(n){var r="onData"+n.charAt(0).toUpperCase()+n.slice(1),u=i[n];Object.defineProperty(i,n,{configurable:!0,enumerable:!1,value:function(){var n=Array.prototype.slice.call(arguments),f=u.apply(this,n);return t.each(i._chartjs.listeners,function(t){"function"==typeof t[r]&&t[r].apply(t,n)}),f}})}))),n._data=r);n.resyncElements()},_configure:function(){this._config=t.merge({},[this.chart.options.datasets[this._type],this.getDataset()],{merger:function(n,i,r){"_meta"!==n&&"data"!==n&&t._merger(n,i,r)}})},_update:function(n){this._configure();this._cachedDataOpts=null;this.update(n)},update:t.noop,transition:function(n){for(var t=this.getMeta(),r=t.data||[],u=r.length,i=0;i<u;++i)r[i].transition(n);t.dataset&&t.dataset.transition(n)},draw:function(){var n=this.getMeta(),i=n.data||[],r=i.length,t=0;for(n.dataset&&n.dataset.draw();t<r;++t)i[t].draw()},getStyle:function(n){var t,i=this.getMeta(),r=i.dataset;return this._configure(),r&&void 0===n?t=this._resolveDatasetElementOptions(r||{}):(n=n||0,t=this._resolveDataElementOptions(i.data[n]||{},n)),!1!==t.fill&&null!==t.fill||(t.backgroundColor=t.borderColor),t},_resolveDatasetElementOptions:function(n,t){for(var r,f,i=this,o=i.chart,c=i._config,l=n.custom||{},a=o.options.elements[i.datasetElementType.prototype._type]||{},s=i._datasetElementOptions,h={},v={chart:o,dataset:i.getDataset(),datasetIndex:i.index,hover:t},u=0,e=s.length;u<e;++u)r=s[u],f=t?"hover"+r.charAt(0).toUpperCase()+r.slice(1):r,h[r]=fi([l[f],c[f],a[f]],v);return h},_resolveDataElementOptions:function(n,i){var u=this,e=n&&n.custom,a=u._cachedDataOpts;if(a&&!e)return a;var v,f,s,r,y=u.chart,c=u._config,p=y.options.elements[u.dataElementType.prototype._type]||{},o=u._dataElementOptions,h={},w={chart:y,dataIndex:i,dataset:u.getDataset(),datasetIndex:u.index},l={cacheable:!e};if(e=e||{},t.isArray(o))for(f=0,s=o.length;f<s;++f)h[r=o[f]]=fi([e[r],c[r],p[r]],w,i,l);else for(f=0,s=(v=Object.keys(o)).length;f<s;++f)h[r=v[f]]=fi([e[r],c[o[r]],c[r],p[r]],w,i,l);return l.cacheable&&(u._cachedDataOpts=Object.freeze(h)),h},removeHoverStyle:function(n){t.merge(n._model,n.$previousStyle||{});delete n.$previousStyle},setHoverStyle:function(n){var r=this.chart.data.datasets[n._datasetIndex],u=n._index,f=n.custom||{},i=n._model,e=t.getHoverColor;n.$previousStyle={backgroundColor:i.backgroundColor,borderColor:i.borderColor,borderWidth:i.borderWidth};i.backgroundColor=fi([f.hoverBackgroundColor,r.hoverBackgroundColor,e(i.backgroundColor)],void 0,u);i.borderColor=fi([f.hoverBorderColor,r.hoverBorderColor,e(i.borderColor)],void 0,u);i.borderWidth=fi([f.hoverBorderWidth,r.hoverBorderWidth,i.borderWidth],void 0,u)},_removeDatasetHoverStyle:function(){var n=this.getMeta().dataset;n&&this.removeHoverStyle(n)},_setDatasetHoverStyle:function(){var n,f,t,e,r,u,i=this.getMeta().dataset,o={};if(i){for(u=i._model,r=this._resolveDatasetElementOptions(i,!0),n=0,f=(e=Object.keys(r)).length;n<f;++n)o[t=e[n]]=u[t],u[t]=r[t];i.$previousStyle=o}},resyncElements:function(){var i=this.getMeta(),r=this.getDataset().data,n=i.data.length,t=r.length;t<n?i.data.splice(t,n-t):t>n&&this.insertElements(n,t-n)},insertElements:function(n,t){for(var i=0;i<t;++i)this.addElementAndReset(n+i)},onDataPush:function(){var n=arguments.length;this.insertElements(this.getDataset().data.length-n,n)},onDataPop:function(){this.getMeta().data.pop()},onDataShift:function(){this.getMeta().data.shift()},onDataSplice:function(n,t){this.getMeta().data.splice(n,t);this.insertElements(n,arguments.length-2)},onDataUnshift:function(){this.insertElements(0,arguments.length)}});rr.extend=t.inherits;y=rr;d=2*Math.PI;i._set("global",{elements:{arc:{backgroundColor:i.global.defaultColor,borderColor:"#fff",borderWidth:2,borderAlign:"center"}}});var kh=nt.extend({_type:"arc",inLabelRange:function(n){var t=this._view;return!!t&&Math.pow(n-t.x,2)<Math.pow(t.radius+t.hoverRadius,2)},inRange:function(n,i){var r=this._view,h,c;if(r){for(var o=t.getAngleFromPoint(r,{x:n,y:i}),u=o.angle,s=o.distance,e=r.startAngle,f=r.endAngle;f<e;)f+=d;for(;u>f;)u-=d;for(;u<e;)u+=d;return h=u>=e&&u<=f,c=s>=r.innerRadius&&s<=r.outerRadius,h&&c}return!1},getCenterPoint:function(){var n=this._view,t=(n.startAngle+n.endAngle)/2,i=(n.innerRadius+n.outerRadius)/2;return{x:n.x+Math.cos(t)*i,y:n.y+Math.sin(t)*i}},getArea:function(){var n=this._view;return Math.PI*((n.endAngle-n.startAngle)/(2*Math.PI))*(Math.pow(n.outerRadius,2)-Math.pow(n.innerRadius,2))},tooltipPosition:function(){var n=this._view,t=n.startAngle+(n.endAngle-n.startAngle)/2,i=(n.outerRadius-n.innerRadius)/2+n.innerRadius;return{x:n.x+Math.cos(t)*i,y:n.y+Math.sin(t)*i}},draw:function(){var r,t=this._chart.ctx,i=this._view,u="inner"===i.borderAlign?.33:0,n={x:i.x,y:i.y,innerRadius:i.innerRadius,outerRadius:Math.max(i.outerRadius-u,0),pixelMargin:u,startAngle:i.startAngle,endAngle:i.endAngle,fullCircles:Math.floor(i.circumference/d)};if(t.save(),t.fillStyle=i.backgroundColor,t.strokeStyle=i.borderColor,n.fullCircles){for(n.endAngle=n.startAngle+d,t.beginPath(),t.arc(n.x,n.y,n.outerRadius,n.startAngle,n.endAngle),t.arc(n.x,n.y,n.innerRadius,n.endAngle,n.startAngle,!0),t.closePath(),r=0;r<n.fullCircles;++r)t.fill();n.endAngle=n.startAngle+i.circumference%d}t.beginPath();t.arc(n.x,n.y,n.outerRadius,n.startAngle,n.endAngle);t.arc(n.x,n.y,n.innerRadius,n.endAngle,n.startAngle,!0);t.closePath();t.fill();i.borderWidth&&bh(t,i,n);t.restore()}}),we=t.valueOrDefault,be=i.global.defaultColor;i._set("global",{elements:{line:{tension:.4,backgroundColor:be,borderWidth:3,borderColor:be,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",capBezierPoints:!0,fill:!0}}});var dh=nt.extend({_type:"line",draw:function(){var r,c,f,s=this,e=s._view,n=s._chart.ctx,a=e.spanGaps,u=s._children.slice(),v=i.global,h=v.elements.line,o=-1,l=s._loop;if(u.length){if(s._loop){for(r=0;r<u.length;++r)if(c=t.previousItem(u,r),!u[r]._view.skip&&c._view.skip){u=u.slice(r).concat(u.slice(0,r));l=a;break}l&&u.push(u[0])}for(n.save(),n.lineCap=e.borderCapStyle||h.borderCapStyle,n.setLineDash&&n.setLineDash(e.borderDash||h.borderDash),n.lineDashOffset=we(e.borderDashOffset,h.borderDashOffset),n.lineJoin=e.borderJoinStyle||h.borderJoinStyle,n.lineWidth=we(e.borderWidth,h.borderWidth),n.strokeStyle=e.borderColor||v.defaultColor,n.beginPath(),(f=u[0]._view).skip||(n.moveTo(f.x,f.y),o=0),r=1;r<u.length;++r)f=u[r]._view,c=-1===o?t.previousItem(u,r):u[o],f.skip||(o!==r-1&&!a||-1===o?n.moveTo(f.x,f.y):t.canvas.lineTo(n,c._view,f),o=r);l&&n.closePath();n.stroke();n.restore()}}}),gh=t.valueOrDefault,ke=i.global.defaultColor;i._set("global",{elements:{point:{radius:3,pointStyle:"circle",backgroundColor:ke,borderColor:ke,borderWidth:1,hitRadius:1,hoverRadius:4,hoverBorderWidth:1}}});ge=nt.extend({_type:"point",inRange:function(n,t){var i=this._view;return!!i&&Math.pow(n-i.x,2)+Math.pow(t-i.y,2)<Math.pow(i.hitRadius+i.radius,2)},inLabelRange:de,inXRange:de,inYRange:function(n){var t=this._view;return!!t&&Math.abs(n-t.y)<t.radius+t.hitRadius},getCenterPoint:function(){var n=this._view;return{x:n.x,y:n.y}},getArea:function(){return Math.PI*Math.pow(this._view.radius,2)},tooltipPosition:function(){var n=this._view;return{x:n.x,y:n.y,padding:n.radius+n.borderWidth}},draw:function(n){var r=this._view,u=this._chart.ctx,o=r.pointStyle,s=r.rotation,h=r.radius,c=r.x,l=r.y,f=i.global,e=f.defaultColor;r.skip||(void 0===n||t.canvas._isPointInArea(r,n))&&(u.strokeStyle=r.borderColor||e,u.lineWidth=gh(r.borderWidth,f.elements.point.borderWidth),u.fillStyle=r.backgroundColor||e,t.canvas.drawPoint(u,o,h,c,l,s))}});ou=i.global.defaultColor;i._set("global",{elements:{rectangle:{backgroundColor:ou,borderColor:ou,borderSkipped:"bottom",borderWidth:0}}});var tc=nt.extend({_type:"rectangle",draw:function(){var n=this._chart.ctx,r=this._view,u=function(n){var t=no(n),r=t.right-t.left,u=t.bottom-t.top,i=nc(n,r/2,u/2);return{outer:{x:t.left,y:t.top,w:r,h:u},inner:{x:t.left+i.l,y:t.top+i.t,w:r-i.l-i.r,h:u-i.t-i.b}}}(r),t=u.outer,i=u.inner;n.fillStyle=r.backgroundColor;n.fillRect(t.x,t.y,t.w,t.h);t.w===i.w&&t.h===i.h||(n.save(),n.beginPath(),n.rect(t.x,t.y,t.w,t.h),n.clip(),n.fillStyle=r.borderColor,n.rect(i.x,i.y,i.w,i.h),n.fill("evenodd"),n.restore())},height:function(){var n=this._view;return n.base-n.y},inRange:function(n,t){return ci(this._view,n,t)},inLabelRange:function(n,t){var i=this._view;return ur(i)?ci(i,n,null):ci(i,null,t)},inXRange:function(n){return ci(this._view,n,null)},inYRange:function(n){return ci(this._view,null,n)},getCenterPoint:function(){var t,i,n=this._view;return ur(n)?(t=n.x,i=(n.y+n.base)/2):(t=(n.x+n.base)/2,i=n.y),{x:t,y:i}},getArea:function(){var n=this._view;return ur(n)?n.width*Math.abs(n.y-n.base):n.height*Math.abs(n.x-n.base)},tooltipPosition:function(){var n=this._view;return{x:n.x,y:n.y}}}),c={},ic=kh,rc=dh,uc=ge,fc=tc;c.Arc=ic;c.Line=rc;c.Point=uc;c.Rectangle=fc;ei=t._deprecated;yt=t.valueOrDefault;i._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}});i._set("global",{datasets:{bar:{categoryPercentage:.8,barPercentage:.9}}});var io=y.extend({dataElementType:c.Rectangle,_dataElementOptions:["backgroundColor","borderColor","borderSkipped","borderWidth","barPercentage","barThickness","categoryPercentage","maxBarThickness","minBarLength"],initialize:function(){var i,n,t=this;y.prototype.initialize.apply(t,arguments);(i=t.getMeta()).stack=t.getDataset().stack;i.bar=!0;n=t._getIndexScale().options;ei("bar chart",n.barPercentage,"scales.[x/y]Axes.barPercentage","dataset.barPercentage");ei("bar chart",n.barThickness,"scales.[x/y]Axes.barThickness","dataset.barThickness");ei("bar chart",n.categoryPercentage,"scales.[x/y]Axes.categoryPercentage","dataset.categoryPercentage");ei("bar chart",t._getValueScale().options.minBarLength,"scales.[x/y]Axes.minBarLength","dataset.minBarLength");ei("bar chart",n.maxBarThickness,"scales.[x/y]Axes.maxBarThickness","dataset.maxBarThickness")},update:function(n){var t,i,r=this.getMeta().data;for(this._ruler=this.getRuler(),t=0,i=r.length;t<i;++t)this.updateElement(r[t],t,n)},updateElement:function(n,i,r){var u=this,e=u.getMeta(),o=u.getDataset(),f=u._resolveDataElementOptions(n,i);n._xScale=u.getScaleForId(e.xAxisID);n._yScale=u.getScaleForId(e.yAxisID);n._datasetIndex=u.index;n._index=i;n._model={backgroundColor:f.backgroundColor,borderColor:f.borderColor,borderSkipped:f.borderSkipped,borderWidth:f.borderWidth,datasetLabel:o.label,label:u.chart.data.labels[i]};t.isArray(o.data[i])&&(n._model.borderSkipped=null);u._updateElementGeometry(n,i,r,f);n.pivot()},_updateElementGeometry:function(n,t,i,r){var u=this,f=n._model,c=u._getValueScale(),s=c.getBasePixel(),e=c.isHorizontal(),l=u._ruler||u.getRuler(),h=u.calculateBarValuePixels(u.index,t,r),o=u.calculateBarIndexPixels(u.index,t,l,r);f.horizontal=e;f.base=i?s:h.base;f.x=e?i?s:h.head:o.center;f.y=e?o.center:i?s:h.head;f.height=e?o.size:void 0;f.width=e?void 0:o.size},_getStacks:function(n){for(var t,u=this._getIndexScale(),f=u._getMatchingVisibleMetas(this._type),e=u.options.stacked,o=f.length,r=[],i=0;i<o&&(t=f[i],(!1===e||-1===r.indexOf(t.stack)||void 0===e&&void 0===t.stack)&&r.push(t.stack),t.index!==n);++i);return r},getStackCount:function(){return this._getStacks().length},getStackIndex:function(n,t){var i=this._getStacks(n),r=void 0!==t?i.indexOf(t):-1;return-1===r?i.length-1:r},getRuler:function(){for(var t=this._getIndexScale(),r=[],n=0,i=this.getMeta().data.length;n<i;++n)r.push(t.getPixelForValue(null,n,this.index));return{pixels:r,start:t._startPixel,end:t._endPixel,stackCount:this.getStackCount(),scale:t}},calculateBarValuePixels:function(n,t,i){var h,a,c,e,l,o,f,g=this.chart,u=this._getValueScale(),p=u.isHorizontal(),w=g.data.datasets,b=u._getMatchingVisibleMetas(this._type),r=u._parseValue(w[n].data[t]),s=i.minBarLength,k=u.options.stacked,d=this.getMeta().stack,v=void 0===r.start?0:r.max>=0&&r.min>=0?r.min:r.max,y=void 0===r.start?r.end:r.max>=0&&r.min>=0?r.max-r.min:r.min-r.max,nt=b.length;if(k||void 0===k&&void 0!==d)for(h=0;h<nt&&(a=b[h]).index!==n;++h)a.stack===d&&(c=void 0===(f=u._parseValue(w[a.index].data[t])).start?f.end:f.min>=0&&f.max>=0?f.max:f.min,(r.min<0&&c<0||r.max>=0&&c>0)&&(v+=c));return e=u.getPixelForValue(v),o=(l=u.getPixelForValue(v+y))-e,void 0!==s&&Math.abs(o)<s&&(o=s,l=y>=0&&!p||y<0&&p?e-s:e+s),{size:o,base:e,head:l,center:l+o/2}},calculateBarIndexPixels:function(n,t,i,r){var u="flex"===r.barThickness?function(n,t,i){var o,e=t.pixels,r=e[n],f=n>0?e[n-1]:null,u=n<e.length-1?e[n+1]:null,s=i.categoryPercentage;return null===f&&(f=r-(null===u?t.end-t.start:u-r)),null===u&&(u=r+r-f),o=r-(r-Math.min(f,u))/2*s,{chunk:Math.abs(u-f)/2*s/t.stackCount,ratio:i.barPercentage,start:o}}(t,i,r):ec(t,i,r),o=this.getStackIndex(n,this.getMeta().stack),f=u.start+u.chunk*o+u.chunk/2,e=Math.min(yt(r.maxBarThickness,1/0),u.chunk*u.ratio);return{base:f-e/2,head:f+e/2,center:f,size:e}},draw:function(){var i=this.chart,f=this._getValueScale(),u=this.getMeta().data,e=this.getDataset(),o=u.length,n=0,r;for(t.canvas.clipArea(i.ctx,i.chartArea);n<o;++n)r=f._parseValue(e.data[n]),isNaN(r.min)||isNaN(r.max)||u[n].draw();t.canvas.unclipArea(i.ctx)},_resolveDataElementOptions:function(){var r=this,n=t.extend({},y.prototype._resolveDataElementOptions.apply(r,arguments)),i=r._getIndexScale().options,u=r._getValueScale().options;return n.barPercentage=yt(i.barPercentage,n.barPercentage),n.barThickness=yt(i.barThickness,n.barThickness),n.categoryPercentage=yt(i.categoryPercentage,n.categoryPercentage),n.maxBarThickness=yt(i.maxBarThickness,n.maxBarThickness),n.minBarLength=yt(u.minBarLength,n.minBarLength),n}}),su=t.valueOrDefault,oc=t.options.resolve;i._set("bubble",{hover:{mode:"single"},scales:{xAxes:[{type:"linear",position:"bottom",id:"x-axis-0"}],yAxes:[{type:"linear",position:"left",id:"y-axis-0"}]},tooltips:{callbacks:{title:function(){return""},label:function(n,t){var i=t.datasets[n.datasetIndex].label||"",r=t.datasets[n.datasetIndex].data[n.index];return i+": ("+n.xLabel+", "+n.yLabel+", "+r.r+")"}}}});var sc=y.extend({dataElementType:c.Point,_dataElementOptions:["backgroundColor","borderColor","borderWidth","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth","hoverRadius","hitRadius","pointStyle","rotation"],update:function(n){var i=this,r=i.getMeta().data;t.each(r,function(t,r){i.updateElement(t,r,n)})},updateElement:function(n,t,i){var u=this,h=u.getMeta(),a=n.custom||{},f=u.getScaleForId(h.xAxisID),e=u.getScaleForId(h.yAxisID),r=u._resolveDataElementOptions(n,t),o=u.getDataset().data[t],s=u.index,c=i?f.getPixelForDecimal(.5):f.getPixelForValue("object"==typeof o?o:NaN,t,s),l=i?e.getBasePixel():e.getPixelForValue(o,t,s);n._xScale=f;n._yScale=e;n._options=r;n._datasetIndex=s;n._index=t;n._model={backgroundColor:r.backgroundColor,borderColor:r.borderColor,borderWidth:r.borderWidth,hitRadius:r.hitRadius,pointStyle:r.pointStyle,rotation:r.rotation,radius:i?0:r.radius,skip:a.skip||isNaN(c)||isNaN(l),x:c,y:l};n.pivot()},setHoverStyle:function(n){var i=n._model,r=n._options,u=t.getHoverColor;n.$previousStyle={backgroundColor:i.backgroundColor,borderColor:i.borderColor,borderWidth:i.borderWidth,radius:i.radius};i.backgroundColor=su(r.hoverBackgroundColor,u(r.backgroundColor));i.borderColor=su(r.hoverBorderColor,u(r.borderColor));i.borderWidth=su(r.hoverBorderWidth,r.borderWidth);i.radius=r.radius+r.hoverRadius},_resolveDataElementOptions:function(n,i){var r=this,f=r.chart,e=r.getDataset(),o=n.custom||{},s=e.data[i]||{},u=y.prototype._resolveDataElementOptions.apply(r,arguments),h={chart:f,dataIndex:i,dataset:e,datasetIndex:r.index};return r._cachedDataOpts===u&&(u=t.extend({},u)),u.radius=oc([o.radius,s.r,r._config.radius,f.options.elements.point.radius],h,i),u}}),fr=t.valueOrDefault,pt=Math.PI,rt=2*pt,wt=pt/2;i._set("doughnut",{animation:{animateRotate:!0,animateScale:!1},hover:{mode:"single"},legendCallback:function(n){var t,u,f,i=document.createElement("ul"),e=n.data,r=e.datasets,o=e.labels;if(i.setAttribute("class",n.id+"-legend"),r.length)for(t=0,u=r[0].data.length;t<u;++t)(f=i.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=r[0].backgroundColor[t],o[t]&&f.appendChild(document.createTextNode(o[t]));return i.outerHTML},legend:{labels:{generateLabels:function(n){var t=n.data;return t.labels.length&&t.datasets.length?t.labels.map(function(i,r){var f=n.getDatasetMeta(0),u=f.controller.getStyle(r);return{text:i,fillStyle:u.backgroundColor,strokeStyle:u.borderColor,lineWidth:u.borderWidth,hidden:isNaN(t.datasets[0].data[r])||f.data[r].hidden,index:r}}):[]}},onClick:function(n,t){for(var r,u=t.index,f=this.chart,i=0,e=(f.data.datasets||[]).length;i<e;++i)(r=f.getDatasetMeta(i)).data[u]&&(r.data[u].hidden=!r.data[u].hidden);f.update()}},cutoutPercentage:50,rotation:-wt,circumference:rt,tooltips:{callbacks:{title:function(){return""},label:function(n,i){var r=i.labels[n.index],u=": "+i.datasets[n.datasetIndex].data[n.index];return t.isArray(r)?(r=r.slice())[0]+=u:r+=u,r}}}});hu=y.extend({dataElementType:c.Arc,linkScales:t.noop,_dataElementOptions:["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"],getRingIndex:function(n){for(var i=0,t=0;t<n;++t)this.chart.isDatasetVisible(t)&&++i;return i},update:function(n){var p,w,r,s,i=this,t=i.chart,h=t.chartArea,y=t.options,b=1,k=1,d=0,g=0,nt=i.getMeta(),o=nt.data,u=y.cutoutPercentage/100||0,tt=y.circumference,ot=i._getRingWeight(i.index);if(tt<rt){var f=y.rotation%rt,e=(f+=f>=pt?-rt:f<-pt?rt:0)+tt,c=Math.cos(f),l=Math.sin(f),a=Math.cos(e),v=Math.sin(e),st=f<=0&&e>=0||e>=rt,ht=f<=wt&&e>=wt||e>=rt+wt,ct=f<=-wt&&e>=-wt||e>=pt+wt,it=f===-pt||e>=pt?-1:Math.min(c,c*u,a,a*u),ut=ct?-1:Math.min(l,l*u,v,v*u),ft=st?1:Math.max(c,c*u,a,a*u),et=ht?1:Math.max(l,l*u,v,v*u);b=(ft-it)/2;k=(et-ut)/2;d=-(ft+it)/2;g=-(et+ut)/2}for(r=0,s=o.length;r<s;++r)o[r]._options=i._resolveDataElementOptions(o[r],r);for(t.borderWidth=i.getMaxBorderWidth(),p=(h.right-h.left-t.borderWidth)/b,w=(h.bottom-h.top-t.borderWidth)/k,t.outerRadius=Math.max(Math.min(p,w)/2,0),t.innerRadius=Math.max(t.outerRadius*u,0),t.radiusLength=(t.outerRadius-t.innerRadius)/(i._getVisibleDatasetWeightTotal()||1),t.offsetX=d*t.outerRadius,t.offsetY=g*t.outerRadius,nt.total=i.calculateTotal(),i.outerRadius=t.outerRadius-t.radiusLength*i._getRingWeightOffset(i.index),i.innerRadius=Math.max(i.outerRadius-t.radiusLength*ot,0),r=0,s=o.length;r<s;++r)i.updateElement(o[r],r,n)},updateElement:function(n,i,r){var u=this,f=u.chart,s=f.chartArea,e=f.options,h=e.animation,a=(s.left+s.right)/2,v=(s.top+s.bottom)/2,y=e.rotation,p=e.rotation,l=u.getDataset(),w=r&&h.animateRotate?0:n.hidden?0:u.calculateCircumference(l.data[i])*(e.circumference/rt),b=r&&h.animateScale?0:u.innerRadius,k=r&&h.animateScale?0:u.outerRadius,c=n._options||{},o;t.extend(n,{_datasetIndex:u.index,_index:i,_model:{backgroundColor:c.backgroundColor,borderColor:c.borderColor,borderWidth:c.borderWidth,borderAlign:c.borderAlign,x:a+f.offsetX,y:v+f.offsetY,startAngle:y,endAngle:p,circumference:w,outerRadius:k,innerRadius:b,label:t.valueAtIndexOrDefault(l.label,i,f.data.labels[i])}});o=n._model;r&&h.animateRotate||(o.startAngle=0===i?e.rotation:u.getMeta().data[i-1]._model.endAngle,o.endAngle=o.startAngle+o.circumference);n.pivot()},calculateTotal:function(){var n,r=this.getDataset(),u=this.getMeta(),i=0;return t.each(u.data,function(t,u){n=r.data[u];isNaN(n)||t.hidden||(i+=Math.abs(n))}),i},calculateCircumference:function(n){var t=this.getMeta().total;return t>0&&!isNaN(n)?rt*(Math.abs(n)/t):0},getMaxBorderWidth:function(n){var t,u,h,e,f,r,o,c,i=0,s=this.chart;if(!n)for(t=0,u=s.data.datasets.length;t<u;++t)if(s.isDatasetVisible(t)){n=(h=s.getDatasetMeta(t)).data;t!==this.index&&(f=h.controller);break}if(!n)return 0;for(t=0,u=n.length;t<u;++t)e=n[t],f?(f._configure(),r=f._resolveDataElementOptions(e,t)):r=e._options,"inner"!==r.borderAlign&&(o=r.borderWidth,i=(c=r.hoverBorderWidth)>(i=o>i?o:i)?c:i);return i},setHoverStyle:function(n){var i=n._model,r=n._options,u=t.getHoverColor;n.$previousStyle={backgroundColor:i.backgroundColor,borderColor:i.borderColor,borderWidth:i.borderWidth};i.backgroundColor=fr(r.hoverBackgroundColor,u(r.backgroundColor));i.borderColor=fr(r.hoverBorderColor,u(r.borderColor));i.borderWidth=fr(r.hoverBorderWidth,r.borderWidth)},_getRingWeightOffset:function(n){for(var i=0,t=0;t<n;++t)this.chart.isDatasetVisible(t)&&(i+=this._getRingWeight(t));return i},_getRingWeight:function(n){return Math.max(fr(this.chart.data.datasets[n].weight,1),0)},_getVisibleDatasetWeightTotal:function(){return this._getRingWeightOffset(this.chart.data.datasets.length)}});i._set("horizontalBar",{hover:{mode:"index",axis:"y"},scales:{xAxes:[{type:"linear",position:"bottom"}],yAxes:[{type:"category",position:"left",offset:!0,gridLines:{offsetGridLines:!0}}]},elements:{rectangle:{borderSkipped:"left"}},tooltips:{mode:"index",axis:"y"}});i._set("global",{datasets:{horizontalBar:{categoryPercentage:.8,barPercentage:.9}}});var hc=io.extend({_getValueScaleId:function(){return this.getMeta().xAxisID},_getIndexScaleId:function(){return this.getMeta().yAxisID}}),ut=t.valueOrDefault,cc=t.options.resolve,cu=t.canvas._isPointInArea;i._set("line",{showLines:!0,spanGaps:!1,hover:{mode:"label"},scales:{xAxes:[{type:"category",id:"x-axis-0"}],yAxes:[{type:"linear",id:"y-axis-0"}]}});lu=y.extend({datasetElementType:c.Line,dataElementType:c.Point,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth","cubicInterpolationMode","fill"],_dataElementOptions:{backgroundColor:"pointBackgroundColor",borderColor:"pointBorderColor",borderWidth:"pointBorderWidth",hitRadius:"pointHitRadius",hoverBackgroundColor:"pointHoverBackgroundColor",hoverBorderColor:"pointHoverBorderColor",hoverBorderWidth:"pointHoverBorderWidth",hoverRadius:"pointHoverRadius",pointStyle:"pointStyle",radius:"pointRadius",rotation:"pointRotation"},update:function(n){var i,e,t=this,o=t.getMeta(),r=o.dataset,u=o.data||[],h=t.chart.options,f=t._config,s=t._showLine=ut(f.showLine,h.showLines);for(t._xScale=t.getScaleForId(o.xAxisID),t._yScale=t.getScaleForId(o.yAxisID),s&&(void 0!==f.tension&&void 0===f.lineTension&&(f.lineTension=f.tension),r._scale=t._yScale,r._datasetIndex=t.index,r._children=u,r._model=t._resolveDatasetElementOptions(r),r.pivot()),i=0,e=u.length;i<e;++i)t.updateElement(u[i],i,n);for(s&&0!==r._model.tension&&t.updateBezierControlPoints(),i=0,e=u.length;i<e;++i)u[i].pivot()},updateElement:function(n,t,i){var e,o,u=this,v=u.getMeta(),c=n.custom||{},y=u.getDataset(),s=u.index,h=y.data[t],l=u._xScale,a=u._yScale,f=v.dataset._model,r=u._resolveDataElementOptions(n,t);e=l.getPixelForValue("object"==typeof h?h:NaN,t,s);o=i?a.getBasePixel():u.calculatePointY(h,t,s);n._xScale=l;n._yScale=a;n._options=r;n._datasetIndex=s;n._index=t;n._model={x:e,y:o,skip:c.skip||isNaN(e)||isNaN(o),radius:r.radius,pointStyle:r.pointStyle,rotation:r.rotation,backgroundColor:r.backgroundColor,borderColor:r.borderColor,borderWidth:r.borderWidth,tension:ut(c.tension,f?f.tension:0),steppedLine:!!f&&f.steppedLine,hitRadius:r.hitRadius}},_resolveDatasetElementOptions:function(n){var i=this,r=i._config,e=n.custom||{},u=i.chart.options,f=u.elements.line,t=y.prototype._resolveDatasetElementOptions.apply(i,arguments);return t.spanGaps=ut(r.spanGaps,u.spanGaps),t.tension=ut(r.lineTension,f.tension),t.steppedLine=cc([e.steppedLine,r.steppedLine,f.stepped]),t.clip=ac(ut(r.clip,lc(i._xScale,i._yScale,t.borderWidth))),t},calculatePointY:function(n,t,i){var u,s,f,o,e,h,c,l=this.chart,r=this._yScale,a=0,v=0;if(r.options.stacked){for(e=+r.getRightValue(n),c=(h=l._getSortedVisibleDatasetMetas()).length,u=0;u<c&&(f=h[u]).index!==i;++u)s=l.data.datasets[f.index],"line"===f.type&&f.yAxisID===r.id&&((o=+r.getRightValue(s.data[t]))<0?v+=o||0:a+=o||0);return e<0?r.getPixelForValue(v+e):r.getPixelForValue(a+e)}return r.getPixelForValue(n)},updateBezierControlPoints:function(){function o(n,t,i){return Math.max(Math.min(n,i),t)}var i,e,n,f,h=this.chart,c=this.getMeta(),s=c.dataset._model,u=h.chartArea,r=c.data||[];if(s.spanGaps&&(r=r.filter(function(n){return!n._model.skip})),"monotone"===s.cubicInterpolationMode)t.splineCurveMonotone(r);else for(i=0,e=r.length;i<e;++i)n=r[i]._model,f=t.splineCurve(t.previousItem(r,i)._model,n,t.nextItem(r,i)._model,s.tension),n.controlPointPreviousX=f.previous.x,n.controlPointPreviousY=f.previous.y,n.controlPointNextX=f.next.x,n.controlPointNextY=f.next.y;if(h.options.elements.line.capBezierPoints)for(i=0,e=r.length;i<e;++i)n=r[i]._model,cu(n,u)&&(i>0&&cu(r[i-1]._model,u)&&(n.controlPointPreviousX=o(n.controlPointPreviousX,u.left,u.right),n.controlPointPreviousY=o(n.controlPointPreviousY,u.top,u.bottom)),i<r.length-1&&cu(r[i+1]._model,u)&&(n.controlPointNextX=o(n.controlPointNextX,u.left,u.right),n.controlPointNextY=o(n.controlPointNextY,u.top,u.bottom)))},draw:function(){var n,r=this.chart,u=this.getMeta(),e=u.data||[],i=r.chartArea,o=r.canvas,f=0,s=e.length;for(this._showLine&&(n=u.dataset._model.clip,t.canvas.clipArea(r.ctx,{left:!1===n.left?0:i.left-n.left,right:!1===n.right?o.width:i.right+n.right,top:!1===n.top?0:i.top-n.top,bottom:!1===n.bottom?o.height:i.bottom+n.bottom}),u.dataset.draw(),t.canvas.unclipArea(r.ctx));f<s;++f)e[f].draw(i)},setHoverStyle:function(n){var i=n._model,r=n._options,u=t.getHoverColor;n.$previousStyle={backgroundColor:i.backgroundColor,borderColor:i.borderColor,borderWidth:i.borderWidth,radius:i.radius};i.backgroundColor=ut(r.hoverBackgroundColor,u(r.backgroundColor));i.borderColor=ut(r.hoverBorderColor,u(r.borderColor));i.borderWidth=ut(r.hoverBorderWidth,r.borderWidth);i.radius=ut(r.hoverRadius,r.radius)}});uo=t.options.resolve;i._set("polarArea",{scale:{type:"radialLinear",angleLines:{display:!1},gridLines:{circular:!0},pointLabels:{display:!1},ticks:{beginAtZero:!0}},animation:{animateRotate:!0,animateScale:!0},startAngle:-.5*Math.PI,legendCallback:function(n){var t,u,f,i=document.createElement("ul"),e=n.data,r=e.datasets,o=e.labels;if(i.setAttribute("class",n.id+"-legend"),r.length)for(t=0,u=r[0].data.length;t<u;++t)(f=i.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=r[0].backgroundColor[t],o[t]&&f.appendChild(document.createTextNode(o[t]));return i.outerHTML},legend:{labels:{generateLabels:function(n){var t=n.data;return t.labels.length&&t.datasets.length?t.labels.map(function(i,r){var f=n.getDatasetMeta(0),u=f.controller.getStyle(r);return{text:i,fillStyle:u.backgroundColor,strokeStyle:u.borderColor,lineWidth:u.borderWidth,hidden:isNaN(t.datasets[0].data[r])||f.data[r].hidden,index:r}}):[]}},onClick:function(n,t){for(var f,e=t.index,r=this.chart,i=0,u=(r.data.datasets||[]).length;i<u;++i)(f=r.getDatasetMeta(i)).data[e].hidden=!f.data[e].hidden;r.update()}},tooltips:{callbacks:{title:function(){return""},label:function(n,t){return t.labels[n.index]+": "+n.yLabel}}}});fo=y.extend({dataElementType:c.Arc,linkScales:t.noop,_dataElementOptions:["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"],_getIndexScaleId:function(){return this.chart.scale.id},_getValueScaleId:function(){return this.chart.scale.id},update:function(n){var t,r,f,i=this,s=i.getDataset(),e=i.getMeta(),o=i.chart.options.startAngle||0,h=i._starts=[],c=i._angles=[],u=e.data;for(i._updateRadius(),e.count=i.countVisibleElements(),t=0,r=s.data.length;t<r;t++)h[t]=o,f=i._computeAngle(t),c[t]=f,o+=f;for(t=0,r=u.length;t<r;++t)u[t]._options=i._resolveDataElementOptions(u[t],t),i.updateElement(u[t],t,n)},_updateRadius:function(){var t=this,n=t.chart,i=n.chartArea,r=n.options,u=Math.min(i.right-i.left,i.bottom-i.top);n.outerRadius=Math.max(u/2,0);n.innerRadius=Math.max(r.cutoutPercentage?n.outerRadius/100*r.cutoutPercentage:1,0);n.radiusLength=(n.outerRadius-n.innerRadius)/n.getVisibleDatasetCount();t.outerRadius=n.outerRadius-n.radiusLength*t.index;t.innerRadius=t.outerRadius-n.radiusLength},updateElement:function(n,i,r){var u=this,o=u.chart,h=u.getDataset(),c=o.options,s=c.animation,f=o.scale,l=o.data.labels,y=f.xCenter,p=f.yCenter,a=c.startAngle,w=n.hidden?0:f.getDistanceFromCenterForValue(h.data[i]),v=u._starts[i],b=v+(n.hidden?0:u._angles[i]),k=s.animateScale?0:f.getDistanceFromCenterForValue(h.data[i]),e=n._options||{};t.extend(n,{_datasetIndex:u.index,_index:i,_scale:f,_model:{backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth,borderAlign:e.borderAlign,x:y,y:p,innerRadius:0,outerRadius:r?k:w,startAngle:r&&s.animateRotate?a:v,endAngle:r&&s.animateRotate?a:b,label:t.valueAtIndexOrDefault(l,i,l[i])}});n.pivot()},countVisibleElements:function(){var i=this.getDataset(),r=this.getMeta(),n=0;return t.each(r.data,function(t,r){isNaN(i.data[r])||t.hidden||n++}),n},setHoverStyle:function(n){var i=n._model,r=n._options,f=t.getHoverColor,u=t.valueOrDefault;n.$previousStyle={backgroundColor:i.backgroundColor,borderColor:i.borderColor,borderWidth:i.borderWidth};i.backgroundColor=u(r.hoverBackgroundColor,f(r.backgroundColor));i.borderColor=u(r.hoverBorderColor,f(r.borderColor));i.borderWidth=u(r.hoverBorderWidth,r.borderWidth)},_computeAngle:function(n){var t=this,u=this.getMeta().count,i=t.getDataset(),f=t.getMeta(),r;return isNaN(i.data[n])||f.data[n].hidden?0:(r={chart:t.chart,dataIndex:n,dataset:i,datasetIndex:t.index},uo([t.chart.options.elements.arc.angle,2*Math.PI/u],r,n))}});i._set("pie",t.clone(i.doughnut));i._set("pie",{cutoutPercentage:0});eo=hu;ht=t.valueOrDefault;i._set("radar",{spanGaps:!1,scale:{type:"radialLinear"},elements:{line:{fill:"start",tension:0}}});oo=y.extend({datasetElementType:c.Line,dataElementType:c.Point,linkScales:t.noop,_datasetElementOptions:["backgroundColor","borderWidth","borderColor","borderCapStyle","borderDash","borderDashOffset","borderJoinStyle","fill"],_dataElementOptions:{backgroundColor:"pointBackgroundColor",borderColor:"pointBorderColor",borderWidth:"pointBorderWidth",hitRadius:"pointHitRadius",hoverBackgroundColor:"pointHoverBackgroundColor",hoverBorderColor:"pointHoverBorderColor",hoverBorderWidth:"pointHoverBorderWidth",hoverRadius:"pointHoverRadius",pointStyle:"pointStyle",radius:"pointRadius",rotation:"pointRotation"},_getIndexScaleId:function(){return this.chart.scale.id},_getValueScaleId:function(){return this.chart.scale.id},update:function(n){var t,f,i=this,o=i.getMeta(),r=o.dataset,u=o.data||[],s=i.chart.scale,e=i._config;for(void 0!==e.tension&&void 0===e.lineTension&&(e.lineTension=e.tension),r._scale=s,r._datasetIndex=i.index,r._children=u,r._loop=!0,r._model=i._resolveDatasetElementOptions(r),r.pivot(),t=0,f=u.length;t<f;++t)i.updateElement(u[t],t,n);for(i.updateBezierControlPoints(),t=0,f=u.length;t<f;++t)u[t].pivot()},updateElement:function(n,t,i){var u=this,e=n.custom||{},l=u.getDataset(),f=u.chart.scale,o=f.getPointPositionForValue(t,l.data[t]),r=u._resolveDataElementOptions(n,t),s=u.getMeta().dataset._model,h=i?f.xCenter:o.x,c=i?f.yCenter:o.y;n._scale=f;n._options=r;n._datasetIndex=u.index;n._index=t;n._model={x:h,y:c,skip:e.skip||isNaN(h)||isNaN(c),radius:r.radius,pointStyle:r.pointStyle,rotation:r.rotation,backgroundColor:r.backgroundColor,borderColor:r.borderColor,borderWidth:r.borderWidth,tension:ht(e.tension,s?s.tension:0),hitRadius:r.hitRadius}},_resolveDatasetElementOptions:function(){var n=this,i=n._config,r=n.chart.options,t=y.prototype._resolveDatasetElementOptions.apply(n,arguments);return t.spanGaps=ht(i.spanGaps,r.spanGaps),t.tension=ht(i.lineTension,r.elements.line.tension),t},updateBezierControlPoints:function(){function e(n,t,i){return Math.max(Math.min(n,i),t)}var r,o,i,f,s=this.getMeta(),n=this.chart.chartArea,u=s.data||[];for(s.dataset._model.spanGaps&&(u=u.filter(function(n){return!n._model.skip})),r=0,o=u.length;r<o;++r)i=u[r]._model,f=t.splineCurve(t.previousItem(u,r,!0)._model,i,t.nextItem(u,r,!0)._model,i.tension),i.controlPointPreviousX=e(f.previous.x,n.left,n.right),i.controlPointPreviousY=e(f.previous.y,n.top,n.bottom),i.controlPointNextX=e(f.next.x,n.left,n.right),i.controlPointNextY=e(f.next.y,n.top,n.bottom)},setHoverStyle:function(n){var i=n._model,r=n._options,u=t.getHoverColor;n.$previousStyle={backgroundColor:i.backgroundColor,borderColor:i.borderColor,borderWidth:i.borderWidth,radius:i.radius};i.backgroundColor=ht(r.hoverBackgroundColor,u(r.backgroundColor));i.borderColor=ht(r.hoverBorderColor,u(r.borderColor));i.borderWidth=ht(r.hoverBorderWidth,r.borderWidth);i.radius=ht(r.hoverRadius,r.radius)}});i._set("scatter",{hover:{mode:"single"},scales:{xAxes:[{id:"x-axis-1",type:"linear",position:"bottom"}],yAxes:[{id:"y-axis-1",type:"linear",position:"left"}]},tooltips:{callbacks:{title:function(){return""},label:function(n){return"("+n.xLabel+", "+n.yLabel+")"}}}});i._set("global",{datasets:{scatter:{showLine:!1}}});au={bar:io,bubble:sc,doughnut:hu,horizontalBar:hc,line:lu,polarArea:fo,pie:eo,radar:oo,scatter:lu};kt={modes:{single:function(n,t){var r=bt(t,n),i=[];return li(n,function(n){if(n.inRange(r.x,r.y))return i.push(n),i}),i.slice(0,1)},label:wu,index:wu,dataset:function(n,t,i){var u=bt(t,n),f,r;return i.axis=i.axis||"xy",f=pu(i.axis),r=i.intersect?vu(n,u):yu(n,u,!1,f),r.length>0&&(r=n.getDatasetMeta(r[0]._datasetIndex).data),r},"x-axis":function(n,t){return wu(n,t,{intersect:!1})},point:function(n,t){return vu(n,bt(t,n))},nearest:function(n,t,i){var u=bt(t,n),r;return i.axis=i.axis||"xy",r=pu(i.axis),yu(n,u,i.intersect,r)},x:function(n,t,i){var r=bt(t,n),u=[],f=!1;return li(n,function(n){n.inXRange(r.x)&&u.push(n);n.inRange(r.x,r.y)&&(f=!0)}),i.intersect&&!f&&(u=[]),u},y:function(n,t,i){var r=bt(t,n),u=[],f=!1;return li(n,function(n){n.inYRange(r.y)&&u.push(n);n.inRange(r.x,r.y)&&(f=!0)}),i.intersect&&!f&&(u=[]),u}}};er=t.extend;i._set("global",{layout:{padding:{top:0,right:0,bottom:0,left:0}}});var bu,b={defaults:{},addBox:function(n,t){n.boxes||(n.boxes=[]);t.fullWidth=t.fullWidth||!1;t.position=t.position||"top";t.weight=t.weight||0;t._layers=t._layers||function(){return[{z:0,draw:function(){t.draw.apply(t,arguments)}}]};n.boxes.push(t)},removeBox:function(n,t){var i=n.boxes?n.boxes.indexOf(t):-1;-1!==i&&n.boxes.splice(i,1)},configure:function(n,t,i){for(var r,f=["fullWidth","position","weight"],e=f.length,u=0;u<e;++u)r=f[u],i.hasOwnProperty(r)&&(t[r]=i[r])},update:function(n,i,r){if(n){var a=n.options.layout||{},f=t.options.toPadding(a.padding),h=i-f.width,c=r-f.height,o=function(n){var t=function(n){for(var i,u=[],t=0,r=(n||[]).length;t<r;++t)i=n[t],u.push({index:t,box:i,pos:i.position,horizontal:i.isHorizontal(),weight:i.weight});return u}(n),i=or(ai(t,"left"),!0),r=or(ai(t,"right")),u=or(ai(t,"top"),!0),f=or(ai(t,"bottom"));return{leftAndTop:i.concat(u),rightAndBottom:r.concat(f),chartArea:ai(t,"chartArea"),vertical:i.concat(r),horizontal:u.concat(f)}}(n.boxes),s=o.vertical,l=o.horizontal,e=Object.freeze({outerWidth:i,outerHeight:r,padding:f,availableWidth:h,vBoxMaxWidth:h/2/s.length,hBoxMaxHeight:c/2}),u=er({maxPadding:er({},f),w:h,h:c,x:f.left,y:f.top},f);!function(n,t){for(var i,r=0,u=n.length;r<u;++r)(i=n[r]).width=i.horizontal?i.box.fullWidth&&t.availableWidth:t.vBoxMaxWidth,i.height=i.horizontal&&t.hBoxMaxHeight}(s.concat(l),e);sr(s,u,e);sr(l,u,e)&&sr(s,u,e),function(n){function t(t){var r=Math.max(i[t]-n[t],0);return n[t]+=r,r}var i=n.maxPadding;n.y+=t("top");n.x+=t("left");t("right");t("bottom")}(u);ho(o.leftAndTop,u,e);u.x+=u.w;u.y+=u.h;ho(o.rightAndBottom,u,e);n.chartArea={left:u.left,top:u.top,right:u.left+u.w,bottom:u.top+u.h};t.each(o.chartArea,function(t){var i=t.box;er(i,n.chartArea);i.update(u.w,u.h)})}}},pc=(bu=Object.freeze({__proto__:null,"default":"@keyframes chartjs-render-animation{from{opacity:.99}to{opacity:1}}.chartjs-render-monitor{animation:chartjs-render-animation 1ms}.chartjs-size-monitor,.chartjs-size-monitor-expand,.chartjs-size-monitor-shrink{position:absolute;direction:ltr;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1}.chartjs-size-monitor-expand>div{position:absolute;width:1000000px;height:1000000px;left:0;top:0}.chartjs-size-monitor-shrink>div{position:absolute;width:200%;height:200%;left:0;top:0}"}))&&bu.default||bu,o="$chartjs",ku="chartjs-size-monitor",co="chartjs-render-monitor",wc="chartjs-render-animation",lo=["animationstart","webkitAnimationStart"],bc={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};du=!!function(){var n=!1,t;try{t=Object.defineProperty({},"passive",{get:function(){n=!0}});window.addEventListener("e",null,t)}catch(n){}return n}()&&{passive:!0};tf={disableCSSInjection:!1,_enabled:"undefined"!=typeof window&&"undefined"!=typeof document,_ensureLoaded:function(n){if(!this.disableCSSInjection){var t=n.getRootNode?n.getRootNode():document;!function(n,t){var r=n[o]||(n[o]={}),i;r.containsStyles||(r.containsStyles=!0,t="/* Chart.js */\n"+t,i=document.createElement("style"),i.setAttribute("type","text/css"),i.appendChild(document.createTextNode(t)),n.appendChild(i))}(t.host?t:document.head,pc)}},acquireContext:function(n,t){"string"==typeof n?n=document.getElementById(n):n.length&&(n=n[0]);n&&n.canvas&&(n=n.canvas);var i=n&&n.getContext&&n.getContext("2d");return i&&i.canvas===n?(this._ensureLoaded(n),function(n,t){var i=n.style,u=n.getAttribute("height"),f=n.getAttribute("width"),r,e;(n[o]={initial:{height:u,width:f,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",null===f||""===f)&&(r=ao(n,"width"),void 0!==r&&(n.width=r));(null===u||""===u)&&(""===n.style.height?n.height=n.width/(t.options.aspectRatio||2):(e=ao(n,"height"),void 0!==r&&(n.height=e)))}(n,t),i):null},releaseContext:function(n){var i=n.canvas,r;i[o]&&(r=i[o].initial,["height","width"].forEach(function(n){var u=r[n];t.isNullOrUndef(u)?i.removeAttribute(n):i.setAttribute(n,u)}),t.each(r.style||{},function(n,t){i.style[t]=n}),i.width=i.width,delete i[o])},addEventListener:function(n,i,r){var f=n.canvas,u;"resize"!==i?(u=r[o]||(r[o]={}),vi(f,i,(u.proxies||(u.proxies={}))[n.id+"_"+i]=function(i){r(function(n,i){var u=bc[n.type]||n.type,r=t.getRelativePosition(n,i);return nf(u,i,r.x,r.y,n)}(i,n))})):kc(f,r,n)},removeEventListener:function(n,t,i){var u=n.canvas,r;"resize"!==t?(r=((i[o]||{}).proxies||{})[n.id+"_"+t],r&&gu(u,t,r)):dc(u)}};t.addEvent=vi;t.removeEvent=gu;vo=tf._enabled?tf:{acquireContext:function(n){return n&&n.canvas&&(n=n.canvas),n&&n.getContext("2d")||null}};dt=t.extend({initialize:function(){},acquireContext:function(){},releaseContext:function(){},addEventListener:function(){},removeEventListener:function(){}},vo);i._set("global",{plugins:{}});var f={_plugins:[],_cacheId:0,register:function(n){var t=this._plugins;[].concat(n).forEach(function(n){-1===t.indexOf(n)&&t.push(n)});this._cacheId++},unregister:function(n){var t=this._plugins;[].concat(n).forEach(function(n){var i=t.indexOf(n);-1!==i&&t.splice(i,1)});this._cacheId++},clear:function(){this._plugins=[];this._cacheId++},count:function(){return this._plugins.length},getAll:function(){return this._plugins},notify:function(n,t,i){for(var u,f,e,o,s=this.descriptors(n),h=s.length,r=0;r<h;++r)if("function"==typeof(o=(f=(u=s[r]).plugin)[t])&&((e=[n].concat(i||[])).push(u.options),!1===o.apply(f,e)))return!1;return!0},descriptors:function(n){var r=n.$plugins||(n.$plugins={});if(r.id===this._cacheId)return r.descriptors;var e=[],u=[],f=n&&n.config||{},o=f.options&&f.options.plugins||{};return this._plugins.concat(f.plugins||[]).forEach(function(n){if(-1===e.indexOf(n)){var f=n.id,r=o[f];!1!==r&&(!0===r&&(r=t.clone(i.global.plugins[f])),e.push(n),u.push({plugin:n,options:r||{}}))}}),r.descriptors=u,r.id=this._cacheId,u},_invalidate:function(n){delete n.$plugins}},pi={constructors:{},defaults:{},registerScaleType:function(n,i,r){this.constructors[n]=i;this.defaults[n]=t.clone(r)},getScaleConstructor:function(n){if(this.constructors.hasOwnProperty(n))return this.constructors[n]},getScaleDefaults:function(n){return this.defaults.hasOwnProperty(n)?t.merge({},[i.scale,this.defaults[n]]):{}},updateScaleDefaults:function(n,i){this.defaults.hasOwnProperty(n)&&(this.defaults[n]=t.extend(this.defaults[n],i))},addScalesToLayout:function(n){t.each(n.scales,function(t){t.fullWidth=t.options.fullWidth;t.position=t.options.position;t.weight=t.options.weight;b.addBox(n,t)})}},ft=t.valueOrDefault,rf=t.rtl.getRtlAdapter;i._set("global",{tooltips:{enabled:!0,custom:null,mode:"nearest",position:"average",intersect:!0,backgroundColor:"rgba(0,0,0,0.8)",titleFontStyle:"bold",titleSpacing:2,titleMarginBottom:6,titleFontColor:"#fff",titleAlign:"left",bodySpacing:2,bodyFontColor:"#fff",bodyAlign:"left",footerFontStyle:"bold",footerSpacing:2,footerMarginTop:6,footerFontColor:"#fff",footerAlign:"left",yPadding:6,xPadding:6,caretPadding:2,caretSize:5,cornerRadius:6,multiKeyBackground:"#fff",displayColors:!0,borderColor:"rgba(0,0,0,0)",borderWidth:0,callbacks:{beforeTitle:t.noop,title:function(n,t){var r="",u=t.labels,f=u?u.length:0,i;return n.length>0&&(i=n[0],i.label?r=i.label:i.xLabel?r=i.xLabel:f>0&&i.index<f&&(r=u[i.index])),r},afterTitle:t.noop,beforeBody:t.noop,beforeLabel:t.noop,label:function(n,i){var r=i.datasets[n.datasetIndex].label||"";return r&&(r+=": "),r+=t.isNullOrUndef(n.value)?n.yLabel:n.value,r},labelColor:function(n,t){var i=t.getDatasetMeta(n.datasetIndex).data[n.index]._view;return{borderColor:i.borderColor,backgroundColor:i.backgroundColor}},labelTextColor:function(){return this._options.bodyFontColor},afterLabel:t.noop,afterBody:t.noop,beforeFooter:t.noop,footer:t.noop,afterFooter:t.noop}}});uf={average:function(n){var i,u;if(!n.length)return!1;for(var e=0,o=0,r=0,t=0,f=n.length;t<f;++t)i=n[t],i&&i.hasValue()&&(u=i.tooltipPosition(),e+=u.x,o+=u.y,++r);return{x:e/r,y:o/r}},nearest:function(n,i){for(var f,h=i.x,c=i.y,l=Number.POSITIVE_INFINITY,r,a,e,o,u=0,s=n.length;u<s;++u)r=n[u],r&&r.hasValue()&&(a=r.getCenterPoint(),e=t.distanceBetweenPoints(i,a),e<l&&(l=e,f=r));return f&&(o=f.tooltipPosition(),h=o.x,c=o.y),{x:h,y:c}}};var gc=nt.extend({initialize:function(){this._model=yo(this._options);this._lastActive=[]},getTitle:function(){var t=this,r=t._options,i=r.callbacks,u=i.beforeTitle.apply(t,arguments),f=i.title.apply(t,arguments),e=i.afterTitle.apply(t,arguments),n=[];return n=tt(n,et(u)),n=tt(n,et(f)),n=tt(n,et(e))},getBeforeBody:function(){return po(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(n,i){var r=this,u=r._options.callbacks,f=[];return t.each(n,function(n){var t={before:[],lines:[],after:[]};tt(t.before,et(u.beforeLabel.call(r,n,i)));tt(t.lines,u.label.call(r,n,i));tt(t.after,et(u.afterLabel.call(r,n,i)));f.push(t)}),f},getAfterBody:function(){return po(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var t=this,i=t._options.callbacks,r=i.beforeFooter.apply(t,arguments),u=i.footer.apply(t,arguments),f=i.afterFooter.apply(t,arguments),n=[];return n=tt(n,et(r)),n=tt(n,et(u)),n=tt(n,et(f))},update:function(n){var v,rt,e,y,p,h,o,w,b,k,r=this,f=r._options,s=r._model,i=r._model=yo(f),d=r._active,c=r._data,g={xAlign:s.xAlign,yAlign:s.yAlign},nt={x:s.x,y:s.y},l={width:s.width,height:s.height},a={x:s.caretX,y:s.caretY},tt,it,u;if(d.length){for(i.opacity=1,tt=[],it=[],a=uf[f.position].call(r,d,r._eventPosition),u=[],v=0,rt=d.length;v<rt;++v)u.push((e=d[v],y=void 0,p=void 0,h=void 0,o=void 0,w=void 0,b=void 0,k=void 0,y=e._xScale,p=e._yScale||e._scale,h=e._index,o=e._datasetIndex,w=e._chart.getDatasetMeta(o).controller,b=w._getIndexScale(),k=w._getValueScale(),{xLabel:y?y.getLabelForIndex(h,o):"",yLabel:p?p.getLabelForIndex(h,o):"",label:b?""+b.getLabelForIndex(h,o):"",value:k?""+k.getLabelForIndex(h,o):"",index:h,datasetIndex:o,x:e._model.x,y:e._model.y}));f.filter&&(u=u.filter(function(n){return f.filter(n,c)}));f.itemSort&&(u=u.sort(function(n,t){return f.itemSort(n,t,c)}));t.each(u,function(n){tt.push(f.callbacks.labelColor.call(r,n,r._chart));it.push(f.callbacks.labelTextColor.call(r,n,r._chart))});i.title=r.getTitle(u,c);i.beforeBody=r.getBeforeBody(u,c);i.body=r.getBody(u,c);i.afterBody=r.getAfterBody(u,c);i.footer=r.getFooter(u,c);i.x=a.x;i.y=a.y;i.caretPadding=f.caretPadding;i.labelColors=tt;i.labelTextColors=it;i.dataPoints=u;l=function(n,i){var f=n._chart.ctx,r=2*i.yPadding,c=0,a=i.body,e=a.reduce(function(n,t){return n+t.before.length+t.lines.length+t.after.length},0),h,u;e+=i.beforeBody.length+i.afterBody.length;var o=i.title.length,s=i.footer.length,v=i.titleFontSize,l=i.bodyFontSize,y=i.footerFontSize;return r+=o*v,r+=o?(o-1)*i.titleSpacing:0,r+=o?i.titleMarginBottom:0,r+=e*l,r+=e?(e-1)*i.bodySpacing:0,r+=s?i.footerMarginTop:0,r+=s*y,r+=s?(s-1)*i.footerSpacing:0,h=0,u=function(n){c=Math.max(c,f.measureText(n).width+h)},f.font=t.fontString(v,i._titleFontStyle,i._titleFontFamily),t.each(i.title,u),f.font=t.fontString(l,i._bodyFontStyle,i._bodyFontFamily),t.each(i.beforeBody.concat(i.afterBody),u),h=i.displayColors?l+2:0,t.each(a,function(n){t.each(n.before,u);t.each(n.lines,u);t.each(n.after,u)}),h=0,f.font=t.fontString(y,i._footerFontStyle,i._footerFontFamily),t.each(i.footer,u),{width:c+=2*i.xPadding,height:r}}(this,i);nt=function(n,t,i,r){var u=n.x,o=n.y,l=n.caretSize,h=n.caretPadding,a=n.cornerRadius,f=i.xAlign,s=i.yAlign,e=l+h,c=a+h;return"right"===f?u-=t.width:"center"===f&&((u-=t.width/2)+t.width>r.width&&(u=r.width-t.width),u<0&&(u=0)),"top"===s?o+=e:o-="bottom"===s?t.height+e:t.height/2,"center"===s?"left"===f?u+=e:"right"===f&&(u-=e):"left"===f?u-=c:"right"===f&&(u+=c),{x:u,y:o}}(i,l,g=function(n,t){var o,s,a,v,h,i=n._model,c=n._chart,e=n._chart.chartArea,u="center",r="center",l,y,f;return i.y<t.height?r="top":i.y>c.height-t.height&&(r="bottom"),l=(e.left+e.right)/2,y=(e.top+e.bottom)/2,"center"===r?(o=function(n){return n<=l},s=function(n){return n>l}):(o=function(n){return n<=t.width/2},s=function(n){return n>=c.width-t.width/2}),a=function(n){return n+t.width+i.caretSize+i.caretPadding>c.width},v=function(n){return n-t.width-i.caretSize-i.caretPadding<0},h=function(n){return n<=y?"top":"bottom"},o(i.x)?(u="left",a(i.x)&&(u="center",r=h(i.y))):s(i.x)&&(u="right",v(i.x)&&(u="center",r=h(i.y))),f=n._options,{xAlign:f.xAlign?f.xAlign:u,yAlign:f.yAlign?f.yAlign:r}}(this,l),r._chart)}else i.opacity=0;return i.xAlign=g.xAlign,i.yAlign=g.yAlign,i.x=nt.x,i.y=nt.y,i.width=l.width,i.height=l.height,i.caretX=a.x,i.caretY=a.y,r._model=i,n&&f.custom&&f.custom.call(r,i),r},drawCaret:function(n,t){var r=this._chart.ctx,u=this._view,i=this.getCaretPosition(n,t,u);r.lineTo(i.x1,i.y1);r.lineTo(i.x2,i.y2);r.lineTo(i.x3,i.y3)},getCaretPosition:function(n,t,i){var u,f,e,s,o,h,r=i.caretSize,v=i.cornerRadius,l=i.xAlign,y=i.yAlign,c=n.x,a=n.y,p=t.width,w=t.height,b;return"center"===y?(o=a+w/2,"left"===l?(f=(u=c)-r,e=u,s=o+r,h=o-r):(f=(u=c+p)+r,e=u,s=o-r,h=o+r)):("left"===l?(u=(f=c+v+r)-r,e=f+r):"right"===l?(u=(f=c+p-v-r)-r,e=f+r):(u=(f=i.caretX)-r,e=f+r),"top"===y)?(o=(s=a)-r,h=s):(o=(s=a+w)+r,h=s,b=e,e=u,u=b),{x1:u,x2:f,x3:e,y1:s,y2:o,y3:h}},drawTitle:function(n,i,r){var f,e,u,h=i.title,o=h.length,s;if(o)for(s=rf(i.rtl,i.x,i.width),n.x=hr(i,i._titleAlign),r.textAlign=s.textAlign(i._titleAlign),r.textBaseline="middle",f=i.titleFontSize,e=i.titleSpacing,r.fillStyle=i.titleFontColor,r.font=t.fontString(f,i._titleFontStyle,i._titleFontFamily),u=0;u<o;++u)r.fillText(h[u],s.x(n.x),n.y+f/2),n.y+=f+e,u+1===o&&(n.y+=i.titleMarginBottom-e)},drawBody:function(n,i,r){var s,l,a,w,e,h,b,k,u=i.bodyFontSize,d=i.bodySpacing,v=i._bodyAlign,g=i.body,y=i.displayColors,p=0,tt=y?hr(i,"left"):0,f=rf(i.rtl,i.x,i.width),o=function(t){r.fillText(t,f.x(n.x+p),n.y+u/2);n.y+=u+d},nt=f.textAlign(v),c;for(r.textAlign=v,r.textBaseline="middle",r.font=t.fontString(u,i._bodyFontStyle,i._bodyFontFamily),n.x=hr(i,nt),r.fillStyle=i.bodyFontColor,t.each(i.beforeBody,o),p=y&&"right"!==nt?"center"===v?u/2+1:u+2:0,e=0,b=g.length;e<b;++e){for(s=g[e],l=i.labelTextColors[e],a=i.labelColors[e],r.fillStyle=l,t.each(s.before,o),h=0,k=(w=s.lines).length;h<k;++h)y&&(c=f.x(tt),r.fillStyle=i.legendColorBackground,r.fillRect(f.leftForLtr(c,u),n.y,u,u),r.lineWidth=1,r.strokeStyle=a.borderColor,r.strokeRect(f.leftForLtr(c,u),n.y,u,u),r.fillStyle=a.backgroundColor,r.fillRect(f.leftForLtr(f.xPlus(c,1),u-2),n.y+1,u-2,u-2),r.fillStyle=l),o(w[h]);t.each(s.after,o)}p=0;t.each(i.afterBody,o);n.y-=d},drawFooter:function(n,i,r){var u,f,o=i.footer,s=o.length,e;if(s)for(e=rf(i.rtl,i.x,i.width),n.x=hr(i,i._footerAlign),n.y+=i.footerMarginTop,r.textAlign=e.textAlign(i._footerAlign),r.textBaseline="middle",u=i.footerFontSize,r.fillStyle=i.footerFontColor,r.font=t.fontString(u,i._footerFontStyle,i._footerFontFamily),f=0;f<s;++f)r.fillText(o[f],e.x(n.x),n.y+u/2),n.y+=u+i.footerSpacing},drawBackground:function(n,t,i,r){i.fillStyle=t.backgroundColor;i.strokeStyle=t.borderColor;i.lineWidth=t.borderWidth;var c=t.xAlign,h=t.yAlign,u=n.x,f=n.y,o=r.width,s=r.height,e=t.cornerRadius;i.beginPath();i.moveTo(u+e,f);"top"===h&&this.drawCaret(n,r);i.lineTo(u+o-e,f);i.quadraticCurveTo(u+o,f,u+o,f+e);"center"===h&&"right"===c&&this.drawCaret(n,r);i.lineTo(u+o,f+s-e);i.quadraticCurveTo(u+o,f+s,u+o-e,f+s);"bottom"===h&&this.drawCaret(n,r);i.lineTo(u+e,f+s);i.quadraticCurveTo(u,f+s,u,f+s-e);"center"===h&&"left"===c&&this.drawCaret(n,r);i.lineTo(u,f+e);i.quadraticCurveTo(u,f,u+e,f);i.closePath();i.fill();t.borderWidth>0&&i.stroke()},draw:function(){var i=this._chart.ctx,n=this._view;if(0!==n.opacity){var u={width:n.width,height:n.height},r={x:n.x,y:n.y},f=Math.abs(n.opacity<.001)?0:n.opacity,e=n.title.length||n.beforeBody.length||n.body.length||n.afterBody.length||n.footer.length;this._options.enabled&&e&&(i.save(),i.globalAlpha=f,this.drawBackground(r,n,i,u),r.y+=n.yPadding,t.rtl.overrideTextDirection(i,n.textDirection),this.drawTitle(r,n,i),this.drawBody(r,n,i),this.drawFooter(r,n,i),t.rtl.restoreTextDirection(i,n.textDirection),i.restore())}},handleEvent:function(n){var u,i=this,r=i._options;return i._lastActive=i._lastActive||[],"mouseout"===n.type?i._active=[]:(i._active=i._chart.getElementsAtEventForMode(n,r.mode,r),r.reverse&&i._active.reverse()),(u=!t.arrayEquals(i._active,i._lastActive))&&(i._lastActive=i._active,(r.enabled||r.custom)&&(i._eventPosition={x:n.x,y:n.y},i.update(!0),i.pivot())),u}}),nl=uf,ff=gc;ff.positioners=nl;cr=t.valueOrDefault;i._set("global",{elements:{},events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,maintainAspectRatio:!0,responsive:!0,responsiveAnimationDuration:0});ot=function(n,t){return this.construct(n,t),this};t.extend(ot.prototype,{construct:function(n,r){var u=this;r=function(n){var t=(n=n||{}).data=n.data||{};return t.datasets=t.datasets||[],t.labels=t.labels||[],n.options=ef(i.global,i[n.type],n.options||{}),n}(r);var e=dt.acquireContext(n,r),f=e&&e.canvas,o=f&&f.height,s=f&&f.width;u.id=t.uid();u.ctx=e;u.canvas=f;u.config=r;u.width=s;u.height=o;u.aspectRatio=o?s/o:null;u.options=r.options;u._bufferedRender=!1;u._layers=[];u.chart=u;u.controller=u;ot.instances[u.id]=u;Object.defineProperty(u,"data",{get:function(){return u.config.data},set:function(n){u.config.data=n}});e&&f?(u.initialize(),u.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var n=this;return f.notify(n,"beforeInit"),t.retinaScale(n,n.options.devicePixelRatio),n.bindEvents(),n.options.responsive&&n.resize(!0),n.initToolTip(),f.notify(n,"afterInit"),n},clear:function(){return t.canvas.clear(this),this},stop:function(){return eu.cancelAnimation(this),this},resize:function(n){var i=this,u=i.options,r=i.canvas,h=u.maintainAspectRatio&&i.aspectRatio||null,e=Math.max(0,Math.floor(t.getMaximumWidth(r))),o=Math.max(0,Math.floor(h?e/h:t.getMaximumHeight(r))),s;i.width===e&&i.height===o||(r.width=i.width=e,r.height=i.height=o,r.style.width=e+"px",r.style.height=o+"px",t.retinaScale(i,u.devicePixelRatio),n)||(s={width:e,height:o},f.notify(i,"resize",[s]),u.onResize&&u.onResize(i,s),i.stop(),i.update({duration:u.responsiveAnimationDuration}))},ensureScalesHaveIDs:function(){var r=this.options,n=r.scales||{},i=r.scale;t.each(n.xAxes,function(t,i){t.id||(t.id=bo(n.xAxes,"x-axis-",i))});t.each(n.yAxes,function(t,i){t.id||(t.id=bo(n.yAxes,"y-axis-",i))});i&&(i.id=i.id||"scale")},buildOrUpdateScales:function(){var n=this,r=n.options,i=n.scales||{},u=[],f=Object.keys(i).reduce(function(n,t){return n[t]=!1,n},{});r.scales&&(u=u.concat((r.scales.xAxes||[]).map(function(n){return{options:n,dtype:"category",dposition:"bottom"}}),(r.scales.yAxes||[]).map(function(n){return{options:n,dtype:"linear",dposition:"left"}})));r.scale&&u.push({options:r.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"});t.each(u,function(t){var u=t.options,e=u.id,o=cr(u.type,t.dtype),r,s;if(ko(u.position)!==ko(t.dposition)&&(u.position=t.dposition),f[e]=!0,r=null,e in i&&i[e].type===o)(r=i[e]).options=u,r.ctx=n.ctx,r.chart=n;else{if(s=pi.getScaleConstructor(o),!s)return;r=new s({id:e,type:o,options:u,ctx:n.ctx,chart:n});i[r.id]=r}r.mergeTicksOptions();t.isDefault&&(n.scale=r)});t.each(f,function(n,t){n||delete i[t]});n.scales=i;pi.addScalesToLayout(this)},buildOrUpdateControllers:function(){for(var i=this,f=[],e=i.data.datasets,r,t=0,u=e.length;t<u;t++){var o=e[t],n=i.getDatasetMeta(t),s=o.type||i.config.type;if(n.type&&n.type!==s&&(i.destroyDatasetMeta(t),n=i.getDatasetMeta(t)),n.type=s,n.order=o.order||0,n.index=t,n.controller)n.controller.updateIndex(t),n.controller.linkScales();else{if(r=au[n.type],void 0===r)throw new Error('"'+n.type+'" is not a chart type.');n.controller=new r(i,t);f.push(n.controller)}}return f},resetElements:function(){var n=this;t.each(n.data.datasets,function(t,i){n.getDatasetMeta(i).controller.reset()},n)},reset:function(){this.resetElements();this.tooltip.initialize()},update:function(n){var r,u,i=this,e;if(n&&"object"==typeof n||(n={duration:n,lazy:arguments[1]}),tl(i),f._invalidate(i),!1!==f.notify(i,"beforeUpdate")){for(i.tooltip._data=i.data,e=i.buildOrUpdateControllers(),r=0,u=i.data.datasets.length;r<u;r++)i.getDatasetMeta(r).controller.buildOrUpdateElements();i.updateLayout();i.options.animation&&i.options.animation.duration&&t.each(e,function(n){n.reset()});i.updateDatasets();i.tooltip.initialize();i.lastActive=[];f.notify(i,"afterUpdate");i._layers.sort(go("z","_idx"));i._bufferedRender?i._bufferedRequest={duration:n.duration,easing:n.easing,lazy:n.lazy}:i.render(n)}},updateLayout:function(){var n=this;!1!==f.notify(n,"beforeLayout")&&(b.update(this,this.width,this.height),n._layers=[],t.each(n.boxes,function(t){t._configure&&t._configure();n._layers.push.apply(n._layers,t._layers())},n),n._layers.forEach(function(n,t){n._idx=t}),f.notify(n,"afterScaleUpdate"),f.notify(n,"afterLayout"))},updateDatasets:function(){if(!1!==f.notify(this,"beforeDatasetsUpdate")){for(var n=0,t=this.data.datasets.length;n<t;++n)this.updateDataset(n);f.notify(this,"afterDatasetsUpdate")}},updateDataset:function(n){var t=this.getDatasetMeta(n),i={meta:t,index:n};!1!==f.notify(this,"beforeDatasetUpdate",[i])&&(t.controller._update(),f.notify(this,"afterDatasetUpdate",[i]))},render:function(n){var i=this,e,o;n&&"object"==typeof n||(n={duration:n,lazy:arguments[1]});var r=i.options.animation,u=cr(n.duration,r&&r.duration),s=n.lazy;if(!1!==f.notify(i,"beforeRender"))return e=function(n){f.notify(i,"afterRender");t.callback(r&&r.onComplete,[n],i)},r&&u?(o=new fu({numSteps:u/16.66,easing:n.easing||r.easing,render:function(n,i){var f=t.easing.effects[i.easing],r=i.currentStep,u=r/i.numSteps;n.draw(f(u),u,r)},onAnimationProgress:r.onProgress,onAnimationComplete:e}),eu.addAnimation(i,o,u,s)):(i.draw(),e(new fu({numSteps:0,chart:i}))),i},draw:function(n){var r,u,i=this;if(i.clear(),t.isNullOrUndef(n)&&(n=1),i.transition(n),!(i.width<=0||i.height<=0)&&!1!==f.notify(i,"beforeDraw",[n])){for(u=i._layers,r=0;r<u.length&&u[r].z<=0;++r)u[r].draw(i.chartArea);for(i.drawDatasets(n);r<u.length;++r)u[r].draw(i.chartArea);i._drawTooltip(n);f.notify(i,"afterDraw",[n])}},transition:function(n){for(var t=0,i=(this.data.datasets||[]).length;t<i;++t)this.isDatasetVisible(t)&&this.getDatasetMeta(t).controller.transition(n);this.tooltip.transition(n)},_getSortedDatasetMetas:function(n){for(var i=[],t=0,r=(this.data.datasets||[]).length;t<r;++t)n&&!this.isDatasetVisible(t)||i.push(this.getDatasetMeta(t));return i.sort(go("order","index")),i},_getSortedVisibleDatasetMetas:function(){return this._getSortedDatasetMetas(!0)},drawDatasets:function(n){var i,t;if(!1!==f.notify(this,"beforeDatasetsDraw",[n])){for(t=(i=this._getSortedVisibleDatasetMetas()).length-1;t>=0;--t)this.drawDataset(i[t],n);f.notify(this,"afterDatasetsDraw",[n])}},drawDataset:function(n,t){var i={meta:n,index:n.index,easingValue:t};!1!==f.notify(this,"beforeDatasetDraw",[i])&&(n.controller.draw(t),f.notify(this,"afterDatasetDraw",[i]))},_drawTooltip:function(n){var t=this.tooltip,i={tooltip:t,easingValue:n};!1!==f.notify(this,"beforeTooltipDraw",[i])&&(t.draw(),f.notify(this,"afterTooltipDraw",[i]))},getElementAtEvent:function(n){return kt.modes.single(this,n)},getElementsAtEvent:function(n){return kt.modes.label(this,n,{intersect:!0})},getElementsAtXAxis:function(n){return kt.modes["x-axis"](this,n,{intersect:!0})},getElementsAtEventForMode:function(n,t,i){var r=kt.modes[t];return"function"==typeof r?r(this,n,i):[]},getDatasetAtEvent:function(n){return kt.modes.dataset(this,n,{intersect:!0})},getDatasetMeta:function(n){var t=this.data.datasets[n],i;return t._meta||(t._meta={}),i=t._meta[this.id],i||(i=t._meta[this.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t.order||0,index:n}),i},getVisibleDatasetCount:function(){for(var t=0,n=0,i=this.data.datasets.length;n<i;++n)this.isDatasetVisible(n)&&t++;return t},isDatasetVisible:function(n){var t=this.getDatasetMeta(n);return"boolean"==typeof t.hidden?!t.hidden:!this.data.datasets[n].hidden},generateLegend:function(){return this.options.legendCallback(this)},destroyDatasetMeta:function(n){var i=this.id,t=this.data.datasets[n],r=t._meta&&t._meta[i];r&&(r.controller.destroy(),delete t._meta[i])},destroy:function(){var i,r,n=this,u=n.canvas;for(n.stop(),i=0,r=n.data.datasets.length;i<r;++i)n.destroyDatasetMeta(i);u&&(n.unbindEvents(),t.canvas.clear(n),dt.releaseContext(n.ctx),n.canvas=null,n.ctx=null);f.notify(n,"destroy");delete ot.instances[n.id]},toBase64Image:function(){return this.canvas.toDataURL.apply(this.canvas,arguments)},initToolTip:function(){var n=this;n.tooltip=new ff({_chart:n,_chartInstance:n,_data:n.data,_options:n.options.tooltips},n)},bindEvents:function(){var n=this,r=n._listeners={},i=function(){n.eventHandler.apply(n,arguments)};t.each(n.options.events,function(t){dt.addEventListener(n,t,i);r[t]=i});n.options.responsive&&(i=function(){n.resize()},dt.addEventListener(n,"resize",i),r.resize=i)},unbindEvents:function(){var n=this,i=n._listeners;i&&(delete n._listeners,t.each(i,function(t,i){dt.removeEventListener(n,i,t)}))},updateHoverStyle:function(n,t,i){for(var u,e=i?"set":"remove",r=0,f=n.length;r<f;++r)(u=n[r])&&this.getDatasetMeta(u._datasetIndex).controller[e+"HoverStyle"](u);"dataset"===t&&this.getDatasetMeta(n[0]._datasetIndex).controller["_"+e+"DatasetHoverStyle"]()},eventHandler:function(n){var t=this,i=t.tooltip,r,u;if(!1!==f.notify(t,"beforeEvent",[n]))return t._bufferedRender=!0,t._bufferedRequest=null,r=t.handleEvent(n),i&&(r=i._start?i.handleEvent(n):r|i.handleEvent(n)),f.notify(t,"afterEvent",[n]),u=t._bufferedRequest,u?t.render(u):r&&!t.animating&&(t.stop(),t.render({duration:t.options.hover.animationDuration,lazy:!0})),t._bufferedRender=!1,t._bufferedRequest=null,t},handleEvent:function(n){var f,i=this,r=i.options||{},u=r.hover;return i.lastActive=i.lastActive||[],i.active="mouseout"===n.type?[]:i.getElementsAtEventForMode(n,u.mode,u),t.callback(r.onHover||r.hover.onHover,[n.native,i.active],i),"mouseup"!==n.type&&"click"!==n.type||r.onClick&&r.onClick.call(i,n.native,i.active),i.lastActive.length&&i.updateHoverStyle(i.lastActive,u.mode,!1),i.active.length&&u.mode&&i.updateHoverStyle(i.active,u.mode,!0),f=!t.arrayEquals(i.active,i.lastActive),i.lastActive=i.active,f}});ot.instances={};r=ot;ot.Controller=ot;ot.types={};t.configMerge=ef;t.scaleMerge=wo;t.extend(lr.prototype,{formats:gt,parse:gt,format:gt,add:gt,diff:gt,startOf:gt,endOf:gt,_create:function(n){return n}});lr.override=function(n){t.extend(lr.prototype,n)};var of={_date:lr},wi={formatters:{values:function(n){return t.isArray(n)?n:""+n},linear:function(n,i,r){var o=r.length>3?r[2]-r[1]:r[1]-r[0],s,u,h,f,e;return Math.abs(o)>1&&n!==Math.floor(n)&&(o=n-Math.floor(n)),s=t.log10(Math.abs(o)),u="",0!==n?Math.max(Math.abs(r[0]),Math.abs(r[r.length-1]))<.0001?(h=t.log10(Math.abs(n)),f=Math.floor(h)-Math.floor(s),f=Math.max(Math.min(f,20),0),u=n.toExponential(f)):(e=-1*Math.floor(s),e=Math.max(Math.min(e,20),0),u=n.toFixed(e)):u="0",u},logarithmic:function(n,i,r){var u=n/Math.pow(10,Math.floor(t.log10(n)));return 0===n?"0":1===u||2===u||5===u||0===i||i===r.length-1?n.toExponential():""}}},ni=t.isArray,bi=t.isNullOrUndef,ti=t.valueOrDefault,oi=t.valueAtIndexOrDefault;i._set("scale",{display:!0,position:"left",offset:!1,gridLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickMarkLength:10,zeroLineWidth:1,zeroLineColor:"rgba(0,0,0,0.25)",zeroLineBorderDash:[],zeroLineBorderDashOffset:0,offsetGridLines:!1,borderDash:[],borderDashOffset:0},scaleLabel:{display:!1,labelString:"",padding:{top:4,bottom:4}},ticks:{beginAtZero:!1,minRotation:0,maxRotation:50,mirror:!1,padding:0,reverse:!1,display:!0,autoSkip:!0,autoSkipPadding:0,labelOffset:0,callback:wi.formatters.values,minor:{},major:{}}});vr=nt.extend({zeroLineIndex:0,getPadding:function(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}},getTicks:function(){return this._ticks},_getLabels:function(){var n=this.chart.data;return this.options.labels||(this.isHorizontal()?n.xLabels:n.yLabels)||n.labels||[]},mergeTicksOptions:function(){},beforeUpdate:function(){t.callback(this.options.beforeUpdate,[this])},update:function(n,i,r){var e,c,s,f,h,u=this,o=u.options.ticks,l=o.sampleSize;if(u.beforeUpdate(),u.maxWidth=n,u.maxHeight=i,u.margins=t.extend({left:0,right:0,top:0,bottom:0},r),u._ticks=null,u.ticks=null,u._labelSizes=null,u._maxLabelLines=0,u.longestLabelWidth=0,u.longestTextCache=u.longestTextCache||{},u._gridLineItems=null,u._labelItems=null,u.beforeSetDimensions(),u.setDimensions(),u.afterSetDimensions(),u.beforeDataLimits(),u.determineDataLimits(),u.afterDataLimits(),u.beforeBuildTicks(),f=u.buildTicks()||[],(!(f=u.afterBuildTicks(f)||f)||!f.length)&&u.ticks)for(f=[],e=0,c=u.ticks.length;e<c;++e)f.push({value:u.ticks[e],major:!1});return u._ticks=f,h=l<f.length,s=u._convertTicksToLabels(h?function(n,t){for(var r=[],u=n.length/t,i=0,f=n.length;i<f;i+=u)r.push(n[Math.floor(i)]);return r}(f,l):f),u._configure(),u.beforeCalculateTickRotation(),u.calculateTickRotation(),u.afterCalculateTickRotation(),u.beforeFit(),u.fit(),u.afterFit(),u._ticksToDraw=o.display&&(o.autoSkip||"auto"===o.source)?u._autoSkip(f):f,h&&(s=u._convertTicksToLabels(u._ticksToDraw)),u.ticks=s,u.afterUpdate(),u.minSize},_configure:function(){var t,i,n=this,r=n.options.ticks.reverse;n.isHorizontal()?(t=n.left,i=n.right):(t=n.top,i=n.bottom,r=!r);n._startPixel=t;n._endPixel=i;n._reversePixels=r;n._length=i-t},afterUpdate:function(){t.callback(this.options.afterUpdate,[this])},beforeSetDimensions:function(){t.callback(this.options.beforeSetDimensions,[this])},setDimensions:function(){var n=this;n.isHorizontal()?(n.width=n.maxWidth,n.left=0,n.right=n.width):(n.height=n.maxHeight,n.top=0,n.bottom=n.height);n.paddingLeft=0;n.paddingTop=0;n.paddingRight=0;n.paddingBottom=0},afterSetDimensions:function(){t.callback(this.options.afterSetDimensions,[this])},beforeDataLimits:function(){t.callback(this.options.beforeDataLimits,[this])},determineDataLimits:t.noop,afterDataLimits:function(){t.callback(this.options.afterDataLimits,[this])},beforeBuildTicks:function(){t.callback(this.options.beforeBuildTicks,[this])},buildTicks:t.noop,afterBuildTicks:function(n){var i=this;return ni(n)&&n.length?t.callback(i.options.afterBuildTicks,[i,n]):(i.ticks=t.callback(i.options.afterBuildTicks,[i,i.ticks])||i.ticks,n)},beforeTickToLabelConversion:function(){t.callback(this.options.beforeTickToLabelConversion,[this])},convertTicksToLabels:function(){var n=this.options.ticks;this.ticks=this.ticks.map(n.userCallback||n.callback,this)},afterTickToLabelConversion:function(){t.callback(this.options.afterTickToLabelConversion,[this])},beforeCalculateTickRotation:function(){t.callback(this.options.beforeCalculateTickRotation,[this])},calculateTickRotation:function(){var u,i,f,c,l,v,a,n=this,r=n.options,e=r.ticks,o=n.getTicks().length,s=e.minRotation||0,y=e.maxRotation,h=s;!n._isVisible()||!e.display||s>=y||o<=1||!n.isHorizontal()?n.labelRotation=s:(i=(u=n._getLabelSizes()).widest.width,f=u.highest.height-u.highest.offset,c=Math.min(n.maxWidth,n.chart.width-i),i+6>(l=r.offset?n.maxWidth/o:c/(o-1))&&(l=c/(o-(r.offset?.5:1)),v=n.maxHeight-ki(r.gridLines)-e.padding-sf(r.scaleLabel),a=Math.sqrt(i*i+f*f),h=t.toDegrees(Math.min(Math.asin(Math.min((u.highest.height+6)/l,1)),Math.asin(Math.min(v/a,1))-Math.asin(f/a))),h=Math.max(s,Math.min(y,h))),n.labelRotation=h)},afterCalculateTickRotation:function(){t.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){t.callback(this.options.beforeFit,[this])},fit:function(){var n=this,i=n.minSize={width:0,height:0},b=n.chart,e=n.options,o=e.ticks,k=e.scaleLabel,d=e.gridLines,c=n._isVisible(),g="bottom"===e.position,s=n.isHorizontal(),v,y,p,w,ft;if(s?i.width=n.maxWidth:c&&(i.width=ki(d)+sf(k)),s?c&&(i.height=ki(d)+sf(k)):i.height=n.maxHeight,o.display&&c){var et=hf(o),h=n._getLabelSizes(),r=h.first,u=h.last,nt=h.widest,tt=h.highest,it=.4*et.minor.lineHeight,rt=o.padding;if(s){var l=0!==n.labelRotation,ut=t.toRadians(n.labelRotation),a=Math.cos(ut),f=Math.sin(ut),ot=f*nt.width+a*(tt.height-(l?tt.offset:0))+(l?0:it);i.height=Math.min(n.maxHeight,i.height+ot+rt);p=n.getPixelForTick(0)-n.left;w=n.right-n.getPixelForTick(n.getTicks().length-1);l?(v=g?a*r.width+f*r.offset:f*(r.height-r.offset),y=g?f*(u.height-u.offset):a*u.width+f*u.offset):(v=r.width/2,y=u.width/2);n.paddingLeft=Math.max((v-p)*n.width/(n.width-p),0)+3;n.paddingRight=Math.max((y-w)*n.width/(n.width-w),0)+3}else ft=o.mirror?0:nt.width+rt+it,i.width=Math.min(n.maxWidth,i.width+ft),n.paddingTop=r.height/2,n.paddingBottom=u.height/2}n.handleMargins();s?(n.width=n._length=b.width-n.margins.left-n.margins.right,n.height=i.height):(n.width=i.width,n.height=n._length=b.height-n.margins.top-n.margins.bottom)},handleMargins:function(){var n=this;n.margins&&(n.margins.left=Math.max(n.paddingLeft,n.margins.left),n.margins.top=Math.max(n.paddingTop,n.margins.top),n.margins.right=Math.max(n.paddingRight,n.margins.right),n.margins.bottom=Math.max(n.paddingBottom,n.margins.bottom))},afterFit:function(){t.callback(this.options.afterFit,[this])},isHorizontal:function(){var n=this.options.position;return"top"===n||"bottom"===n},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(n){if(bi(n))return NaN;if(("number"==typeof n||n instanceof Number)&&!isFinite(n))return NaN;if(n)if(this.isHorizontal()){if(void 0!==n.x)return this.getRightValue(n.x)}else if(void 0!==n.y)return this.getRightValue(n.y);return n},_convertTicksToLabels:function(n){var r,t,u,i=this;for(i.ticks=n.map(function(n){return n.value}),i.beforeTickToLabelConversion(),r=i.convertTicksToLabels(n)||i.ticks,i.afterTickToLabelConversion(),t=0,u=n.length;t<u;++t)n[t].label=r[t];return r},_getLabelSizes:function(){var n=this,t=n._labelSizes;return t||(n._labelSizes=t=rl(n.ctx,hf(n.options.ticks),n.getTicks(),n.longestTextCache),n.longestLabelWidth=t.widest.width),t},_parseValue:function(n){var t,i,r,u;return ni(n)?(t=+this.getRightValue(n[0]),i=+this.getRightValue(n[1]),r=Math.min(t,i),u=Math.max(t,i)):(t=void 0,i=n=+this.getRightValue(n),r=n,u=n),{min:r,max:u,start:t,end:i}},_getScaleLabel:function(n){var t=this._parseValue(n);return void 0!==t.start?"["+t.start+", "+t.end+"]":+this.getRightValue(n)},getLabelForIndex:t.noop,getPixelForValue:t.noop,getValueForPixel:t.noop,getPixelForTick:function(n){var t=this.options.offset,i=this._ticks.length,r=1/Math.max(i-(t?0:1),1);return n<0||n>i-1?null:this.getPixelForDecimal(n*r+(t?r/2:0))},getPixelForDecimal:function(n){return this._reversePixels&&(n=1-n),this._startPixel+n*this._length},getDecimalForPixel:function(n){var t=(n-this._startPixel)/this._length;return this._reversePixels?1-t:t},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var n=this.min,t=this.max;return this.beginAtZero?0:n<0&&t<0?t:n>0&&t>0?n:0},_autoSkip:function(n){var u,c,f,e,l=this.options.ticks,a=this._length,o=l.maxTicksLimit||a/this._tickSize()+1,i=l.major.enabled?function(n){for(var r=[],t=0,i=n.length;t<i;t++)n[t].major&&r.push(t);return r}(n):[],r=i.length,s=i[0],h=i[r-1];if(r>o)return function(n,t,i){var r,u,e=0,f=t[0];for(i=Math.ceil(i),r=0;r<n.length;r++)u=n[r],r===f?(u._index=r,f=t[++e*i]):delete u.label}(n,i,r/o),cf(n);if(f=function(n,i,r,u){var o,s,f,h,c=function(n){var t,i,r=n.length;if(r<2)return!1;for(i=n[0],t=1;t<r;++t)if(n[t]-n[t-1]!==i)return!1;return i}(n),e=(i.length-1)/u;if(!c)return Math.max(e,1);for(f=0,h=(o=t.math._factorize(c)).length-1;f<h;f++)if((s=o[f])>e)return s;return Math.max(e,1)}(i,n,0,o),r>0){for(u=0,c=r-1;u<c;u++)ar(n,f,i[u],i[u+1]);return e=r>1?(h-s)/(r-1):null,ar(n,f,t.isNullOrUndef(e)?0:s-e,s),ar(n,f,h,t.isNullOrUndef(e)?n.length:h+e),cf(n)}return ar(n,f),cf(n)},_tickSize:function(){var s=this.options.ticks,e=t.toRadians(this.labelRotation),n=Math.abs(Math.cos(e)),i=Math.abs(Math.sin(e)),r=this._getLabelSizes(),o=s.autoSkipPadding||0,u=r?r.widest.width+o:0,f=r?r.highest.height+o:0;return this.isHorizontal()?f*n>u*i?u/n:f/i:f*i<u*n?f/n:u/i},_isVisible:function(){var n,i,r,t=this.chart,u=this.options.display;if("auto"!==u)return!!u;for(n=0,i=t.data.datasets.length;n<i;++n)if(t.isDatasetVisible(n)&&((r=t.getDatasetMeta(n)).xAxisID===this.id||r.yAxisID===this.id))return!0;return!1},_computeGridLineItems:function(n){var u,f,d,ot,g,s,h,c,l,a,v,y,p,w,nt,tt,it,i=this,st=i.chart,rt=i.options,r=rt.gridLines,ut=rt.position,ft=r.offsetGridLines,at=i.isHorizontal(),et=i._ticksToDraw,ht=et.length+(ft?1:0),b=ki(r),k=[],ct=r.drawBorder?oi(r.lineWidth,0,0):0,e=ct/2,lt=t._alignPixel,o=function(n){return lt(st,n,ct)};for("top"===ut?(u=o(i.bottom),h=i.bottom-b,l=u-e,v=o(n.top)+e,p=n.bottom):"bottom"===ut?(u=o(i.top),v=n.top,p=o(n.bottom)-e,h=u+e,l=i.top+b):"left"===ut?(u=o(i.right),s=i.right-b,c=u-e,a=o(n.left)+e,y=n.right):(u=o(i.left),a=n.left,y=o(n.right)-e,s=u+e,c=i.left+b),f=0;f<ht;++f)d=et[f]||{},bi(d.label)&&f<et.length||(f===i.zeroLineIndex&&rt.offset===ft?(w=r.zeroLineWidth,nt=r.zeroLineColor,tt=r.zeroLineBorderDash||[],it=r.zeroLineBorderDashOffset||0):(w=oi(r.lineWidth,f,1),nt=oi(r.color,f,"rgba(0,0,0,0.1)"),tt=r.borderDash||[],it=r.borderDashOffset||0),void 0!==(ot=il(i,d._index||f,ft))&&(g=lt(st,ot,w),at?s=c=a=y=g:h=l=v=p=g,k.push({tx1:s,ty1:h,tx2:c,ty2:l,x1:a,y1:v,x2:y,y2:p,width:w,color:nt,borderDash:tt,borderDashOffset:it})));return k.ticksLength=ht,k.borderValue=u,k},_computeLabelItems:function(){var i,d,y,r,e,o,u,p,g,s,w,b,n=this,k=n.options,h=k.ticks,c=k.position,l=h.mirror,rt=n.isHorizontal(),nt=n._ticksToDraw,tt=hf(h),a=h.padding,v=ki(k.gridLines),f=-t.toRadians(n.labelRotation),it=[];for("top"===c?(o=n.bottom-v-a,u=f?"left":"center"):"bottom"===c?(o=n.top+v+a,u=f?"right":"center"):"left"===c?(e=n.right-(l?0:v)-a,u=l?"left":"right"):(e=n.left+(l?0:v)+a,u=l?"right":"left"),i=0,d=nt.length;i<d;++i)r=(y=nt[i]).label,bi(r)||(p=n.getPixelForTick(y._index||i)+h.labelOffset,s=(g=y.major?tt.major:tt.minor).lineHeight,w=ni(r)?r.length:1,rt?(e=p,b="top"===c?((f?1:.5)-w)*s:(f?0:.5)*s):(o=p,b=(1-w)*s/2),it.push({x:e,y:o,rotation:f,label:r,font:g,textOffset:b,textAlign:u}));return it},_drawGrid:function(n){var u=this,f=u.options.gridLines;if(f.display){for(var a,v,r,i=u.ctx,o=u.chart,s=t._alignPixel,y=f.drawBorder?oi(f.lineWidth,0,0):0,h=u._gridLineItems||(u._gridLineItems=u._computeGridLineItems(n)),e=0,d=h.length;e<d;++e)a=(r=h[e]).width,v=r.color,a&&v&&(i.save(),i.lineWidth=a,i.strokeStyle=v,i.setLineDash&&(i.setLineDash(r.borderDash),i.lineDashOffset=r.borderDashOffset),i.beginPath(),f.drawTicks&&(i.moveTo(r.tx1,r.ty1),i.lineTo(r.tx2,r.ty2)),f.drawOnChartArea&&(i.moveTo(r.x1,r.y1),i.lineTo(r.x2,r.y2)),i.stroke(),i.restore());if(y){var p,w,b,k,c=y,l=oi(f.lineWidth,h.ticksLength-1,1),g=h.borderValue;u.isHorizontal()?(p=s(o,u.left,c)-c/2,w=s(o,u.right,l)+l/2,b=k=g):(b=s(o,u.top,c)-c/2,k=s(o,u.bottom,l)+l/2,p=w=g);i.lineWidth=y;i.strokeStyle=oi(f.color,0);i.beginPath();i.moveTo(p,b);i.lineTo(w,k);i.stroke()}}},_drawLabels:function(){var i=this,u,f,h,c,t,e,r,o,n,s;if(i.options.ticks.display)for(n=i.ctx,s=i._labelItems||(i._labelItems=i._computeLabelItems()),u=0,h=s.length;u<h;++u){if(e=(t=s[u]).font,n.save(),n.translate(t.x,t.y),n.rotate(t.rotation),n.font=e.string,n.fillStyle=e.color,n.textBaseline="middle",n.textAlign=t.textAlign,r=t.label,o=t.textOffset,ni(r))for(f=0,c=r.length;f<c;++f)n.fillText(""+r[f],0,o),o+=e.lineHeight;else n.fillText(r,0,o);n.restore()}},_drawTitle:function(){var n=this,r=n.ctx,c=n.options,u=c.scaleLabel,h;if(u.display){var o,s,y=ti(u.fontColor,i.global.defaultFontColor),l=t.options._parseFont(u),f=t.options.toPadding(u.padding),e=l.lineHeight/2,a=c.position,v=0;n.isHorizontal()?(o=n.left+n.width/2,s="bottom"===a?n.bottom-e-f.bottom:n.top+e+f.top):(h="left"===a,o=h?n.left+e+f.top:n.right-e-f.top,s=n.top+n.height/2,v=h?-.5*Math.PI:.5*Math.PI);r.save();r.translate(o,s);r.rotate(v);r.textAlign="center";r.textBaseline="middle";r.fillStyle=y;r.font=l.string;r.fillText(u.labelString,0,0);r.restore()}},draw:function(n){this._isVisible()&&(this._drawGrid(n),this._drawTitle(),this._drawLabels())},_layers:function(){var n=this,t=n.options,i=t.ticks&&t.ticks.z||0,r=t.gridLines&&t.gridLines.z||0;return n._isVisible()&&i!==r&&n.draw===n._draw?[{z:r,draw:function(){n._drawGrid.apply(n,arguments);n._drawTitle.apply(n,arguments)}},{z:i,draw:function(){n._drawLabels.apply(n,arguments)}}]:[{z:i,draw:function(){n.draw.apply(n,arguments)}}]},_getMatchingVisibleMetas:function(n){var t=this,i=t.isHorizontal();return t.chart._getSortedVisibleDatasetMetas().filter(function(r){return(!n||r.type===n)&&(i?r.xAxisID===t.id:r.yAxisID===t.id)})}});vr.prototype._draw=vr.prototype.draw;var l=vr,lf=t.isNullOrUndef,ts=l.extend({determineDataLimits:function(){var i,n=this,t=n._getLabels(),f=n.options.ticks,e=f.min,o=f.max,r=0,u=t.length-1;void 0!==e&&(i=t.indexOf(e))>=0&&(r=i);void 0!==o&&(i=t.indexOf(o))>=0&&(u=i);n.minIndex=r;n.maxIndex=u;n.min=t[r];n.max=t[u]},buildTicks:function(){var n=this._getLabels(),t=this.minIndex,i=this.maxIndex;this.ticks=0===t&&i===n.length-1?n:n.slice(t,i+1)},getLabelForIndex:function(n,t){var i=this.chart;return i.getDatasetMeta(t).controller._getValueScaleId()===this.id?this.getRightValue(i.data.datasets[t].data[n]):this._getLabels()[n]},_configure:function(){var n=this,t=n.options.offset,i=n.ticks;l.prototype._configure.call(n);n.isHorizontal()||(n._reversePixels=!n._reversePixels);i&&(n._startValue=n.minIndex-(t?.5:0),n._valueRange=Math.max(i.length-(t?0:1),1))},getPixelForValue:function(n,i,r){var f,e,o,u=this;return lf(i)||lf(r)||(n=u.chart.data.datasets[r].data[i]),lf(n)||(f=u.isHorizontal()?n.x:n.y),(void 0!==f||void 0!==n&&isNaN(i))&&(e=u._getLabels(),n=t.valueOrDefault(f,n),i=-1!==(o=e.indexOf(n))?o:i,isNaN(i)&&(i=n)),u.getPixelForDecimal((i-u._startValue)/u._valueRange)},getPixelForTick:function(n){var t=this.ticks;return n<0||n>t.length-1?null:this.getPixelForValue(t[n],n+this.minIndex)},getValueForPixel:function(n){var t=Math.round(this._startValue+this.getDecimalForPixel(n)*this._valueRange);return Math.min(Math.max(t,0),this.ticks.length-1)},getBasePixel:function(){return this.bottom}});ts._defaults={position:"bottom"};var ul=t.noop,ii=t.isNullOrUndef,yr=l.extend({getRightValue:function(n){return"string"==typeof n?+n:l.prototype.getRightValue.call(this,n)},handleTickRangeOptions:function(){var n=this,i=n.options.ticks,r,u,f,e;i.beginAtZero&&(r=t.sign(n.min),u=t.sign(n.max),r<0&&u<0?n.max=0:r>0&&u>0&&(n.min=0));f=void 0!==i.min||void 0!==i.suggestedMin;e=void 0!==i.max||void 0!==i.suggestedMax;void 0!==i.min?n.min=i.min:void 0!==i.suggestedMin&&(n.min=null===n.min?i.suggestedMin:Math.min(n.min,i.suggestedMin));void 0!==i.max?n.max=i.max:void 0!==i.suggestedMax&&(n.max=null===n.max?i.suggestedMax:Math.max(n.max,i.suggestedMax));f!==e&&n.min>=n.max&&(f?n.max=n.min+1:n.min=n.max-1);n.min===n.max&&(n.max++,i.beginAtZero||n.min--)},getTickLimit:function(){var n,r=this.options.ticks,i=r.stepSize,t=r.maxTicksLimit;return i?n=Math.ceil(this.max/i)-Math.floor(this.min/i)+1:(n=this._computeTickLimit(),t=t||11),t&&(n=Math.min(t,n)),n},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:ul,buildTicks:function(){var n=this,i=n.options.ticks,u=n.getTickLimit(),f={maxTicks:u=Math.max(2,u),min:i.min,max:i.max,precision:i.precision,stepSize:t.valueOrDefault(i.fixedStepSize,i.stepSize)},r=n.ticks=function(n,i){var u,e,o,f,c=[],p=n.stepSize,l=p||1,w=n.maxTicks-1,s=n.min,h=n.max,b=n.precision,a=i.min,v=i.max,r=t.niceNum((v-a)/w/l)*l,y;if(r<1e-14&&ii(s)&&ii(h))return[a,v];for((f=Math.ceil(v/r)-Math.floor(a/r))>w&&(r=t.niceNum(f*r/w/l)*l),p||ii(b)?u=Math.pow(10,t._decimalPlaces(r)):(u=Math.pow(10,b),r=Math.ceil(r*u)/u),e=Math.floor(a/r)*r,o=Math.ceil(v/r)*r,p&&(!ii(s)&&t.almostWhole(s/r,r/1e3)&&(e=s),!ii(h)&&t.almostWhole(h/r,r/1e3)&&(o=h)),f=(o-e)/r,f=t.almostEquals(f,Math.round(f),r/1e3)?Math.round(f):Math.ceil(f),e=Math.round(e*u)/u,o=Math.round(o*u)/u,c.push(ii(s)?e:s),y=1;y<f;++y)c.push(Math.round((e+y*r)*u)/u);return c.push(ii(h)?o:h),c}(f,n);n.handleDirectionalChanges();n.max=t.max(r);n.min=t.min(r);i.reverse?(r.reverse(),n.start=n.max,n.end=n.min):(n.start=n.min,n.end=n.max)},convertTicksToLabels:function(){var n=this;n.ticksAsNumbers=n.ticks.slice();n.zeroLineIndex=n.ticks.indexOf(0);l.prototype.convertTicksToLabels.call(n)},_configure:function(){var r,n=this,u=n.getTicks(),t=n.min,i=n.max;l.prototype._configure.call(n);n.options.offset&&u.length&&(t-=r=(i-t)/Math.max(u.length-1,1)/2,i+=r);n._startValue=t;n._endValue=i;n._valueRange=i-t}}),fl={position:"left",ticks:{callback:wi.formatters.linear}};af=yr.extend({determineDataLimits:function(){var i,r,f,e,n=this,c=n.options,l=n.chart.data.datasets,o=n._getMatchingVisibleMetas(),u=c.stacked,s={},h=o.length;if(n.min=Number.POSITIVE_INFINITY,n.max=Number.NEGATIVE_INFINITY,void 0===u)for(i=0;!u&&i<h;++i)u=void 0!==(r=o[i]).stack;for(i=0;i<h;++i)f=l[(r=o[i]).index].data,u?el(n,s,r,f):ol(n,r,f);t.each(s,function(i){e=i.pos.concat(i.neg);n.min=Math.min(n.min,t.min(e));n.max=Math.max(n.max,t.max(e))});n.min=t.isFinite(n.min)&&!isNaN(n.min)?n.min:0;n.max=t.isFinite(n.max)&&!isNaN(n.max)?n.max:1;n.handleTickRangeOptions()},_computeTickLimit:function(){var n;return this.isHorizontal()?Math.ceil(this.width/40):(n=t.options._parseFont(this.options.ticks),Math.ceil(this.height/n.lineHeight))},handleDirectionalChanges:function(){this.isHorizontal()||this.ticks.reverse()},getLabelForIndex:function(n,t){return this._getScaleLabel(this.chart.data.datasets[t].data[n])},getPixelForValue:function(n){return this.getPixelForDecimal((+this.getRightValue(n)-this._startValue)/this._valueRange)},getValueForPixel:function(n){return this._startValue+this.getDecimalForPixel(n)*this._valueRange},getPixelForTick:function(n){var t=this.ticksAsNumbers;return n<0||n>t.length-1?null:this.getPixelForValue(t[n])}});is=fl;af._defaults=is;var vf=t.valueOrDefault,a=t.math.log10,sl={position:"left",ticks:{callback:wi.formatters.logarithmic}};yf=l.extend({determineDataLimits:function(){function p(t){return w?t.xAxisID===n.id:t.yAxisID===n.id}var i,f,r,h,u,c,n=this,y=n.options,e=n.chart,o=e.data.datasets,w=n.isHorizontal(),l,s,a,v;if(n.min=Number.POSITIVE_INFINITY,n.max=Number.NEGATIVE_INFINITY,n.minNotZero=Number.POSITIVE_INFINITY,l=y.stacked,void 0===l)for(i=0;i<o.length;i++)if(f=e.getDatasetMeta(i),e.isDatasetVisible(i)&&p(f)&&void 0!==f.stack){l=!0;break}if(y.stacked||l){for(s={},i=0;i<o.length;i++)if(a=[(f=e.getDatasetMeta(i)).type,void 0===y.stacked&&void 0===f.stack?i:"",f.stack].join("."),e.isDatasetVisible(i)&&p(f))for(void 0===s[a]&&(s[a]=[]),u=0,c=(h=o[i].data).length;u<c;u++)v=s[a],r=n._parseValue(h[u]),isNaN(r.min)||isNaN(r.max)||f.data[u].hidden||r.min<0||r.max<0||(v[u]=v[u]||0,v[u]+=r.max);t.each(s,function(i){if(i.length>0){var r=t.min(i),u=t.max(i);n.min=Math.min(n.min,r);n.max=Math.max(n.max,u)}})}else for(i=0;i<o.length;i++)if(f=e.getDatasetMeta(i),e.isDatasetVisible(i)&&p(f))for(u=0,c=(h=o[i].data).length;u<c;u++)r=n._parseValue(h[u]),isNaN(r.min)||isNaN(r.max)||f.data[u].hidden||r.min<0||r.max<0||(n.min=Math.min(r.min,n.min),n.max=Math.max(r.max,n.max),0!==r.min&&(n.minNotZero=Math.min(r.min,n.minNotZero)));n.min=t.isFinite(n.min)?n.min:null;n.max=t.isFinite(n.max)?n.max:null;n.minNotZero=t.isFinite(n.minNotZero)?n.minNotZero:null;this.handleTickRangeOptions()},handleTickRangeOptions:function(){var n=this,t=n.options.ticks;n.min=pr(t.min,n.min);n.max=pr(t.max,n.max);n.min===n.max&&(0!==n.min&&null!==n.min?(n.min=Math.pow(10,Math.floor(a(n.min))-1),n.max=Math.pow(10,Math.floor(a(n.max))+1)):(n.min=1,n.max=10));null===n.min&&(n.min=Math.pow(10,Math.floor(a(n.max))-1));null===n.max&&(n.max=0!==n.min?Math.pow(10,Math.floor(a(n.min))+1):10);null===n.minNotZero&&(n.minNotZero=n.min>0?n.min:n.max<1?Math.pow(10,Math.floor(a(n.max))):1)},buildTicks:function(){var n=this,i=n.options.ticks,r=!n.isHorizontal(),f={min:pr(i.min),max:pr(i.max)},u=n.ticks=function(n,t){var i,u,e=[],r=vf(n.min,Math.pow(10,Math.floor(a(t.min)))),o=Math.floor(a(t.max)),h=Math.ceil(t.max/Math.pow(10,o)),f,s;0===r?(i=Math.floor(a(t.minNotZero)),u=Math.floor(t.minNotZero/Math.pow(10,i)),e.push(r),r=u*Math.pow(10,i)):(i=Math.floor(a(r)),u=Math.floor(r/Math.pow(10,i)));f=i<0?Math.pow(10,Math.abs(i)):1;do e.push(r),10==++u&&(u=1,f=++i>=0?1:f),r=Math.round(u*Math.pow(10,i)*f)/f;while(i<o||i===o&&u<h);return s=vf(n.max,r),e.push(s),e}(f,n);n.max=t.max(u);n.min=t.min(u);i.reverse?(r=!r,n.start=n.max,n.end=n.min):(n.start=n.min,n.end=n.max);r&&u.reverse()},convertTicksToLabels:function(){this.tickValues=this.ticks.slice();l.prototype.convertTicksToLabels.call(this)},getLabelForIndex:function(n,t){return this._getScaleLabel(this.chart.data.datasets[t].data[n])},getPixelForTick:function(n){var t=this.tickValues;return n<0||n>t.length-1?null:this.getPixelForValue(t[n])},_getFirstTickValue:function(n){var t=Math.floor(a(n));return Math.floor(n/Math.pow(10,t))*Math.pow(10,t)},_configure:function(){var n=this,t=n.min,r=0;l.prototype._configure.call(n);0===t&&(t=n._getFirstTickValue(n.minNotZero),r=vf(n.options.ticks.fontSize,i.global.defaultFontSize)/n._length);n._startValue=a(t);n._valueOffset=r;n._valueRange=(a(n.max)-a(t))/(1-r)},getPixelForValue:function(n){var t=this,i=0;return(n=+t.getRightValue(n))>t.min&&n>0&&(i=(a(n)-t._startValue)/t._valueRange+t._valueOffset),t.getPixelForDecimal(i)},getValueForPixel:function(n){var t=this,i=t.getDecimalForPixel(n);return 0===i&&0===t.min?0:Math.pow(10,t._startValue+(i-t._valueOffset)*t._valueRange)}});rs=sl;yf._defaults=rs;var wr=t.valueOrDefault,pf=t.valueAtIndexOrDefault,us=t.options.resolve,hl={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,borderDash:[],borderDashOffset:0},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:wi.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(n){return n}}};bf=yr.extend({setDimensions:function(){var n=this;n.width=n.maxWidth;n.height=n.maxHeight;n.paddingTop=wf(n.options)/2;n.xCenter=Math.floor(n.width/2);n.yCenter=Math.floor((n.height-n.paddingTop)/2);n.drawingArea=Math.min(n.height-n.paddingTop,n.width)/2},determineDataLimits:function(){var n=this,u=n.chart,i=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;t.each(u.data.datasets,function(f,e){if(u.isDatasetVisible(e)){var o=u.getDatasetMeta(e);t.each(f.data,function(t,u){var f=+n.getRightValue(t);isNaN(f)||o.data[u].hidden||(i=Math.min(f,i),r=Math.max(f,r))})}});n.min=i===Number.POSITIVE_INFINITY?0:i;n.max=r===Number.NEGATIVE_INFINITY?0:r;n.handleTickRangeOptions()},_computeTickLimit:function(){return Math.ceil(this.drawingArea/wf(this.options))},convertTicksToLabels:function(){var n=this;yr.prototype.convertTicksToLabels.call(n);n.pointLabels=n.chart.data.labels.map(function(){var i=t.callback(n.options.pointLabels.callback,arguments,n);return i||0===i?i:""})},getLabelForIndex:function(n,t){return+this.getRightValue(this.chart.data.datasets[t].data[n])},fit:function(){var n=this.options;n.display&&n.pointLabels.display?function(n){var r,o,l,v=t.options._parseFont(n.options.pointLabels),i={l:0,r:n.width,t:0,b:n.height-n.paddingTop},u={},s,a,f,y;for(n.ctx.font=v.string,n._pointLabelSizes=[],y=n.chart.data.labels.length,r=0;r<y;r++){l=n.getPointPosition(r,n.drawingArea+5);s=n.ctx;a=v.lineHeight;f=n.pointLabels[r];o=t.isArray(f)?{w:t.longestText(s,s.font,f),h:f.length*a}:{w:s.measureText(f).width,h:a};n._pointLabelSizes[r]=o;var e=n.getIndexAngle(r),p=t.toDegrees(e)%360,h=fs(p,l.x,o.w,0,180),c=fs(p,l.y,o.h,90,270);h.start<i.l&&(i.l=h.start,u.l=e);h.end>i.r&&(i.r=h.end,u.r=e);c.start<i.t&&(i.t=c.start,u.t=e);c.end>i.b&&(i.b=c.end,u.b=e)}n.setReductions(n.drawingArea,i,u)}(this):this.setCenterPoint(0,0,0,0)},setReductions:function(n,t,i){var r=this,u=t.l/Math.sin(i.l),f=Math.max(t.r-r.width,0)/Math.sin(i.r),e=-t.t/Math.cos(i.t),o=-Math.max(t.b-(r.height-r.paddingTop),0)/Math.cos(i.b);u=br(u);f=br(f);e=br(e);o=br(o);r.drawingArea=Math.min(Math.floor(n-(u+f)/2),Math.floor(n-(e+o)/2));r.setCenterPoint(u,f,e,o)},setCenterPoint:function(n,t,i,r){var u=this,f=u.width-t-u.drawingArea,e=n+u.drawingArea,o=i+u.drawingArea,s=u.height-u.paddingTop-r-u.drawingArea;u.xCenter=Math.floor((e+f)/2+u.left);u.yCenter=Math.floor((o+s)/2+u.top+u.paddingTop)},getIndexAngle:function(n){var i=this.chart,t=(n*(360/i.data.labels.length)+((i.options||{}).startAngle||0))%360;return(t<0?t+360:t)*Math.PI/180},getDistanceFromCenterForValue:function(n){var i=this,r;return t.isNullOrUndef(n)?NaN:(r=i.drawingArea/(i.max-i.min),i.options.ticks.reverse?(i.max-n)*r:(n-i.min)*r)},getPointPosition:function(n,t){var i=this.getIndexAngle(n)-Math.PI/2;return{x:Math.cos(i)*t+this.xCenter,y:Math.sin(i)*t+this.yCenter}},getPointPositionForValue:function(n,t){return this.getPointPosition(n,this.getDistanceFromCenterForValue(t))},getBasePosition:function(n){var t=this.min,i=this.max;return this.getPointPositionForValue(n||0,this.beginAtZero?0:t<0&&i<0?i:t>0&&i>0?t:0)},_drawGrid:function(){var e,o,h,n=this,r=n.ctx,s=n.options,u=s.gridLines,f=s.angleLines,c=wr(f.lineWidth,u.lineWidth),l=wr(f.color,u.color);if(s.pointLabels.display&&function(n){var u=n.ctx,f=n.options,o=f.pointLabels,l=wf(f),a=n.getDistanceFromCenterForValue(f.ticks.reverse?n.min:n.max),s=t.options._parseFont(o),r,c,e;for(u.save(),u.font=s.string,u.textBaseline="middle",r=n.chart.data.labels.length-1;r>=0;r--){var v=0===r?l/2:0,h=n.getPointPosition(r,a+v+5),y=pf(o.fontColor,r,i.global.defaultFontColor);u.fillStyle=y;c=n.getIndexAngle(r);e=t.toDegrees(c);u.textAlign=cl(e);al(e,n._pointLabelSizes[r],h);ll(u,n.pointLabels[r],h,s.lineHeight)}u.restore()}(n),u.display&&t.each(n.ticks,function(t,i){0!==i&&(o=n.getDistanceFromCenterForValue(n.ticksAsNumbers[i]),function(n,t,i,r){var f,u=n.ctx,o=t.circular,s=n.chart.data.labels.length,h=pf(t.color,r-1),c=pf(t.lineWidth,r-1),e;if((o||s)&&h&&c){if(u.save(),u.strokeStyle=h,u.lineWidth=c,u.setLineDash&&(u.setLineDash(t.borderDash||[]),u.lineDashOffset=t.borderDashOffset||0),u.beginPath(),o)u.arc(n.xCenter,n.yCenter,i,0,2*Math.PI);else for(f=n.getPointPosition(0,i),u.moveTo(f.x,f.y),e=1;e<s;e++)f=n.getPointPosition(e,i),u.lineTo(f.x,f.y);u.closePath();u.stroke();u.restore()}}(n,u,o,i))}),f.display&&c&&l){for(r.save(),r.lineWidth=c,r.strokeStyle=l,r.setLineDash&&(r.setLineDash(us([f.borderDash,u.borderDash,[]])),r.lineDashOffset=us([f.borderDashOffset,u.borderDashOffset,0])),e=n.chart.data.labels.length-1;e>=0;e--)o=n.getDistanceFromCenterForValue(s.ticks.reverse?n.min:n.max),h=n.getPointPosition(e,o),r.beginPath(),r.moveTo(n.xCenter,n.yCenter),r.lineTo(h.x,h.y),r.stroke();r.restore()}},_drawLabels:function(){var u=this,n=u.ctx,r=u.options.ticks;if(r.display){var f,e,s=u.getIndexAngle(0),o=t.options._parseFont(r),h=wr(r.fontColor,i.global.defaultFontColor);n.save();n.font=o.string;n.translate(u.xCenter,u.yCenter);n.rotate(s);n.textAlign="center";n.textBaseline="middle";t.each(u.ticks,function(t,i){(0!==i||r.reverse)&&(f=u.getDistanceFromCenterForValue(u.ticksAsNumbers[i]),r.showLabelBackdrop&&(e=n.measureText(t).width,n.fillStyle=r.backdropColor,n.fillRect(-e/2-r.backdropPaddingX,-f-o.size/2-r.backdropPaddingY,e+2*r.backdropPaddingX,o.size+2*r.backdropPaddingY)),n.fillStyle=h,n.fillText(t,0,-f))});n.restore()}},_drawTitle:t.noop});es=hl;bf._defaults=es;var kf=t._deprecated,os=t.options.resolve,vl=t.valueOrDefault,ss=Number.MIN_SAFE_INTEGER||-9007199254740991,df=Number.MAX_SAFE_INTEGER||9007199254740991,kr={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}},v=Object.keys(kr);ne=l.extend({initialize:function(){this.mergeTicksOptions();l.prototype.initialize.call(this)},update:function(){var i=this,r=i.options,n=r.time||(r.time={}),u=i._adapter=new of._date(r.adapters.date);return kf("time scale",n.format,"time.format","time.parser"),kf("time scale",n.min,"time.min","ticks.min"),kf("time scale",n.max,"time.max","ticks.max"),t.mergeIf(n.displayFormats,u.formats()),l.prototype.update.apply(i,arguments)},getRightValue:function(n){return n&&void 0!==n.t&&(n=n.t),l.prototype.getRightValue.call(this,n)},determineDataLimits:function(){for(var o,y,c,l,p,i=this,a=i.chart,w=i._adapter,v=i.options,b=v.time.unit||"day",r=df,u=ss,f=[],h=[],e=[],k=i._getLabels(),n=0,s=k.length;n<s;++n)e.push(ri(i,k[n]));for(n=0,s=(a.data.datasets||[]).length;n<s;++n)if(a.isDatasetVisible(n))if(c=a.data.datasets[n].data,t.isObject(c[0]))for(h[n]=[],o=0,y=c.length;o<y;++o)l=ri(i,c[o]),f.push(l),h[n][o]=l;else h[n]=e.slice(0),p||(f=f.concat(e),p=!0);else h[n]=[];e.length&&(r=Math.min(r,e[0]),u=Math.max(u,e[e.length-1]));f.length&&(f=s>1?function(n){for(var i,u={},f=[],t=0,r=n.length;t<r;++t)u[i=n[t]]||(u[i]=!0,f.push(i));return f}(f).sort(hs):f.sort(hs),r=Math.min(r,f[0]),u=Math.max(u,f[f.length-1]));r=ri(i,cs(v))||r;u=ri(i,ls(v))||u;r=r===df?+w.startOf(Date.now(),b):r;u=u===ss?+w.endOf(Date.now(),b)+1:u;i.min=Math.min(r,u);i.max=Math.max(r+1,u);i._table=[];i._timestamps={data:f,datasets:h,labels:e}},buildTicks:function(){var e,l,s,n=this,i=n.min,r=n.max,u=n.options,o=u.ticks,h=u.time,t=n._timestamps,f=[],a=n.getLabelCapacity(i),c=o.source,y=u.distribution;for(t="data"===c||"auto"===c&&"series"===y?t.data:"labels"===c?t.labels:function(n,t,i,r){var u,s=n._adapter,a=n.options,f=a.time,e=f.unit||as(f.minUnit,t,i,r),h=os([f.stepSize,f.unitStepSize,1]),c="week"===e&&f.isoWeekday,o=t,l=[];if(c&&(o=+s.startOf(o,"isoWeek",c)),o=+s.startOf(o,c?"day":e),s.diff(i,t,e)>1e5*h)throw t+" and "+i+" are too far apart with stepSize of "+h+" "+e;for(u=o;u<i;u=+s.add(u,h,e))l.push(u);return u!==i&&"ticks"!==a.bounds||l.push(u),l}(n,i,r,a),"ticks"===u.bounds&&t.length&&(i=t[0],r=t[t.length-1]),i=ri(n,cs(u))||i,r=ri(n,ls(u))||r,e=0,l=t.length;e<l;++e)(s=t[e])>=i&&s<=r&&f.push(s);return n.min=i,n.max=r,n._unit=h.unit||(o.autoSkip?as(h.minUnit,n.min,n.max,a):function(n,t,i,r,u){for(var e,f=v.length-1;f>=v.indexOf(i);f--)if(e=v[f],kr[e].common&&n._adapter.diff(u,r,e)>=t-1)return e;return v[i?v.indexOf(i):0]}(n,f.length,h.minUnit,n.min,n.max)),n._majorUnit=o.major.enabled&&"year"!==n._unit?function(n){for(var t=v.indexOf(n)+1,i=v.length;t<i;++t)if(kr[v[t]].common)return v[t]}(n._unit):void 0,n._table=function(n,t,i,r){if("linear"===r||!n.length)return[{time:t,pos:0},{time:i,pos:1}];for(var s,f,h,c=[],e=[t],u=0,o=n.length;u<o;++u)(f=n[u])>t&&f<i&&e.push(f);for(e.push(i),u=0,o=e.length;u<o;++u)h=e[u+1],s=e[u-1],f=e[u],void 0!==s&&void 0!==h&&Math.round((h+s)/2)===f||c.push({time:f,pos:u/(o-1)});return c}(n._timestamps.data,i,r,y),n._offsets=function(n,t,i,r,u){var f,e,o=0,s=0;return u.offset&&t.length&&(f=si(n,"time",t[0],"pos"),o=1===t.length?1-f:(si(n,"time",t[1],"pos")-f)/2,e=si(n,"time",t[t.length-1],"pos"),s=1===t.length?e:(e-si(n,"time",t[t.length-2],"pos"))/2),{start:o,end:s,factor:1/(o+1+s)}}(n._table,f,0,0,u),o.reverse&&f.reverse(),vs(n,f,n._majorUnit)},getLabelForIndex:function(n,i){var r=this,o=r._adapter,f=r.chart.data,e=r.options.time,u=f.labels&&n<f.labels.length?f.labels[n]:"",s=f.datasets[i].data[n];return t.isObject(s)&&(u=r.getRightValue(s)),e.tooltipFormat?o.format(gf(r,u),e.tooltipFormat):"string"==typeof u?u:o.format(gf(r,u),e.displayFormats.datetime)},tickFormatFunction:function(n,t,i,r){var y=this._adapter,f=this.options,e=f.time.displayFormats,p=e[this._unit],o=this._majorUnit,s=e[o],h=i[t],u=f.ticks,c=o&&s&&h&&h.major,l=y.format(n,r||(c?s:p)),a=c?u.major:u.minor,v=os([a.callback,a.userCallback,u.callback,u.userCallback]);return v?v(l,t,i):l},convertTicksToLabels:function(n){for(var r=[],t=0,i=n.length;t<i;++t)r.push(this.tickFormatFunction(n[t].value,t,n));return r},getPixelForOffset:function(n){var t=this._offsets,i=si(this._table,"time",n,"pos");return this.getPixelForDecimal((t.start+i)*t.factor)},getPixelForValue:function(n,t,i){var r=null;if(void 0!==t&&void 0!==i&&(r=this._timestamps.datasets[i][t]),null===r&&(r=ri(this,n)),null!==r)return this.getPixelForOffset(r)},getPixelForTick:function(n){var t=this.getTicks();return n>=0&&n<t.length?this.getPixelForOffset(t[n].value):null},getValueForPixel:function(n){var t=this._offsets,i=this.getDecimalForPixel(n)/t.factor-t.end,r=si(this._table,"pos",i,"time");return this._adapter._create(r)},_getLabelSize:function(n){var r=this.options.ticks,u=this.ctx.measureText(n).width,f=t.toRadians(this.isHorizontal()?r.maxRotation:r.minRotation),e=Math.cos(f),o=Math.sin(f),s=vl(r.fontSize,i.global.defaultFontSize);return{w:u*e+s*o,h:u*o+s*e}},getLabelWidth:function(n){return this._getLabelSize(n).w},getLabelCapacity:function(n){var t=this,r=t.options.time,u=r.displayFormats,e=u[r.unit]||u.millisecond,o=t.tickFormatFunction(n,0,vs(t,[n],t._majorUnit),e),f=t._getLabelSize(o),i=Math.floor(t.isHorizontal()?t.width/f.w:t.height/f.h);return t.options.offset&&i--,i>0?i:1}});ys={position:"bottom",distribution:"linear",bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{autoSkip:!1,source:"auto",major:{enabled:!1}}};ne._defaults=ys;ps={category:ts,linear:af,logarithmic:yf,radialLinear:bf,time:ne};ws={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};of._date.override("function"==typeof n?{_id:"moment",formats:function(){return ws},parse:function(t,i){return"string"==typeof t&&"string"==typeof i?t=n(t,i):t instanceof n||(t=n(t)),t.isValid()?t.valueOf():null},format:function(t,i){return n(t).format(i)},add:function(t,i,r){return n(t).add(i,r).valueOf()},diff:function(t,i,r){return n(t).diff(n(i),r)},startOf:function(t,i,r){return t=n(t),"isoWeek"===i?t.isoWeekday(r).valueOf():t.startOf(i).valueOf()},endOf:function(t,i){return n(t).endOf(i).valueOf()},_create:function(t){return n(t)}}:{});i._set("global",{plugins:{filler:{propagate:!0}}});bs={dataset:function(n){var t=n.fill,i=n.chart,r=i.getDatasetMeta(t),u=r&&i.isDatasetVisible(t)&&r.dataset._children||[],f=u.length||0;return f?function(n,t){return t<f&&u[t]._view||null}:null},boundary:function(n){var i=n.boundary,r=i?i.x:null,u=i?i.y:null;return t.isArray(i)?function(n,t){return i[t]}:function(n){return{x:null===r?n.x:r,y:null===u?n.y:u}}}};var dl={id:"filler",afterDatasetsUpdate:function(n,t){for(var o,u,r,f=(n.data.datasets||[]).length,s=t.propagate,e=[],i=0;i<f;++i)r=null,(u=(o=n.getDatasetMeta(i)).dataset)&&u._model&&u instanceof c.Line&&(r={visible:n.isDatasetVisible(i),fill:yl(u,i,f),chart:n,el:u}),o.$filler=r,e.push(r);for(i=0;i<f;++i)(r=e[i])&&(r.fill=wl(e,i,s),r.boundary=pl(r),r.mapper=bl(r))},beforeDatasetsDraw:function(n){for(var r,f,e,o,s,h,l=n._getSortedVisibleDatasetMetas(),c=n.ctx,u=l.length-1;u>=0;--u)(r=l[u].$filler)&&r.visible&&(e=(f=r.el)._view,o=f._children||[],s=r.mapper,h=e.backgroundColor||i.global.defaultColor,s&&h&&o.length&&(t.canvas.clipArea(c,n.chartArea),kl(c,o,s,e,h,f._loop),t.canvas.unclipArea(c)))}},gl=t.rtl.getRtlAdapter,ct=t.noop,lt=t.valueOrDefault;i._set("global",{legend:{display:!0,position:"top",align:"center",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(n,t){var r=t.datasetIndex,i=this.chart,u=i.getDatasetMeta(r);u.hidden=null===u.hidden?!i.data.datasets[r].hidden:null;i.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(n){var i=n.data.datasets,t=n.options.legend||{},r=t.labels&&t.labels.usePointStyle;return n._getSortedDatasetMetas().map(function(t){var u=t.controller.getStyle(r?0:void 0);return{text:i[t.index].label,fillStyle:u.backgroundColor,hidden:!n.isDatasetVisible(t.index),lineCap:u.borderCapStyle,lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:u.borderWidth,strokeStyle:u.borderColor,pointStyle:u.pointStyle,rotation:u.rotation,datasetIndex:t.index}},this)}}},legendCallback:function(n){var t,u,f,r=document.createElement("ul"),i=n.data.datasets;for(r.setAttribute("class",n.id+"-legend"),t=0,u=i.length;t<u;t++)(f=r.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=i[t].backgroundColor,i[t].label&&f.appendChild(document.createTextNode(i[t].label));return r.outerHTML}});ie=nt.extend({initialize:function(n){t.extend(this,n);this.legendHitBoxes=[];this._hoveredItem=null;this.doughnutMode=!1},beforeUpdate:ct,update:function(n,t,i){var r=this;return r.beforeUpdate(),r.maxWidth=n,r.maxHeight=t,r.margins=i,r.beforeSetDimensions(),r.setDimensions(),r.afterSetDimensions(),r.beforeBuildLabels(),r.buildLabels(),r.afterBuildLabels(),r.beforeFit(),r.fit(),r.afterFit(),r.afterUpdate(),r.minSize},afterUpdate:ct,beforeSetDimensions:ct,setDimensions:function(){var n=this;n.isHorizontal()?(n.width=n.maxWidth,n.left=0,n.right=n.width):(n.height=n.maxHeight,n.top=0,n.bottom=n.height);n.paddingLeft=0;n.paddingTop=0;n.paddingRight=0;n.paddingBottom=0;n.minSize={width:0,height:0}},afterSetDimensions:ct,beforeBuildLabels:ct,buildLabels:function(){var n=this,r=n.options.labels||{},i=t.callback(r.generateLabels,[n.chart],n)||[];r.filter&&(i=i.filter(function(t){return r.filter(t,n.chart.data)}));n.options.reverse&&i.reverse();n.legendItems=i},afterBuildLabels:ct,beforeFit:ct,fit:function(){var n=this,a=n.options,r=a.labels,h=a.display,o=n.ctx,v=t.options._parseFont(r),u=v.size,y=n.legendHitBoxes=[],i=n.minSize,p=n.isHorizontal(),f,c;if(p?(i.width=n.maxWidth,i.height=h?10:0):(i.width=h?10:0,i.height=n.maxHeight),h){if(o.font=v.string,p)f=n.lineWidths=[0],c=0,o.textAlign="left",o.textBaseline="middle",t.each(n.legendItems,function(n,t){var e=te(r,u)+u/2+o.measureText(n.text).width;(0===t||f[f.length-1]+e+2*r.padding>i.width)&&(c+=u+r.padding,f[f.length-(t>0?0:1)]=0);y[t]={left:0,top:0,width:e,height:u};f[f.length-1]+=e+r.padding}),i.height+=c;else{var w=r.padding,b=n.columnWidths=[],k=n.columnHeights=[],l=r.padding,e=0,s=0;t.each(n.legendItems,function(n,t){var f=te(r,u)+u/2+o.measureText(n.text).width;t>0&&s+u+2*w>i.height&&(l+=e+r.padding,b.push(e),k.push(s),e=0,s=0);e=Math.max(e,f);s+=u+w;y[t]={left:0,top:0,width:f,height:u}});l+=e;b.push(e);k.push(s);i.width+=l}n.width=i.width;n.height=i.height}else n.width=i.width=n.height=i.height=0},afterFit:ct,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var r=this,h=r.options,f=h.labels,v=i.global,w=v.defaultColor,c=v.elements.line,b=r.height,k=r.columnHeights,d=r.width,g=r.lineWidths,a;if(h.display){var u,o=gl(h.rtl,r.left,r.minSize.width),n=r.ctx,nt=lt(f.fontColor,v.defaultFontColor),tt=t.options._parseFont(f),s=tt.size;n.textAlign=o.textAlign("left");n.textBaseline="middle";n.lineWidth=.5;n.strokeStyle=nt;n.fillStyle=nt;n.font=tt.string;var e=te(f,s),y=r.legendHitBoxes,l=function(n,t){switch(h.align){case"start":return f.padding;case"end":return n-t;default:return(n-t+f.padding)/2}},p=r.isHorizontal();u=p?{x:r.left+l(d,g[0]),y:r.top+f.padding,line:0}:{x:r.left+f.padding,y:r.top+l(b,k[0]),line:0};t.rtl.overrideTextDirection(r.ctx,h.textDirection);a=s+f.padding;t.each(r.legendItems,function(i,h){var it=n.measureText(i.text).width,rt=e+s/2+it,nt=u.x,v=u.y,tt;o.setWidth(r.minSize.width);p?h>0&&nt+rt+f.padding>r.left+r.minSize.width&&(v=u.y+=a,u.line++,nt=u.x=r.left+l(d,g[u.line])):h>0&&v+a>r.top+r.minSize.height&&(nt=u.x=nt+r.columnWidths[u.line]+f.padding,u.line++,v=u.y=r.top+l(b,k[u.line]));tt=o.x(nt);!function(i,r,u){var h;if(!(isNaN(e)||e<=0)){if(n.save(),h=lt(u.lineWidth,c.borderWidth),n.fillStyle=lt(u.fillStyle,w),n.lineCap=lt(u.lineCap,c.borderCapStyle),n.lineDashOffset=lt(u.lineDashOffset,c.borderDashOffset),n.lineJoin=lt(u.lineJoin,c.borderJoinStyle),n.lineWidth=h,n.strokeStyle=lt(u.strokeStyle,w),n.setLineDash&&n.setLineDash(lt(u.lineDash,c.borderDash)),f&&f.usePointStyle){var l=e*Math.SQRT2/2,a=o.xPlus(i,e/2),v=r+s/2;t.canvas.drawPoint(n,u.pointStyle,l,a,v,u.rotation)}else n.fillRect(o.leftForLtr(i,e),r,e,s),0!==h&&n.strokeRect(o.leftForLtr(i,e),r,e,s);n.restore()}}(tt,v,i);y[h].left=o.leftForLtr(tt,y[h].width);y[h].top=v,function(t,i,r,u){var c=s/2,f=o.xPlus(t,e+c),h=i+c;n.fillText(r.text,f,h);r.hidden&&(n.beginPath(),n.lineWidth=2,n.moveTo(f,h),n.lineTo(o.xPlus(f,u),h),n.stroke())}(tt,v,i,it);p?u.x+=rt+f.padding:u.y+=a});t.rtl.restoreTextDirection(r.ctx,h.textDirection)}},_getLegendItemAt:function(n,t){var u,i,f,r=this;if(n>=r.left&&n<=r.right&&t>=r.top&&t<=r.bottom)for(f=r.legendHitBoxes,u=0;u<f.length;++u)if(n>=(i=f[u]).left&&n<=i.left+i.width&&t>=i.top&&t<=i.top+i.height)return r.legendItems[u];return null},handleEvent:function(n){var r,t=this,i=t.options,u="mouseup"===n.type?"click":n.type;if("mousemove"===u){if(!i.onHover&&!i.onLeave)return}else{if("click"!==u)return;if(!i.onClick)return}r=t._getLegendItemAt(n.x,n.y);"click"===u?r&&i.onClick&&i.onClick.call(t,n.native,r):(i.onLeave&&r!==t._hoveredItem&&(t._hoveredItem&&i.onLeave.call(t,n.native,t._hoveredItem),t._hoveredItem=r),i.onHover&&r&&i.onHover.call(t,n.native,r))}});nh={id:"legend",_element:ie,beforeInit:function(n){var t=n.options.legend;t&&gs(n,t)},beforeUpdate:function(n){var r=n.options.legend,u=n.legend;r?(t.mergeIf(r,i.global.legend),u?(b.configure(n,u,r),u.options=r):gs(n,r)):u&&(b.removeBox(n,u),delete n.legend)},afterEvent:function(n,t){var i=n.legend;i&&i.handleEvent(t)}};it=t.noop;i._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});re=nt.extend({initialize:function(n){t.extend(this,n);this.legendHitBoxes=[]},beforeUpdate:it,update:function(n,t,i){var r=this;return r.beforeUpdate(),r.maxWidth=n,r.maxHeight=t,r.margins=i,r.beforeSetDimensions(),r.setDimensions(),r.afterSetDimensions(),r.beforeBuildLabels(),r.buildLabels(),r.afterBuildLabels(),r.beforeFit(),r.fit(),r.afterFit(),r.afterUpdate(),r.minSize},afterUpdate:it,beforeSetDimensions:it,setDimensions:function(){var n=this;n.isHorizontal()?(n.width=n.maxWidth,n.left=0,n.right=n.width):(n.height=n.maxHeight,n.top=0,n.bottom=n.height);n.paddingLeft=0;n.paddingTop=0;n.paddingRight=0;n.paddingBottom=0;n.minSize={width:0,height:0}},afterSetDimensions:it,beforeBuildLabels:it,buildLabels:it,afterBuildLabels:it,beforeFit:it,fit:function(){var u,n=this,i=n.options,r=n.minSize={},f=n.isHorizontal();i.display?(u=(t.isArray(i.text)?i.text.length:1)*t.options._parseFont(i).lineHeight+2*i.padding,n.width=r.width=f?n.maxWidth:u,n.height=r.height=f?u:n.maxHeight):n.width=r.width=n.height=r.height=0},afterFit:it,isHorizontal:function(){var n=this.options.position;return"top"===n||"bottom"===n},draw:function(){var r=this,n=r.ctx,u=r.options,f,y,h;if(u.display){var e,c,l,p=t.options._parseFont(u),w=p.lineHeight,a=w/2+u.padding,b=0,o=r.top,s=r.left,k=r.bottom,v=r.right;if(n.fillStyle=t.valueOrDefault(u.fontColor,i.global.defaultFontColor),n.font=p.string,r.isHorizontal()?(c=s+(v-s)/2,l=o+a,e=v-s):(c="left"===u.position?s+a:v-a,l=o+(k-o)/2,e=k-o,b=Math.PI*("left"===u.position?-.5:.5)),n.save(),n.translate(c,l),n.rotate(b),n.textAlign="center",n.textBaseline="middle",f=u.text,t.isArray(f))for(y=0,h=0;h<f.length;++h)n.fillText(f[h],0,y,e),y+=w;else n.fillText(f,0,0,e);n.restore()}}});var at={},na=dl,ta=nh,ia={id:"title",_element:re,beforeInit:function(n){var t=n.options.title;t&&th(n,t)},beforeUpdate:function(n){var r=n.options.title,u=n.titleBlock;r?(t.mergeIf(r,i.global.title),u?(b.configure(n,u,r),u.options=r):th(n,r)):u&&(b.removeBox(n,u),delete n.titleBlock)}};for(ue in at.filler=na,at.legend=ta,at.title=ia,r.helpers=t,function(){function n(n,t,i){var r;return"string"==typeof n?(r=parseInt(n,10),-1!==n.indexOf("%")&&(r=r/100*t.parentNode[i])):r=n,r}function r(n){return null!=n&&"none"!==n}function u(i,u,f){var e=document.defaultView,o=t._getParentNode(i),s=e.getComputedStyle(i)[u],h=e.getComputedStyle(o)[u],c=r(s),l=r(h),a=Number.POSITIVE_INFINITY;return c||l?Math.min(c?n(s,i,f):a,l?n(h,o,f):a):"none"}t.where=function(n,i){if(t.isArray(n)&&Array.prototype.filter)return n.filter(i);var r=[];return t.each(n,function(n){i(n)&&r.push(n)}),r};t.findIndex=Array.prototype.findIndex?function(n,t,i){return n.findIndex(t,i)}:function(n,t,i){i=void 0===i?n:i;for(var r=0,u=n.length;r<u;++r)if(t.call(i,n[r],r,n))return r;return-1};t.findNextWhere=function(n,i,r){var u,f;for(t.isNullOrUndef(r)&&(r=-1),u=r+1;u<n.length;u++)if(f=n[u],i(f))return f};t.findPreviousWhere=function(n,i,r){var u,f;for(t.isNullOrUndef(r)&&(r=n.length),u=r-1;u>=0;u--)if(f=n[u],i(f))return f};t.isNumber=function(n){return!isNaN(parseFloat(n))&&isFinite(n)};t.almostEquals=function(n,t,i){return Math.abs(n-t)<i};t.almostWhole=function(n,t){var i=Math.round(n);return i-t<=n&&i+t>=n};t.max=function(n){return n.reduce(function(n,t){return isNaN(t)?n:Math.max(n,t)},Number.NEGATIVE_INFINITY)};t.min=function(n){return n.reduce(function(n,t){return isNaN(t)?n:Math.min(n,t)},Number.POSITIVE_INFINITY)};t.sign=Math.sign?function(n){return Math.sign(n)}:function(n){return 0==(n=+n)||isNaN(n)?n:n>0?1:-1};t.toRadians=function(n){return n*(Math.PI/180)};t.toDegrees=function(n){return n*(180/Math.PI)};t._decimalPlaces=function(n){if(t.isFinite(n)){for(var i=1,r=0;Math.round(n*i)/i!==n;)i*=10,r++;return r}};t.getAngleFromPoint=function(n,t){var i=t.x-n.x,r=t.y-n.y,f=Math.sqrt(i*i+r*r),u=Math.atan2(r,i);return u<-.5*Math.PI&&(u+=2*Math.PI),{angle:u,distance:f}};t.distanceBetweenPoints=function(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))};t.aliasPixel=function(n){return n%2==0?0:.5};t._alignPixel=function(n,t,i){var r=n.currentDevicePixelRatio,u=i/2;return Math.round((t-u)*r)/r+u};t.splineCurve=function(n,t,i,r){var f=n.skip?t:n,u=t,e=i.skip?t:i,o=Math.sqrt(Math.pow(u.x-f.x,2)+Math.pow(u.y-f.y,2)),s=Math.sqrt(Math.pow(e.x-u.x,2)+Math.pow(e.y-u.y,2)),h=o/(o+s),c=s/(o+s),l=r*(h=isNaN(h)?0:h),a=r*(c=isNaN(c)?0:c);return{previous:{x:u.x-l*(e.x-f.x),y:u.y-l*(e.y-f.y)},next:{x:u.x+a*(e.x-f.x),y:u.y+a*(e.y-f.y)}}};t.EPSILON=Number.EPSILON||1e-14;t.splineCurveMonotone=function(n){for(var f,i,u,h,c,l,v,o,e=(n||[]).map(function(n){return{model:n._model,deltaK:0,mK:0}}),s=e.length,a,r=0;r<s;++r)(i=e[r]).model.skip||((f=r>0?e[r-1]:null,(u=r<s-1?e[r+1]:null)&&!u.model.skip)&&(a=u.model.x-i.model.x,i.deltaK=0!==a?(u.model.y-i.model.y)/a:0),i.mK=!f||f.model.skip?i.deltaK:!u||u.model.skip?f.deltaK:this.sign(f.deltaK)!==this.sign(i.deltaK)?0:(f.deltaK+i.deltaK)/2);for(r=0;r<s-1;++r)i=e[r],u=e[r+1],i.model.skip||u.model.skip||(t.almostEquals(i.deltaK,0,this.EPSILON)?i.mK=u.mK=0:(h=i.mK/i.deltaK,c=u.mK/i.deltaK,(v=Math.pow(h,2)+Math.pow(c,2))<=9||(l=3/Math.sqrt(v),i.mK=h*l*i.deltaK,u.mK=c*l*i.deltaK)));for(r=0;r<s;++r)(i=e[r]).model.skip||(f=r>0?e[r-1]:null,u=r<s-1?e[r+1]:null,f&&!f.model.skip&&(o=(i.model.x-f.model.x)/3,i.model.controlPointPreviousX=i.model.x-o,i.model.controlPointPreviousY=i.model.y-o*i.mK),u&&!u.model.skip&&(o=(u.model.x-i.model.x)/3,i.model.controlPointNextX=i.model.x+o,i.model.controlPointNextY=i.model.y+o*i.mK))};t.nextItem=function(n,t,i){return i?t>=n.length-1?n[0]:n[t+1]:t>=n.length-1?n[n.length-1]:n[t+1]};t.previousItem=function(n,t,i){return i?t<=0?n[n.length-1]:n[t-1]:t<=0?n[0]:n[t-1]};t.niceNum=function(n,i){var u=Math.floor(t.log10(n)),r=n/Math.pow(10,u);return(i?r<1.5?1:r<3?2:r<7?5:10:r<=1?1:r<=2?2:r<=5?5:10)*Math.pow(10,u)};t.requestAnimFrame="undefined"==typeof window?function(n){n()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(n){return window.setTimeout(n,1e3/60)};t.getRelativePosition=function(n,i){var f,e,s=n.originalEvent||n,r=n.target||n.srcElement,u=r.getBoundingClientRect(),o=s.touches;o&&o.length>0?(f=o[0].clientX,e=o[0].clientY):(f=s.clientX,e=s.clientY);var h=parseFloat(t.getStyle(r,"padding-left")),c=parseFloat(t.getStyle(r,"padding-top")),l=parseFloat(t.getStyle(r,"padding-right")),a=parseFloat(t.getStyle(r,"padding-bottom")),v=u.right-u.left-h-l,y=u.bottom-u.top-c-a;return{x:f=Math.round((f-u.left-h)/v*r.width/i.currentDevicePixelRatio),y:e=Math.round((e-u.top-c)/y*r.height/i.currentDevicePixelRatio)}};t.getConstraintWidth=function(n){return u(n,"max-width","clientWidth")};t.getConstraintHeight=function(n){return u(n,"max-height","clientHeight")};t._calculatePadding=function(n,i,r){return(i=t.getStyle(n,i)).indexOf("%")>-1?r*parseInt(i,10)/100:parseInt(i,10)};t._getParentNode=function(n){var t=n.parentNode;return t&&"[object ShadowRoot]"===t.toString()&&(t=t.host),t};t.getMaximumWidth=function(n){var i=t._getParentNode(n);if(!i)return n.clientWidth;var r=i.clientWidth,u=r-t._calculatePadding(i,"padding-left",r)-t._calculatePadding(i,"padding-right",r),f=t.getConstraintWidth(n);return isNaN(f)?u:Math.min(u,f)};t.getMaximumHeight=function(n){var i=t._getParentNode(n);if(!i)return n.clientHeight;var r=i.clientHeight,u=r-t._calculatePadding(i,"padding-top",r)-t._calculatePadding(i,"padding-bottom",r),f=t.getConstraintHeight(n);return isNaN(f)?u:Math.min(u,f)};t.getStyle=function(n,t){return n.currentStyle?n.currentStyle[t]:document.defaultView.getComputedStyle(n,null).getPropertyValue(t)};t.retinaScale=function(n,t){var r=n.currentDevicePixelRatio=t||"undefined"!=typeof window&&window.devicePixelRatio||1;if(1!==r){var i=n.canvas,u=n.height,f=n.width;i.height=u*r;i.width=f*r;n.ctx.scale(r,r);i.style.height||i.style.width||(i.style.height=u+"px",i.style.width=f+"px")}};t.fontString=function(n,t,i){return t+" "+n+"px "+i};t.longestText=function(n,i,r,u){var h=(u=u||{}).data=u.data||{},e=u.garbageCollect=u.garbageCollect||[],f,c,v,o,a,s,y,l;for(u.font!==i&&(h=u.data={},e=u.garbageCollect=[],u.font=i),n.font=i,s=0,y=r.length,f=0;f<y;f++)if(null!=(o=r[f])&&!0!==t.isArray(o))s=t.measureText(n,h,e,s,o);else if(t.isArray(o))for(c=0,v=o.length;c<v;c++)null==(a=o[c])||t.isArray(a)||(s=t.measureText(n,h,e,s,a));if(l=e.length/2,l>r.length){for(f=0;f<l;f++)delete h[e[f]];e.splice(0,l)}return s};t.measureText=function(n,t,i,r,u){var f=t[u];return f||(f=t[u]=n.measureText(u).width,i.push(u)),f>r&&(r=f),r};t.numberOfLabelLines=function(n){var i=1;return t.each(n,function(n){t.isArray(n)&&n.length>i&&(i=n.length)}),i};t.color=gi?function(n){return n instanceof CanvasGradient&&(n=i.global.defaultColor),gi(n)}:function(n){return console.error("Color.js not found!"),n};t.getHoverColor=function(n){return n instanceof CanvasPattern||n instanceof CanvasGradient?n:t.color(n).saturate(.5).darken(.1).rgbString()}}(),r._adapters=of,r.Animation=fu,r.animationService=eu,r.controllers=au,r.DatasetController=y,r.defaults=i,r.Element=nt,r.elements=c,r.Interaction=kt,r.layouts=b,r.platform=dt,r.plugins=f,r.Scale=l,r.scaleService=pi,r.Ticks=wi,r.Tooltip=ff,r.helpers.each(ps,function(n,t){r.scaleService.registerScaleType(t,n,n._defaults)}),at)at.hasOwnProperty(ue)&&r.plugins.register(at[ue]);return r.platform.initialize(),ih=r,"undefined"!=typeof window&&(window.Chart=r),r.Chart=r,r.Legend=at.legend._element,r.Title=at.title._element,r.pluginService=r.plugins,r.PluginBase=r.Element.extend({}),r.canvasHelpers=r.helpers.canvas,r.layoutService=r.layouts,r.LinearScaleBase=yr,r.helpers.each(["Bar","Bubble","Doughnut","Line","PolarArea","Radar","Scatter"],function(n){r[n]=function(t,i){return new r(t,r.helpers.merge(i||{},{type:n.charAt(0).toLowerCase()+n.slice(1)}))}}),ih})