chunk-5d4d188e.b0ffa164.js 189 KB

12345678
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5d4d188e"],{"038f":function(t,e,n){var i=n("24fb");e=i(!1),e.push([t.i,".ant-card .chart[data-v-2b303a0f]{max-height:300px}.ant-card .chart_dashboard[data-v-2b303a0f]{padding:60px}.ant-card .chart_dashboard .description[data-v-2b303a0f]{width:120px;text-align:center}@media (max-width:512px){.ant-card[data-v-2b303a0f]{margin:10px 0}.ant-card .chart_dashboard[data-v-2b303a0f]{padding:20px}}",""]),t.exports=e},1148:function(t,e,n){"use strict";var i=n("a691"),a=n("1d80");t.exports="".repeat||function(t){var e=String(a(this)),n="",r=i(t);if(r<0||r==1/0)throw RangeError("Wrong number of repetitions");for(;r>0;(r>>>=1)&&(e+=e))1&r&&(n+=e);return n}},"1dd2":function(t,e,n){"use strict";n("6306")},"30ef":function(t,e,n){
  2. /*!
  3. * Chart.js v2.9.4
  4. * https://www.chartjs.org
  5. * (c) 2020 Chart.js Contributors
  6. * Released under the MIT License
  7. */
  8. (function(e,i){t.exports=i(function(){try{return n("c1df")}catch(t){}}())})(0,(function(t){"use strict";function e(t,e){return e={exports:{}},t(e,e.exports),e.exports}function n(t){return t&&t["default"]||t}t=t&&t.hasOwnProperty("default")?t["default"]:t;var i={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]},a=e((function(t){var e={};for(var n in i)i.hasOwnProperty(n)&&(e[i[n]]=n);var a=t.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(var r in a)if(a.hasOwnProperty(r)){if(!("channels"in a[r]))throw new Error("missing channels property: "+r);if(!("labels"in a[r]))throw new Error("missing channel labels property: "+r);if(a[r].labels.length!==a[r].channels)throw new Error("channel and label counts mismatch: "+r);var o=a[r].channels,s=a[r].labels;delete a[r].channels,delete a[r].labels,Object.defineProperty(a[r],"channels",{value:o}),Object.defineProperty(a[r],"labels",{value:s})}function l(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2)}a.rgb.hsl=function(t){var e,n,i,a=t[0]/255,r=t[1]/255,o=t[2]/255,s=Math.min(a,r,o),l=Math.max(a,r,o),u=l-s;return l===s?e=0:a===l?e=(r-o)/u:r===l?e=2+(o-a)/u:o===l&&(e=4+(a-r)/u),e=Math.min(60*e,360),e<0&&(e+=360),i=(s+l)/2,n=l===s?0:i<=.5?u/(l+s):u/(2-l-s),[e,100*n,100*i]},a.rgb.hsv=function(t){var e,n,i,a,r,o=t[0]/255,s=t[1]/255,l=t[2]/255,u=Math.max(o,s,l),c=u-Math.min(o,s,l),d=function(t){return(u-t)/6/c+.5};return 0===c?a=r=0:(r=c/u,e=d(o),n=d(s),i=d(l),o===u?a=i-n:s===u?a=1/3+e-i:l===u&&(a=2/3+n-e),a<0?a+=1:a>1&&(a-=1)),[360*a,100*r,100*u]},a.rgb.hwb=function(t){var e=t[0],n=t[1],i=t[2],r=a.rgb.hsl(t)[0],o=1/255*Math.min(e,Math.min(n,i));return i=1-1/255*Math.max(e,Math.max(n,i)),[r,100*o,100*i]},a.rgb.cmyk=function(t){var e,n,i,a,r=t[0]/255,o=t[1]/255,s=t[2]/255;return a=Math.min(1-r,1-o,1-s),e=(1-r-a)/(1-a)||0,n=(1-o-a)/(1-a)||0,i=(1-s-a)/(1-a)||0,[100*e,100*n,100*i,100*a]},a.rgb.keyword=function(t){var n=e[t];if(n)return n;var a,r=1/0;for(var o in i)if(i.hasOwnProperty(o)){var s=i[o],u=l(t,s);u<r&&(r=u,a=o)}return a},a.keyword.rgb=function(t){return i[t]},a.rgb.xyz=function(t){var e=t[0]/255,n=t[1]/255,i=t[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92;var a=.4124*e+.3576*n+.1805*i,r=.2126*e+.7152*n+.0722*i,o=.0193*e+.1192*n+.9505*i;return[100*a,100*r,100*o]},a.rgb.lab=function(t){var e,n,i,r=a.rgb.xyz(t),o=r[0],s=r[1],l=r[2];return o/=95.047,s/=100,l/=108.883,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,s=s>.008856?Math.pow(s,1/3):7.787*s+16/116,l=l>.008856?Math.pow(l,1/3):7.787*l+16/116,e=116*s-16,n=500*(o-s),i=200*(s-l),[e,n,i]},a.hsl.rgb=function(t){var e,n,i,a,r,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return r=255*l,[r,r,r];n=l<.5?l*(1+s):l+s-l*s,e=2*l-n,a=[0,0,0];for(var u=0;u<3;u++)i=o+1/3*-(u-1),i<0&&i++,i>1&&i--,r=6*i<1?e+6*(n-e)*i:2*i<1?n:3*i<2?e+(n-e)*(2/3-i)*6:e,a[u]=255*r;return a},a.hsl.hsv=function(t){var e,n,i=t[0],a=t[1]/100,r=t[2]/100,o=a,s=Math.max(r,.01);return r*=2,a*=r<=1?r:2-r,o*=s<=1?s:2-s,n=(r+a)/2,e=0===r?2*o/(s+o):2*a/(r+a),[i,100*e,100*n]},a.hsv.rgb=function(t){var e=t[0]/60,n=t[1]/100,i=t[2]/100,a=Math.floor(e)%6,r=e-Math.floor(e),o=255*i*(1-n),s=255*i*(1-n*r),l=255*i*(1-n*(1-r));switch(i*=255,a){case 0:return[i,l,o];case 1:return[s,i,o];case 2:return[o,i,l];case 3:return[o,s,i];case 4:return[l,o,i];case 5:return[i,o,s]}},a.hsv.hsl=function(t){var e,n,i,a=t[0],r=t[1]/100,o=t[2]/100,s=Math.max(o,.01);return i=(2-r)*o,e=(2-r)*s,n=r*s,n/=e<=1?e:2-e,n=n||0,i/=2,[a,100*n,100*i]},a.hwb.rgb=function(t){var e,n,i,a,r,o,s,l=t[0]/360,u=t[1]/100,c=t[2]/100,d=u+c;switch(d>1&&(u/=d,c/=d),e=Math.floor(6*l),n=1-c,i=6*l-e,0!==(1&e)&&(i=1-i),a=u+i*(n-u),e){default:case 6:case 0:r=n,o=a,s=u;break;case 1:r=a,o=n,s=u;break;case 2:r=u,o=n,s=a;break;case 3:r=u,o=a,s=n;break;case 4:r=a,o=u,s=n;break;case 5:r=n,o=u,s=a;break}return[255*r,255*o,255*s]},a.cmyk.rgb=function(t){var e,n,i,a=t[0]/100,r=t[1]/100,o=t[2]/100,s=t[3]/100;return e=1-Math.min(1,a*(1-s)+s),n=1-Math.min(1,r*(1-s)+s),i=1-Math.min(1,o*(1-s)+s),[255*e,255*n,255*i]},a.xyz.rgb=function(t){var e,n,i,a=t[0]/100,r=t[1]/100,o=t[2]/100;return e=3.2406*a+-1.5372*r+-.4986*o,n=-.9689*a+1.8758*r+.0415*o,i=.0557*a+-.204*r+1.057*o,e=e>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:12.92*i,e=Math.min(Math.max(0,e),1),n=Math.min(Math.max(0,n),1),i=Math.min(Math.max(0,i),1),[255*e,255*n,255*i]},a.xyz.lab=function(t){var e,n,i,a=t[0],r=t[1],o=t[2];return a/=95.047,r/=100,o/=108.883,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,e=116*r-16,n=500*(a-r),i=200*(r-o),[e,n,i]},a.lab.xyz=function(t){var e,n,i,a=t[0],r=t[1],o=t[2];n=(a+16)/116,e=r/500+n,i=n-o/200;var s=Math.pow(n,3),l=Math.pow(e,3),u=Math.pow(i,3);return n=s>.008856?s:(n-16/116)/7.787,e=l>.008856?l:(e-16/116)/7.787,i=u>.008856?u:(i-16/116)/7.787,e*=95.047,n*=100,i*=108.883,[e,n,i]},a.lab.lch=function(t){var e,n,i,a=t[0],r=t[1],o=t[2];return e=Math.atan2(o,r),n=360*e/2/Math.PI,n<0&&(n+=360),i=Math.sqrt(r*r+o*o),[a,i,n]},a.lch.lab=function(t){var e,n,i,a=t[0],r=t[1],o=t[2];return i=o/360*2*Math.PI,e=r*Math.cos(i),n=r*Math.sin(i),[a,e,n]},a.rgb.ansi16=function(t){var e=t[0],n=t[1],i=t[2],r=1 in arguments?arguments[1]:a.rgb.hsv(t)[2];if(r=Math.round(r/50),0===r)return 30;var o=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(e/255));return 2===r&&(o+=60),o},a.hsv.ansi16=function(t){return a.rgb.ansi16(a.hsv.rgb(t),t[2])},a.rgb.ansi256=function(t){var e=t[0],n=t[1],i=t[2];if(e===n&&n===i)return e<8?16:e>248?231:Math.round((e-8)/247*24)+232;var a=16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5);return a},a.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];var n=.5*(1+~~(t>50)),i=(1&e)*n*255,a=(e>>1&1)*n*255,r=(e>>2&1)*n*255;return[i,a,r]},a.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var n;t-=16;var i=Math.floor(t/36)/5*255,a=Math.floor((n=t%36)/6)/5*255,r=n%6/5*255;return[i,a,r]},a.rgb.hex=function(t){var e=((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2])),n=e.toString(16).toUpperCase();return"000000".substring(n.length)+n},a.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var n=e[0];3===e[0].length&&(n=n.split("").map((function(t){return t+t})).join(""));var i=parseInt(n,16),a=i>>16&255,r=i>>8&255,o=255&i;return[a,r,o]},a.rgb.hcg=function(t){var e,n,i=t[0]/255,a=t[1]/255,r=t[2]/255,o=Math.max(Math.max(i,a),r),s=Math.min(Math.min(i,a),r),l=o-s;return e=l<1?s/(1-l):0,n=l<=0?0:o===i?(a-r)/l%6:o===a?2+(r-i)/l:4+(i-a)/l+4,n/=6,n%=1,[360*n,100*l,100*e]},a.hsl.hcg=function(t){var e=t[1]/100,n=t[2]/100,i=1,a=0;return i=n<.5?2*e*n:2*e*(1-n),i<1&&(a=(n-.5*i)/(1-i)),[t[0],100*i,100*a]},a.hsv.hcg=function(t){var e=t[1]/100,n=t[2]/100,i=e*n,a=0;return i<1&&(a=(n-i)/(1-i)),[t[0],100*i,100*a]},a.hcg.rgb=function(t){var e=t[0]/360,n=t[1]/100,i=t[2]/100;if(0===n)return[255*i,255*i,255*i];var a=[0,0,0],r=e%1*6,o=r%1,s=1-o,l=0;switch(Math.floor(r)){case 0:a[0]=1,a[1]=o,a[2]=0;break;case 1:a[0]=s,a[1]=1,a[2]=0;break;case 2:a[0]=0,a[1]=1,a[2]=o;break;case 3:a[0]=0,a[1]=s,a[2]=1;break;case 4:a[0]=o,a[1]=0,a[2]=1;break;default:a[0]=1,a[1]=0,a[2]=s}return l=(1-n)*i,[255*(n*a[0]+l),255*(n*a[1]+l),255*(n*a[2]+l)]},a.hcg.hsv=function(t){var e=t[1]/100,n=t[2]/100,i=e+n*(1-e),a=0;return i>0&&(a=e/i),[t[0],100*a,100*i]},a.hcg.hsl=function(t){var e=t[1]/100,n=t[2]/100,i=n*(1-e)+.5*e,a=0;return i>0&&i<.5?a=e/(2*i):i>=.5&&i<1&&(a=e/(2*(1-i))),[t[0],100*a,100*i]},a.hcg.hwb=function(t){var e=t[1]/100,n=t[2]/100,i=e+n*(1-e);return[t[0],100*(i-e),100*(1-i)]},a.hwb.hcg=function(t){var e=t[1]/100,n=t[2]/100,i=1-n,a=i-e,r=0;return a<1&&(r=(i-a)/(1-a)),[t[0],100*a,100*r]},a.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},a.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},a.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},a.gray.hsl=a.gray.hsv=function(t){return[0,0,t[0]]},a.gray.hwb=function(t){return[0,100,t[0]]},a.gray.cmyk=function(t){return[0,0,0,t[0]]},a.gray.lab=function(t){return[t[0],0,0]},a.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),n=(e<<16)+(e<<8)+e,i=n.toString(16).toUpperCase();return"000000".substring(i.length)+i},a.rgb.gray=function(t){var e=(t[0]+t[1]+t[2])/3;return[e/255*100]}}));a.rgb,a.hsl,a.hsv,a.hwb,a.cmyk,a.xyz,a.lab,a.lch,a.hex,a.keyword,a.ansi16,a.ansi256,a.hcg,a.apple,a.gray;function r(){for(var t={},e=Object.keys(a),n=e.length,i=0;i<n;i++)t[e[i]]={distance:-1,parent:null};return t}function o(t){var e=r(),n=[t];e[t].distance=0;while(n.length)for(var i=n.pop(),o=Object.keys(a[i]),s=o.length,l=0;l<s;l++){var u=o[l],c=e[u];-1===c.distance&&(c.distance=e[i].distance+1,c.parent=i,n.unshift(u))}return e}function s(t,e){return function(n){return e(t(n))}}function l(t,e){var n=[e[t].parent,t],i=a[e[t].parent][t],r=e[t].parent;while(e[r].parent)n.unshift(e[r].parent),i=s(a[e[r].parent][r],i),r=e[r].parent;return i.conversion=n,i}var u=function(t){for(var e=o(t),n={},i=Object.keys(e),a=i.length,r=0;r<a;r++){var s=i[r],u=e[s];null!==u.parent&&(n[s]=l(s,e))}return n},c={},d=Object.keys(a);function h(t){var e=function(e){return void 0===e||null===e?e:(arguments.length>1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}function f(t){var e=function(e){if(void 0===e||null===e)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var n=t(e);if("object"===typeof n)for(var i=n.length,a=0;a<i;a++)n[a]=Math.round(n[a]);return n};return"conversion"in t&&(e.conversion=t.conversion),e}d.forEach((function(t){c[t]={},Object.defineProperty(c[t],"channels",{value:a[t].channels}),Object.defineProperty(c[t],"labels",{value:a[t].labels});var e=u(t),n=Object.keys(e);n.forEach((function(n){var i=e[n];c[t][n]=f(i),c[t][n].raw=h(i)}))}));var g=c,p={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]},m={getRgba:v,getHsla:b,getRgb:x,getHsl:_,getHwb:y,getAlpha:w,hexString:k,rgbString:M,rgbaString:C,percentString:S,percentaString:P,hslString:D,hslaString:A,hwbString:T,keyword:O};function v(t){if(t){var e=/^#([a-fA-F0-9]{3,4})$/i,n=/^#([a-fA-F0-9]{6}([a-fA-F0-9]{2})?)$/i,i=/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i,a=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i,r=/(\w+)/,o=[0,0,0],s=1,l=t.match(e),u="";if(l){l=l[1],u=l[3];for(var c=0;c<o.length;c++)o[c]=parseInt(l[c]+l[c],16);u&&(s=Math.round(parseInt(u+u,16)/255*100)/100)}else if(l=t.match(n)){u=l[2],l=l[1];for(c=0;c<o.length;c++)o[c]=parseInt(l.slice(2*c,2*c+2),16);u&&(s=Math.round(parseInt(u,16)/255*100)/100)}else if(l=t.match(i)){for(c=0;c<o.length;c++)o[c]=parseInt(l[c+1]);s=parseFloat(l[4])}else if(l=t.match(a)){for(c=0;c<o.length;c++)o[c]=Math.round(2.55*parseFloat(l[c+1]));s=parseFloat(l[4])}else if(l=t.match(r)){if("transparent"==l[1])return[0,0,0,0];if(o=p[l[1]],!o)return}for(c=0;c<o.length;c++)o[c]=I(o[c],0,255);return s=s||0==s?I(s,0,1):1,o[3]=s,o}}function b(t){if(t){var e=/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/,n=t.match(e);if(n){var i=parseFloat(n[4]),a=I(parseInt(n[1]),0,360),r=I(parseFloat(n[2]),0,100),o=I(parseFloat(n[3]),0,100),s=I(isNaN(i)?1:i,0,1);return[a,r,o,s]}}}function y(t){if(t){var e=/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/,n=t.match(e);if(n){var i=parseFloat(n[4]),a=I(parseInt(n[1]),0,360),r=I(parseFloat(n[2]),0,100),o=I(parseFloat(n[3]),0,100),s=I(isNaN(i)?1:i,0,1);return[a,r,o,s]}}}function x(t){var e=v(t);return e&&e.slice(0,3)}function _(t){var e=b(t);return e&&e.slice(0,3)}function w(t){var e=v(t);return e||(e=b(t))||(e=y(t))?e[3]:void 0}function k(t,e){e=void 0!==e&&3===t.length?e:t[3];return"#"+L(t[0])+L(t[1])+L(t[2])+(e>=0&&e<1?L(Math.round(255*e)):"")}function M(t,e){return e<1||t[3]&&t[3]<1?C(t,e):"rgb("+t[0]+", "+t[1]+", "+t[2]+")"}function C(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"rgba("+t[0]+", "+t[1]+", "+t[2]+", "+e+")"}function S(t,e){if(e<1||t[3]&&t[3]<1)return P(t,e);var n=Math.round(t[0]/255*100),i=Math.round(t[1]/255*100),a=Math.round(t[2]/255*100);return"rgb("+n+"%, "+i+"%, "+a+"%)"}function P(t,e){var n=Math.round(t[0]/255*100),i=Math.round(t[1]/255*100),a=Math.round(t[2]/255*100);return"rgba("+n+"%, "+i+"%, "+a+"%, "+(e||t[3]||1)+")"}function D(t,e){return e<1||t[3]&&t[3]<1?A(t,e):"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"}function A(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+e+")"}function T(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+(void 0!==e&&1!==e?", "+e:"")+")"}function O(t){return F[t.slice(0,3)]}function I(t,e,n){return Math.min(Math.max(e,t),n)}function L(t){var e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}var F={};for(var R in p)F[p[R]]=R;var N=function(t){return t instanceof N?t:this instanceof N?(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 t?(e=m.getRgba(t),e?this.setValues("rgb",e):(e=m.getHsla(t))?this.setValues("hsl",e):(e=m.getHwb(t))&&this.setValues("hwb",e)):"object"===typeof t&&(e=t,void 0!==e.r||void 0!==e.red?this.setValues("rgb",e):void 0!==e.l||void 0!==e.lightness?this.setValues("hsl",e):void 0!==e.v||void 0!==e.value?this.setValues("hsv",e):void 0!==e.w||void 0!==e.whiteness?this.setValues("hwb",e):void 0===e.c&&void 0===e.cyan||this.setValues("cmyk",e)))):new N(t);var e};N.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 t=this.values;return 1!==t.alpha?t.hwb.concat([t.alpha]):t.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var t=this.values;return t.rgb.concat([t.alpha])},hslaArray:function(){var t=this.values;return t.hsl.concat([t.alpha])},alpha:function(t){return void 0===t?this.values.alpha:(this.setValues("alpha",t),this)},red:function(t){return this.setChannel("rgb",0,t)},green:function(t){return this.setChannel("rgb",1,t)},blue:function(t){return this.setChannel("rgb",2,t)},hue:function(t){return t&&(t%=360,t=t<0?360+t:t),this.setChannel("hsl",0,t)},saturation:function(t){return this.setChannel("hsl",1,t)},lightness:function(t){return this.setChannel("hsl",2,t)},saturationv:function(t){return this.setChannel("hsv",1,t)},whiteness:function(t){return this.setChannel("hwb",1,t)},blackness:function(t){return this.setChannel("hwb",2,t)},value:function(t){return this.setChannel("hsv",2,t)},cyan:function(t){return this.setChannel("cmyk",0,t)},magenta:function(t){return this.setChannel("cmyk",1,t)},yellow:function(t){return this.setChannel("cmyk",2,t)},black:function(t){return this.setChannel("cmyk",3,t)},hexString:function(){return m.hexString(this.values.rgb)},rgbString:function(){return m.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return m.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return m.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return m.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return m.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return m.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return m.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){var t=this.values.rgb;return t[0]<<16|t[1]<<8|t[2]},luminosity:function(){for(var t=this.values.rgb,e=[],n=0;n<t.length;n++){var i=t[n]/255;e[n]=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),n=t.luminosity();return e>n?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb,e=(299*t[0]+587*t[1]+114*t[2])/1e3;return e<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){var e=this.values.hsl;return e[2]+=e[2]*t,this.setValues("hsl",e),this},darken:function(t){var e=this.values.hsl;return e[2]-=e[2]*t,this.setValues("hsl",e),this},saturate:function(t){var e=this.values.hsl;return e[1]+=e[1]*t,this.setValues("hsl",e),this},desaturate:function(t){var e=this.values.hsl;return e[1]-=e[1]*t,this.setValues("hsl",e),this},whiten:function(t){var e=this.values.hwb;return e[1]+=e[1]*t,this.setValues("hwb",e),this},blacken:function(t){var e=this.values.hwb;return e[2]+=e[2]*t,this.setValues("hwb",e),this},greyscale:function(){var t=this.values.rgb,e=.3*t[0]+.59*t[1]+.11*t[2];return this.setValues("rgb",[e,e,e]),this},clearer:function(t){var e=this.values.alpha;return this.setValues("alpha",e-e*t),this},opaquer:function(t){var e=this.values.alpha;return this.setValues("alpha",e+e*t),this},rotate:function(t){var e=this.values.hsl,n=(e[0]+t)%360;return e[0]=n<0?360+n:n,this.setValues("hsl",e),this},mix:function(t,e){var n=this,i=t,a=void 0===e?.5:e,r=2*a-1,o=n.alpha()-i.alpha(),s=((r*o===-1?r:(r+o)/(1+r*o))+1)/2,l=1-s;return this.rgb(s*n.red()+l*i.red(),s*n.green()+l*i.green(),s*n.blue()+l*i.blue()).alpha(n.alpha()*a+i.alpha()*(1-a))},toJSON:function(){return this.rgb()},clone:function(){var t,e,n=new N,i=this.values,a=n.values;for(var r in i)i.hasOwnProperty(r)&&(t=i[r],e={}.toString.call(t),"[object Array]"===e?a[r]=t.slice(0):"[object Number]"===e?a[r]=t:console.error("unexpected color value:",t));return n}},N.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},N.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},N.prototype.getValues=function(t){for(var e=this.values,n={},i=0;i<t.length;i++)n[t.charAt(i)]=e[t][i];return 1!==e.alpha&&(n.a=e.alpha),n},N.prototype.setValues=function(t,e){var n,i,a=this.values,r=this.spaces,o=this.maxes,s=1;if(this.valid=!0,"alpha"===t)s=e;else if(e.length)a[t]=e.slice(0,t.length),s=e[t.length];else if(void 0!==e[t.charAt(0)]){for(n=0;n<t.length;n++)a[t][n]=e[t.charAt(n)];s=e.a}else if(void 0!==e[r[t][0]]){var l=r[t];for(n=0;n<t.length;n++)a[t][n]=e[l[n]];s=e.alpha}if(a.alpha=Math.max(0,Math.min(1,void 0===s?a.alpha:s)),"alpha"===t)return!1;for(n=0;n<t.length;n++)i=Math.max(0,Math.min(o[t][n],a[t][n])),a[t][n]=Math.round(i);for(var u in r)u!==t&&(a[u]=g[t][u](a[t]));return!0},N.prototype.setSpace=function(t,e){var n=e[0];return void 0===n?this.getValues(t):("number"===typeof n&&(n=Array.prototype.slice.call(e)),this.setValues(t,n),this)},N.prototype.setChannel=function(t,e,n){var i=this.values[t];return void 0===n?i[e]:(n===i[e]||(i[e]=n,this.setValues(t,i)),this)},"undefined"!==typeof window&&(window.Color=N);var E=N;function z(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}var B={noop:function(){},uid:function(){var t=0;return function(){return t++}}(),isNullOrUndef:function(t){return null===t||"undefined"===typeof t},isArray:function(t){if(Array.isArray&&Array.isArray(t))return!0;var e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)},isObject:function(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)},isFinite:function(t){return("number"===typeof t||t instanceof Number)&&isFinite(t)},valueOrDefault:function(t,e){return"undefined"===typeof t?e:t},valueAtIndexOrDefault:function(t,e,n){return B.valueOrDefault(B.isArray(t)?t[e]:t,n)},callback:function(t,e,n){if(t&&"function"===typeof t.call)return t.apply(n,e)},each:function(t,e,n,i){var a,r,o;if(B.isArray(t))if(r=t.length,i)for(a=r-1;a>=0;a--)e.call(n,t[a],a);else for(a=0;a<r;a++)e.call(n,t[a],a);else if(B.isObject(t))for(o=Object.keys(t),r=o.length,a=0;a<r;a++)e.call(n,t[o[a]],o[a])},arrayEquals:function(t,e){var n,i,a,r;if(!t||!e||t.length!==e.length)return!1;for(n=0,i=t.length;n<i;++n)if(a=t[n],r=e[n],a instanceof Array&&r instanceof Array){if(!B.arrayEquals(a,r))return!1}else if(a!==r)return!1;return!0},clone:function(t){if(B.isArray(t))return t.map(B.clone);if(B.isObject(t)){for(var e=Object.create(t),n=Object.keys(t),i=n.length,a=0;a<i;++a)e[n[a]]=B.clone(t[n[a]]);return e}return t},_merger:function(t,e,n,i){if(z(t)){var a=e[t],r=n[t];B.isObject(a)&&B.isObject(r)?B.merge(a,r,i):e[t]=B.clone(r)}},_mergerIf:function(t,e,n){if(z(t)){var i=e[t],a=n[t];B.isObject(i)&&B.isObject(a)?B.mergeIf(i,a):e.hasOwnProperty(t)||(e[t]=B.clone(a))}},merge:function(t,e,n){var i,a,r,o,s,l=B.isArray(e)?e:[e],u=l.length;if(!B.isObject(t))return t;for(n=n||{},i=n.merger||B._merger,a=0;a<u;++a)if(e=l[a],B.isObject(e))for(r=Object.keys(e),s=0,o=r.length;s<o;++s)i(r[s],t,e,n);return t},mergeIf:function(t,e){return B.merge(t,e,{merger:B._mergerIf})},extend:Object.assign||function(t){return B.merge(t,[].slice.call(arguments,1),{merger:function(t,e,n){e[t]=n[t]}})},inherits:function(t){var e=this,n=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return e.apply(this,arguments)},i=function(){this.constructor=n};return i.prototype=e.prototype,n.prototype=new i,n.extend=B.inherits,t&&B.extend(n.prototype,t),n.__super__=e.prototype,n},_deprecated:function(t,e,n,i){void 0!==e&&console.warn(t+': "'+n+'" is deprecated. Please use "'+i+'" instead')}},W=B;B.callCallback=B.callback,B.indexOf=function(t,e,n){return Array.prototype.indexOf.call(t,e,n)},B.getValueOrDefault=B.valueOrDefault,B.getValueAtIndexOrDefault=B.valueAtIndexOrDefault;var V={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-t*(t-2)},easeInOutQuad:function(t){return(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return(t-=1)*t*t+1},easeInOutCubic:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return-((t-=1)*t*t*t-1)},easeInOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return(t-=1)*t*t*t*t+1},easeInOutQuint:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},easeInSine:function(t){return 1-Math.cos(t*(Math.PI/2))},easeOutSine:function(t){return Math.sin(t*(Math.PI/2))},easeInOutSine:function(t){return-.5*(Math.cos(Math.PI*t)-1)},easeInExpo:function(t){return 0===t?0:Math.pow(2,10*(t-1))},easeOutExpo:function(t){return 1===t?1:1-Math.pow(2,-10*t)},easeInOutExpo:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))},easeInCirc:function(t){return t>=1?t:-(Math.sqrt(1-t*t)-1)},easeOutCirc:function(t){return Math.sqrt(1-(t-=1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n))},easeOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/n)+1)},easeInOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:2===(t/=.5)?1:(n||(n=.45),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),t<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*.5+1)},easeInBack:function(t){var e=1.70158;return t*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:function(t){return 1-V.easeOutBounce(1-t)},easeOutBounce:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:function(t){return t<.5?.5*V.easeInBounce(2*t):.5*V.easeOutBounce(2*t-1)+.5}},H={effects:V};W.easingEffects=V;var j=Math.PI,q=j/180,U=2*j,Y=j/2,$=j/4,G=2*j/3,X={clear:function(t){t.ctx.clearRect(0,0,t.width,t.height)},roundedRect:function(t,e,n,i,a,r){if(r){var o=Math.min(r,a/2,i/2),s=e+o,l=n+o,u=e+i-o,c=n+a-o;t.moveTo(e,l),s<u&&l<c?(t.arc(s,l,o,-j,-Y),t.arc(u,l,o,-Y,0),t.arc(u,c,o,0,Y),t.arc(s,c,o,Y,j)):s<u?(t.moveTo(s,n),t.arc(u,l,o,-Y,Y),t.arc(s,l,o,Y,j+Y)):l<c?(t.arc(s,l,o,-j,0),t.arc(s,c,o,0,j)):t.arc(s,l,o,-j,j),t.closePath(),t.moveTo(e,n)}else t.rect(e,n,i,a)},drawPoint:function(t,e,n,i,a,r){var o,s,l,u,c,d=(r||0)*q;if(e&&"object"===typeof e&&(o=e.toString(),"[object HTMLImageElement]"===o||"[object HTMLCanvasElement]"===o))return t.save(),t.translate(i,a),t.rotate(d),t.drawImage(e,-e.width/2,-e.height/2,e.width,e.height),void t.restore();if(!(isNaN(n)||n<=0)){switch(t.beginPath(),e){default:t.arc(i,a,n,0,U),t.closePath();break;case"triangle":t.moveTo(i+Math.sin(d)*n,a-Math.cos(d)*n),d+=G,t.lineTo(i+Math.sin(d)*n,a-Math.cos(d)*n),d+=G,t.lineTo(i+Math.sin(d)*n,a-Math.cos(d)*n),t.closePath();break;case"rectRounded":c=.516*n,u=n-c,s=Math.cos(d+$)*u,l=Math.sin(d+$)*u,t.arc(i-s,a-l,c,d-j,d-Y),t.arc(i+l,a-s,c,d-Y,d),t.arc(i+s,a+l,c,d,d+Y),t.arc(i-l,a+s,c,d+Y,d+j),t.closePath();break;case"rect":if(!r){u=Math.SQRT1_2*n,t.rect(i-u,a-u,2*u,2*u);break}d+=$;case"rectRot":s=Math.cos(d)*n,l=Math.sin(d)*n,t.moveTo(i-s,a-l),t.lineTo(i+l,a-s),t.lineTo(i+s,a+l),t.lineTo(i-l,a+s),t.closePath();break;case"crossRot":d+=$;case"cross":s=Math.cos(d)*n,l=Math.sin(d)*n,t.moveTo(i-s,a-l),t.lineTo(i+s,a+l),t.moveTo(i+l,a-s),t.lineTo(i-l,a+s);break;case"star":s=Math.cos(d)*n,l=Math.sin(d)*n,t.moveTo(i-s,a-l),t.lineTo(i+s,a+l),t.moveTo(i+l,a-s),t.lineTo(i-l,a+s),d+=$,s=Math.cos(d)*n,l=Math.sin(d)*n,t.moveTo(i-s,a-l),t.lineTo(i+s,a+l),t.moveTo(i+l,a-s),t.lineTo(i-l,a+s);break;case"line":s=Math.cos(d)*n,l=Math.sin(d)*n,t.moveTo(i-s,a-l),t.lineTo(i+s,a+l);break;case"dash":t.moveTo(i,a),t.lineTo(i+Math.cos(d)*n,a+Math.sin(d)*n);break}t.fill(),t.stroke()}},_isPointInArea:function(t,e){var n=1e-6;return t.x>e.left-n&&t.x<e.right+n&&t.y>e.top-n&&t.y<e.bottom+n},clipArea:function(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()},unclipArea:function(t){t.restore()},lineTo:function(t,e,n,i){var a=n.steppedLine;if(a){if("middle"===a){var r=(e.x+n.x)/2;t.lineTo(r,i?n.y:e.y),t.lineTo(r,i?e.y:n.y)}else"after"===a&&!i||"after"!==a&&i?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y);t.lineTo(n.x,n.y)}else n.tension?t.bezierCurveTo(i?e.controlPointPreviousX:e.controlPointNextX,i?e.controlPointPreviousY:e.controlPointNextY,i?n.controlPointNextX:n.controlPointPreviousX,i?n.controlPointNextY:n.controlPointPreviousY,n.x,n.y):t.lineTo(n.x,n.y)}},K=X;W.clear=X.clear,W.drawRoundedRectangle=function(t){t.beginPath(),X.roundedRect.apply(X,arguments)};var Z={_set:function(t,e){return W.merge(this[t]||(this[t]={}),e)}};Z._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 J=Z,Q=W.valueOrDefault;function tt(t){return!t||W.isNullOrUndef(t.size)||W.isNullOrUndef(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}var et={toLineHeight:function(t,e){var n=(""+t).match(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/);if(!n||"normal"===n[1])return 1.2*e;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100;break}return e*t},toPadding:function(t){var e,n,i,a;return W.isObject(t)?(e=+t.top||0,n=+t.right||0,i=+t.bottom||0,a=+t.left||0):e=n=i=a=+t||0,{top:e,right:n,bottom:i,left:a,height:e+i,width:a+n}},_parseFont:function(t){var e=J.global,n=Q(t.fontSize,e.defaultFontSize),i={family:Q(t.fontFamily,e.defaultFontFamily),lineHeight:W.options.toLineHeight(Q(t.lineHeight,e.defaultLineHeight),n),size:n,style:Q(t.fontStyle,e.defaultFontStyle),weight:null,string:""};return i.string=tt(i),i},resolve:function(t,e,n,i){var a,r,o,s=!0;for(a=0,r=t.length;a<r;++a)if(o=t[a],void 0!==o&&(void 0!==e&&"function"===typeof o&&(o=o(e),s=!1),void 0!==n&&W.isArray(o)&&(o=o[n],s=!1),void 0!==o))return i&&!s&&(i.cacheable=!1),o}},nt={_factorize:function(t){var e,n=[],i=Math.sqrt(t);for(e=1;e<i;e++)t%e===0&&(n.push(e),n.push(t/e));return i===(0|i)&&n.push(i),n.sort((function(t,e){return t-e})).pop(),n},log10:Math.log10||function(t){var e=Math.log(t)*Math.LOG10E,n=Math.round(e),i=t===Math.pow(10,n);return i?n:e}},it=nt;W.log10=nt.log10;var at=function(t,e){return{x:function(n){return t+t+e-n},setWidth:function(t){e=t},textAlign:function(t){return"center"===t?t:"right"===t?"left":"right"},xPlus:function(t,e){return t-e},leftForLtr:function(t,e){return t-e}}},rt=function(){return{x:function(t){return t},setWidth:function(t){},textAlign:function(t){return t},xPlus:function(t,e){return t+e},leftForLtr:function(t,e){return t}}},ot=function(t,e,n){return t?at(e,n):rt()},st=function(t,e){var n,i;"ltr"!==e&&"rtl"!==e||(n=t.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=i)},lt=function(t){var e=t.prevTextDirection;void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))},ut={getRtlAdapter:ot,overrideTextDirection:st,restoreTextDirection:lt},ct=W,dt=H,ht=K,ft=et,gt=it,pt=ut;function mt(t,e,n,i){var a,r,o,s,l,u,c,d,h,f=Object.keys(n);for(a=0,r=f.length;a<r;++a)if(o=f[a],u=n[o],e.hasOwnProperty(o)||(e[o]=u),s=e[o],s!==u&&"_"!==o[0]){if(t.hasOwnProperty(o)||(t[o]=s),l=t[o],c=typeof u,c===typeof l)if("string"===c){if(d=E(l),d.valid&&(h=E(u),h.valid)){e[o]=h.mix(d,i).rgbString();continue}}else if(ct.isFinite(l)&&ct.isFinite(u)){e[o]=l+(u-l)*i;continue}e[o]=u}}ct.easing=dt,ct.canvas=ht,ct.options=ft,ct.math=gt,ct.rtl=pt;var vt=function(t){ct.extend(this,t),this.initialize.apply(this,arguments)};ct.extend(vt.prototype,{_type:void 0,initialize:function(){this.hidden=!1},pivot:function(){var t=this;return t._view||(t._view=ct.extend({},t._model)),t._start={},t},transition:function(t){var e=this,n=e._model,i=e._start,a=e._view;return n&&1!==t?(a||(a=e._view={}),i||(i=e._start={}),mt(i,a,n,t),e):(e._view=ct.extend({},n),e._start=null,e)},tooltipPosition:function(){return{x:this._model.x,y:this._model.y}},hasValue:function(){return ct.isNumber(this._model.x)&&ct.isNumber(this._model.y)}}),vt.extend=ct.inherits;var bt=vt,yt=bt.extend({chart:null,currentStep:0,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),xt=yt;Object.defineProperty(yt.prototype,"animationObject",{get:function(){return this}}),Object.defineProperty(yt.prototype,"chartInstance",{get:function(){return this.chart},set:function(t){this.chart=t}}),J._set("global",{animation:{duration:1e3,easing:"easeOutQuart",onProgress:ct.noop,onComplete:ct.noop}});var _t={animations:[],request:null,addAnimation:function(t,e,n,i){var a,r,o=this.animations;for(e.chart=t,e.startTime=Date.now(),e.duration=n,i||(t.animating=!0),a=0,r=o.length;a<r;++a)if(o[a].chart===t)return void(o[a]=e);o.push(e),1===o.length&&this.requestAnimationFrame()},cancelAnimation:function(t){var e=ct.findIndex(this.animations,(function(e){return e.chart===t}));-1!==e&&(this.animations.splice(e,1),t.animating=!1)},requestAnimationFrame:function(){var t=this;null===t.request&&(t.request=ct.requestAnimFrame.call(window,(function(){t.request=null,t.startDigest()})))},startDigest:function(){var t=this;t.advance(),t.animations.length>0&&t.requestAnimationFrame()},advance:function(){var t,e,n,i,a=this.animations,r=0;while(r<a.length)t=a[r],e=t.chart,n=t.numSteps,i=Math.floor((Date.now()-t.startTime)/t.duration*n)+1,t.currentStep=Math.min(i,n),ct.callback(t.render,[e,t],e),ct.callback(t.onAnimationProgress,[t],e),t.currentStep>=n?(ct.callback(t.onAnimationComplete,[t],e),e.animating=!1,a.splice(r,1)):++r}},wt=ct.options.resolve,kt=["push","pop","shift","splice","unshift"];function Mt(t,e){t._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),kt.forEach((function(e){var n="onData"+e.charAt(0).toUpperCase()+e.slice(1),i=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:function(){var e=Array.prototype.slice.call(arguments),a=i.apply(this,e);return ct.each(t._chartjs.listeners,(function(t){"function"===typeof t[n]&&t[n].apply(t,e)})),a}})})))}function Ct(t,e){var n=t._chartjs;if(n){var i=n.listeners,a=i.indexOf(e);-1!==a&&i.splice(a,1),i.length>0||(kt.forEach((function(e){delete t[e]})),delete t._chartjs)}}var St=function(t,e){this.initialize(t,e)};ct.extend(St.prototype,{datasetElementType:null,dataElementType:null,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth"],_dataElementOptions:["backgroundColor","borderColor","borderWidth","pointStyle"],initialize:function(t,e){var n=this;n.chart=t,n.index=e,n.linkScales(),n.addElements(),n._type=n.getMeta().type},updateIndex:function(t){this.index=t},linkScales:function(){var t=this,e=t.getMeta(),n=t.chart,i=n.scales,a=t.getDataset(),r=n.options.scales;null!==e.xAxisID&&e.xAxisID in i&&!a.xAxisID||(e.xAxisID=a.xAxisID||r.xAxes[0].id),null!==e.yAxisID&&e.yAxisID in i&&!a.yAxisID||(e.yAxisID=a.yAxisID||r.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(t){return this.chart.scales[t]},_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&&Ct(this._data,this)},createMetaDataset:function(){var t=this,e=t.datasetElementType;return e&&new e({_chart:t.chart,_datasetIndex:t.index})},createMetaData:function(t){var e=this,n=e.dataElementType;return n&&new n({_chart:e.chart,_datasetIndex:e.index,_index:t})},addElements:function(){var t,e,n=this,i=n.getMeta(),a=n.getDataset().data||[],r=i.data;for(t=0,e=a.length;t<e;++t)r[t]=r[t]||n.createMetaData(t);i.dataset=i.dataset||n.createMetaDataset()},addElementAndReset:function(t){var e=this.createMetaData(t);this.getMeta().data.splice(t,0,e),this.updateElement(e,t,!0)},buildOrUpdateElements:function(){var t=this,e=t.getDataset(),n=e.data||(e.data=[]);t._data!==n&&(t._data&&Ct(t._data,t),n&&Object.isExtensible(n)&&Mt(n,t),t._data=n),t.resyncElements()},_configure:function(){var t=this;t._config=ct.merge(Object.create(null),[t.chart.options.datasets[t._type],t.getDataset()],{merger:function(t,e,n){"_meta"!==t&&"data"!==t&&ct._merger(t,e,n)}})},_update:function(t){var e=this;e._configure(),e._cachedDataOpts=null,e.update(t)},update:ct.noop,transition:function(t){for(var e=this.getMeta(),n=e.data||[],i=n.length,a=0;a<i;++a)n[a].transition(t);e.dataset&&e.dataset.transition(t)},draw:function(){var t=this.getMeta(),e=t.data||[],n=e.length,i=0;for(t.dataset&&t.dataset.draw();i<n;++i)e[i].draw()},getStyle:function(t){var e,n=this,i=n.getMeta(),a=i.dataset;return n._configure(),a&&void 0===t?e=n._resolveDatasetElementOptions(a||{}):(t=t||0,e=n._resolveDataElementOptions(i.data[t]||{},t)),!1!==e.fill&&null!==e.fill||(e.backgroundColor=e.borderColor),e},_resolveDatasetElementOptions:function(t,e){var n,i,a,r,o=this,s=o.chart,l=o._config,u=t.custom||{},c=s.options.elements[o.datasetElementType.prototype._type]||{},d=o._datasetElementOptions,h={},f={chart:s,dataset:o.getDataset(),datasetIndex:o.index,hover:e};for(n=0,i=d.length;n<i;++n)a=d[n],r=e?"hover"+a.charAt(0).toUpperCase()+a.slice(1):a,h[a]=wt([u[r],l[r],c[r]],f);return h},_resolveDataElementOptions:function(t,e){var n=this,i=t&&t.custom,a=n._cachedDataOpts;if(a&&!i)return a;var r,o,s,l,u=n.chart,c=n._config,d=u.options.elements[n.dataElementType.prototype._type]||{},h=n._dataElementOptions,f={},g={chart:u,dataIndex:e,dataset:n.getDataset(),datasetIndex:n.index},p={cacheable:!i};if(i=i||{},ct.isArray(h))for(o=0,s=h.length;o<s;++o)l=h[o],f[l]=wt([i[l],c[l],d[l]],g,e,p);else for(r=Object.keys(h),o=0,s=r.length;o<s;++o)l=r[o],f[l]=wt([i[l],c[h[l]],c[l],d[l]],g,e,p);return p.cacheable&&(n._cachedDataOpts=Object.freeze(f)),f},removeHoverStyle:function(t){ct.merge(t._model,t.$previousStyle||{}),delete t.$previousStyle},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t._index,i=t.custom||{},a=t._model,r=ct.getHoverColor;t.$previousStyle={backgroundColor:a.backgroundColor,borderColor:a.borderColor,borderWidth:a.borderWidth},a.backgroundColor=wt([i.hoverBackgroundColor,e.hoverBackgroundColor,r(a.backgroundColor)],void 0,n),a.borderColor=wt([i.hoverBorderColor,e.hoverBorderColor,r(a.borderColor)],void 0,n),a.borderWidth=wt([i.hoverBorderWidth,e.hoverBorderWidth,a.borderWidth],void 0,n)},_removeDatasetHoverStyle:function(){var t=this.getMeta().dataset;t&&this.removeHoverStyle(t)},_setDatasetHoverStyle:function(){var t,e,n,i,a,r,o=this.getMeta().dataset,s={};if(o){for(r=o._model,a=this._resolveDatasetElementOptions(o,!0),i=Object.keys(a),t=0,e=i.length;t<e;++t)n=i[t],s[n]=r[n],r[n]=a[n];o.$previousStyle=s}},resyncElements:function(){var t=this,e=t.getMeta(),n=t.getDataset().data,i=e.data.length,a=n.length;a<i?e.data.splice(a,i-a):a>i&&t.insertElements(i,a-i)},insertElements:function(t,e){for(var n=0;n<e;++n)this.addElementAndReset(t+n)},onDataPush:function(){var t=arguments.length;this.insertElements(this.getDataset().data.length-t,t)},onDataPop:function(){this.getMeta().data.pop()},onDataShift:function(){this.getMeta().data.shift()},onDataSplice:function(t,e){this.getMeta().data.splice(t,e),this.insertElements(t,arguments.length-2)},onDataUnshift:function(){this.insertElements(0,arguments.length)}}),St.extend=ct.inherits;var Pt=St,Dt=2*Math.PI;function At(t,e){var n=e.startAngle,i=e.endAngle,a=e.pixelMargin,r=a/e.outerRadius,o=e.x,s=e.y;t.beginPath(),t.arc(o,s,e.outerRadius,n-r,i+r),e.innerRadius>a?(r=a/e.innerRadius,t.arc(o,s,e.innerRadius-a,i+r,n-r,!0)):t.arc(o,s,a,i+Math.PI/2,n-Math.PI/2),t.closePath(),t.clip()}function Tt(t,e,n,i){var a,r=n.endAngle;for(i&&(n.endAngle=n.startAngle+Dt,At(t,n),n.endAngle=r,n.endAngle===n.startAngle&&n.fullCircles&&(n.endAngle+=Dt,n.fullCircles--)),t.beginPath(),t.arc(n.x,n.y,n.innerRadius,n.startAngle+Dt,n.startAngle,!0),a=0;a<n.fullCircles;++a)t.stroke();for(t.beginPath(),t.arc(n.x,n.y,e.outerRadius,n.startAngle,n.startAngle+Dt),a=0;a<n.fullCircles;++a)t.stroke()}function Ot(t,e,n){var i="inner"===e.borderAlign;i?(t.lineWidth=2*e.borderWidth,t.lineJoin="round"):(t.lineWidth=e.borderWidth,t.lineJoin="bevel"),n.fullCircles&&Tt(t,e,n,i),i&&At(t,n),t.beginPath(),t.arc(n.x,n.y,e.outerRadius,n.startAngle,n.endAngle),t.arc(n.x,n.y,n.innerRadius,n.endAngle,n.startAngle,!0),t.closePath(),t.stroke()}J._set("global",{elements:{arc:{backgroundColor:J.global.defaultColor,borderColor:"#fff",borderWidth:2,borderAlign:"center"}}});var It=bt.extend({_type:"arc",inLabelRange:function(t){var e=this._view;return!!e&&Math.pow(t-e.x,2)<Math.pow(e.radius+e.hoverRadius,2)},inRange:function(t,e){var n=this._view;if(n){var i=ct.getAngleFromPoint(n,{x:t,y:e}),a=i.angle,r=i.distance,o=n.startAngle,s=n.endAngle;while(s<o)s+=Dt;while(a>s)a-=Dt;while(a<o)a+=Dt;var l=a>=o&&a<=s,u=r>=n.innerRadius&&r<=n.outerRadius;return l&&u}return!1},getCenterPoint:function(){var t=this._view,e=(t.startAngle+t.endAngle)/2,n=(t.innerRadius+t.outerRadius)/2;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},getArea:function(){var t=this._view;return Math.PI*((t.endAngle-t.startAngle)/(2*Math.PI))*(Math.pow(t.outerRadius,2)-Math.pow(t.innerRadius,2))},tooltipPosition:function(){var t=this._view,e=t.startAngle+(t.endAngle-t.startAngle)/2,n=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},draw:function(){var t,e=this._chart.ctx,n=this._view,i="inner"===n.borderAlign?.33:0,a={x:n.x,y:n.y,innerRadius:n.innerRadius,outerRadius:Math.max(n.outerRadius-i,0),pixelMargin:i,startAngle:n.startAngle,endAngle:n.endAngle,fullCircles:Math.floor(n.circumference/Dt)};if(e.save(),e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,a.fullCircles){for(a.endAngle=a.startAngle+Dt,e.beginPath(),e.arc(a.x,a.y,a.outerRadius,a.startAngle,a.endAngle),e.arc(a.x,a.y,a.innerRadius,a.endAngle,a.startAngle,!0),e.closePath(),t=0;t<a.fullCircles;++t)e.fill();a.endAngle=a.startAngle+n.circumference%Dt}e.beginPath(),e.arc(a.x,a.y,a.outerRadius,a.startAngle,a.endAngle),e.arc(a.x,a.y,a.innerRadius,a.endAngle,a.startAngle,!0),e.closePath(),e.fill(),n.borderWidth&&Ot(e,n,a),e.restore()}}),Lt=ct.valueOrDefault,Ft=J.global.defaultColor;J._set("global",{elements:{line:{tension:.4,backgroundColor:Ft,borderWidth:3,borderColor:Ft,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",capBezierPoints:!0,fill:!0}}});var Rt=bt.extend({_type:"line",draw:function(){var t,e,n,i=this,a=i._view,r=i._chart.ctx,o=a.spanGaps,s=i._children.slice(),l=J.global,u=l.elements.line,c=-1,d=i._loop;if(s.length){if(i._loop){for(t=0;t<s.length;++t)if(e=ct.previousItem(s,t),!s[t]._view.skip&&e._view.skip){s=s.slice(t).concat(s.slice(0,t)),d=o;break}d&&s.push(s[0])}for(r.save(),r.lineCap=a.borderCapStyle||u.borderCapStyle,r.setLineDash&&r.setLineDash(a.borderDash||u.borderDash),r.lineDashOffset=Lt(a.borderDashOffset,u.borderDashOffset),r.lineJoin=a.borderJoinStyle||u.borderJoinStyle,r.lineWidth=Lt(a.borderWidth,u.borderWidth),r.strokeStyle=a.borderColor||l.defaultColor,r.beginPath(),n=s[0]._view,n.skip||(r.moveTo(n.x,n.y),c=0),t=1;t<s.length;++t)n=s[t]._view,e=-1===c?ct.previousItem(s,t):s[c],n.skip||(c!==t-1&&!o||-1===c?r.moveTo(n.x,n.y):ct.canvas.lineTo(r,e._view,n),c=t);d&&r.closePath(),r.stroke(),r.restore()}}}),Nt=ct.valueOrDefault,Et=J.global.defaultColor;function zt(t){var e=this._view;return!!e&&Math.abs(t-e.x)<e.radius+e.hitRadius}function Bt(t){var e=this._view;return!!e&&Math.abs(t-e.y)<e.radius+e.hitRadius}J._set("global",{elements:{point:{radius:3,pointStyle:"circle",backgroundColor:Et,borderColor:Et,borderWidth:1,hitRadius:1,hoverRadius:4,hoverBorderWidth:1}}});var Wt=bt.extend({_type:"point",inRange:function(t,e){var n=this._view;return!!n&&Math.pow(t-n.x,2)+Math.pow(e-n.y,2)<Math.pow(n.hitRadius+n.radius,2)},inLabelRange:zt,inXRange:zt,inYRange:Bt,getCenterPoint:function(){var t=this._view;return{x:t.x,y:t.y}},getArea:function(){return Math.PI*Math.pow(this._view.radius,2)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y,padding:t.radius+t.borderWidth}},draw:function(t){var e=this._view,n=this._chart.ctx,i=e.pointStyle,a=e.rotation,r=e.radius,o=e.x,s=e.y,l=J.global,u=l.defaultColor;e.skip||(void 0===t||ct.canvas._isPointInArea(e,t))&&(n.strokeStyle=e.borderColor||u,n.lineWidth=Nt(e.borderWidth,l.elements.point.borderWidth),n.fillStyle=e.backgroundColor||u,ct.canvas.drawPoint(n,i,r,o,s,a))}}),Vt=J.global.defaultColor;function Ht(t){return t&&void 0!==t.width}function jt(t){var e,n,i,a,r;return Ht(t)?(r=t.width/2,e=t.x-r,n=t.x+r,i=Math.min(t.y,t.base),a=Math.max(t.y,t.base)):(r=t.height/2,e=Math.min(t.x,t.base),n=Math.max(t.x,t.base),i=t.y-r,a=t.y+r),{left:e,top:i,right:n,bottom:a}}function qt(t,e,n){return t===e?n:t===n?e:t}function Ut(t){var e=t.borderSkipped,n={};return e?(t.horizontal?t.base>t.x&&(e=qt(e,"left","right")):t.base<t.y&&(e=qt(e,"bottom","top")),n[e]=!0,n):n}function Yt(t,e,n){var i,a,r,o,s=t.borderWidth,l=Ut(t);return ct.isObject(s)?(i=+s.top||0,a=+s.right||0,r=+s.bottom||0,o=+s.left||0):i=a=r=o=+s||0,{t:l.top||i<0?0:i>n?n:i,r:l.right||a<0?0:a>e?e:a,b:l.bottom||r<0?0:r>n?n:r,l:l.left||o<0?0:o>e?e:o}}function $t(t){var e=jt(t),n=e.right-e.left,i=e.bottom-e.top,a=Yt(t,n/2,i/2);return{outer:{x:e.left,y:e.top,w:n,h:i},inner:{x:e.left+a.l,y:e.top+a.t,w:n-a.l-a.r,h:i-a.t-a.b}}}function Gt(t,e,n){var i=null===e,a=null===n,r=!(!t||i&&a)&&jt(t);return r&&(i||e>=r.left&&e<=r.right)&&(a||n>=r.top&&n<=r.bottom)}J._set("global",{elements:{rectangle:{backgroundColor:Vt,borderColor:Vt,borderSkipped:"bottom",borderWidth:0}}});var Xt=bt.extend({_type:"rectangle",draw:function(){var t=this._chart.ctx,e=this._view,n=$t(e),i=n.outer,a=n.inner;t.fillStyle=e.backgroundColor,t.fillRect(i.x,i.y,i.w,i.h),i.w===a.w&&i.h===a.h||(t.save(),t.beginPath(),t.rect(i.x,i.y,i.w,i.h),t.clip(),t.fillStyle=e.borderColor,t.rect(a.x,a.y,a.w,a.h),t.fill("evenodd"),t.restore())},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){return Gt(this._view,t,e)},inLabelRange:function(t,e){var n=this._view;return Ht(n)?Gt(n,t,null):Gt(n,null,e)},inXRange:function(t){return Gt(this._view,t,null)},inYRange:function(t){return Gt(this._view,null,t)},getCenterPoint:function(){var t,e,n=this._view;return Ht(n)?(t=n.x,e=(n.y+n.base)/2):(t=(n.x+n.base)/2,e=n.y),{x:t,y:e}},getArea:function(){var t=this._view;return Ht(t)?t.width*Math.abs(t.y-t.base):t.height*Math.abs(t.x-t.base)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y}}}),Kt={},Zt=It,Jt=Rt,Qt=Wt,te=Xt;Kt.Arc=Zt,Kt.Line=Jt,Kt.Point=Qt,Kt.Rectangle=te;var ee=ct._deprecated,ne=ct.valueOrDefault;function ie(t,e){var n,i,a,r,o=t._length;for(a=1,r=e.length;a<r;++a)o=Math.min(o,Math.abs(e[a]-e[a-1]));for(a=0,r=t.getTicks().length;a<r;++a)i=t.getPixelForTick(a),o=a>0?Math.min(o,Math.abs(i-n)):o,n=i;return o}function ae(t,e,n){var i,a,r=n.barThickness,o=e.stackCount,s=e.pixels[t],l=ct.isNullOrUndef(r)?ie(e.scale,e.pixels):-1;return ct.isNullOrUndef(r)?(i=l*n.categoryPercentage,a=n.barPercentage):(i=r*o,a=1),{chunk:i/o,ratio:a,start:s-i/2}}function re(t,e,n){var i,a,r=e.pixels,o=r[t],s=t>0?r[t-1]:null,l=t<r.length-1?r[t+1]:null,u=n.categoryPercentage;return null===s&&(s=o-(null===l?e.end-e.start:l-o)),null===l&&(l=o+o-s),i=o-(o-Math.min(s,l))/2*u,a=Math.abs(l-s)/2*u,{chunk:a/e.stackCount,ratio:n.barPercentage,start:i}}J._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}}),J._set("global",{datasets:{bar:{categoryPercentage:.8,barPercentage:.9}}});var oe=Pt.extend({dataElementType:Kt.Rectangle,_dataElementOptions:["backgroundColor","borderColor","borderSkipped","borderWidth","barPercentage","barThickness","categoryPercentage","maxBarThickness","minBarLength"],initialize:function(){var t,e,n=this;Pt.prototype.initialize.apply(n,arguments),t=n.getMeta(),t.stack=n.getDataset().stack,t.bar=!0,e=n._getIndexScale().options,ee("bar chart",e.barPercentage,"scales.[x/y]Axes.barPercentage","dataset.barPercentage"),ee("bar chart",e.barThickness,"scales.[x/y]Axes.barThickness","dataset.barThickness"),ee("bar chart",e.categoryPercentage,"scales.[x/y]Axes.categoryPercentage","dataset.categoryPercentage"),ee("bar chart",n._getValueScale().options.minBarLength,"scales.[x/y]Axes.minBarLength","dataset.minBarLength"),ee("bar chart",e.maxBarThickness,"scales.[x/y]Axes.maxBarThickness","dataset.maxBarThickness")},update:function(t){var e,n,i=this,a=i.getMeta().data;for(i._ruler=i.getRuler(),e=0,n=a.length;e<n;++e)i.updateElement(a[e],e,t)},updateElement:function(t,e,n){var i=this,a=i.getMeta(),r=i.getDataset(),o=i._resolveDataElementOptions(t,e);t._xScale=i.getScaleForId(a.xAxisID),t._yScale=i.getScaleForId(a.yAxisID),t._datasetIndex=i.index,t._index=e,t._model={backgroundColor:o.backgroundColor,borderColor:o.borderColor,borderSkipped:o.borderSkipped,borderWidth:o.borderWidth,datasetLabel:r.label,label:i.chart.data.labels[e]},ct.isArray(r.data[e])&&(t._model.borderSkipped=null),i._updateElementGeometry(t,e,n,o),t.pivot()},_updateElementGeometry:function(t,e,n,i){var a=this,r=t._model,o=a._getValueScale(),s=o.getBasePixel(),l=o.isHorizontal(),u=a._ruler||a.getRuler(),c=a.calculateBarValuePixels(a.index,e,i),d=a.calculateBarIndexPixels(a.index,e,u,i);r.horizontal=l,r.base=n?s:c.base,r.x=l?n?s:c.head:d.center,r.y=l?d.center:n?s:c.head,r.height=l?d.size:void 0,r.width=l?void 0:d.size},_getStacks:function(t){var e,n,i=this,a=i._getIndexScale(),r=a._getMatchingVisibleMetas(i._type),o=a.options.stacked,s=r.length,l=[];for(e=0;e<s;++e)if(n=r[e],(!1===o||-1===l.indexOf(n.stack)||void 0===o&&void 0===n.stack)&&l.push(n.stack),n.index===t)break;return l},getStackCount:function(){return this._getStacks().length},getStackIndex:function(t,e){var n=this._getStacks(t),i=void 0!==e?n.indexOf(e):-1;return-1===i?n.length-1:i},getRuler:function(){var t,e,n=this,i=n._getIndexScale(),a=[];for(t=0,e=n.getMeta().data.length;t<e;++t)a.push(i.getPixelForValue(null,t,n.index));return{pixels:a,start:i._startPixel,end:i._endPixel,stackCount:n.getStackCount(),scale:i}},calculateBarValuePixels:function(t,e,n){var i,a,r,o,s,l,u,c=this,d=c.chart,h=c._getValueScale(),f=h.isHorizontal(),g=d.data.datasets,p=h._getMatchingVisibleMetas(c._type),m=h._parseValue(g[t].data[e]),v=n.minBarLength,b=h.options.stacked,y=c.getMeta().stack,x=void 0===m.start?0:m.max>=0&&m.min>=0?m.min:m.max,_=void 0===m.start?m.end:m.max>=0&&m.min>=0?m.max-m.min:m.min-m.max,w=p.length;if(b||void 0===b&&void 0!==y)for(i=0;i<w;++i){if(a=p[i],a.index===t)break;a.stack===y&&(u=h._parseValue(g[a.index].data[e]),r=void 0===u.start?u.end:u.min>=0&&u.max>=0?u.max:u.min,(m.min<0&&r<0||m.max>=0&&r>0)&&(x+=r))}return o=h.getPixelForValue(x),s=h.getPixelForValue(x+_),l=s-o,void 0!==v&&Math.abs(l)<v&&(l=v,s=_>=0&&!f||_<0&&f?o-v:o+v),{size:l,base:o,head:s,center:s+l/2}},calculateBarIndexPixels:function(t,e,n,i){var a=this,r="flex"===i.barThickness?re(e,n,i):ae(e,n,i),o=a.getStackIndex(t,a.getMeta().stack),s=r.start+r.chunk*o+r.chunk/2,l=Math.min(ne(i.maxBarThickness,1/0),r.chunk*r.ratio);return{base:s-l/2,head:s+l/2,center:s,size:l}},draw:function(){var t=this,e=t.chart,n=t._getValueScale(),i=t.getMeta().data,a=t.getDataset(),r=i.length,o=0;for(ct.canvas.clipArea(e.ctx,e.chartArea);o<r;++o){var s=n._parseValue(a.data[o]);isNaN(s.min)||isNaN(s.max)||i[o].draw()}ct.canvas.unclipArea(e.ctx)},_resolveDataElementOptions:function(){var t=this,e=ct.extend({},Pt.prototype._resolveDataElementOptions.apply(t,arguments)),n=t._getIndexScale().options,i=t._getValueScale().options;return e.barPercentage=ne(n.barPercentage,e.barPercentage),e.barThickness=ne(n.barThickness,e.barThickness),e.categoryPercentage=ne(n.categoryPercentage,e.categoryPercentage),e.maxBarThickness=ne(n.maxBarThickness,e.maxBarThickness),e.minBarLength=ne(i.minBarLength,e.minBarLength),e}}),se=ct.valueOrDefault,le=ct.options.resolve;J._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(t,e){var n=e.datasets[t.datasetIndex].label||"",i=e.datasets[t.datasetIndex].data[t.index];return n+": ("+t.xLabel+", "+t.yLabel+", "+i.r+")"}}}});var ue=Pt.extend({dataElementType:Kt.Point,_dataElementOptions:["backgroundColor","borderColor","borderWidth","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth","hoverRadius","hitRadius","pointStyle","rotation"],update:function(t){var e=this,n=e.getMeta(),i=n.data;ct.each(i,(function(n,i){e.updateElement(n,i,t)}))},updateElement:function(t,e,n){var i=this,a=i.getMeta(),r=t.custom||{},o=i.getScaleForId(a.xAxisID),s=i.getScaleForId(a.yAxisID),l=i._resolveDataElementOptions(t,e),u=i.getDataset().data[e],c=i.index,d=n?o.getPixelForDecimal(.5):o.getPixelForValue("object"===typeof u?u:NaN,e,c),h=n?s.getBasePixel():s.getPixelForValue(u,e,c);t._xScale=o,t._yScale=s,t._options=l,t._datasetIndex=c,t._index=e,t._model={backgroundColor:l.backgroundColor,borderColor:l.borderColor,borderWidth:l.borderWidth,hitRadius:l.hitRadius,pointStyle:l.pointStyle,rotation:l.rotation,radius:n?0:l.radius,skip:r.skip||isNaN(d)||isNaN(h),x:d,y:h},t.pivot()},setHoverStyle:function(t){var e=t._model,n=t._options,i=ct.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth,radius:e.radius},e.backgroundColor=se(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=se(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=se(n.hoverBorderWidth,n.borderWidth),e.radius=n.radius+n.hoverRadius},_resolveDataElementOptions:function(t,e){var n=this,i=n.chart,a=n.getDataset(),r=t.custom||{},o=a.data[e]||{},s=Pt.prototype._resolveDataElementOptions.apply(n,arguments),l={chart:i,dataIndex:e,dataset:a,datasetIndex:n.index};return n._cachedDataOpts===s&&(s=ct.extend({},s)),s.radius=le([r.radius,o.r,n._config.radius,i.options.elements.point.radius],l,e),s}}),ce=ct.valueOrDefault,de=Math.PI,he=2*de,fe=de/2;J._set("doughnut",{animation:{animateRotate:!0,animateScale:!1},hover:{mode:"single"},legendCallback:function(t){var e,n,i,a,r=document.createElement("ul"),o=t.data,s=o.datasets,l=o.labels;if(r.setAttribute("class",t.id+"-legend"),s.length)for(e=0,n=s[0].data.length;e<n;++e)i=r.appendChild(document.createElement("li")),a=i.appendChild(document.createElement("span")),a.style.backgroundColor=s[0].backgroundColor[e],l[e]&&i.appendChild(document.createTextNode(l[e]));return r.outerHTML},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map((function(n,i){var a=t.getDatasetMeta(0),r=a.controller.getStyle(i);return{text:n,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,hidden:isNaN(e.datasets[0].data[i])||a.data[i].hidden,index:i}})):[]}},onClick:function(t,e){var n,i,a,r=e.index,o=this.chart;for(n=0,i=(o.data.datasets||[]).length;n<i;++n)a=o.getDatasetMeta(n),a.data[r]&&(a.data[r].hidden=!a.data[r].hidden);o.update()}},cutoutPercentage:50,rotation:-fe,circumference:he,tooltips:{callbacks:{title:function(){return""},label:function(t,e){var n=e.labels[t.index],i=": "+e.datasets[t.datasetIndex].data[t.index];return ct.isArray(n)?(n=n.slice(),n[0]+=i):n+=i,n}}}});var ge=Pt.extend({dataElementType:Kt.Arc,linkScales:ct.noop,_dataElementOptions:["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"],getRingIndex:function(t){for(var e=0,n=0;n<t;++n)this.chart.isDatasetVisible(n)&&++e;return e},update:function(t){var e,n,i,a,r=this,o=r.chart,s=o.chartArea,l=o.options,u=1,c=1,d=0,h=0,f=r.getMeta(),g=f.data,p=l.cutoutPercentage/100||0,m=l.circumference,v=r._getRingWeight(r.index);if(m<he){var b=l.rotation%he;b+=b>=de?-he:b<-de?he:0;var y=b+m,x=Math.cos(b),_=Math.sin(b),w=Math.cos(y),k=Math.sin(y),M=b<=0&&y>=0||y>=he,C=b<=fe&&y>=fe||y>=he+fe,S=b===-de||y>=de,P=b<=-fe&&y>=-fe||y>=de+fe,D=S?-1:Math.min(x,x*p,w,w*p),A=P?-1:Math.min(_,_*p,k,k*p),T=M?1:Math.max(x,x*p,w,w*p),O=C?1:Math.max(_,_*p,k,k*p);u=(T-D)/2,c=(O-A)/2,d=-(T+D)/2,h=-(O+A)/2}for(i=0,a=g.length;i<a;++i)g[i]._options=r._resolveDataElementOptions(g[i],i);for(o.borderWidth=r.getMaxBorderWidth(),e=(s.right-s.left-o.borderWidth)/u,n=(s.bottom-s.top-o.borderWidth)/c,o.outerRadius=Math.max(Math.min(e,n)/2,0),o.innerRadius=Math.max(o.outerRadius*p,0),o.radiusLength=(o.outerRadius-o.innerRadius)/(r._getVisibleDatasetWeightTotal()||1),o.offsetX=d*o.outerRadius,o.offsetY=h*o.outerRadius,f.total=r.calculateTotal(),r.outerRadius=o.outerRadius-o.radiusLength*r._getRingWeightOffset(r.index),r.innerRadius=Math.max(r.outerRadius-o.radiusLength*v,0),i=0,a=g.length;i<a;++i)r.updateElement(g[i],i,t)},updateElement:function(t,e,n){var i=this,a=i.chart,r=a.chartArea,o=a.options,s=o.animation,l=(r.left+r.right)/2,u=(r.top+r.bottom)/2,c=o.rotation,d=o.rotation,h=i.getDataset(),f=n&&s.animateRotate||t.hidden?0:i.calculateCircumference(h.data[e])*(o.circumference/he),g=n&&s.animateScale?0:i.innerRadius,p=n&&s.animateScale?0:i.outerRadius,m=t._options||{};ct.extend(t,{_datasetIndex:i.index,_index:e,_model:{backgroundColor:m.backgroundColor,borderColor:m.borderColor,borderWidth:m.borderWidth,borderAlign:m.borderAlign,x:l+a.offsetX,y:u+a.offsetY,startAngle:c,endAngle:d,circumference:f,outerRadius:p,innerRadius:g,label:ct.valueAtIndexOrDefault(h.label,e,a.data.labels[e])}});var v=t._model;n&&s.animateRotate||(v.startAngle=0===e?o.rotation:i.getMeta().data[e-1]._model.endAngle,v.endAngle=v.startAngle+v.circumference),t.pivot()},calculateTotal:function(){var t,e=this.getDataset(),n=this.getMeta(),i=0;return ct.each(n.data,(function(n,a){t=e.data[a],isNaN(t)||n.hidden||(i+=Math.abs(t))})),i},calculateCircumference:function(t){var e=this.getMeta().total;return e>0&&!isNaN(t)?he*(Math.abs(t)/e):0},getMaxBorderWidth:function(t){var e,n,i,a,r,o,s,l,u=this,c=0,d=u.chart;if(!t)for(e=0,n=d.data.datasets.length;e<n;++e)if(d.isDatasetVisible(e)){i=d.getDatasetMeta(e),t=i.data,e!==u.index&&(r=i.controller);break}if(!t)return 0;for(e=0,n=t.length;e<n;++e)a=t[e],r?(r._configure(),o=r._resolveDataElementOptions(a,e)):o=a._options,"inner"!==o.borderAlign&&(s=o.borderWidth,l=o.hoverBorderWidth,c=s>c?s:c,c=l>c?l:c);return c},setHoverStyle:function(t){var e=t._model,n=t._options,i=ct.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth},e.backgroundColor=ce(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=ce(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=ce(n.hoverBorderWidth,n.borderWidth)},_getRingWeightOffset:function(t){for(var e=0,n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(e+=this._getRingWeight(n));return e},_getRingWeight:function(t){return Math.max(ce(this.chart.data.datasets[t].weight,1),0)},_getVisibleDatasetWeightTotal:function(){return this._getRingWeightOffset(this.chart.data.datasets.length)}});J._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"}}),J._set("global",{datasets:{horizontalBar:{categoryPercentage:.8,barPercentage:.9}}});var pe=oe.extend({_getValueScaleId:function(){return this.getMeta().xAxisID},_getIndexScaleId:function(){return this.getMeta().yAxisID}}),me=ct.valueOrDefault,ve=ct.options.resolve,be=ct.canvas._isPointInArea;function ye(t,e){var n=t&&t.options.ticks||{},i=n.reverse,a=void 0===n.min?e:0,r=void 0===n.max?e:0;return{start:i?r:a,end:i?a:r}}function xe(t,e,n){var i=n/2,a=ye(t,i),r=ye(e,i);return{top:r.end,right:a.end,bottom:r.start,left:a.start}}function _e(t){var e,n,i,a;return ct.isObject(t)?(e=t.top,n=t.right,i=t.bottom,a=t.left):e=n=i=a=t,{top:e,right:n,bottom:i,left:a}}J._set("line",{showLines:!0,spanGaps:!1,hover:{mode:"label"},scales:{xAxes:[{type:"category",id:"x-axis-0"}],yAxes:[{type:"linear",id:"y-axis-0"}]}});var we=Pt.extend({datasetElementType:Kt.Line,dataElementType:Kt.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(t){var e,n,i=this,a=i.getMeta(),r=a.dataset,o=a.data||[],s=i.chart.options,l=i._config,u=i._showLine=me(l.showLine,s.showLines);for(i._xScale=i.getScaleForId(a.xAxisID),i._yScale=i.getScaleForId(a.yAxisID),u&&(void 0!==l.tension&&void 0===l.lineTension&&(l.lineTension=l.tension),r._scale=i._yScale,r._datasetIndex=i.index,r._children=o,r._model=i._resolveDatasetElementOptions(r),r.pivot()),e=0,n=o.length;e<n;++e)i.updateElement(o[e],e,t);for(u&&0!==r._model.tension&&i.updateBezierControlPoints(),e=0,n=o.length;e<n;++e)o[e].pivot()},updateElement:function(t,e,n){var i,a,r=this,o=r.getMeta(),s=t.custom||{},l=r.getDataset(),u=r.index,c=l.data[e],d=r._xScale,h=r._yScale,f=o.dataset._model,g=r._resolveDataElementOptions(t,e);i=d.getPixelForValue("object"===typeof c?c:NaN,e,u),a=n?h.getBasePixel():r.calculatePointY(c,e,u),t._xScale=d,t._yScale=h,t._options=g,t._datasetIndex=u,t._index=e,t._model={x:i,y:a,skip:s.skip||isNaN(i)||isNaN(a),radius:g.radius,pointStyle:g.pointStyle,rotation:g.rotation,backgroundColor:g.backgroundColor,borderColor:g.borderColor,borderWidth:g.borderWidth,tension:me(s.tension,f?f.tension:0),steppedLine:!!f&&f.steppedLine,hitRadius:g.hitRadius}},_resolveDatasetElementOptions:function(t){var e=this,n=e._config,i=t.custom||{},a=e.chart.options,r=a.elements.line,o=Pt.prototype._resolveDatasetElementOptions.apply(e,arguments);return o.spanGaps=me(n.spanGaps,a.spanGaps),o.tension=me(n.lineTension,r.tension),o.steppedLine=ve([i.steppedLine,n.steppedLine,r.stepped]),o.clip=_e(me(n.clip,xe(e._xScale,e._yScale,o.borderWidth))),o},calculatePointY:function(t,e,n){var i,a,r,o,s,l,u,c=this,d=c.chart,h=c._yScale,f=0,g=0;if(h.options.stacked){for(s=+h.getRightValue(t),l=d._getSortedVisibleDatasetMetas(),u=l.length,i=0;i<u;++i){if(r=l[i],r.index===n)break;a=d.data.datasets[r.index],"line"===r.type&&r.yAxisID===h.id&&(o=+h.getRightValue(a.data[e]),o<0?g+=o||0:f+=o||0)}return s<0?h.getPixelForValue(g+s):h.getPixelForValue(f+s)}return h.getPixelForValue(t)},updateBezierControlPoints:function(){var t,e,n,i,a=this,r=a.chart,o=a.getMeta(),s=o.dataset._model,l=r.chartArea,u=o.data||[];function c(t,e,n){return Math.max(Math.min(t,n),e)}if(s.spanGaps&&(u=u.filter((function(t){return!t._model.skip}))),"monotone"===s.cubicInterpolationMode)ct.splineCurveMonotone(u);else for(t=0,e=u.length;t<e;++t)n=u[t]._model,i=ct.splineCurve(ct.previousItem(u,t)._model,n,ct.nextItem(u,t)._model,s.tension),n.controlPointPreviousX=i.previous.x,n.controlPointPreviousY=i.previous.y,n.controlPointNextX=i.next.x,n.controlPointNextY=i.next.y;if(r.options.elements.line.capBezierPoints)for(t=0,e=u.length;t<e;++t)n=u[t]._model,be(n,l)&&(t>0&&be(u[t-1]._model,l)&&(n.controlPointPreviousX=c(n.controlPointPreviousX,l.left,l.right),n.controlPointPreviousY=c(n.controlPointPreviousY,l.top,l.bottom)),t<u.length-1&&be(u[t+1]._model,l)&&(n.controlPointNextX=c(n.controlPointNextX,l.left,l.right),n.controlPointNextY=c(n.controlPointNextY,l.top,l.bottom)))},draw:function(){var t,e=this,n=e.chart,i=e.getMeta(),a=i.data||[],r=n.chartArea,o=n.canvas,s=0,l=a.length;for(e._showLine&&(t=i.dataset._model.clip,ct.canvas.clipArea(n.ctx,{left:!1===t.left?0:r.left-t.left,right:!1===t.right?o.width:r.right+t.right,top:!1===t.top?0:r.top-t.top,bottom:!1===t.bottom?o.height:r.bottom+t.bottom}),i.dataset.draw(),ct.canvas.unclipArea(n.ctx));s<l;++s)a[s].draw(r)},setHoverStyle:function(t){var e=t._model,n=t._options,i=ct.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth,radius:e.radius},e.backgroundColor=me(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=me(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=me(n.hoverBorderWidth,n.borderWidth),e.radius=me(n.hoverRadius,n.radius)}}),ke=ct.options.resolve;J._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(t){var e,n,i,a,r=document.createElement("ul"),o=t.data,s=o.datasets,l=o.labels;if(r.setAttribute("class",t.id+"-legend"),s.length)for(e=0,n=s[0].data.length;e<n;++e)i=r.appendChild(document.createElement("li")),a=i.appendChild(document.createElement("span")),a.style.backgroundColor=s[0].backgroundColor[e],l[e]&&i.appendChild(document.createTextNode(l[e]));return r.outerHTML},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map((function(n,i){var a=t.getDatasetMeta(0),r=a.controller.getStyle(i);return{text:n,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,hidden:isNaN(e.datasets[0].data[i])||a.data[i].hidden,index:i}})):[]}},onClick:function(t,e){var n,i,a,r=e.index,o=this.chart;for(n=0,i=(o.data.datasets||[]).length;n<i;++n)a=o.getDatasetMeta(n),a.data[r].hidden=!a.data[r].hidden;o.update()}},tooltips:{callbacks:{title:function(){return""},label:function(t,e){return e.labels[t.index]+": "+t.yLabel}}}});var Me=Pt.extend({dataElementType:Kt.Arc,linkScales:ct.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(t){var e,n,i,a=this,r=a.getDataset(),o=a.getMeta(),s=a.chart.options.startAngle||0,l=a._starts=[],u=a._angles=[],c=o.data;for(a._updateRadius(),o.count=a.countVisibleElements(),e=0,n=r.data.length;e<n;e++)l[e]=s,i=a._computeAngle(e),u[e]=i,s+=i;for(e=0,n=c.length;e<n;++e)c[e]._options=a._resolveDataElementOptions(c[e],e),a.updateElement(c[e],e,t)},_updateRadius:function(){var t=this,e=t.chart,n=e.chartArea,i=e.options,a=Math.min(n.right-n.left,n.bottom-n.top);e.outerRadius=Math.max(a/2,0),e.innerRadius=Math.max(i.cutoutPercentage?e.outerRadius/100*i.cutoutPercentage:1,0),e.radiusLength=(e.outerRadius-e.innerRadius)/e.getVisibleDatasetCount(),t.outerRadius=e.outerRadius-e.radiusLength*t.index,t.innerRadius=t.outerRadius-e.radiusLength},updateElement:function(t,e,n){var i=this,a=i.chart,r=i.getDataset(),o=a.options,s=o.animation,l=a.scale,u=a.data.labels,c=l.xCenter,d=l.yCenter,h=o.startAngle,f=t.hidden?0:l.getDistanceFromCenterForValue(r.data[e]),g=i._starts[e],p=g+(t.hidden?0:i._angles[e]),m=s.animateScale?0:l.getDistanceFromCenterForValue(r.data[e]),v=t._options||{};ct.extend(t,{_datasetIndex:i.index,_index:e,_scale:l,_model:{backgroundColor:v.backgroundColor,borderColor:v.borderColor,borderWidth:v.borderWidth,borderAlign:v.borderAlign,x:c,y:d,innerRadius:0,outerRadius:n?m:f,startAngle:n&&s.animateRotate?h:g,endAngle:n&&s.animateRotate?h:p,label:ct.valueAtIndexOrDefault(u,e,u[e])}}),t.pivot()},countVisibleElements:function(){var t=this.getDataset(),e=this.getMeta(),n=0;return ct.each(e.data,(function(e,i){isNaN(t.data[i])||e.hidden||n++})),n},setHoverStyle:function(t){var e=t._model,n=t._options,i=ct.getHoverColor,a=ct.valueOrDefault;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth},e.backgroundColor=a(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=a(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=a(n.hoverBorderWidth,n.borderWidth)},_computeAngle:function(t){var e=this,n=this.getMeta().count,i=e.getDataset(),a=e.getMeta();if(isNaN(i.data[t])||a.data[t].hidden)return 0;var r={chart:e.chart,dataIndex:t,dataset:i,datasetIndex:e.index};return ke([e.chart.options.elements.arc.angle,2*Math.PI/n],r,t)}});J._set("pie",ct.clone(J.doughnut)),J._set("pie",{cutoutPercentage:0});var Ce=ge,Se=ct.valueOrDefault;J._set("radar",{spanGaps:!1,scale:{type:"radialLinear"},elements:{line:{fill:"start",tension:0}}});var Pe=Pt.extend({datasetElementType:Kt.Line,dataElementType:Kt.Point,linkScales:ct.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(t){var e,n,i=this,a=i.getMeta(),r=a.dataset,o=a.data||[],s=i.chart.scale,l=i._config;for(void 0!==l.tension&&void 0===l.lineTension&&(l.lineTension=l.tension),r._scale=s,r._datasetIndex=i.index,r._children=o,r._loop=!0,r._model=i._resolveDatasetElementOptions(r),r.pivot(),e=0,n=o.length;e<n;++e)i.updateElement(o[e],e,t);for(i.updateBezierControlPoints(),e=0,n=o.length;e<n;++e)o[e].pivot()},updateElement:function(t,e,n){var i=this,a=t.custom||{},r=i.getDataset(),o=i.chart.scale,s=o.getPointPositionForValue(e,r.data[e]),l=i._resolveDataElementOptions(t,e),u=i.getMeta().dataset._model,c=n?o.xCenter:s.x,d=n?o.yCenter:s.y;t._scale=o,t._options=l,t._datasetIndex=i.index,t._index=e,t._model={x:c,y:d,skip:a.skip||isNaN(c)||isNaN(d),radius:l.radius,pointStyle:l.pointStyle,rotation:l.rotation,backgroundColor:l.backgroundColor,borderColor:l.borderColor,borderWidth:l.borderWidth,tension:Se(a.tension,u?u.tension:0),hitRadius:l.hitRadius}},_resolveDatasetElementOptions:function(){var t=this,e=t._config,n=t.chart.options,i=Pt.prototype._resolveDatasetElementOptions.apply(t,arguments);return i.spanGaps=Se(e.spanGaps,n.spanGaps),i.tension=Se(e.lineTension,n.elements.line.tension),i},updateBezierControlPoints:function(){var t,e,n,i,a=this,r=a.getMeta(),o=a.chart.chartArea,s=r.data||[];function l(t,e,n){return Math.max(Math.min(t,n),e)}for(r.dataset._model.spanGaps&&(s=s.filter((function(t){return!t._model.skip}))),t=0,e=s.length;t<e;++t)n=s[t]._model,i=ct.splineCurve(ct.previousItem(s,t,!0)._model,n,ct.nextItem(s,t,!0)._model,n.tension),n.controlPointPreviousX=l(i.previous.x,o.left,o.right),n.controlPointPreviousY=l(i.previous.y,o.top,o.bottom),n.controlPointNextX=l(i.next.x,o.left,o.right),n.controlPointNextY=l(i.next.y,o.top,o.bottom)},setHoverStyle:function(t){var e=t._model,n=t._options,i=ct.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth,radius:e.radius},e.backgroundColor=Se(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=Se(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=Se(n.hoverBorderWidth,n.borderWidth),e.radius=Se(n.hoverRadius,n.radius)}});J._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(t){return"("+t.xLabel+", "+t.yLabel+")"}}}}),J._set("global",{datasets:{scatter:{showLine:!1}}});var De=we,Ae={bar:oe,bubble:ue,doughnut:ge,horizontalBar:pe,line:we,polarArea:Me,pie:Ce,radar:Pe,scatter:De};function Te(t,e){return t.native?{x:t.x,y:t.y}:ct.getRelativePosition(t,e)}function Oe(t,e){var n,i,a,r,o,s,l=t._getSortedVisibleDatasetMetas();for(i=0,r=l.length;i<r;++i)for(n=l[i].data,a=0,o=n.length;a<o;++a)s=n[a],s._view.skip||e(s)}function Ie(t,e){var n=[];return Oe(t,(function(t){t.inRange(e.x,e.y)&&n.push(t)})),n}function Le(t,e,n,i){var a=Number.POSITIVE_INFINITY,r=[];return Oe(t,(function(t){if(!n||t.inRange(e.x,e.y)){var o=t.getCenterPoint(),s=i(e,o);s<a?(r=[t],a=s):s===a&&r.push(t)}})),r}function Fe(t){var e=-1!==t.indexOf("x"),n=-1!==t.indexOf("y");return function(t,i){var a=e?Math.abs(t.x-i.x):0,r=n?Math.abs(t.y-i.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(r,2))}}function Re(t,e,n){var i=Te(e,t);n.axis=n.axis||"x";var a=Fe(n.axis),r=n.intersect?Ie(t,i):Le(t,i,!1,a),o=[];return r.length?(t._getSortedVisibleDatasetMetas().forEach((function(t){var e=t.data[r[0]._index];e&&!e._view.skip&&o.push(e)})),o):[]}var Ne={modes:{single:function(t,e){var n=Te(e,t),i=[];return Oe(t,(function(t){if(t.inRange(n.x,n.y))return i.push(t),i})),i.slice(0,1)},label:Re,index:Re,dataset:function(t,e,n){var i=Te(e,t);n.axis=n.axis||"xy";var a=Fe(n.axis),r=n.intersect?Ie(t,i):Le(t,i,!1,a);return r.length>0&&(r=t.getDatasetMeta(r[0]._datasetIndex).data),r},"x-axis":function(t,e){return Re(t,e,{intersect:!1})},point:function(t,e){var n=Te(e,t);return Ie(t,n)},nearest:function(t,e,n){var i=Te(e,t);n.axis=n.axis||"xy";var a=Fe(n.axis);return Le(t,i,n.intersect,a)},x:function(t,e,n){var i=Te(e,t),a=[],r=!1;return Oe(t,(function(t){t.inXRange(i.x)&&a.push(t),t.inRange(i.x,i.y)&&(r=!0)})),n.intersect&&!r&&(a=[]),a},y:function(t,e,n){var i=Te(e,t),a=[],r=!1;return Oe(t,(function(t){t.inYRange(i.y)&&a.push(t),t.inRange(i.x,i.y)&&(r=!0)})),n.intersect&&!r&&(a=[]),a}}},Ee=ct.extend;function ze(t,e){return ct.where(t,(function(t){return t.pos===e}))}function Be(t,e){return t.sort((function(t,n){var i=e?n:t,a=e?t:n;return i.weight===a.weight?i.index-a.index:i.weight-a.weight}))}function We(t){var e,n,i,a=[];for(e=0,n=(t||[]).length;e<n;++e)i=t[e],a.push({index:e,box:i,pos:i.position,horizontal:i.isHorizontal(),weight:i.weight});return a}function Ve(t,e){var n,i,a;for(n=0,i=t.length;n<i;++n)a=t[n],a.width=a.horizontal?a.box.fullWidth&&e.availableWidth:e.vBoxMaxWidth,a.height=a.horizontal&&e.hBoxMaxHeight}function He(t){var e=We(t),n=Be(ze(e,"left"),!0),i=Be(ze(e,"right")),a=Be(ze(e,"top"),!0),r=Be(ze(e,"bottom"));return{leftAndTop:n.concat(a),rightAndBottom:i.concat(r),chartArea:ze(e,"chartArea"),vertical:n.concat(i),horizontal:a.concat(r)}}function je(t,e,n,i){return Math.max(t[n],e[n])+Math.max(t[i],e[i])}function qe(t,e,n){var i,a,r=n.box,o=t.maxPadding;if(n.size&&(t[n.pos]-=n.size),n.size=n.horizontal?r.height:r.width,t[n.pos]+=n.size,r.getPadding){var s=r.getPadding();o.top=Math.max(o.top,s.top),o.left=Math.max(o.left,s.left),o.bottom=Math.max(o.bottom,s.bottom),o.right=Math.max(o.right,s.right)}if(i=e.outerWidth-je(o,t,"left","right"),a=e.outerHeight-je(o,t,"top","bottom"),i!==t.w||a!==t.h){t.w=i,t.h=a;var l=n.horizontal?[i,t.w]:[a,t.h];return l[0]!==l[1]&&(!isNaN(l[0])||!isNaN(l[1]))}}function Ue(t){var e=t.maxPadding;function n(n){var i=Math.max(e[n]-t[n],0);return t[n]+=i,i}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}function Ye(t,e){var n=e.maxPadding;function i(t){var i={left:0,top:0,right:0,bottom:0};return t.forEach((function(t){i[t]=Math.max(e[t],n[t])})),i}return i(t?["left","right"]:["top","bottom"])}function $e(t,e,n){var i,a,r,o,s,l,u=[];for(i=0,a=t.length;i<a;++i)r=t[i],o=r.box,o.update(r.width||e.w,r.height||e.h,Ye(r.horizontal,e)),qe(e,n,r)&&(l=!0,u.length&&(s=!0)),o.fullWidth||u.push(r);return s&&$e(u,e,n)||l}function Ge(t,e,n){var i,a,r,o,s=n.padding,l=e.x,u=e.y;for(i=0,a=t.length;i<a;++i)r=t[i],o=r.box,r.horizontal?(o.left=o.fullWidth?s.left:e.left,o.right=o.fullWidth?n.outerWidth-s.right:e.left+e.w,o.top=u,o.bottom=u+o.height,o.width=o.right-o.left,u=o.bottom):(o.left=l,o.right=l+o.width,o.top=e.top,o.bottom=e.top+e.h,o.height=o.bottom-o.top,l=o.right);e.x=l,e.y=u}J._set("global",{layout:{padding:{top:0,right:0,bottom:0,left:0}}});var Xe={defaults:{},addBox:function(t,e){t.boxes||(t.boxes=[]),e.fullWidth=e.fullWidth||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw:function(){e.draw.apply(e,arguments)}}]},t.boxes.push(e)},removeBox:function(t,e){var n=t.boxes?t.boxes.indexOf(e):-1;-1!==n&&t.boxes.splice(n,1)},configure:function(t,e,n){for(var i,a=["fullWidth","position","weight"],r=a.length,o=0;o<r;++o)i=a[o],n.hasOwnProperty(i)&&(e[i]=n[i])},update:function(t,e,n){if(t){var i=t.options.layout||{},a=ct.options.toPadding(i.padding),r=e-a.width,o=n-a.height,s=He(t.boxes),l=s.vertical,u=s.horizontal,c=Object.freeze({outerWidth:e,outerHeight:n,padding:a,availableWidth:r,vBoxMaxWidth:r/2/l.length,hBoxMaxHeight:o/2}),d=Ee({maxPadding:Ee({},a),w:r,h:o,x:a.left,y:a.top},a);Ve(l.concat(u),c),$e(l,d,c),$e(u,d,c)&&$e(l,d,c),Ue(d),Ge(s.leftAndTop,d,c),d.x+=d.w,d.y+=d.h,Ge(s.rightAndBottom,d,c),t.chartArea={left:d.left,top:d.top,right:d.left+d.w,bottom:d.top+d.h},ct.each(s.chartArea,(function(e){var n=e.box;Ee(n,t.chartArea),n.update(d.w,d.h)}))}}},Ke={acquireContext:function(t){return t&&t.canvas&&(t=t.canvas),t&&t.getContext("2d")||null}},Ze="/*\r\n * DOM element rendering detection\r\n * https://davidwalsh.name/detect-node-insertion\r\n */\r\n@keyframes chartjs-render-animation {\r\n\tfrom { opacity: 0.99; }\r\n\tto { opacity: 1; }\r\n}\r\n\r\n.chartjs-render-monitor {\r\n\tanimation: chartjs-render-animation 0.001s;\r\n}\r\n\r\n/*\r\n * DOM element resizing detection\r\n * https://github.com/marcj/css-element-queries\r\n */\r\n.chartjs-size-monitor,\r\n.chartjs-size-monitor-expand,\r\n.chartjs-size-monitor-shrink {\r\n\tposition: absolute;\r\n\tdirection: ltr;\r\n\tleft: 0;\r\n\ttop: 0;\r\n\tright: 0;\r\n\tbottom: 0;\r\n\toverflow: hidden;\r\n\tpointer-events: none;\r\n\tvisibility: hidden;\r\n\tz-index: -1;\r\n}\r\n\r\n.chartjs-size-monitor-expand > div {\r\n\tposition: absolute;\r\n\twidth: 1000000px;\r\n\theight: 1000000px;\r\n\tleft: 0;\r\n\ttop: 0;\r\n}\r\n\r\n.chartjs-size-monitor-shrink > div {\r\n\tposition: absolute;\r\n\twidth: 200%;\r\n\theight: 200%;\r\n\tleft: 0;\r\n\ttop: 0;\r\n}\r\n",Je=Object.freeze({__proto__:null,default:Ze}),Qe=n(Je),tn="$chartjs",en="chartjs-",nn=en+"size-monitor",an=en+"render-monitor",rn=en+"render-animation",on=["animationstart","webkitAnimationStart"],sn={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function ln(t,e){var n=ct.getStyle(t,e),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?Number(i[1]):void 0}function un(t,e){var n=t.style,i=t.getAttribute("height"),a=t.getAttribute("width");if(t[tn]={initial:{height:i,width:a,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",null===a||""===a){var r=ln(t,"width");void 0!==r&&(t.width=r)}if(null===i||""===i)if(""===t.style.height)t.height=t.width/(e.options.aspectRatio||2);else{var o=ln(t,"height");void 0!==r&&(t.height=o)}return t}var cn=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("e",null,e)}catch(n){}return t}(),dn=!!cn&&{passive:!0};function hn(t,e,n){t.addEventListener(e,n,dn)}function fn(t,e,n){t.removeEventListener(e,n,dn)}function gn(t,e,n,i,a){return{type:t,chart:e,native:a||null,x:void 0!==n?n:null,y:void 0!==i?i:null}}function pn(t,e){var n=sn[t.type]||t.type,i=ct.getRelativePosition(t,e);return gn(n,e,i.x,i.y,t)}function mn(t,e){var n=!1,i=[];return function(){i=Array.prototype.slice.call(arguments),e=e||this,n||(n=!0,ct.requestAnimFrame.call(window,(function(){n=!1,t.apply(e,i)})))}}function vn(t){var e=document.createElement("div");return e.className=t||"",e}function bn(t){var e=1e6,n=vn(nn),i=vn(nn+"-expand"),a=vn(nn+"-shrink");i.appendChild(vn()),a.appendChild(vn()),n.appendChild(i),n.appendChild(a),n._reset=function(){i.scrollLeft=e,i.scrollTop=e,a.scrollLeft=e,a.scrollTop=e};var r=function(){n._reset(),t()};return hn(i,"scroll",r.bind(i,"expand")),hn(a,"scroll",r.bind(a,"shrink")),n}function yn(t,e){var n=t[tn]||(t[tn]={}),i=n.renderProxy=function(t){t.animationName===rn&&e()};ct.each(on,(function(e){hn(t,e,i)})),n.reflow=!!t.offsetParent,t.classList.add(an)}function xn(t){var e=t[tn]||{},n=e.renderProxy;n&&(ct.each(on,(function(e){fn(t,e,n)})),delete e.renderProxy),t.classList.remove(an)}function _n(t,e,n){var i=t[tn]||(t[tn]={}),a=i.resizer=bn(mn((function(){if(i.resizer){var a=n.options.maintainAspectRatio&&t.parentNode,r=a?a.clientWidth:0;e(gn("resize",n)),a&&a.clientWidth<r&&n.canvas&&e(gn("resize",n))}})));yn(t,(function(){if(i.resizer){var e=t.parentNode;e&&e!==a.parentNode&&e.insertBefore(a,e.firstChild),a._reset()}}))}function wn(t){var e=t[tn]||{},n=e.resizer;delete e.resizer,xn(t),n&&n.parentNode&&n.parentNode.removeChild(n)}function kn(t,e){var n=t[tn]||(t[tn]={});if(!n.containsStyles){n.containsStyles=!0,e="/* Chart.js */\n"+e;var i=document.createElement("style");i.setAttribute("type","text/css"),i.appendChild(document.createTextNode(e)),t.appendChild(i)}}var Mn={disableCSSInjection:!1,_enabled:"undefined"!==typeof window&&"undefined"!==typeof document,_ensureLoaded:function(t){if(!this.disableCSSInjection){var e=t.getRootNode?t.getRootNode():document,n=e.host?e:document.head;kn(n,Qe)}},acquireContext:function(t,e){"string"===typeof t?t=document.getElementById(t):t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas);var n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(this._ensureLoaded(t),un(t,e),n):null},releaseContext:function(t){var e=t.canvas;if(e[tn]){var n=e[tn].initial;["height","width"].forEach((function(t){var i=n[t];ct.isNullOrUndef(i)?e.removeAttribute(t):e.setAttribute(t,i)})),ct.each(n.style||{},(function(t,n){e.style[n]=t})),e.width=e.width,delete e[tn]}},addEventListener:function(t,e,n){var i=t.canvas;if("resize"!==e){var a=n[tn]||(n[tn]={}),r=a.proxies||(a.proxies={}),o=r[t.id+"_"+e]=function(e){n(pn(e,t))};hn(i,e,o)}else _n(i,n,t)},removeEventListener:function(t,e,n){var i=t.canvas;if("resize"!==e){var a=n[tn]||{},r=a.proxies||{},o=r[t.id+"_"+e];o&&fn(i,e,o)}else wn(i)}};ct.addEvent=hn,ct.removeEvent=fn;var Cn=Mn._enabled?Mn:Ke,Sn=ct.extend({initialize:function(){},acquireContext:function(){},releaseContext:function(){},addEventListener:function(){},removeEventListener:function(){}},Cn);J._set("global",{plugins:{}});var Pn={_plugins:[],_cacheId:0,register:function(t){var e=this._plugins;[].concat(t).forEach((function(t){-1===e.indexOf(t)&&e.push(t)})),this._cacheId++},unregister:function(t){var e=this._plugins;[].concat(t).forEach((function(t){var n=e.indexOf(t);-1!==n&&e.splice(n,1)})),this._cacheId++},clear:function(){this._plugins=[],this._cacheId++},count:function(){return this._plugins.length},getAll:function(){return this._plugins},notify:function(t,e,n){var i,a,r,o,s,l=this.descriptors(t),u=l.length;for(i=0;i<u;++i)if(a=l[i],r=a.plugin,s=r[e],"function"===typeof s&&(o=[t].concat(n||[]),o.push(a.options),!1===s.apply(r,o)))return!1;return!0},descriptors:function(t){var e=t.$plugins||(t.$plugins={});if(e.id===this._cacheId)return e.descriptors;var n=[],i=[],a=t&&t.config||{},r=a.options&&a.options.plugins||{};return this._plugins.concat(a.plugins||[]).forEach((function(t){var e=n.indexOf(t);if(-1===e){var a=t.id,o=r[a];!1!==o&&(!0===o&&(o=ct.clone(J.global.plugins[a])),n.push(t),i.push({plugin:t,options:o||{}}))}})),e.descriptors=i,e.id=this._cacheId,i},_invalidate:function(t){delete t.$plugins}},Dn={constructors:{},defaults:{},registerScaleType:function(t,e,n){this.constructors[t]=e,this.defaults[t]=ct.clone(n)},getScaleConstructor:function(t){return this.constructors.hasOwnProperty(t)?this.constructors[t]:void 0},getScaleDefaults:function(t){return this.defaults.hasOwnProperty(t)?ct.merge(Object.create(null),[J.scale,this.defaults[t]]):{}},updateScaleDefaults:function(t,e){var n=this;n.defaults.hasOwnProperty(t)&&(n.defaults[t]=ct.extend(n.defaults[t],e))},addScalesToLayout:function(t){ct.each(t.scales,(function(e){e.fullWidth=e.options.fullWidth,e.position=e.options.position,e.weight=e.options.weight,Xe.addBox(t,e)}))}},An=ct.valueOrDefault,Tn=ct.rtl.getRtlAdapter;J._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:ct.noop,title:function(t,e){var n="",i=e.labels,a=i?i.length:0;if(t.length>0){var r=t[0];r.label?n=r.label:r.xLabel?n=r.xLabel:a>0&&r.index<a&&(n=i[r.index])}return n},afterTitle:ct.noop,beforeBody:ct.noop,beforeLabel:ct.noop,label:function(t,e){var n=e.datasets[t.datasetIndex].label||"";return n&&(n+=": "),ct.isNullOrUndef(t.value)?n+=t.yLabel:n+=t.value,n},labelColor:function(t,e){var n=e.getDatasetMeta(t.datasetIndex),i=n.data[t.index],a=i._view;return{borderColor:a.borderColor,backgroundColor:a.backgroundColor}},labelTextColor:function(){return this._options.bodyFontColor},afterLabel:ct.noop,afterBody:ct.noop,beforeFooter:ct.noop,footer:ct.noop,afterFooter:ct.noop}}});var On={average:function(t){if(!t.length)return!1;var e,n,i=0,a=0,r=0;for(e=0,n=t.length;e<n;++e){var o=t[e];if(o&&o.hasValue()){var s=o.tooltipPosition();i+=s.x,a+=s.y,++r}}return{x:i/r,y:a/r}},nearest:function(t,e){var n,i,a,r=e.x,o=e.y,s=Number.POSITIVE_INFINITY;for(n=0,i=t.length;n<i;++n){var l=t[n];if(l&&l.hasValue()){var u=l.getCenterPoint(),c=ct.distanceBetweenPoints(e,u);c<s&&(s=c,a=l)}}if(a){var d=a.tooltipPosition();r=d.x,o=d.y}return{x:r,y:o}}};function In(t,e){return e&&(ct.isArray(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Ln(t){return("string"===typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function Fn(t){var e=t._xScale,n=t._yScale||t._scale,i=t._index,a=t._datasetIndex,r=t._chart.getDatasetMeta(a).controller,o=r._getIndexScale(),s=r._getValueScale();return{xLabel:e?e.getLabelForIndex(i,a):"",yLabel:n?n.getLabelForIndex(i,a):"",label:o?""+o.getLabelForIndex(i,a):"",value:s?""+s.getLabelForIndex(i,a):"",index:i,datasetIndex:a,x:t._model.x,y:t._model.y}}function Rn(t){var e=J.global;return{xPadding:t.xPadding,yPadding:t.yPadding,xAlign:t.xAlign,yAlign:t.yAlign,rtl:t.rtl,textDirection:t.textDirection,bodyFontColor:t.bodyFontColor,_bodyFontFamily:An(t.bodyFontFamily,e.defaultFontFamily),_bodyFontStyle:An(t.bodyFontStyle,e.defaultFontStyle),_bodyAlign:t.bodyAlign,bodyFontSize:An(t.bodyFontSize,e.defaultFontSize),bodySpacing:t.bodySpacing,titleFontColor:t.titleFontColor,_titleFontFamily:An(t.titleFontFamily,e.defaultFontFamily),_titleFontStyle:An(t.titleFontStyle,e.defaultFontStyle),titleFontSize:An(t.titleFontSize,e.defaultFontSize),_titleAlign:t.titleAlign,titleSpacing:t.titleSpacing,titleMarginBottom:t.titleMarginBottom,footerFontColor:t.footerFontColor,_footerFontFamily:An(t.footerFontFamily,e.defaultFontFamily),_footerFontStyle:An(t.footerFontStyle,e.defaultFontStyle),footerFontSize:An(t.footerFontSize,e.defaultFontSize),_footerAlign:t.footerAlign,footerSpacing:t.footerSpacing,footerMarginTop:t.footerMarginTop,caretSize:t.caretSize,cornerRadius:t.cornerRadius,backgroundColor:t.backgroundColor,opacity:0,legendColorBackground:t.multiKeyBackground,displayColors:t.displayColors,borderColor:t.borderColor,borderWidth:t.borderWidth}}function Nn(t,e){var n=t._chart.ctx,i=2*e.yPadding,a=0,r=e.body,o=r.reduce((function(t,e){return t+e.before.length+e.lines.length+e.after.length}),0);o+=e.beforeBody.length+e.afterBody.length;var s=e.title.length,l=e.footer.length,u=e.titleFontSize,c=e.bodyFontSize,d=e.footerFontSize;i+=s*u,i+=s?(s-1)*e.titleSpacing:0,i+=s?e.titleMarginBottom:0,i+=o*c,i+=o?(o-1)*e.bodySpacing:0,i+=l?e.footerMarginTop:0,i+=l*d,i+=l?(l-1)*e.footerSpacing:0;var h=0,f=function(t){a=Math.max(a,n.measureText(t).width+h)};return n.font=ct.fontString(u,e._titleFontStyle,e._titleFontFamily),ct.each(e.title,f),n.font=ct.fontString(c,e._bodyFontStyle,e._bodyFontFamily),ct.each(e.beforeBody.concat(e.afterBody),f),h=e.displayColors?c+2:0,ct.each(r,(function(t){ct.each(t.before,f),ct.each(t.lines,f),ct.each(t.after,f)})),h=0,n.font=ct.fontString(d,e._footerFontStyle,e._footerFontFamily),ct.each(e.footer,f),a+=2*e.xPadding,{width:a,height:i}}function En(t,e){var n,i,a,r,o,s=t._model,l=t._chart,u=t._chart.chartArea,c="center",d="center";s.y<e.height?d="top":s.y>l.height-e.height&&(d="bottom");var h=(u.left+u.right)/2,f=(u.top+u.bottom)/2;"center"===d?(n=function(t){return t<=h},i=function(t){return t>h}):(n=function(t){return t<=e.width/2},i=function(t){return t>=l.width-e.width/2}),a=function(t){return t+e.width+s.caretSize+s.caretPadding>l.width},r=function(t){return t-e.width-s.caretSize-s.caretPadding<0},o=function(t){return t<=f?"top":"bottom"},n(s.x)?(c="left",a(s.x)&&(c="center",d=o(s.y))):i(s.x)&&(c="right",r(s.x)&&(c="center",d=o(s.y)));var g=t._options;return{xAlign:g.xAlign?g.xAlign:c,yAlign:g.yAlign?g.yAlign:d}}function zn(t,e,n,i){var a=t.x,r=t.y,o=t.caretSize,s=t.caretPadding,l=t.cornerRadius,u=n.xAlign,c=n.yAlign,d=o+s,h=l+s;return"right"===u?a-=e.width:"center"===u&&(a-=e.width/2,a+e.width>i.width&&(a=i.width-e.width),a<0&&(a=0)),"top"===c?r+=d:r-="bottom"===c?e.height+d:e.height/2,"center"===c?"left"===u?a+=d:"right"===u&&(a-=d):"left"===u?a-=h:"right"===u&&(a+=h),{x:a,y:r}}function Bn(t,e){return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-t.xPadding:t.x+t.xPadding}function Wn(t){return In([],Ln(t))}var Vn=bt.extend({initialize:function(){this._model=Rn(this._options),this._lastActive=[]},getTitle:function(){var t=this,e=t._options,n=e.callbacks,i=n.beforeTitle.apply(t,arguments),a=n.title.apply(t,arguments),r=n.afterTitle.apply(t,arguments),o=[];return o=In(o,Ln(i)),o=In(o,Ln(a)),o=In(o,Ln(r)),o},getBeforeBody:function(){return Wn(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(t,e){var n=this,i=n._options.callbacks,a=[];return ct.each(t,(function(t){var r={before:[],lines:[],after:[]};In(r.before,Ln(i.beforeLabel.call(n,t,e))),In(r.lines,i.label.call(n,t,e)),In(r.after,Ln(i.afterLabel.call(n,t,e))),a.push(r)})),a},getAfterBody:function(){return Wn(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var t=this,e=t._options.callbacks,n=e.beforeFooter.apply(t,arguments),i=e.footer.apply(t,arguments),a=e.afterFooter.apply(t,arguments),r=[];return r=In(r,Ln(n)),r=In(r,Ln(i)),r=In(r,Ln(a)),r},update:function(t){var e,n,i=this,a=i._options,r=i._model,o=i._model=Rn(a),s=i._active,l=i._data,u={xAlign:r.xAlign,yAlign:r.yAlign},c={x:r.x,y:r.y},d={width:r.width,height:r.height},h={x:r.caretX,y:r.caretY};if(s.length){o.opacity=1;var f=[],g=[];h=On[a.position].call(i,s,i._eventPosition);var p=[];for(e=0,n=s.length;e<n;++e)p.push(Fn(s[e]));a.filter&&(p=p.filter((function(t){return a.filter(t,l)}))),a.itemSort&&(p=p.sort((function(t,e){return a.itemSort(t,e,l)}))),ct.each(p,(function(t){f.push(a.callbacks.labelColor.call(i,t,i._chart)),g.push(a.callbacks.labelTextColor.call(i,t,i._chart))})),o.title=i.getTitle(p,l),o.beforeBody=i.getBeforeBody(p,l),o.body=i.getBody(p,l),o.afterBody=i.getAfterBody(p,l),o.footer=i.getFooter(p,l),o.x=h.x,o.y=h.y,o.caretPadding=a.caretPadding,o.labelColors=f,o.labelTextColors=g,o.dataPoints=p,d=Nn(this,o),u=En(this,d),c=zn(o,d,u,i._chart)}else o.opacity=0;return o.xAlign=u.xAlign,o.yAlign=u.yAlign,o.x=c.x,o.y=c.y,o.width=d.width,o.height=d.height,o.caretX=h.x,o.caretY=h.y,i._model=o,t&&a.custom&&a.custom.call(i,o),i},drawCaret:function(t,e){var n=this._chart.ctx,i=this._view,a=this.getCaretPosition(t,e,i);n.lineTo(a.x1,a.y1),n.lineTo(a.x2,a.y2),n.lineTo(a.x3,a.y3)},getCaretPosition:function(t,e,n){var i,a,r,o,s,l,u=n.caretSize,c=n.cornerRadius,d=n.xAlign,h=n.yAlign,f=t.x,g=t.y,p=e.width,m=e.height;if("center"===h)s=g+m/2,"left"===d?(i=f,a=i-u,r=i,o=s+u,l=s-u):(i=f+p,a=i+u,r=i,o=s-u,l=s+u);else if("left"===d?(a=f+c+u,i=a-u,r=a+u):"right"===d?(a=f+p-c-u,i=a-u,r=a+u):(a=n.caretX,i=a-u,r=a+u),"top"===h)o=g,s=o-u,l=o;else{o=g+m,s=o+u,l=o;var v=r;r=i,i=v}return{x1:i,x2:a,x3:r,y1:o,y2:s,y3:l}},drawTitle:function(t,e,n){var i,a,r,o=e.title,s=o.length;if(s){var l=Tn(e.rtl,e.x,e.width);for(t.x=Bn(e,e._titleAlign),n.textAlign=l.textAlign(e._titleAlign),n.textBaseline="middle",i=e.titleFontSize,a=e.titleSpacing,n.fillStyle=e.titleFontColor,n.font=ct.fontString(i,e._titleFontStyle,e._titleFontFamily),r=0;r<s;++r)n.fillText(o[r],l.x(t.x),t.y+i/2),t.y+=i+a,r+1===s&&(t.y+=e.titleMarginBottom-a)}},drawBody:function(t,e,n){var i,a,r,o,s,l,u,c,d=e.bodyFontSize,h=e.bodySpacing,f=e._bodyAlign,g=e.body,p=e.displayColors,m=0,v=p?Bn(e,"left"):0,b=Tn(e.rtl,e.x,e.width),y=function(e){n.fillText(e,b.x(t.x+m),t.y+d/2),t.y+=d+h},x=b.textAlign(f);for(n.textAlign=f,n.textBaseline="middle",n.font=ct.fontString(d,e._bodyFontStyle,e._bodyFontFamily),t.x=Bn(e,x),n.fillStyle=e.bodyFontColor,ct.each(e.beforeBody,y),m=p&&"right"!==x?"center"===f?d/2+1:d+2:0,s=0,u=g.length;s<u;++s){for(i=g[s],a=e.labelTextColors[s],r=e.labelColors[s],n.fillStyle=a,ct.each(i.before,y),o=i.lines,l=0,c=o.length;l<c;++l){if(p){var _=b.x(v);n.fillStyle=e.legendColorBackground,n.fillRect(b.leftForLtr(_,d),t.y,d,d),n.lineWidth=1,n.strokeStyle=r.borderColor,n.strokeRect(b.leftForLtr(_,d),t.y,d,d),n.fillStyle=r.backgroundColor,n.fillRect(b.leftForLtr(b.xPlus(_,1),d-2),t.y+1,d-2,d-2),n.fillStyle=a}y(o[l])}ct.each(i.after,y)}m=0,ct.each(e.afterBody,y),t.y-=h},drawFooter:function(t,e,n){var i,a,r=e.footer,o=r.length;if(o){var s=Tn(e.rtl,e.x,e.width);for(t.x=Bn(e,e._footerAlign),t.y+=e.footerMarginTop,n.textAlign=s.textAlign(e._footerAlign),n.textBaseline="middle",i=e.footerFontSize,n.fillStyle=e.footerFontColor,n.font=ct.fontString(i,e._footerFontStyle,e._footerFontFamily),a=0;a<o;++a)n.fillText(r[a],s.x(t.x),t.y+i/2),t.y+=i+e.footerSpacing}},drawBackground:function(t,e,n,i){n.fillStyle=e.backgroundColor,n.strokeStyle=e.borderColor,n.lineWidth=e.borderWidth;var a=e.xAlign,r=e.yAlign,o=t.x,s=t.y,l=i.width,u=i.height,c=e.cornerRadius;n.beginPath(),n.moveTo(o+c,s),"top"===r&&this.drawCaret(t,i),n.lineTo(o+l-c,s),n.quadraticCurveTo(o+l,s,o+l,s+c),"center"===r&&"right"===a&&this.drawCaret(t,i),n.lineTo(o+l,s+u-c),n.quadraticCurveTo(o+l,s+u,o+l-c,s+u),"bottom"===r&&this.drawCaret(t,i),n.lineTo(o+c,s+u),n.quadraticCurveTo(o,s+u,o,s+u-c),"center"===r&&"left"===a&&this.drawCaret(t,i),n.lineTo(o,s+c),n.quadraticCurveTo(o,s,o+c,s),n.closePath(),n.fill(),e.borderWidth>0&&n.stroke()},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var n={width:e.width,height:e.height},i={x:e.x,y:e.y},a=Math.abs(e.opacity<.001)?0:e.opacity,r=e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length;this._options.enabled&&r&&(t.save(),t.globalAlpha=a,this.drawBackground(i,e,t,n),i.y+=e.yPadding,ct.rtl.overrideTextDirection(t,e.textDirection),this.drawTitle(i,e,t),this.drawBody(i,e,t),this.drawFooter(i,e,t),ct.rtl.restoreTextDirection(t,e.textDirection),t.restore())}},handleEvent:function(t){var e=this,n=e._options,i=!1;return e._lastActive=e._lastActive||[],"mouseout"===t.type?e._active=[]:(e._active=e._chart.getElementsAtEventForMode(t,n.mode,n),n.reverse&&e._active.reverse()),i=!ct.arrayEquals(e._active,e._lastActive),i&&(e._lastActive=e._active,(n.enabled||n.custom)&&(e._eventPosition={x:t.x,y:t.y},e.update(!0),e.pivot())),i}}),Hn=On,jn=Vn;jn.positioners=Hn;var qn=ct.valueOrDefault;function Un(){return ct.merge(Object.create(null),[].slice.call(arguments),{merger:function(t,e,n,i){if("xAxes"===t||"yAxes"===t){var a,r,o,s=n[t].length;for(e[t]||(e[t]=[]),a=0;a<s;++a)o=n[t][a],r=qn(o.type,"xAxes"===t?"category":"linear"),a>=e[t].length&&e[t].push({}),!e[t][a].type||o.type&&o.type!==e[t][a].type?ct.merge(e[t][a],[Dn.getScaleDefaults(r),o]):ct.merge(e[t][a],o)}else ct._merger(t,e,n,i)}})}function Yn(){return ct.merge(Object.create(null),[].slice.call(arguments),{merger:function(t,e,n,i){var a=e[t]||Object.create(null),r=n[t];"scales"===t?e[t]=Un(a,r):"scale"===t?e[t]=ct.merge(a,[Dn.getScaleDefaults(r.type),r]):ct._merger(t,e,n,i)}})}function $n(t){t=t||Object.create(null);var e=t.data=t.data||{};return e.datasets=e.datasets||[],e.labels=e.labels||[],t.options=Yn(J.global,J[t.type],t.options||{}),t}function Gn(t){var e=t.options;ct.each(t.scales,(function(e){Xe.removeBox(t,e)})),e=Yn(J.global,J[t.config.type],e),t.options=t.config.options=e,t.ensureScalesHaveIDs(),t.buildOrUpdateScales(),t.tooltip._options=e.tooltips,t.tooltip.initialize()}function Xn(t,e,n){var i,a=function(t){return t.id===i};do{i=e+n++}while(ct.findIndex(t,a)>=0);return i}function Kn(t){return"top"===t||"bottom"===t}function Zn(t,e){return function(n,i){return n[t]===i[t]?n[e]-i[e]:n[t]-i[t]}}J._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});var Jn=function(t,e){return this.construct(t,e),this};ct.extend(Jn.prototype,{construct:function(t,e){var n=this;e=$n(e);var i=Sn.acquireContext(t,e),a=i&&i.canvas,r=a&&a.height,o=a&&a.width;n.id=ct.uid(),n.ctx=i,n.canvas=a,n.config=e,n.width=o,n.height=r,n.aspectRatio=r?o/r:null,n.options=e.options,n._bufferedRender=!1,n._layers=[],n.chart=n,n.controller=n,Jn.instances[n.id]=n,Object.defineProperty(n,"data",{get:function(){return n.config.data},set:function(t){n.config.data=t}}),i&&a?(n.initialize(),n.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var t=this;return Pn.notify(t,"beforeInit"),ct.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.initToolTip(),Pn.notify(t,"afterInit"),t},clear:function(){return ct.canvas.clear(this),this},stop:function(){return _t.cancelAnimation(this),this},resize:function(t){var e=this,n=e.options,i=e.canvas,a=n.maintainAspectRatio&&e.aspectRatio||null,r=Math.max(0,Math.floor(ct.getMaximumWidth(i))),o=Math.max(0,Math.floor(a?r/a:ct.getMaximumHeight(i)));if((e.width!==r||e.height!==o)&&(i.width=e.width=r,i.height=e.height=o,i.style.width=r+"px",i.style.height=o+"px",ct.retinaScale(e,n.devicePixelRatio),!t)){var s={width:r,height:o};Pn.notify(e,"resize",[s]),n.onResize&&n.onResize(e,s),e.stop(),e.update({duration:n.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},n=t.scale;ct.each(e.xAxes,(function(t,n){t.id||(t.id=Xn(e.xAxes,"x-axis-",n))})),ct.each(e.yAxes,(function(t,n){t.id||(t.id=Xn(e.yAxes,"y-axis-",n))})),n&&(n.id=n.id||"scale")},buildOrUpdateScales:function(){var t=this,e=t.options,n=t.scales||{},i=[],a=Object.keys(n).reduce((function(t,e){return t[e]=!1,t}),{});e.scales&&(i=i.concat((e.scales.xAxes||[]).map((function(t){return{options:t,dtype:"category",dposition:"bottom"}})),(e.scales.yAxes||[]).map((function(t){return{options:t,dtype:"linear",dposition:"left"}})))),e.scale&&i.push({options:e.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),ct.each(i,(function(e){var i=e.options,r=i.id,o=qn(i.type,e.dtype);Kn(i.position)!==Kn(e.dposition)&&(i.position=e.dposition),a[r]=!0;var s=null;if(r in n&&n[r].type===o)s=n[r],s.options=i,s.ctx=t.ctx,s.chart=t;else{var l=Dn.getScaleConstructor(o);if(!l)return;s=new l({id:r,type:o,options:i,ctx:t.ctx,chart:t}),n[s.id]=s}s.mergeTicksOptions(),e.isDefault&&(t.scale=s)})),ct.each(a,(function(t,e){t||delete n[e]})),t.scales=n,Dn.addScalesToLayout(this)},buildOrUpdateControllers:function(){var t,e,n=this,i=[],a=n.data.datasets;for(t=0,e=a.length;t<e;t++){var r=a[t],o=n.getDatasetMeta(t),s=r.type||n.config.type;if(o.type&&o.type!==s&&(n.destroyDatasetMeta(t),o=n.getDatasetMeta(t)),o.type=s,o.order=r.order||0,o.index=t,o.controller)o.controller.updateIndex(t),o.controller.linkScales();else{var l=Ae[o.type];if(void 0===l)throw new Error('"'+o.type+'" is not a chart type.');o.controller=new l(n,t),i.push(o.controller)}}return i},resetElements:function(){var t=this;ct.each(t.data.datasets,(function(e,n){t.getDatasetMeta(n).controller.reset()}),t)},reset:function(){this.resetElements(),this.tooltip.initialize()},update:function(t){var e,n,i=this;if(t&&"object"===typeof t||(t={duration:t,lazy:arguments[1]}),Gn(i),Pn._invalidate(i),!1!==Pn.notify(i,"beforeUpdate")){i.tooltip._data=i.data;var a=i.buildOrUpdateControllers();for(e=0,n=i.data.datasets.length;e<n;e++)i.getDatasetMeta(e).controller.buildOrUpdateElements();i.updateLayout(),i.options.animation&&i.options.animation.duration&&ct.each(a,(function(t){t.reset()})),i.updateDatasets(),i.tooltip.initialize(),i.lastActive=[],Pn.notify(i,"afterUpdate"),i._layers.sort(Zn("z","_idx")),i._bufferedRender?i._bufferedRequest={duration:t.duration,easing:t.easing,lazy:t.lazy}:i.render(t)}},updateLayout:function(){var t=this;!1!==Pn.notify(t,"beforeLayout")&&(Xe.update(this,this.width,this.height),t._layers=[],ct.each(t.boxes,(function(e){e._configure&&e._configure(),t._layers.push.apply(t._layers,e._layers())}),t),t._layers.forEach((function(t,e){t._idx=e})),Pn.notify(t,"afterScaleUpdate"),Pn.notify(t,"afterLayout"))},updateDatasets:function(){var t=this;if(!1!==Pn.notify(t,"beforeDatasetsUpdate")){for(var e=0,n=t.data.datasets.length;e<n;++e)t.updateDataset(e);Pn.notify(t,"afterDatasetsUpdate")}},updateDataset:function(t){var e=this,n=e.getDatasetMeta(t),i={meta:n,index:t};!1!==Pn.notify(e,"beforeDatasetUpdate",[i])&&(n.controller._update(),Pn.notify(e,"afterDatasetUpdate",[i]))},render:function(t){var e=this;t&&"object"===typeof t||(t={duration:t,lazy:arguments[1]});var n=e.options.animation,i=qn(t.duration,n&&n.duration),a=t.lazy;if(!1!==Pn.notify(e,"beforeRender")){var r=function(t){Pn.notify(e,"afterRender"),ct.callback(n&&n.onComplete,[t],e)};if(n&&i){var o=new xt({numSteps:i/16.66,easing:t.easing||n.easing,render:function(t,e){var n=ct.easing.effects[e.easing],i=e.currentStep,a=i/e.numSteps;t.draw(n(a),a,i)},onAnimationProgress:n.onProgress,onAnimationComplete:r});_t.addAnimation(e,o,i,a)}else e.draw(),r(new xt({numSteps:0,chart:e}));return e}},draw:function(t){var e,n,i=this;if(i.clear(),ct.isNullOrUndef(t)&&(t=1),i.transition(t),!(i.width<=0||i.height<=0)&&!1!==Pn.notify(i,"beforeDraw",[t])){for(n=i._layers,e=0;e<n.length&&n[e].z<=0;++e)n[e].draw(i.chartArea);for(i.drawDatasets(t);e<n.length;++e)n[e].draw(i.chartArea);i._drawTooltip(t),Pn.notify(i,"afterDraw",[t])}},transition:function(t){for(var e=this,n=0,i=(e.data.datasets||[]).length;n<i;++n)e.isDatasetVisible(n)&&e.getDatasetMeta(n).controller.transition(t);e.tooltip.transition(t)},_getSortedDatasetMetas:function(t){var e,n,i=this,a=i.data.datasets||[],r=[];for(e=0,n=a.length;e<n;++e)t&&!i.isDatasetVisible(e)||r.push(i.getDatasetMeta(e));return r.sort(Zn("order","index")),r},_getSortedVisibleDatasetMetas:function(){return this._getSortedDatasetMetas(!0)},drawDatasets:function(t){var e,n,i=this;if(!1!==Pn.notify(i,"beforeDatasetsDraw",[t])){for(e=i._getSortedVisibleDatasetMetas(),n=e.length-1;n>=0;--n)i.drawDataset(e[n],t);Pn.notify(i,"afterDatasetsDraw",[t])}},drawDataset:function(t,e){var n=this,i={meta:t,index:t.index,easingValue:e};!1!==Pn.notify(n,"beforeDatasetDraw",[i])&&(t.controller.draw(e),Pn.notify(n,"afterDatasetDraw",[i]))},_drawTooltip:function(t){var e=this,n=e.tooltip,i={tooltip:n,easingValue:t};!1!==Pn.notify(e,"beforeTooltipDraw",[i])&&(n.draw(),Pn.notify(e,"afterTooltipDraw",[i]))},getElementAtEvent:function(t){return Ne.modes.single(this,t)},getElementsAtEvent:function(t){return Ne.modes.label(this,t,{intersect:!0})},getElementsAtXAxis:function(t){return Ne.modes["x-axis"](this,t,{intersect:!0})},getElementsAtEventForMode:function(t,e,n){var i=Ne.modes[e];return"function"===typeof i?i(this,t,n):[]},getDatasetAtEvent:function(t){return Ne.modes.dataset(this,t,{intersect:!0})},getDatasetMeta:function(t){var e=this,n=e.data.datasets[t];n._meta||(n._meta={});var i=n._meta[e.id];return i||(i=n._meta[e.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n.order||0,index:t}),i},getVisibleDatasetCount:function(){for(var t=0,e=0,n=this.data.datasets.length;e<n;++e)this.isDatasetVisible(e)&&t++;return t},isDatasetVisible:function(t){var e=this.getDatasetMeta(t);return"boolean"===typeof e.hidden?!e.hidden:!this.data.datasets[t].hidden},generateLegend:function(){return this.options.legendCallback(this)},destroyDatasetMeta:function(t){var e=this.id,n=this.data.datasets[t],i=n._meta&&n._meta[e];i&&(i.controller.destroy(),delete n._meta[e])},destroy:function(){var t,e,n=this,i=n.canvas;for(n.stop(),t=0,e=n.data.datasets.length;t<e;++t)n.destroyDatasetMeta(t);i&&(n.unbindEvents(),ct.canvas.clear(n),Sn.releaseContext(n.ctx),n.canvas=null,n.ctx=null),Pn.notify(n,"destroy"),delete Jn.instances[n.id]},toBase64Image:function(){return this.canvas.toDataURL.apply(this.canvas,arguments)},initToolTip:function(){var t=this;t.tooltip=new jn({_chart:t,_chartInstance:t,_data:t.data,_options:t.options.tooltips},t)},bindEvents:function(){var t=this,e=t._listeners={},n=function(){t.eventHandler.apply(t,arguments)};ct.each(t.options.events,(function(i){Sn.addEventListener(t,i,n),e[i]=n})),t.options.responsive&&(n=function(){t.resize()},Sn.addEventListener(t,"resize",n),e.resize=n)},unbindEvents:function(){var t=this,e=t._listeners;e&&(delete t._listeners,ct.each(e,(function(e,n){Sn.removeEventListener(t,n,e)})))},updateHoverStyle:function(t,e,n){var i,a,r,o=n?"set":"remove";for(a=0,r=t.length;a<r;++a)i=t[a],i&&this.getDatasetMeta(i._datasetIndex).controller[o+"HoverStyle"](i);"dataset"===e&&this.getDatasetMeta(t[0]._datasetIndex).controller["_"+o+"DatasetHoverStyle"]()},eventHandler:function(t){var e=this,n=e.tooltip;if(!1!==Pn.notify(e,"beforeEvent",[t])){e._bufferedRender=!0,e._bufferedRequest=null;var i=e.handleEvent(t);n&&(i=n._start?n.handleEvent(t):i|n.handleEvent(t)),Pn.notify(e,"afterEvent",[t]);var a=e._bufferedRequest;return a?e.render(a):i&&!e.animating&&(e.stop(),e.render({duration:e.options.hover.animationDuration,lazy:!0})),e._bufferedRender=!1,e._bufferedRequest=null,e}},handleEvent:function(t){var e=this,n=e.options||{},i=n.hover,a=!1;return e.lastActive=e.lastActive||[],"mouseout"===t.type?e.active=[]:e.active=e.getElementsAtEventForMode(t,i.mode,i),ct.callback(n.onHover||n.hover.onHover,[t.native,e.active],e),"mouseup"!==t.type&&"click"!==t.type||n.onClick&&n.onClick.call(e,t.native,e.active),e.lastActive.length&&e.updateHoverStyle(e.lastActive,i.mode,!1),e.active.length&&i.mode&&e.updateHoverStyle(e.active,i.mode,!0),a=!ct.arrayEquals(e.active,e.lastActive),e.lastActive=e.active,a}}),Jn.instances={};var Qn=Jn;Jn.Controller=Jn,Jn.types={},ct.configMerge=Yn,ct.scaleMerge=Un;var ti=function(){function t(t,e,n){var i;return"string"===typeof t?(i=parseInt(t,10),-1!==t.indexOf("%")&&(i=i/100*e.parentNode[n])):i=t,i}function e(t){return void 0!==t&&null!==t&&"none"!==t}function n(n,i,a){var r=document.defaultView,o=ct._getParentNode(n),s=r.getComputedStyle(n)[i],l=r.getComputedStyle(o)[i],u=e(s),c=e(l),d=Number.POSITIVE_INFINITY;return u||c?Math.min(u?t(s,n,a):d,c?t(l,o,a):d):"none"}ct.where=function(t,e){if(ct.isArray(t)&&Array.prototype.filter)return t.filter(e);var n=[];return ct.each(t,(function(t){e(t)&&n.push(t)})),n},ct.findIndex=Array.prototype.findIndex?function(t,e,n){return t.findIndex(e,n)}:function(t,e,n){n=void 0===n?t:n;for(var i=0,a=t.length;i<a;++i)if(e.call(n,t[i],i,t))return i;return-1},ct.findNextWhere=function(t,e,n){ct.isNullOrUndef(n)&&(n=-1);for(var i=n+1;i<t.length;i++){var a=t[i];if(e(a))return a}},ct.findPreviousWhere=function(t,e,n){ct.isNullOrUndef(n)&&(n=t.length);for(var i=n-1;i>=0;i--){var a=t[i];if(e(a))return a}},ct.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},ct.almostEquals=function(t,e,n){return Math.abs(t-e)<n},ct.almostWhole=function(t,e){var n=Math.round(t);return n-e<=t&&n+e>=t},ct.max=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.max(t,e)}),Number.NEGATIVE_INFINITY)},ct.min=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.min(t,e)}),Number.POSITIVE_INFINITY)},ct.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return t=+t,0===t||isNaN(t)?t:t>0?1:-1},ct.toRadians=function(t){return t*(Math.PI/180)},ct.toDegrees=function(t){return t*(180/Math.PI)},ct._decimalPlaces=function(t){if(ct.isFinite(t)){var e=1,n=0;while(Math.round(t*e)/e!==t)e*=10,n++;return n}},ct.getAngleFromPoint=function(t,e){var n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),r=Math.atan2(i,n);return r<-.5*Math.PI&&(r+=2*Math.PI),{angle:r,distance:a}},ct.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},ct.aliasPixel=function(t){return t%2===0?0:.5},ct._alignPixel=function(t,e,n){var i=t.currentDevicePixelRatio,a=n/2;return Math.round((e-a)*i)/i+a},ct.splineCurve=function(t,e,n,i){var a=t.skip?e:t,r=e,o=n.skip?e:n,s=Math.sqrt(Math.pow(r.x-a.x,2)+Math.pow(r.y-a.y,2)),l=Math.sqrt(Math.pow(o.x-r.x,2)+Math.pow(o.y-r.y,2)),u=s/(s+l),c=l/(s+l);u=isNaN(u)?0:u,c=isNaN(c)?0:c;var d=i*u,h=i*c;return{previous:{x:r.x-d*(o.x-a.x),y:r.y-d*(o.y-a.y)},next:{x:r.x+h*(o.x-a.x),y:r.y+h*(o.y-a.y)}}},ct.EPSILON=Number.EPSILON||1e-14,ct.splineCurveMonotone=function(t){var e,n,i,a,r,o,s,l,u,c=(t||[]).map((function(t){return{model:t._model,deltaK:0,mK:0}})),d=c.length;for(e=0;e<d;++e)if(i=c[e],!i.model.skip){if(n=e>0?c[e-1]:null,a=e<d-1?c[e+1]:null,a&&!a.model.skip){var h=a.model.x-i.model.x;i.deltaK=0!==h?(a.model.y-i.model.y)/h:0}!n||n.model.skip?i.mK=i.deltaK:!a||a.model.skip?i.mK=n.deltaK:this.sign(n.deltaK)!==this.sign(i.deltaK)?i.mK=0:i.mK=(n.deltaK+i.deltaK)/2}for(e=0;e<d-1;++e)i=c[e],a=c[e+1],i.model.skip||a.model.skip||(ct.almostEquals(i.deltaK,0,this.EPSILON)?i.mK=a.mK=0:(r=i.mK/i.deltaK,o=a.mK/i.deltaK,l=Math.pow(r,2)+Math.pow(o,2),l<=9||(s=3/Math.sqrt(l),i.mK=r*s*i.deltaK,a.mK=o*s*i.deltaK)));for(e=0;e<d;++e)i=c[e],i.model.skip||(n=e>0?c[e-1]:null,a=e<d-1?c[e+1]:null,n&&!n.model.skip&&(u=(i.model.x-n.model.x)/3,i.model.controlPointPreviousX=i.model.x-u,i.model.controlPointPreviousY=i.model.y-u*i.mK),a&&!a.model.skip&&(u=(a.model.x-i.model.x)/3,i.model.controlPointNextX=i.model.x+u,i.model.controlPointNextY=i.model.y+u*i.mK))},ct.nextItem=function(t,e,n){return n?e>=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},ct.previousItem=function(t,e,n){return n?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},ct.niceNum=function(t,e){var n,i=Math.floor(ct.log10(t)),a=t/Math.pow(10,i);return n=e?a<1.5?1:a<3?2:a<7?5:10:a<=1?1:a<=2?2:a<=5?5:10,n*Math.pow(10,i)},ct.requestAnimFrame=function(){return"undefined"===typeof window?function(t){t()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)}}(),ct.getRelativePosition=function(t,e){var n,i,a=t.originalEvent||t,r=t.target||t.srcElement,o=r.getBoundingClientRect(),s=a.touches;s&&s.length>0?(n=s[0].clientX,i=s[0].clientY):(n=a.clientX,i=a.clientY);var l=parseFloat(ct.getStyle(r,"padding-left")),u=parseFloat(ct.getStyle(r,"padding-top")),c=parseFloat(ct.getStyle(r,"padding-right")),d=parseFloat(ct.getStyle(r,"padding-bottom")),h=o.right-o.left-l-c,f=o.bottom-o.top-u-d;return n=Math.round((n-o.left-l)/h*r.width/e.currentDevicePixelRatio),i=Math.round((i-o.top-u)/f*r.height/e.currentDevicePixelRatio),{x:n,y:i}},ct.getConstraintWidth=function(t){return n(t,"max-width","clientWidth")},ct.getConstraintHeight=function(t){return n(t,"max-height","clientHeight")},ct._calculatePadding=function(t,e,n){return e=ct.getStyle(t,e),e.indexOf("%")>-1?n*parseInt(e,10)/100:parseInt(e,10)},ct._getParentNode=function(t){var e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e},ct.getMaximumWidth=function(t){var e=ct._getParentNode(t);if(!e)return t.clientWidth;var n=e.clientWidth,i=ct._calculatePadding(e,"padding-left",n),a=ct._calculatePadding(e,"padding-right",n),r=n-i-a,o=ct.getConstraintWidth(t);return isNaN(o)?r:Math.min(r,o)},ct.getMaximumHeight=function(t){var e=ct._getParentNode(t);if(!e)return t.clientHeight;var n=e.clientHeight,i=ct._calculatePadding(e,"padding-top",n),a=ct._calculatePadding(e,"padding-bottom",n),r=n-i-a,o=ct.getConstraintHeight(t);return isNaN(o)?r:Math.min(r,o)},ct.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},ct.retinaScale=function(t,e){var n=t.currentDevicePixelRatio=e||"undefined"!==typeof window&&window.devicePixelRatio||1;if(1!==n){var i=t.canvas,a=t.height,r=t.width;i.height=a*n,i.width=r*n,t.ctx.scale(n,n),i.style.height||i.style.width||(i.style.height=a+"px",i.style.width=r+"px")}},ct.fontString=function(t,e,n){return e+" "+t+"px "+n},ct.longestText=function(t,e,n,i){i=i||{};var a=i.data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(a=i.data={},r=i.garbageCollect=[],i.font=e),t.font=e;var o,s,l,u,c,d=0,h=n.length;for(o=0;o<h;o++)if(u=n[o],void 0!==u&&null!==u&&!0!==ct.isArray(u))d=ct.measureText(t,a,r,d,u);else if(ct.isArray(u))for(s=0,l=u.length;s<l;s++)c=u[s],void 0===c||null===c||ct.isArray(c)||(d=ct.measureText(t,a,r,d,c));var f=r.length/2;if(f>n.length){for(o=0;o<f;o++)delete a[r[o]];r.splice(0,f)}return d},ct.measureText=function(t,e,n,i,a){var r=e[a];return r||(r=e[a]=t.measureText(a).width,n.push(a)),r>i&&(i=r),i},ct.numberOfLabelLines=function(t){var e=1;return ct.each(t,(function(t){ct.isArray(t)&&t.length>e&&(e=t.length)})),e},ct.color=E?function(t){return t instanceof CanvasGradient&&(t=J.global.defaultColor),E(t)}:function(t){return console.error("Color.js not found!"),t},ct.getHoverColor=function(t){return t instanceof CanvasPattern||t instanceof CanvasGradient?t:ct.color(t).saturate(.5).darken(.1).rgbString()}};function ei(){throw new Error("This method is not implemented: either no adapter can be found or an incomplete integration was provided.")}function ni(t){this.options=t||{}}ct.extend(ni.prototype,{formats:ei,parse:ei,format:ei,add:ei,diff:ei,startOf:ei,endOf:ei,_create:function(t){return t}}),ni.override=function(t){ct.extend(ni.prototype,t)};var ii=ni,ai={_date:ii},ri={formatters:{values:function(t){return ct.isArray(t)?t:""+t},linear:function(t,e,n){var i=n.length>3?n[2]-n[1]:n[1]-n[0];Math.abs(i)>1&&t!==Math.floor(t)&&(i=t-Math.floor(t));var a=ct.log10(Math.abs(i)),r="";if(0!==t){var o=Math.max(Math.abs(n[0]),Math.abs(n[n.length-1]));if(o<1e-4){var s=ct.log10(Math.abs(t)),l=Math.floor(s)-Math.floor(a);l=Math.max(Math.min(l,20),0),r=t.toExponential(l)}else{var u=-1*Math.floor(a);u=Math.max(Math.min(u,20),0),r=t.toFixed(u)}}else r="0";return r},logarithmic:function(t,e,n){var i=t/Math.pow(10,Math.floor(ct.log10(t)));return 0===t?"0":1===i||2===i||5===i||0===e||e===n.length-1?t.toExponential():""}}},oi=ct.isArray,si=ct.isNullOrUndef,li=ct.valueOrDefault,ui=ct.valueAtIndexOrDefault;function ci(t,e){for(var n=[],i=t.length/e,a=0,r=t.length;a<r;a+=i)n.push(t[Math.floor(a)]);return n}function di(t,e,n){var i,a=t.getTicks().length,r=Math.min(e,a-1),o=t.getPixelForTick(r),s=t._startPixel,l=t._endPixel,u=1e-6;if(!(n&&(i=1===a?Math.max(o-s,l-o):0===e?(t.getPixelForTick(1)-o)/2:(o-t.getPixelForTick(r-1))/2,o+=r<e?i:-i,o<s-u||o>l+u)))return o}function hi(t,e){ct.each(t,(function(t){var n,i=t.gc,a=i.length/2;if(a>e){for(n=0;n<a;++n)delete t.data[i[n]];i.splice(0,a)}}))}function fi(t,e,n,i){var a,r,o,s,l,u,c,d,h,f,g,p,m,v=n.length,b=[],y=[],x=[],_=0,w=0;for(a=0;a<v;++a){if(s=n[a].label,l=n[a].major?e.major:e.minor,t.font=u=l.string,c=i[u]=i[u]||{data:{},gc:[]},d=l.lineHeight,h=f=0,si(s)||oi(s)){if(oi(s))for(r=0,o=s.length;r<o;++r)g=s[r],si(g)||oi(g)||(h=ct.measureText(t,c.data,c.gc,h,g),f+=d)}else h=ct.measureText(t,c.data,c.gc,h,s),f=d;b.push(h),y.push(f),x.push(d/2),_=Math.max(h,_),w=Math.max(f,w)}function k(t){return{width:b[t]||0,height:y[t]||0,offset:x[t]||0}}return hi(i,v),p=b.indexOf(_),m=y.indexOf(w),{first:k(0),last:k(v-1),widest:k(p),highest:k(m)}}function gi(t){return t.drawTicks?t.tickMarkLength:0}function pi(t){var e,n;return t.display?(e=ct.options._parseFont(t),n=ct.options.toPadding(t.padding),e.lineHeight+n.height):0}function mi(t,e){return ct.extend(ct.options._parseFont({fontFamily:li(e.fontFamily,t.fontFamily),fontSize:li(e.fontSize,t.fontSize),fontStyle:li(e.fontStyle,t.fontStyle),lineHeight:li(e.lineHeight,t.lineHeight)}),{color:ct.options.resolve([e.fontColor,t.fontColor,J.global.defaultFontColor])})}function vi(t){var e=mi(t,t.minor),n=t.major.enabled?mi(t,t.major):e;return{minor:e,major:n}}function bi(t){var e,n,i,a=[];for(n=0,i=t.length;n<i;++n)e=t[n],"undefined"!==typeof e._index&&a.push(e);return a}function yi(t){var e,n,i=t.length;if(i<2)return!1;for(n=t[0],e=1;e<i;++e)if(t[e]-t[e-1]!==n)return!1;return n}function xi(t,e,n,i){var a,r,o,s,l=yi(t),u=(e.length-1)/i;if(!l)return Math.max(u,1);for(a=ct.math._factorize(l),o=0,s=a.length-1;o<s;o++)if(r=a[o],r>u)return r;return Math.max(u,1)}function _i(t){var e,n,i=[];for(e=0,n=t.length;e<n;e++)t[e].major&&i.push(e);return i}function wi(t,e,n){var i,a,r=0,o=e[0];for(n=Math.ceil(n),i=0;i<t.length;i++)a=t[i],i===o?(a._index=i,r++,o=e[r*n]):delete a.label}function ki(t,e,n,i){var a,r,o,s,l=li(n,0),u=Math.min(li(i,t.length),t.length),c=0;e=Math.ceil(e),i&&(a=i-n,e=a/Math.floor(a/e)),s=l;while(s<0)c++,s=Math.round(l+c*e);for(r=Math.max(l,0);r<u;r++)o=t[r],r===s?(o._index=r,c++,s=Math.round(l+c*e)):delete o.label}J._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:ri.formatters.values,minor:{},major:{}}});var Mi=bt.extend({zeroLineIndex:0,getPadding:function(){var t=this;return{left:t.paddingLeft||0,top:t.paddingTop||0,right:t.paddingRight||0,bottom:t.paddingBottom||0}},getTicks:function(){return this._ticks},_getLabels:function(){var t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]},mergeTicksOptions:function(){},beforeUpdate:function(){ct.callback(this.options.beforeUpdate,[this])},update:function(t,e,n){var i,a,r,o,s,l=this,u=l.options.ticks,c=u.sampleSize;if(l.beforeUpdate(),l.maxWidth=t,l.maxHeight=e,l.margins=ct.extend({left:0,right:0,top:0,bottom:0},n),l._ticks=null,l.ticks=null,l._labelSizes=null,l._maxLabelLines=0,l.longestLabelWidth=0,l.longestTextCache=l.longestTextCache||{},l._gridLineItems=null,l._labelItems=null,l.beforeSetDimensions(),l.setDimensions(),l.afterSetDimensions(),l.beforeDataLimits(),l.determineDataLimits(),l.afterDataLimits(),l.beforeBuildTicks(),o=l.buildTicks()||[],o=l.afterBuildTicks(o)||o,(!o||!o.length)&&l.ticks)for(o=[],i=0,a=l.ticks.length;i<a;++i)o.push({value:l.ticks[i],major:!1});return l._ticks=o,s=c<o.length,r=l._convertTicksToLabels(s?ci(o,c):o),l._configure(),l.beforeCalculateTickRotation(),l.calculateTickRotation(),l.afterCalculateTickRotation(),l.beforeFit(),l.fit(),l.afterFit(),l._ticksToDraw=u.display&&(u.autoSkip||"auto"===u.source)?l._autoSkip(o):o,s&&(r=l._convertTicksToLabels(l._ticksToDraw)),l.ticks=r,l.afterUpdate(),l.minSize},_configure:function(){var t,e,n=this,i=n.options.ticks.reverse;n.isHorizontal()?(t=n.left,e=n.right):(t=n.top,e=n.bottom,i=!i),n._startPixel=t,n._endPixel=e,n._reversePixels=i,n._length=e-t},afterUpdate:function(){ct.callback(this.options.afterUpdate,[this])},beforeSetDimensions:function(){ct.callback(this.options.beforeSetDimensions,[this])},setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0},afterSetDimensions:function(){ct.callback(this.options.afterSetDimensions,[this])},beforeDataLimits:function(){ct.callback(this.options.beforeDataLimits,[this])},determineDataLimits:ct.noop,afterDataLimits:function(){ct.callback(this.options.afterDataLimits,[this])},beforeBuildTicks:function(){ct.callback(this.options.beforeBuildTicks,[this])},buildTicks:ct.noop,afterBuildTicks:function(t){var e=this;return oi(t)&&t.length?ct.callback(e.options.afterBuildTicks,[e,t]):(e.ticks=ct.callback(e.options.afterBuildTicks,[e,e.ticks])||e.ticks,t)},beforeTickToLabelConversion:function(){ct.callback(this.options.beforeTickToLabelConversion,[this])},convertTicksToLabels:function(){var t=this,e=t.options.ticks;t.ticks=t.ticks.map(e.userCallback||e.callback,this)},afterTickToLabelConversion:function(){ct.callback(this.options.afterTickToLabelConversion,[this])},beforeCalculateTickRotation:function(){ct.callback(this.options.beforeCalculateTickRotation,[this])},calculateTickRotation:function(){var t,e,n,i,a,r,o,s=this,l=s.options,u=l.ticks,c=s.getTicks().length,d=u.minRotation||0,h=u.maxRotation,f=d;!s._isVisible()||!u.display||d>=h||c<=1||!s.isHorizontal()?s.labelRotation=d:(t=s._getLabelSizes(),e=t.widest.width,n=t.highest.height-t.highest.offset,i=Math.min(s.maxWidth,s.chart.width-e),a=l.offset?s.maxWidth/c:i/(c-1),e+6>a&&(a=i/(c-(l.offset?.5:1)),r=s.maxHeight-gi(l.gridLines)-u.padding-pi(l.scaleLabel),o=Math.sqrt(e*e+n*n),f=ct.toDegrees(Math.min(Math.asin(Math.min((t.highest.height+6)/a,1)),Math.asin(Math.min(r/o,1))-Math.asin(n/o))),f=Math.max(d,Math.min(h,f))),s.labelRotation=f)},afterCalculateTickRotation:function(){ct.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){ct.callback(this.options.beforeFit,[this])},fit:function(){var t=this,e=t.minSize={width:0,height:0},n=t.chart,i=t.options,a=i.ticks,r=i.scaleLabel,o=i.gridLines,s=t._isVisible(),l="bottom"===i.position,u=t.isHorizontal();if(u?e.width=t.maxWidth:s&&(e.width=gi(o)+pi(r)),u?s&&(e.height=gi(o)+pi(r)):e.height=t.maxHeight,a.display&&s){var c=vi(a),d=t._getLabelSizes(),h=d.first,f=d.last,g=d.widest,p=d.highest,m=.4*c.minor.lineHeight,v=a.padding;if(u){var b=0!==t.labelRotation,y=ct.toRadians(t.labelRotation),x=Math.cos(y),_=Math.sin(y),w=_*g.width+x*(p.height-(b?p.offset:0))+(b?0:m);e.height=Math.min(t.maxHeight,e.height+w+v);var k,M,C=t.getPixelForTick(0)-t.left,S=t.right-t.getPixelForTick(t.getTicks().length-1);b?(k=l?x*h.width+_*h.offset:_*(h.height-h.offset),M=l?_*(f.height-f.offset):x*f.width+_*f.offset):(k=h.width/2,M=f.width/2),t.paddingLeft=Math.max((k-C)*t.width/(t.width-C),0)+3,t.paddingRight=Math.max((M-S)*t.width/(t.width-S),0)+3}else{var P=a.mirror?0:g.width+v+m;e.width=Math.min(t.maxWidth,e.width+P),t.paddingTop=h.height/2,t.paddingBottom=f.height/2}}t.handleMargins(),u?(t.width=t._length=n.width-t.margins.left-t.margins.right,t.height=e.height):(t.width=e.width,t.height=t._length=n.height-t.margins.top-t.margins.bottom)},handleMargins:function(){var t=this;t.margins&&(t.margins.left=Math.max(t.paddingLeft,t.margins.left),t.margins.top=Math.max(t.paddingTop,t.margins.top),t.margins.right=Math.max(t.paddingRight,t.margins.right),t.margins.bottom=Math.max(t.paddingBottom,t.margins.bottom))},afterFit:function(){ct.callback(this.options.afterFit,[this])},isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(t){if(si(t))return NaN;if(("number"===typeof t||t instanceof Number)&&!isFinite(t))return NaN;if(t)if(this.isHorizontal()){if(void 0!==t.x)return this.getRightValue(t.x)}else if(void 0!==t.y)return this.getRightValue(t.y);return t},_convertTicksToLabels:function(t){var e,n,i,a=this;for(a.ticks=t.map((function(t){return t.value})),a.beforeTickToLabelConversion(),e=a.convertTicksToLabels(t)||a.ticks,a.afterTickToLabelConversion(),n=0,i=t.length;n<i;++n)t[n].label=e[n];return e},_getLabelSizes:function(){var t=this,e=t._labelSizes;return e||(t._labelSizes=e=fi(t.ctx,vi(t.options.ticks),t.getTicks(),t.longestTextCache),t.longestLabelWidth=e.widest.width),e},_parseValue:function(t){var e,n,i,a;return oi(t)?(e=+this.getRightValue(t[0]),n=+this.getRightValue(t[1]),i=Math.min(e,n),a=Math.max(e,n)):(t=+this.getRightValue(t),e=void 0,n=t,i=t,a=t),{min:i,max:a,start:e,end:n}},_getScaleLabel:function(t){var e=this._parseValue(t);return void 0!==e.start?"["+e.start+", "+e.end+"]":+this.getRightValue(t)},getLabelForIndex:ct.noop,getPixelForValue:ct.noop,getValueForPixel:ct.noop,getPixelForTick:function(t){var e=this,n=e.options.offset,i=e._ticks.length,a=1/Math.max(i-(n?0:1),1);return t<0||t>i-1?null:e.getPixelForDecimal(t*a+(n?a/2:0))},getPixelForDecimal:function(t){var e=this;return e._reversePixels&&(t=1-t),e._startPixel+t*e._length},getDecimalForPixel:function(t){var e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var t=this,e=t.min,n=t.max;return t.beginAtZero?0:e<0&&n<0?n:e>0&&n>0?e:0},_autoSkip:function(t){var e,n,i,a,r=this,o=r.options.ticks,s=r._length,l=o.maxTicksLimit||s/r._tickSize()+1,u=o.major.enabled?_i(t):[],c=u.length,d=u[0],h=u[c-1];if(c>l)return wi(t,u,c/l),bi(t);if(i=xi(u,t,s,l),c>0){for(e=0,n=c-1;e<n;e++)ki(t,i,u[e],u[e+1]);return a=c>1?(h-d)/(c-1):null,ki(t,i,ct.isNullOrUndef(a)?0:d-a,d),ki(t,i,h,ct.isNullOrUndef(a)?t.length:h+a),bi(t)}return ki(t,i),bi(t)},_tickSize:function(){var t=this,e=t.options.ticks,n=ct.toRadians(t.labelRotation),i=Math.abs(Math.cos(n)),a=Math.abs(Math.sin(n)),r=t._getLabelSizes(),o=e.autoSkipPadding||0,s=r?r.widest.width+o:0,l=r?r.highest.height+o:0;return t.isHorizontal()?l*i>s*a?s/i:l/a:l*a<s*i?l/i:s/a},_isVisible:function(){var t,e,n,i=this,a=i.chart,r=i.options.display;if("auto"!==r)return!!r;for(t=0,e=a.data.datasets.length;t<e;++t)if(a.isDatasetVisible(t)&&(n=a.getDatasetMeta(t),n.xAxisID===i.id||n.yAxisID===i.id))return!0;return!1},_computeGridLineItems:function(t){var e,n,i,a,r,o,s,l,u,c,d,h,f,g,p,m,v,b=this,y=b.chart,x=b.options,_=x.gridLines,w=x.position,k=_.offsetGridLines,M=b.isHorizontal(),C=b._ticksToDraw,S=C.length+(k?1:0),P=gi(_),D=[],A=_.drawBorder?ui(_.lineWidth,0,0):0,T=A/2,O=ct._alignPixel,I=function(t){return O(y,t,A)};for("top"===w?(e=I(b.bottom),s=b.bottom-P,u=e-T,d=I(t.top)+T,f=t.bottom):"bottom"===w?(e=I(b.top),d=t.top,f=I(t.bottom)-T,s=e+T,u=b.top+P):"left"===w?(e=I(b.right),o=b.right-P,l=e-T,c=I(t.left)+T,h=t.right):(e=I(b.left),c=t.left,h=I(t.right)-T,o=e+T,l=b.left+P),n=0;n<S;++n)i=C[n]||{},si(i.label)&&n<C.length||(n===b.zeroLineIndex&&x.offset===k?(g=_.zeroLineWidth,p=_.zeroLineColor,m=_.zeroLineBorderDash||[],v=_.zeroLineBorderDashOffset||0):(g=ui(_.lineWidth,n,1),p=ui(_.color,n,"rgba(0,0,0,0.1)"),m=_.borderDash||[],v=_.borderDashOffset||0),a=di(b,i._index||n,k),void 0!==a&&(r=O(y,a,g),M?o=l=c=h=r:s=u=d=f=r,D.push({tx1:o,ty1:s,tx2:l,ty2:u,x1:c,y1:d,x2:h,y2:f,width:g,color:p,borderDash:m,borderDashOffset:v})));return D.ticksLength=S,D.borderValue=e,D},_computeLabelItems:function(){var t,e,n,i,a,r,o,s,l,u,c,d,h=this,f=h.options,g=f.ticks,p=f.position,m=g.mirror,v=h.isHorizontal(),b=h._ticksToDraw,y=vi(g),x=g.padding,_=gi(f.gridLines),w=-ct.toRadians(h.labelRotation),k=[];for("top"===p?(r=h.bottom-_-x,o=w?"left":"center"):"bottom"===p?(r=h.top+_+x,o=w?"right":"center"):"left"===p?(a=h.right-(m?0:_)-x,o=m?"left":"right"):(a=h.left+(m?0:_)+x,o=m?"right":"left"),t=0,e=b.length;t<e;++t)n=b[t],i=n.label,si(i)||(s=h.getPixelForTick(n._index||t)+g.labelOffset,l=n.major?y.major:y.minor,u=l.lineHeight,c=oi(i)?i.length:1,v?(a=s,d="top"===p?((w?1:.5)-c)*u:(w?0:.5)*u):(r=s,d=(1-c)*u/2),k.push({x:a,y:r,rotation:w,label:i,font:l,textOffset:d,textAlign:o}));return k},_drawGrid:function(t){var e=this,n=e.options.gridLines;if(n.display){var i,a,r,o,s,l=e.ctx,u=e.chart,c=ct._alignPixel,d=n.drawBorder?ui(n.lineWidth,0,0):0,h=e._gridLineItems||(e._gridLineItems=e._computeGridLineItems(t));for(r=0,o=h.length;r<o;++r)s=h[r],i=s.width,a=s.color,i&&a&&(l.save(),l.lineWidth=i,l.strokeStyle=a,l.setLineDash&&(l.setLineDash(s.borderDash),l.lineDashOffset=s.borderDashOffset),l.beginPath(),n.drawTicks&&(l.moveTo(s.tx1,s.ty1),l.lineTo(s.tx2,s.ty2)),n.drawOnChartArea&&(l.moveTo(s.x1,s.y1),l.lineTo(s.x2,s.y2)),l.stroke(),l.restore());if(d){var f,g,p,m,v=d,b=ui(n.lineWidth,h.ticksLength-1,1),y=h.borderValue;e.isHorizontal()?(f=c(u,e.left,v)-v/2,g=c(u,e.right,b)+b/2,p=m=y):(p=c(u,e.top,v)-v/2,m=c(u,e.bottom,b)+b/2,f=g=y),l.lineWidth=d,l.strokeStyle=ui(n.color,0),l.beginPath(),l.moveTo(f,p),l.lineTo(g,m),l.stroke()}}},_drawLabels:function(){var t=this,e=t.options.ticks;if(e.display){var n,i,a,r,o,s,l,u,c=t.ctx,d=t._labelItems||(t._labelItems=t._computeLabelItems());for(n=0,a=d.length;n<a;++n){if(o=d[n],s=o.font,c.save(),c.translate(o.x,o.y),c.rotate(o.rotation),c.font=s.string,c.fillStyle=s.color,c.textBaseline="middle",c.textAlign=o.textAlign,l=o.label,u=o.textOffset,oi(l))for(i=0,r=l.length;i<r;++i)c.fillText(""+l[i],0,u),u+=s.lineHeight;else c.fillText(l,0,u);c.restore()}}},_drawTitle:function(){var t=this,e=t.ctx,n=t.options,i=n.scaleLabel;if(i.display){var a,r,o=li(i.fontColor,J.global.defaultFontColor),s=ct.options._parseFont(i),l=ct.options.toPadding(i.padding),u=s.lineHeight/2,c=n.position,d=0;if(t.isHorizontal())a=t.left+t.width/2,r="bottom"===c?t.bottom-u-l.bottom:t.top+u+l.top;else{var h="left"===c;a=h?t.left+u+l.top:t.right-u-l.top,r=t.top+t.height/2,d=h?-.5*Math.PI:.5*Math.PI}e.save(),e.translate(a,r),e.rotate(d),e.textAlign="center",e.textBaseline="middle",e.fillStyle=o,e.font=s.string,e.fillText(i.labelString,0,0),e.restore()}},draw:function(t){var e=this;e._isVisible()&&(e._drawGrid(t),e._drawTitle(),e._drawLabels())},_layers:function(){var t=this,e=t.options,n=e.ticks&&e.ticks.z||0,i=e.gridLines&&e.gridLines.z||0;return t._isVisible()&&n!==i&&t.draw===t._draw?[{z:i,draw:function(){t._drawGrid.apply(t,arguments),t._drawTitle.apply(t,arguments)}},{z:n,draw:function(){t._drawLabels.apply(t,arguments)}}]:[{z:n,draw:function(){t.draw.apply(t,arguments)}}]},_getMatchingVisibleMetas:function(t){var e=this,n=e.isHorizontal();return e.chart._getSortedVisibleDatasetMetas().filter((function(i){return(!t||i.type===t)&&(n?i.xAxisID===e.id:i.yAxisID===e.id)}))}});Mi.prototype._draw=Mi.prototype.draw;var Ci=Mi,Si=ct.isNullOrUndef,Pi={position:"bottom"},Di=Ci.extend({determineDataLimits:function(){var t,e=this,n=e._getLabels(),i=e.options.ticks,a=i.min,r=i.max,o=0,s=n.length-1;void 0!==a&&(t=n.indexOf(a),t>=0&&(o=t)),void 0!==r&&(t=n.indexOf(r),t>=0&&(s=t)),e.minIndex=o,e.maxIndex=s,e.min=n[o],e.max=n[s]},buildTicks:function(){var t=this,e=t._getLabels(),n=t.minIndex,i=t.maxIndex;t.ticks=0===n&&i===e.length-1?e:e.slice(n,i+1)},getLabelForIndex:function(t,e){var n=this,i=n.chart;return i.getDatasetMeta(e).controller._getValueScaleId()===n.id?n.getRightValue(i.data.datasets[e].data[t]):n._getLabels()[t]},_configure:function(){var t=this,e=t.options.offset,n=t.ticks;Ci.prototype._configure.call(t),t.isHorizontal()||(t._reversePixels=!t._reversePixels),n&&(t._startValue=t.minIndex-(e?.5:0),t._valueRange=Math.max(n.length-(e?0:1),1))},getPixelForValue:function(t,e,n){var i,a,r,o=this;return Si(e)||Si(n)||(t=o.chart.data.datasets[n].data[e]),Si(t)||(i=o.isHorizontal()?t.x:t.y),(void 0!==i||void 0!==t&&isNaN(e))&&(a=o._getLabels(),t=ct.valueOrDefault(i,t),r=a.indexOf(t),e=-1!==r?r:e,isNaN(e)&&(e=t)),o.getPixelForDecimal((e-o._startValue)/o._valueRange)},getPixelForTick:function(t){var e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t],t+this.minIndex)},getValueForPixel:function(t){var e=this,n=Math.round(e._startValue+e.getDecimalForPixel(t)*e._valueRange);return Math.min(Math.max(n,0),e.ticks.length-1)},getBasePixel:function(){return this.bottom}}),Ai=Pi;Di._defaults=Ai;var Ti=ct.noop,Oi=ct.isNullOrUndef;function Ii(t,e){var n,i,a,r,o=[],s=1e-14,l=t.stepSize,u=l||1,c=t.maxTicks-1,d=t.min,h=t.max,f=t.precision,g=e.min,p=e.max,m=ct.niceNum((p-g)/c/u)*u;if(m<s&&Oi(d)&&Oi(h))return[g,p];r=Math.ceil(p/m)-Math.floor(g/m),r>c&&(m=ct.niceNum(r*m/c/u)*u),l||Oi(f)?n=Math.pow(10,ct._decimalPlaces(m)):(n=Math.pow(10,f),m=Math.ceil(m*n)/n),i=Math.floor(g/m)*m,a=Math.ceil(p/m)*m,l&&(!Oi(d)&&ct.almostWhole(d/m,m/1e3)&&(i=d),!Oi(h)&&ct.almostWhole(h/m,m/1e3)&&(a=h)),r=(a-i)/m,r=ct.almostEquals(r,Math.round(r),m/1e3)?Math.round(r):Math.ceil(r),i=Math.round(i*n)/n,a=Math.round(a*n)/n,o.push(Oi(d)?i:d);for(var v=1;v<r;++v)o.push(Math.round((i+v*m)*n)/n);return o.push(Oi(h)?a:h),o}var Li=Ci.extend({getRightValue:function(t){return"string"===typeof t?+t:Ci.prototype.getRightValue.call(this,t)},handleTickRangeOptions:function(){var t=this,e=t.options,n=e.ticks;if(n.beginAtZero){var i=ct.sign(t.min),a=ct.sign(t.max);i<0&&a<0?t.max=0:i>0&&a>0&&(t.min=0)}var r=void 0!==n.min||void 0!==n.suggestedMin,o=void 0!==n.max||void 0!==n.suggestedMax;void 0!==n.min?t.min=n.min:void 0!==n.suggestedMin&&(null===t.min?t.min=n.suggestedMin:t.min=Math.min(t.min,n.suggestedMin)),void 0!==n.max?t.max=n.max:void 0!==n.suggestedMax&&(null===t.max?t.max=n.suggestedMax:t.max=Math.max(t.max,n.suggestedMax)),r!==o&&t.min>=t.max&&(r?t.max=t.min+1:t.min=t.max-1),t.min===t.max&&(t.max++,n.beginAtZero||t.min--)},getTickLimit:function(){var t,e=this,n=e.options.ticks,i=n.stepSize,a=n.maxTicksLimit;return i?t=Math.ceil(e.max/i)-Math.floor(e.min/i)+1:(t=e._computeTickLimit(),a=a||11),a&&(t=Math.min(a,t)),t},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:Ti,buildTicks:function(){var t=this,e=t.options,n=e.ticks,i=t.getTickLimit();i=Math.max(2,i);var a={maxTicks:i,min:n.min,max:n.max,precision:n.precision,stepSize:ct.valueOrDefault(n.fixedStepSize,n.stepSize)},r=t.ticks=Ii(a,t);t.handleDirectionalChanges(),t.max=ct.max(r),t.min=ct.min(r),n.reverse?(r.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max)},convertTicksToLabels:function(){var t=this;t.ticksAsNumbers=t.ticks.slice(),t.zeroLineIndex=t.ticks.indexOf(0),Ci.prototype.convertTicksToLabels.call(t)},_configure:function(){var t,e=this,n=e.getTicks(),i=e.min,a=e.max;Ci.prototype._configure.call(e),e.options.offset&&n.length&&(t=(a-i)/Math.max(n.length-1,1)/2,i-=t,a+=t),e._startValue=i,e._endValue=a,e._valueRange=a-i}}),Fi={position:"left",ticks:{callback:ri.formatters.linear}},Ri=0,Ni=1;function Ei(t,e,n){var i=[n.type,void 0===e&&void 0===n.stack?n.index:"",n.stack].join(".");return void 0===t[i]&&(t[i]={pos:[],neg:[]}),t[i]}function zi(t,e,n,i){var a,r,o=t.options,s=o.stacked,l=Ei(e,s,n),u=l.pos,c=l.neg,d=i.length;for(a=0;a<d;++a)r=t._parseValue(i[a]),isNaN(r.min)||isNaN(r.max)||n.data[a].hidden||(u[a]=u[a]||0,c[a]=c[a]||0,o.relativePoints?u[a]=100:r.min<0||r.max<0?c[a]+=r.min:u[a]+=r.max)}function Bi(t,e,n){var i,a,r=n.length;for(i=0;i<r;++i)a=t._parseValue(n[i]),isNaN(a.min)||isNaN(a.max)||e.data[i].hidden||(t.min=Math.min(t.min,a.min),t.max=Math.max(t.max,a.max))}var Wi=Li.extend({determineDataLimits:function(){var t,e,n,i,a=this,r=a.options,o=a.chart,s=o.data.datasets,l=a._getMatchingVisibleMetas(),u=r.stacked,c={},d=l.length;if(a.min=Number.POSITIVE_INFINITY,a.max=Number.NEGATIVE_INFINITY,void 0===u)for(t=0;!u&&t<d;++t)e=l[t],u=void 0!==e.stack;for(t=0;t<d;++t)e=l[t],n=s[e.index].data,u?zi(a,c,e,n):Bi(a,e,n);ct.each(c,(function(t){i=t.pos.concat(t.neg),a.min=Math.min(a.min,ct.min(i)),a.max=Math.max(a.max,ct.max(i))})),a.min=ct.isFinite(a.min)&&!isNaN(a.min)?a.min:Ri,a.max=ct.isFinite(a.max)&&!isNaN(a.max)?a.max:Ni,a.handleTickRangeOptions()},_computeTickLimit:function(){var t,e=this;return e.isHorizontal()?Math.ceil(e.width/40):(t=ct.options._parseFont(e.options.ticks),Math.ceil(e.height/t.lineHeight))},handleDirectionalChanges:function(){this.isHorizontal()||this.ticks.reverse()},getLabelForIndex:function(t,e){return this._getScaleLabel(this.chart.data.datasets[e].data[t])},getPixelForValue:function(t){var e=this;return e.getPixelForDecimal((+e.getRightValue(t)-e._startValue)/e._valueRange)},getValueForPixel:function(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange},getPixelForTick:function(t){var e=this.ticksAsNumbers;return t<0||t>e.length-1?null:this.getPixelForValue(e[t])}}),Vi=Fi;Wi._defaults=Vi;var Hi=ct.valueOrDefault,ji=ct.math.log10;function qi(t,e){var n,i,a=[],r=Hi(t.min,Math.pow(10,Math.floor(ji(e.min)))),o=Math.floor(ji(e.max)),s=Math.ceil(e.max/Math.pow(10,o));0===r?(n=Math.floor(ji(e.minNotZero)),i=Math.floor(e.minNotZero/Math.pow(10,n)),a.push(r),r=i*Math.pow(10,n)):(n=Math.floor(ji(r)),i=Math.floor(r/Math.pow(10,n)));var l=n<0?Math.pow(10,Math.abs(n)):1;do{a.push(r),++i,10===i&&(i=1,++n,l=n>=0?1:l),r=Math.round(i*Math.pow(10,n)*l)/l}while(n<o||n===o&&i<s);var u=Hi(t.max,r);return a.push(u),a}var Ui={position:"left",ticks:{callback:ri.formatters.logarithmic}};function Yi(t,e){return ct.isFinite(t)&&t>=0?t:e}var $i=Ci.extend({determineDataLimits:function(){var t,e,n,i,a,r,o=this,s=o.options,l=o.chart,u=l.data.datasets,c=o.isHorizontal();function d(t){return c?t.xAxisID===o.id:t.yAxisID===o.id}o.min=Number.POSITIVE_INFINITY,o.max=Number.NEGATIVE_INFINITY,o.minNotZero=Number.POSITIVE_INFINITY;var h=s.stacked;if(void 0===h)for(t=0;t<u.length;t++)if(e=l.getDatasetMeta(t),l.isDatasetVisible(t)&&d(e)&&void 0!==e.stack){h=!0;break}if(s.stacked||h){var f={};for(t=0;t<u.length;t++){e=l.getDatasetMeta(t);var g=[e.type,void 0===s.stacked&&void 0===e.stack?t:"",e.stack].join(".");if(l.isDatasetVisible(t)&&d(e))for(void 0===f[g]&&(f[g]=[]),i=u[t].data,a=0,r=i.length;a<r;a++){var p=f[g];n=o._parseValue(i[a]),isNaN(n.min)||isNaN(n.max)||e.data[a].hidden||n.min<0||n.max<0||(p[a]=p[a]||0,p[a]+=n.max)}}ct.each(f,(function(t){if(t.length>0){var e=ct.min(t),n=ct.max(t);o.min=Math.min(o.min,e),o.max=Math.max(o.max,n)}}))}else for(t=0;t<u.length;t++)if(e=l.getDatasetMeta(t),l.isDatasetVisible(t)&&d(e))for(i=u[t].data,a=0,r=i.length;a<r;a++)n=o._parseValue(i[a]),isNaN(n.min)||isNaN(n.max)||e.data[a].hidden||n.min<0||n.max<0||(o.min=Math.min(n.min,o.min),o.max=Math.max(n.max,o.max),0!==n.min&&(o.minNotZero=Math.min(n.min,o.minNotZero)));o.min=ct.isFinite(o.min)?o.min:null,o.max=ct.isFinite(o.max)?o.max:null,o.minNotZero=ct.isFinite(o.minNotZero)?o.minNotZero:null,this.handleTickRangeOptions()},handleTickRangeOptions:function(){var t=this,e=t.options.ticks,n=1,i=10;t.min=Yi(e.min,t.min),t.max=Yi(e.max,t.max),t.min===t.max&&(0!==t.min&&null!==t.min?(t.min=Math.pow(10,Math.floor(ji(t.min))-1),t.max=Math.pow(10,Math.floor(ji(t.max))+1)):(t.min=n,t.max=i)),null===t.min&&(t.min=Math.pow(10,Math.floor(ji(t.max))-1)),null===t.max&&(t.max=0!==t.min?Math.pow(10,Math.floor(ji(t.min))+1):i),null===t.minNotZero&&(t.min>0?t.minNotZero=t.min:t.max<1?t.minNotZero=Math.pow(10,Math.floor(ji(t.max))):t.minNotZero=n)},buildTicks:function(){var t=this,e=t.options.ticks,n=!t.isHorizontal(),i={min:Yi(e.min),max:Yi(e.max)},a=t.ticks=qi(i,t);t.max=ct.max(a),t.min=ct.min(a),e.reverse?(n=!n,t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),n&&a.reverse()},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),Ci.prototype.convertTicksToLabels.call(this)},getLabelForIndex:function(t,e){return this._getScaleLabel(this.chart.data.datasets[e].data[t])},getPixelForTick:function(t){var e=this.tickValues;return t<0||t>e.length-1?null:this.getPixelForValue(e[t])},_getFirstTickValue:function(t){var e=Math.floor(ji(t)),n=Math.floor(t/Math.pow(10,e));return n*Math.pow(10,e)},_configure:function(){var t=this,e=t.min,n=0;Ci.prototype._configure.call(t),0===e&&(e=t._getFirstTickValue(t.minNotZero),n=Hi(t.options.ticks.fontSize,J.global.defaultFontSize)/t._length),t._startValue=ji(e),t._valueOffset=n,t._valueRange=(ji(t.max)-ji(e))/(1-n)},getPixelForValue:function(t){var e=this,n=0;return t=+e.getRightValue(t),t>e.min&&t>0&&(n=(ji(t)-e._startValue)/e._valueRange+e._valueOffset),e.getPixelForDecimal(n)},getValueForPixel:function(t){var e=this,n=e.getDecimalForPixel(t);return 0===n&&0===e.min?0:Math.pow(10,e._startValue+(n-e._valueOffset)*e._valueRange)}}),Gi=Ui;$i._defaults=Gi;var Xi=ct.valueOrDefault,Ki=ct.valueAtIndexOrDefault,Zi=ct.options.resolve,Ji={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:ri.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(t){return t}}};function Qi(t){var e=t.ticks;return e.display&&t.display?Xi(e.fontSize,J.global.defaultFontSize)+2*e.backdropPaddingY:0}function ta(t,e,n){return ct.isArray(n)?{w:ct.longestText(t,t.font,n),h:n.length*e}:{w:t.measureText(n).width,h:e}}function ea(t,e,n,i,a){return t===i||t===a?{start:e-n/2,end:e+n/2}:t<i||t>a?{start:e-n,end:e}:{start:e,end:e+n}}function na(t){var e,n,i,a=ct.options._parseFont(t.options.pointLabels),r={l:0,r:t.width,t:0,b:t.height-t.paddingTop},o={};t.ctx.font=a.string,t._pointLabelSizes=[];var s=t.chart.data.labels.length;for(e=0;e<s;e++){i=t.getPointPosition(e,t.drawingArea+5),n=ta(t.ctx,a.lineHeight,t.pointLabels[e]),t._pointLabelSizes[e]=n;var l=t.getIndexAngle(e),u=ct.toDegrees(l)%360,c=ea(u,i.x,n.w,0,180),d=ea(u,i.y,n.h,90,270);c.start<r.l&&(r.l=c.start,o.l=l),c.end>r.r&&(r.r=c.end,o.r=l),d.start<r.t&&(r.t=d.start,o.t=l),d.end>r.b&&(r.b=d.end,o.b=l)}t.setReductions(t.drawingArea,r,o)}function ia(t){return 0===t||180===t?"center":t<180?"left":"right"}function aa(t,e,n,i){var a,r,o=n.y+i/2;if(ct.isArray(e))for(a=0,r=e.length;a<r;++a)t.fillText(e[a],n.x,o),o+=i;else t.fillText(e,n.x,o)}function ra(t,e,n){90===t||270===t?n.y-=e.h/2:(t>270||t<90)&&(n.y-=e.h)}function oa(t){var e=t.ctx,n=t.options,i=n.pointLabels,a=Qi(n),r=t.getDistanceFromCenterForValue(n.ticks.reverse?t.min:t.max),o=ct.options._parseFont(i);e.save(),e.font=o.string,e.textBaseline="middle";for(var s=t.chart.data.labels.length-1;s>=0;s--){var l=0===s?a/2:0,u=t.getPointPosition(s,r+l+5),c=Ki(i.fontColor,s,J.global.defaultFontColor);e.fillStyle=c;var d=t.getIndexAngle(s),h=ct.toDegrees(d);e.textAlign=ia(h),ra(h,t._pointLabelSizes[s],u),aa(e,t.pointLabels[s],u,o.lineHeight)}e.restore()}function sa(t,e,n,i){var a,r=t.ctx,o=e.circular,s=t.chart.data.labels.length,l=Ki(e.color,i-1),u=Ki(e.lineWidth,i-1);if((o||s)&&l&&u){if(r.save(),r.strokeStyle=l,r.lineWidth=u,r.setLineDash&&(r.setLineDash(e.borderDash||[]),r.lineDashOffset=e.borderDashOffset||0),r.beginPath(),o)r.arc(t.xCenter,t.yCenter,n,0,2*Math.PI);else{a=t.getPointPosition(0,n),r.moveTo(a.x,a.y);for(var c=1;c<s;c++)a=t.getPointPosition(c,n),r.lineTo(a.x,a.y)}r.closePath(),r.stroke(),r.restore()}}function la(t){return ct.isNumber(t)?t:0}var ua=Li.extend({setDimensions:function(){var t=this;t.width=t.maxWidth,t.height=t.maxHeight,t.paddingTop=Qi(t.options)/2,t.xCenter=Math.floor(t.width/2),t.yCenter=Math.floor((t.height-t.paddingTop)/2),t.drawingArea=Math.min(t.height-t.paddingTop,t.width)/2},determineDataLimits:function(){var t=this,e=t.chart,n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;ct.each(e.data.datasets,(function(a,r){if(e.isDatasetVisible(r)){var o=e.getDatasetMeta(r);ct.each(a.data,(function(e,a){var r=+t.getRightValue(e);isNaN(r)||o.data[a].hidden||(n=Math.min(r,n),i=Math.max(r,i))}))}})),t.min=n===Number.POSITIVE_INFINITY?0:n,t.max=i===Number.NEGATIVE_INFINITY?0:i,t.handleTickRangeOptions()},_computeTickLimit:function(){return Math.ceil(this.drawingArea/Qi(this.options))},convertTicksToLabels:function(){var t=this;Li.prototype.convertTicksToLabels.call(t),t.pointLabels=t.chart.data.labels.map((function(){var e=ct.callback(t.options.pointLabels.callback,arguments,t);return e||0===e?e:""}))},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},fit:function(){var t=this,e=t.options;e.display&&e.pointLabels.display?na(t):t.setCenterPoint(0,0,0,0)},setReductions:function(t,e,n){var i=this,a=e.l/Math.sin(n.l),r=Math.max(e.r-i.width,0)/Math.sin(n.r),o=-e.t/Math.cos(n.t),s=-Math.max(e.b-(i.height-i.paddingTop),0)/Math.cos(n.b);a=la(a),r=la(r),o=la(o),s=la(s),i.drawingArea=Math.min(Math.floor(t-(a+r)/2),Math.floor(t-(o+s)/2)),i.setCenterPoint(a,r,o,s)},setCenterPoint:function(t,e,n,i){var a=this,r=a.width-e-a.drawingArea,o=t+a.drawingArea,s=n+a.drawingArea,l=a.height-a.paddingTop-i-a.drawingArea;a.xCenter=Math.floor((o+r)/2+a.left),a.yCenter=Math.floor((s+l)/2+a.top+a.paddingTop)},getIndexAngle:function(t){var e=this.chart,n=360/e.data.labels.length,i=e.options||{},a=i.startAngle||0,r=(t*n+a)%360;return(r<0?r+360:r)*Math.PI*2/360},getDistanceFromCenterForValue:function(t){var e=this;if(ct.isNullOrUndef(t))return NaN;var n=e.drawingArea/(e.max-e.min);return e.options.ticks.reverse?(e.max-t)*n:(t-e.min)*n},getPointPosition:function(t,e){var n=this,i=n.getIndexAngle(t)-Math.PI/2;return{x:Math.cos(i)*e+n.xCenter,y:Math.sin(i)*e+n.yCenter}},getPointPositionForValue:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))},getBasePosition:function(t){var e=this,n=e.min,i=e.max;return e.getPointPositionForValue(t||0,e.beginAtZero?0:n<0&&i<0?i:n>0&&i>0?n:0)},_drawGrid:function(){var t,e,n,i=this,a=i.ctx,r=i.options,o=r.gridLines,s=r.angleLines,l=Xi(s.lineWidth,o.lineWidth),u=Xi(s.color,o.color);if(r.pointLabels.display&&oa(i),o.display&&ct.each(i.ticks,(function(t,n){0!==n&&(e=i.getDistanceFromCenterForValue(i.ticksAsNumbers[n]),sa(i,o,e,n))})),s.display&&l&&u){for(a.save(),a.lineWidth=l,a.strokeStyle=u,a.setLineDash&&(a.setLineDash(Zi([s.borderDash,o.borderDash,[]])),a.lineDashOffset=Zi([s.borderDashOffset,o.borderDashOffset,0])),t=i.chart.data.labels.length-1;t>=0;t--)e=i.getDistanceFromCenterForValue(r.ticks.reverse?i.min:i.max),n=i.getPointPosition(t,e),a.beginPath(),a.moveTo(i.xCenter,i.yCenter),a.lineTo(n.x,n.y),a.stroke();a.restore()}},_drawLabels:function(){var t=this,e=t.ctx,n=t.options,i=n.ticks;if(i.display){var a,r,o=t.getIndexAngle(0),s=ct.options._parseFont(i),l=Xi(i.fontColor,J.global.defaultFontColor);e.save(),e.font=s.string,e.translate(t.xCenter,t.yCenter),e.rotate(o),e.textAlign="center",e.textBaseline="middle",ct.each(t.ticks,(function(n,o){(0!==o||i.reverse)&&(a=t.getDistanceFromCenterForValue(t.ticksAsNumbers[o]),i.showLabelBackdrop&&(r=e.measureText(n).width,e.fillStyle=i.backdropColor,e.fillRect(-r/2-i.backdropPaddingX,-a-s.size/2-i.backdropPaddingY,r+2*i.backdropPaddingX,s.size+2*i.backdropPaddingY)),e.fillStyle=l,e.fillText(n,0,-a))})),e.restore()}},_drawTitle:ct.noop}),ca=Ji;ua._defaults=ca;var da=ct._deprecated,ha=ct.options.resolve,fa=ct.valueOrDefault,ga=Number.MIN_SAFE_INTEGER||-9007199254740991,pa=Number.MAX_SAFE_INTEGER||9007199254740991,ma={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}},va=Object.keys(ma);function ba(t,e){return t-e}function ya(t){var e,n,i,a={},r=[];for(e=0,n=t.length;e<n;++e)i=t[e],a[i]||(a[i]=!0,r.push(i));return r}function xa(t){return ct.valueOrDefault(t.time.min,t.ticks.min)}function _a(t){return ct.valueOrDefault(t.time.max,t.ticks.max)}function wa(t,e,n,i){if("linear"===i||!t.length)return[{time:e,pos:0},{time:n,pos:1}];var a,r,o,s,l,u=[],c=[e];for(a=0,r=t.length;a<r;++a)s=t[a],s>e&&s<n&&c.push(s);for(c.push(n),a=0,r=c.length;a<r;++a)l=c[a+1],o=c[a-1],s=c[a],void 0!==o&&void 0!==l&&Math.round((l+o)/2)===s||u.push({time:s,pos:a/(r-1)});return u}function ka(t,e,n){var i,a,r,o=0,s=t.length-1;while(o>=0&&o<=s){if(i=o+s>>1,a=t[i-1]||null,r=t[i],!a)return{lo:null,hi:r};if(r[e]<n)o=i+1;else{if(!(a[e]>n))return{lo:a,hi:r};s=i-1}}return{lo:r,hi:null}}function Ma(t,e,n,i){var a=ka(t,e,n),r=a.lo?a.hi?a.lo:t[t.length-2]:t[0],o=a.lo?a.hi?a.hi:t[t.length-1]:t[1],s=o[e]-r[e],l=s?(n-r[e])/s:0,u=(o[i]-r[i])*l;return r[i]+u}function Ca(t,e){var n=t._adapter,i=t.options.time,a=i.parser,r=a||i.format,o=e;return"function"===typeof a&&(o=a(o)),ct.isFinite(o)||(o="string"===typeof r?n.parse(o,r):n.parse(o)),null!==o?+o:(a||"function"!==typeof r||(o=r(e),ct.isFinite(o)||(o=n.parse(o))),o)}function Sa(t,e){if(ct.isNullOrUndef(e))return null;var n=t.options.time,i=Ca(t,t.getRightValue(e));return null===i||n.round&&(i=+t._adapter.startOf(i,n.round)),i}function Pa(t,e,n,i){var a,r,o,s=va.length;for(a=va.indexOf(t);a<s-1;++a)if(r=ma[va[a]],o=r.steps?r.steps:pa,r.common&&Math.ceil((n-e)/(o*r.size))<=i)return va[a];return va[s-1]}function Da(t,e,n,i,a){var r,o;for(r=va.length-1;r>=va.indexOf(n);r--)if(o=va[r],ma[o].common&&t._adapter.diff(a,i,o)>=e-1)return o;return va[n?va.indexOf(n):0]}function Aa(t){for(var e=va.indexOf(t)+1,n=va.length;e<n;++e)if(ma[va[e]].common)return va[e]}function Ta(t,e,n,i){var a,r=t._adapter,o=t.options,s=o.time,l=s.unit||Pa(s.minUnit,e,n,i),u=ha([s.stepSize,s.unitStepSize,1]),c="week"===l&&s.isoWeekday,d=e,h=[];if(c&&(d=+r.startOf(d,"isoWeek",c)),d=+r.startOf(d,c?"day":l),r.diff(n,e,l)>1e5*u)throw e+" and "+n+" are too far apart with stepSize of "+u+" "+l;for(a=d;a<n;a=+r.add(a,u,l))h.push(a);return a!==n&&"ticks"!==o.bounds||h.push(a),h}function Oa(t,e,n,i,a){var r,o,s=0,l=0;return a.offset&&e.length&&(r=Ma(t,"time",e[0],"pos"),s=1===e.length?1-r:(Ma(t,"time",e[1],"pos")-r)/2,o=Ma(t,"time",e[e.length-1],"pos"),l=1===e.length?o:(o-Ma(t,"time",e[e.length-2],"pos"))/2),{start:s,end:l,factor:1/(s+1+l)}}function Ia(t,e,n,i){var a,r,o=t._adapter,s=+o.startOf(e[0].value,i),l=e[e.length-1].value;for(a=s;a<=l;a=+o.add(a,1,i))r=n[a],r>=0&&(e[r].major=!0);return e}function La(t,e,n){var i,a,r=[],o={},s=e.length;for(i=0;i<s;++i)a=e[i],o[a]=i,r.push({value:a,major:!1});return 0!==s&&n?Ia(t,r,o,n):r}var Fa={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}}},Ra=Ci.extend({initialize:function(){this.mergeTicksOptions(),Ci.prototype.initialize.call(this)},update:function(){var t=this,e=t.options,n=e.time||(e.time={}),i=t._adapter=new ai._date(e.adapters.date);return da("time scale",n.format,"time.format","time.parser"),da("time scale",n.min,"time.min","ticks.min"),da("time scale",n.max,"time.max","ticks.max"),ct.mergeIf(n.displayFormats,i.formats()),Ci.prototype.update.apply(t,arguments)},getRightValue:function(t){return t&&void 0!==t.t&&(t=t.t),Ci.prototype.getRightValue.call(this,t)},determineDataLimits:function(){var t,e,n,i,a,r,o,s=this,l=s.chart,u=s._adapter,c=s.options,d=c.time.unit||"day",h=pa,f=ga,g=[],p=[],m=[],v=s._getLabels();for(t=0,n=v.length;t<n;++t)m.push(Sa(s,v[t]));for(t=0,n=(l.data.datasets||[]).length;t<n;++t)if(l.isDatasetVisible(t))if(a=l.data.datasets[t].data,ct.isObject(a[0]))for(p[t]=[],e=0,i=a.length;e<i;++e)r=Sa(s,a[e]),g.push(r),p[t][e]=r;else p[t]=m.slice(0),o||(g=g.concat(m),o=!0);else p[t]=[];m.length&&(h=Math.min(h,m[0]),f=Math.max(f,m[m.length-1])),g.length&&(g=n>1?ya(g).sort(ba):g.sort(ba),h=Math.min(h,g[0]),f=Math.max(f,g[g.length-1])),h=Sa(s,xa(c))||h,f=Sa(s,_a(c))||f,h=h===pa?+u.startOf(Date.now(),d):h,f=f===ga?+u.endOf(Date.now(),d)+1:f,s.min=Math.min(h,f),s.max=Math.max(h+1,f),s._table=[],s._timestamps={data:g,datasets:p,labels:m}},buildTicks:function(){var t,e,n,i=this,a=i.min,r=i.max,o=i.options,s=o.ticks,l=o.time,u=i._timestamps,c=[],d=i.getLabelCapacity(a),h=s.source,f=o.distribution;for(u="data"===h||"auto"===h&&"series"===f?u.data:"labels"===h?u.labels:Ta(i,a,r,d),"ticks"===o.bounds&&u.length&&(a=u[0],r=u[u.length-1]),a=Sa(i,xa(o))||a,r=Sa(i,_a(o))||r,t=0,e=u.length;t<e;++t)n=u[t],n>=a&&n<=r&&c.push(n);return i.min=a,i.max=r,i._unit=l.unit||(s.autoSkip?Pa(l.minUnit,i.min,i.max,d):Da(i,c.length,l.minUnit,i.min,i.max)),i._majorUnit=s.major.enabled&&"year"!==i._unit?Aa(i._unit):void 0,i._table=wa(i._timestamps.data,a,r,f),i._offsets=Oa(i._table,c,a,r,o),s.reverse&&c.reverse(),La(i,c,i._majorUnit)},getLabelForIndex:function(t,e){var n=this,i=n._adapter,a=n.chart.data,r=n.options.time,o=a.labels&&t<a.labels.length?a.labels[t]:"",s=a.datasets[e].data[t];return ct.isObject(s)&&(o=n.getRightValue(s)),r.tooltipFormat?i.format(Ca(n,o),r.tooltipFormat):"string"===typeof o?o:i.format(Ca(n,o),r.displayFormats.datetime)},tickFormatFunction:function(t,e,n,i){var a=this,r=a._adapter,o=a.options,s=o.time.displayFormats,l=s[a._unit],u=a._majorUnit,c=s[u],d=n[e],h=o.ticks,f=u&&c&&d&&d.major,g=r.format(t,i||(f?c:l)),p=f?h.major:h.minor,m=ha([p.callback,p.userCallback,h.callback,h.userCallback]);return m?m(g,e,n):g},convertTicksToLabels:function(t){var e,n,i=[];for(e=0,n=t.length;e<n;++e)i.push(this.tickFormatFunction(t[e].value,e,t));return i},getPixelForOffset:function(t){var e=this,n=e._offsets,i=Ma(e._table,"time",t,"pos");return e.getPixelForDecimal((n.start+i)*n.factor)},getPixelForValue:function(t,e,n){var i=this,a=null;if(void 0!==e&&void 0!==n&&(a=i._timestamps.datasets[n][e]),null===a&&(a=Sa(i,t)),null!==a)return i.getPixelForOffset(a)},getPixelForTick:function(t){var e=this.getTicks();return t>=0&&t<e.length?this.getPixelForOffset(e[t].value):null},getValueForPixel:function(t){var e=this,n=e._offsets,i=e.getDecimalForPixel(t)/n.factor-n.end,a=Ma(e._table,"pos",i,"time");return e._adapter._create(a)},_getLabelSize:function(t){var e=this,n=e.options.ticks,i=e.ctx.measureText(t).width,a=ct.toRadians(e.isHorizontal()?n.maxRotation:n.minRotation),r=Math.cos(a),o=Math.sin(a),s=fa(n.fontSize,J.global.defaultFontSize);return{w:i*r+s*o,h:i*o+s*r}},getLabelWidth:function(t){return this._getLabelSize(t).w},getLabelCapacity:function(t){var e=this,n=e.options.time,i=n.displayFormats,a=i[n.unit]||i.millisecond,r=e.tickFormatFunction(t,0,La(e,[t],e._majorUnit),a),o=e._getLabelSize(r),s=Math.floor(e.isHorizontal()?e.width/o.w:e.height/o.h);return e.options.offset&&s--,s>0?s:1}}),Na=Fa;Ra._defaults=Na;var Ea={category:Di,linear:Wi,logarithmic:$i,radialLinear:ua,time:Ra},za={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"};ai._date.override("function"===typeof t?{_id:"moment",formats:function(){return za},parse:function(e,n){return"string"===typeof e&&"string"===typeof n?e=t(e,n):e instanceof t||(e=t(e)),e.isValid()?e.valueOf():null},format:function(e,n){return t(e).format(n)},add:function(e,n,i){return t(e).add(n,i).valueOf()},diff:function(e,n,i){return t(e).diff(t(n),i)},startOf:function(e,n,i){return e=t(e),"isoWeek"===n?e.isoWeekday(i).valueOf():e.startOf(n).valueOf()},endOf:function(e,n){return t(e).endOf(n).valueOf()},_create:function(e){return t(e)}}:{}),J._set("global",{plugins:{filler:{propagate:!0}}});var Ba={dataset:function(t){var e=t.fill,n=t.chart,i=n.getDatasetMeta(e),a=i&&n.isDatasetVisible(e),r=a&&i.dataset._children||[],o=r.length||0;return o?function(t,e){return e<o&&r[e]._view||null}:null},boundary:function(t){var e=t.boundary,n=e?e.x:null,i=e?e.y:null;return ct.isArray(e)?function(t,n){return e[n]}:function(t){return{x:null===n?t.x:n,y:null===i?t.y:i}}}};function Wa(t,e,n){var i,a=t._model||{},r=a.fill;if(void 0===r&&(r=!!a.backgroundColor),!1===r||null===r)return!1;if(!0===r)return"origin";if(i=parseFloat(r,10),isFinite(i)&&Math.floor(i)===i)return"-"!==r[0]&&"+"!==r[0]||(i=e+i),!(i===e||i<0||i>=n)&&i;switch(r){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return r;default:return!1}}function Va(t){var e,n=t.el._model||{},i=t.el._scale||{},a=t.fill,r=null;if(isFinite(a))return null;if("start"===a?r=void 0===n.scaleBottom?i.bottom:n.scaleBottom:"end"===a?r=void 0===n.scaleTop?i.top:n.scaleTop:void 0!==n.scaleZero?r=n.scaleZero:i.getBasePixel&&(r=i.getBasePixel()),void 0!==r&&null!==r){if(void 0!==r.x&&void 0!==r.y)return r;if(ct.isFinite(r))return e=i.isHorizontal(),{x:e?r:null,y:e?null:r}}return null}function Ha(t){var e,n,i,a,r,o=t.el._scale,s=o.options,l=o.chart.data.labels.length,u=t.fill,c=[];if(!l)return null;for(e=s.ticks.reverse?o.max:o.min,n=s.ticks.reverse?o.min:o.max,i=o.getPointPositionForValue(0,e),a=0;a<l;++a)r="start"===u||"end"===u?o.getPointPositionForValue(a,"start"===u?e:n):o.getBasePosition(a),s.gridLines.circular&&(r.cx=i.x,r.cy=i.y,r.angle=o.getIndexAngle(a)-Math.PI/2),c.push(r);return c}function ja(t){var e=t.el._scale||{};return e.getPointPositionForValue?Ha(t):Va(t)}function qa(t,e,n){var i,a=t[e],r=a.fill,o=[e];if(!n)return r;while(!1!==r&&-1===o.indexOf(r)){if(!isFinite(r))return r;if(i=t[r],!i)return!1;if(i.visible)return r;o.push(r),r=i.fill}return!1}function Ua(t){var e=t.fill,n="dataset";return!1===e?null:(isFinite(e)||(n="boundary"),Ba[n](t))}function Ya(t){return t&&!t.skip}function $a(t,e,n,i,a){var r,o,s,l;if(i&&a){for(t.moveTo(e[0].x,e[0].y),r=1;r<i;++r)ct.canvas.lineTo(t,e[r-1],e[r]);if(void 0===n[0].angle)for(t.lineTo(n[a-1].x,n[a-1].y),r=a-1;r>0;--r)ct.canvas.lineTo(t,n[r],n[r-1],!0);else for(o=n[0].cx,s=n[0].cy,l=Math.sqrt(Math.pow(n[0].x-o,2)+Math.pow(n[0].y-s,2)),r=a-1;r>0;--r)t.arc(o,s,l,n[r].angle,n[r-1].angle,!0)}}function Ga(t,e,n,i,a,r){var o,s,l,u,c,d,h,f,g=e.length,p=i.spanGaps,m=[],v=[],b=0,y=0;for(t.beginPath(),o=0,s=g;o<s;++o)l=o%g,u=e[l]._view,c=n(u,l,i),d=Ya(u),h=Ya(c),r&&void 0===f&&d&&(f=o+1,s=g+f),d&&h?(b=m.push(u),y=v.push(c)):b&&y&&(p?(d&&m.push(u),h&&v.push(c)):($a(t,m,v,b,y),b=y=0,m=[],v=[]));$a(t,m,v,b,y),t.closePath(),t.fillStyle=a,t.fill()}var Xa={id:"filler",afterDatasetsUpdate:function(t,e){var n,i,a,r,o=(t.data.datasets||[]).length,s=e.propagate,l=[];for(i=0;i<o;++i)n=t.getDatasetMeta(i),a=n.dataset,r=null,a&&a._model&&a instanceof Kt.Line&&(r={visible:t.isDatasetVisible(i),fill:Wa(a,i,o),chart:t,el:a}),n.$filler=r,l.push(r);for(i=0;i<o;++i)r=l[i],r&&(r.fill=qa(l,i,s),r.boundary=ja(r),r.mapper=Ua(r))},beforeDatasetsDraw:function(t){var e,n,i,a,r,o,s,l=t._getSortedVisibleDatasetMetas(),u=t.ctx;for(n=l.length-1;n>=0;--n)e=l[n].$filler,e&&e.visible&&(i=e.el,a=i._view,r=i._children||[],o=e.mapper,s=a.backgroundColor||J.global.defaultColor,o&&s&&r.length&&(ct.canvas.clipArea(u,t.chartArea),Ga(u,r,o,a,s,i._loop),ct.canvas.unclipArea(u)))}},Ka=ct.rtl.getRtlAdapter,Za=ct.noop,Ja=ct.valueOrDefault;function Qa(t,e){return t.usePointStyle&&t.boxWidth>e?e:t.boxWidth}J._set("global",{legend:{display:!0,position:"top",align:"center",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(t,e){var n=e.datasetIndex,i=this.chart,a=i.getDatasetMeta(n);a.hidden=null===a.hidden?!i.data.datasets[n].hidden:null,i.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(t){var e=t.data.datasets,n=t.options.legend||{},i=n.labels&&n.labels.usePointStyle;return t._getSortedDatasetMetas().map((function(n){var a=n.controller.getStyle(i?0:void 0);return{text:e[n.index].label,fillStyle:a.backgroundColor,hidden:!t.isDatasetVisible(n.index),lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:a.borderWidth,strokeStyle:a.borderColor,pointStyle:a.pointStyle,rotation:a.rotation,datasetIndex:n.index}}),this)}}},legendCallback:function(t){var e,n,i,a,r=document.createElement("ul"),o=t.data.datasets;for(r.setAttribute("class",t.id+"-legend"),e=0,n=o.length;e<n;e++)i=r.appendChild(document.createElement("li")),a=i.appendChild(document.createElement("span")),a.style.backgroundColor=o[e].backgroundColor,o[e].label&&i.appendChild(document.createTextNode(o[e].label));return r.outerHTML}});var tr=bt.extend({initialize:function(t){var e=this;ct.extend(e,t),e.legendHitBoxes=[],e._hoveredItem=null,e.doughnutMode=!1},beforeUpdate:Za,update:function(t,e,n){var i=this;return i.beforeUpdate(),i.maxWidth=t,i.maxHeight=e,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:Za,beforeSetDimensions:Za,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:Za,beforeBuildLabels:Za,buildLabels:function(){var t=this,e=t.options.labels||{},n=ct.callback(e.generateLabels,[t.chart],t)||[];e.filter&&(n=n.filter((function(n){return e.filter(n,t.chart.data)}))),t.options.reverse&&n.reverse(),t.legendItems=n},afterBuildLabels:Za,beforeFit:Za,fit:function(){var t=this,e=t.options,n=e.labels,i=e.display,a=t.ctx,r=ct.options._parseFont(n),o=r.size,s=t.legendHitBoxes=[],l=t.minSize,u=t.isHorizontal();if(u?(l.width=t.maxWidth,l.height=i?10:0):(l.width=i?10:0,l.height=t.maxHeight),i){if(a.font=r.string,u){var c=t.lineWidths=[0],d=0;a.textAlign="left",a.textBaseline="middle",ct.each(t.legendItems,(function(t,e){var i=Qa(n,o),r=i+o/2+a.measureText(t.text).width;(0===e||c[c.length-1]+r+2*n.padding>l.width)&&(d+=o+n.padding,c[c.length-(e>0?0:1)]=0),s[e]={left:0,top:0,width:r,height:o},c[c.length-1]+=r+n.padding})),l.height+=d}else{var h=n.padding,f=t.columnWidths=[],g=t.columnHeights=[],p=n.padding,m=0,v=0;ct.each(t.legendItems,(function(t,e){var i=Qa(n,o),r=i+o/2+a.measureText(t.text).width;e>0&&v+o+2*h>l.height&&(p+=m+n.padding,f.push(m),g.push(v),m=0,v=0),m=Math.max(m,r),v+=o+h,s[e]={left:0,top:0,width:r,height:o}})),p+=m,f.push(m),g.push(v),l.width+=p}t.width=l.width,t.height=l.height}else t.width=l.width=t.height=l.height=0},afterFit:Za,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var t=this,e=t.options,n=e.labels,i=J.global,a=i.defaultColor,r=i.elements.line,o=t.height,s=t.columnHeights,l=t.width,u=t.lineWidths;if(e.display){var c,d=Ka(e.rtl,t.left,t.minSize.width),h=t.ctx,f=Ja(n.fontColor,i.defaultFontColor),g=ct.options._parseFont(n),p=g.size;h.textAlign=d.textAlign("left"),h.textBaseline="middle",h.lineWidth=.5,h.strokeStyle=f,h.fillStyle=f,h.font=g.string;var m=Qa(n,p),v=t.legendHitBoxes,b=function(t,e,i){if(!(isNaN(m)||m<=0)){h.save();var o=Ja(i.lineWidth,r.borderWidth);if(h.fillStyle=Ja(i.fillStyle,a),h.lineCap=Ja(i.lineCap,r.borderCapStyle),h.lineDashOffset=Ja(i.lineDashOffset,r.borderDashOffset),h.lineJoin=Ja(i.lineJoin,r.borderJoinStyle),h.lineWidth=o,h.strokeStyle=Ja(i.strokeStyle,a),h.setLineDash&&h.setLineDash(Ja(i.lineDash,r.borderDash)),n&&n.usePointStyle){var s=m*Math.SQRT2/2,l=d.xPlus(t,m/2),u=e+p/2;ct.canvas.drawPoint(h,i.pointStyle,s,l,u,i.rotation)}else h.fillRect(d.leftForLtr(t,m),e,m,p),0!==o&&h.strokeRect(d.leftForLtr(t,m),e,m,p);h.restore()}},y=function(t,e,n,i){var a=p/2,r=d.xPlus(t,m+a),o=e+a;h.fillText(n.text,r,o),n.hidden&&(h.beginPath(),h.lineWidth=2,h.moveTo(r,o),h.lineTo(d.xPlus(r,i),o),h.stroke())},x=function(t,i){switch(e.align){case"start":return n.padding;case"end":return t-i;default:return(t-i+n.padding)/2}},_=t.isHorizontal();c=_?{x:t.left+x(l,u[0]),y:t.top+n.padding,line:0}:{x:t.left+n.padding,y:t.top+x(o,s[0]),line:0},ct.rtl.overrideTextDirection(t.ctx,e.textDirection);var w=p+n.padding;ct.each(t.legendItems,(function(e,i){var a=h.measureText(e.text).width,r=m+p/2+a,f=c.x,g=c.y;d.setWidth(t.minSize.width),_?i>0&&f+r+n.padding>t.left+t.minSize.width&&(g=c.y+=w,c.line++,f=c.x=t.left+x(l,u[c.line])):i>0&&g+w>t.top+t.minSize.height&&(f=c.x=f+t.columnWidths[c.line]+n.padding,c.line++,g=c.y=t.top+x(o,s[c.line]));var k=d.x(f);b(k,g,e),v[i].left=d.leftForLtr(k,v[i].width),v[i].top=g,y(k,g,e,a),_?c.x+=r+n.padding:c.y+=w})),ct.rtl.restoreTextDirection(t.ctx,e.textDirection)}},_getLegendItemAt:function(t,e){var n,i,a,r=this;if(t>=r.left&&t<=r.right&&e>=r.top&&e<=r.bottom)for(a=r.legendHitBoxes,n=0;n<a.length;++n)if(i=a[n],t>=i.left&&t<=i.left+i.width&&e>=i.top&&e<=i.top+i.height)return r.legendItems[n];return null},handleEvent:function(t){var e,n=this,i=n.options,a="mouseup"===t.type?"click":t.type;if("mousemove"===a){if(!i.onHover&&!i.onLeave)return}else{if("click"!==a)return;if(!i.onClick)return}e=n._getLegendItemAt(t.x,t.y),"click"===a?e&&i.onClick&&i.onClick.call(n,t.native,e):(i.onLeave&&e!==n._hoveredItem&&(n._hoveredItem&&i.onLeave.call(n,t.native,n._hoveredItem),n._hoveredItem=e),i.onHover&&e&&i.onHover.call(n,t.native,e))}});function er(t,e){var n=new tr({ctx:t.ctx,options:e,chart:t});Xe.configure(t,n,e),Xe.addBox(t,n),t.legend=n}var nr={id:"legend",_element:tr,beforeInit:function(t){var e=t.options.legend;e&&er(t,e)},beforeUpdate:function(t){var e=t.options.legend,n=t.legend;e?(ct.mergeIf(e,J.global.legend),n?(Xe.configure(t,n,e),n.options=e):er(t,e)):n&&(Xe.removeBox(t,n),delete t.legend)},afterEvent:function(t,e){var n=t.legend;n&&n.handleEvent(e)}},ir=ct.noop;J._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var ar=bt.extend({initialize:function(t){var e=this;ct.extend(e,t),e.legendHitBoxes=[]},beforeUpdate:ir,update:function(t,e,n){var i=this;return i.beforeUpdate(),i.maxWidth=t,i.maxHeight=e,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:ir,beforeSetDimensions:ir,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:ir,beforeBuildLabels:ir,buildLabels:ir,afterBuildLabels:ir,beforeFit:ir,fit:function(){var t,e,n=this,i=n.options,a=n.minSize={},r=n.isHorizontal();i.display?(t=ct.isArray(i.text)?i.text.length:1,e=t*ct.options._parseFont(i).lineHeight+2*i.padding,n.width=a.width=r?n.maxWidth:e,n.height=a.height=r?e:n.maxHeight):n.width=a.width=n.height=a.height=0},afterFit:ir,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var t=this,e=t.ctx,n=t.options;if(n.display){var i,a,r,o=ct.options._parseFont(n),s=o.lineHeight,l=s/2+n.padding,u=0,c=t.top,d=t.left,h=t.bottom,f=t.right;e.fillStyle=ct.valueOrDefault(n.fontColor,J.global.defaultFontColor),e.font=o.string,t.isHorizontal()?(a=d+(f-d)/2,r=c+l,i=f-d):(a="left"===n.position?d+l:f-l,r=c+(h-c)/2,i=h-c,u=Math.PI*("left"===n.position?-.5:.5)),e.save(),e.translate(a,r),e.rotate(u),e.textAlign="center",e.textBaseline="middle";var g=n.text;if(ct.isArray(g))for(var p=0,m=0;m<g.length;++m)e.fillText(g[m],0,p,i),p+=s;else e.fillText(g,0,0,i);e.restore()}}});function rr(t,e){var n=new ar({ctx:t.ctx,options:e,chart:t});Xe.configure(t,n,e),Xe.addBox(t,n),t.titleBlock=n}var or={id:"title",_element:ar,beforeInit:function(t){var e=t.options.title;e&&rr(t,e)},beforeUpdate:function(t){var e=t.options.title,n=t.titleBlock;e?(ct.mergeIf(e,J.global.title),n?(Xe.configure(t,n,e),n.options=e):rr(t,e)):n&&(Xe.removeBox(t,n),delete t.titleBlock)}},sr={},lr=Xa,ur=nr,cr=or;for(var dr in sr.filler=lr,sr.legend=ur,sr.title=cr,Qn.helpers=ct,ti(),Qn._adapters=ai,Qn.Animation=xt,Qn.animationService=_t,Qn.controllers=Ae,Qn.DatasetController=Pt,Qn.defaults=J,Qn.Element=bt,Qn.elements=Kt,Qn.Interaction=Ne,Qn.layouts=Xe,Qn.platform=Sn,Qn.plugins=Pn,Qn.Scale=Ci,Qn.scaleService=Dn,Qn.Ticks=ri,Qn.Tooltip=jn,Qn.helpers.each(Ea,(function(t,e){Qn.scaleService.registerScaleType(e,t,t._defaults)})),sr)sr.hasOwnProperty(dr)&&Qn.plugins.register(sr[dr]);Qn.platform.initialize();var hr=Qn;return"undefined"!==typeof window&&(window.Chart=Qn),Qn.Chart=Qn,Qn.Legend=sr.legend._element,Qn.Title=sr.title._element,Qn.pluginService=Qn.plugins,Qn.PluginBase=Qn.Element.extend({}),Qn.canvasHelpers=Qn.helpers.canvas,Qn.layoutService=Qn.layouts,Qn.LinearScaleBase=Li,Qn.helpers.each(["Bar","Bubble","Doughnut","Line","PolarArea","Radar","Scatter"],(function(t){Qn[t]=function(e,n){return new Qn(e,Qn.helpers.merge(n||{},{type:t.charAt(0).toLowerCase()+t.slice(1)}))}})),hr}))},"408a":function(t,e,n){var i=n("c6b6");t.exports=function(t){if("number"!=typeof t&&"Number"!=i(t))throw TypeError("Incorrect invocation");return+t}},6306:function(t,e,n){var i=n("038f");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var a=n("499e").default;a("2f11979b",i,!0,{sourceMap:!1,shadowMode:!1})},"7aaa":function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("a-row",{staticClass:"row-two"},[n("a-col",{attrs:{lg:24,sm:24}},[n("a-card",{staticStyle:{"min-height":"400px"},attrs:{title:"服务器状态"}},[n("a-row",[n("a-col",{staticClass:"chart",attrs:{lg:12,sm:24}},[n("a-statistic",{staticStyle:{margin:"0 50px 10px 0"},attrs:{value:t.cpu,title:"CPU"},scopedSlots:t._u([{key:"suffix",fn:function(){return[n("span",[t._v("%")])]},proxy:!0}])}),n("p",[t._v("运行时间 "+t._s(t.uptime))]),n("p",[t._v("系统负载 1min:"+t._s(t.loadavg.load1)+" 5min:"+t._s(t.loadavg.load5)+" 15min:"+t._s(t.loadavg.load15))]),n("line-chart",{attrs:{"chart-data":t.cpu_analytic,options:t.cpu_analytic.options,height:150}})],1),n("a-col",{staticClass:"chart_dashboard",attrs:{lg:6,sm:8,xs:12}},[n("div",[n("a-tooltip",{attrs:{title:"已使用: "+t.memory_used+" 缓存: "+t.memory_cached+"空闲:"+t.memory_free+" 物理内存: "+t.memory_total}},[n("a-progress",{attrs:{percent:t.memory_pressure,strokeColor:"rgb(135, 208, 104)",type:"dashboard"}}),n("p",{staticClass:"description"},[t._v("实际内存占用")])],1)],1)]),n("a-col",{staticClass:"chart_dashboard",attrs:{lg:6,sm:8,xs:12}},[n("div",[n("a-tooltip",{attrs:{title:"已使用: "+t.disk_used+" / 总共: "+t.disk_total}},[n("a-progress",{attrs:{percent:t.disk_percentage,type:"dashboard"}}),n("p",{staticClass:"description"},[t._v("存储空间")])],1)],1)])],1)],1)],1)],1)],1)},a=[];n("b680");function r(t,e){if(e){var n=this.$data._chart,i=t.datasets.map((function(t){return t.label})),a=e.datasets.map((function(t){return t.label})),r=JSON.stringify(a),o=JSON.stringify(i);o===r&&e.datasets.length===t.datasets.length?(t.datasets.forEach((function(t,i){var a=Object.keys(e.datasets[i]),r=Object.keys(t),o=a.filter((function(t){return"_meta"!==t&&-1===r.indexOf(t)}));for(var s in o.forEach((function(t){delete n.data.datasets[i][t]})),t)t.hasOwnProperty(s)&&(n.data.datasets[i][s]=t[s])})),t.hasOwnProperty("labels")&&(n.data.labels=t.labels,this.$emit("labels:update")),t.hasOwnProperty("xLabels")&&(n.data.xLabels=t.xLabels,this.$emit("xlabels:update")),t.hasOwnProperty("yLabels")&&(n.data.yLabels=t.yLabels,this.$emit("ylabels:update")),n.update(),this.$emit("chart:update")):(n&&(n.destroy(),this.$emit("chart:destroy")),this.renderChart(this.chartData,this.options),this.$emit("chart:render"))}else this.$data._chart&&(this.$data._chart.destroy(),this.$emit("chart:destroy")),this.renderChart(this.chartData,this.options),this.$emit("chart:render")}var o={data:function(){return{chartData:null}},watch:{chartData:r}},s={props:{chartData:{type:Object,required:!0,default:function(){}}},watch:{chartData:r}},l={reactiveData:o,reactiveProp:s},u=n("30ef"),c=n.n(u);function d(t,e){return{render:function(t){return t("div",{style:this.styles,class:this.cssClasses},[t("canvas",{attrs:{id:this.chartId,width:this.width,height:this.height},ref:"canvas"})])},props:{chartId:{default:t,type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object},plugins:{type:Array,default:function(){return[]}}},data:function(){return{_chart:null,_plugins:this.plugins}},methods:{addPlugin:function(t){this.$data._plugins.push(t)},generateLegend:function(){if(this.$data._chart)return this.$data._chart.generateLegend()},renderChart:function(t,n){if(this.$data._chart&&this.$data._chart.destroy(),!this.$refs.canvas)throw new Error("Please remove the <template></template> tags from your chart component. See https://vue-chartjs.org/guide/#vue-single-file-components");this.$data._chart=new c.a(this.$refs.canvas.getContext("2d"),{type:e,data:t,options:n,plugins:this.$data._plugins})}},beforeDestroy:function(){this.$data._chart&&this.$data._chart.destroy()}}}d("bar-chart","bar"),d("horizontalbar-chart","horizontalBar"),d("doughnut-chart","doughnut");var h,f,g=d("line-chart","line"),p=(d("pie-chart","pie"),d("polar-chart","polarArea"),d("radar-chart","radar"),d("bubble-chart","bubble"),d("scatter-chart","scatter"),l.reactiveProp),m={name:"LineChart",extends:g,mixins:[p],props:["options"],data:function(){return{updating:!1}},mounted:function(){this.renderChart(this.chartData,this.options)},watch:{chartData:{deep:!0,handler:function(){var t=this;!this.updating&&this.$data&&this.$data._chart&&(this.updating=!0,this.$data._chart.update(),this.$nextTick((function(){return t.updating=!1})))}}}},v=m,b=n("2877"),y=Object(b["a"])(v,h,f,!1,null,"d506df10",null),x=y.exports,_=function(t,e){return _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},_(t,e)};function w(t,e){function n(){this.constructor=t}_(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function k(t){var e="function"===typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function M(t,e){var n="function"===typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,a,r=n.call(t),o=[];try{while((void 0===e||e-- >0)&&!(i=r.next()).done)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r["return"])&&n.call(r)}finally{if(a)throw a.error}}return o}function C(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(M(arguments[e]));return t}var S=function(){function t(t,e){this.target=e,this.type=t}return t}(),P=function(t){function e(e,n){var i=t.call(this,"error",n)||this;return i.message=e.message,i.error=e,i}return w(e,t),e}(S),D=function(t){function e(e,n,i){void 0===e&&(e=1e3),void 0===n&&(n="");var a=t.call(this,"close",i)||this;return a.wasClean=!0,a.code=e,a.reason=n,a}return w(e,t),e}(S),A=function(){if("undefined"!==typeof WebSocket)return WebSocket},T=function(t){return"undefined"!==typeof t&&!!t&&2===t.CLOSING},O={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+4e3*Math.random(),minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0,startClosed:!1,debug:!1},I=function(){function t(t,e,n){var i=this;void 0===n&&(n={}),this._listeners={error:[],message:[],open:[],close:[]},this._retryCount=-1,this._shouldReconnect=!0,this._connectLock=!1,this._binaryType="blob",this._closeCalled=!1,this._messageQueue=[],this.onclose=null,this.onerror=null,this.onmessage=null,this.onopen=null,this._handleOpen=function(t){i._debug("open event");var e=i._options.minUptime,n=void 0===e?O.minUptime:e;clearTimeout(i._connectTimeout),i._uptimeTimeout=setTimeout((function(){return i._acceptOpen()}),n),i._ws.binaryType=i._binaryType,i._messageQueue.forEach((function(t){return i._ws.send(t)})),i._messageQueue=[],i.onopen&&i.onopen(t),i._listeners.open.forEach((function(e){return i._callEventListener(t,e)}))},this._handleMessage=function(t){i._debug("message event"),i.onmessage&&i.onmessage(t),i._listeners.message.forEach((function(e){return i._callEventListener(t,e)}))},this._handleError=function(t){i._debug("error event",t.message),i._disconnect(void 0,"TIMEOUT"===t.message?"timeout":void 0),i.onerror&&i.onerror(t),i._debug("exec error listeners"),i._listeners.error.forEach((function(e){return i._callEventListener(t,e)})),i._connect()},this._handleClose=function(t){i._debug("close event"),i._clearTimeouts(),i._shouldReconnect&&i._connect(),i.onclose&&i.onclose(t),i._listeners.close.forEach((function(e){return i._callEventListener(t,e)}))},this._url=t,this._protocols=e,this._options=n,this._options.startClosed&&(this._shouldReconnect=!1),this._connect()}return Object.defineProperty(t,"CONNECTING",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(t,"OPEN",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(t,"CLOSING",{get:function(){return 2},enumerable:!0,configurable:!0}),Object.defineProperty(t,"CLOSED",{get:function(){return 3},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"CONNECTING",{get:function(){return t.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"OPEN",{get:function(){return t.OPEN},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"CLOSING",{get:function(){return t.CLOSING},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"CLOSED",{get:function(){return t.CLOSED},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"binaryType",{get:function(){return this._ws?this._ws.binaryType:this._binaryType},set:function(t){this._binaryType=t,this._ws&&(this._ws.binaryType=t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"retryCount",{get:function(){return Math.max(this._retryCount,0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bufferedAmount",{get:function(){var t=this._messageQueue.reduce((function(t,e){return"string"===typeof e?t+=e.length:e instanceof Blob?t+=e.size:t+=e.byteLength,t}),0);return t+(this._ws?this._ws.bufferedAmount:0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"extensions",{get:function(){return this._ws?this._ws.extensions:""},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"protocol",{get:function(){return this._ws?this._ws.protocol:""},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"readyState",{get:function(){return this._ws?this._ws.readyState:this._options.startClosed?t.CLOSED:t.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"url",{get:function(){return this._ws?this._ws.url:""},enumerable:!0,configurable:!0}),t.prototype.close=function(t,e){void 0===t&&(t=1e3),this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),this._ws?this._ws.readyState!==this.CLOSED?this._ws.close(t,e):this._debug("close: already closed"):this._debug("close enqueued: no ws instance")},t.prototype.reconnect=function(t,e){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,this._ws&&this._ws.readyState!==this.CLOSED?(this._disconnect(t,e),this._connect()):this._connect()},t.prototype.send=function(t){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",t),this._ws.send(t);else{var e=this._options.maxEnqueuedMessages,n=void 0===e?O.maxEnqueuedMessages:e;this._messageQueue.length<n&&(this._debug("enqueue",t),this._messageQueue.push(t))}},t.prototype.addEventListener=function(t,e){this._listeners[t]&&this._listeners[t].push(e)},t.prototype.dispatchEvent=function(t){var e,n,i=this._listeners[t.type];if(i)try{for(var a=k(i),r=a.next();!r.done;r=a.next()){var o=r.value;this._callEventListener(t,o)}}catch(s){e={error:s}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return!0},t.prototype.removeEventListener=function(t,e){this._listeners[t]&&(this._listeners[t]=this._listeners[t].filter((function(t){return t!==e})))},t.prototype._debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._options.debug&&console.log.apply(console,C(["RWS>"],t))},t.prototype._getNextDelay=function(){var t=this._options,e=t.reconnectionDelayGrowFactor,n=void 0===e?O.reconnectionDelayGrowFactor:e,i=t.minReconnectionDelay,a=void 0===i?O.minReconnectionDelay:i,r=t.maxReconnectionDelay,o=void 0===r?O.maxReconnectionDelay:r,s=0;return this._retryCount>0&&(s=a*Math.pow(n,this._retryCount-1),s>o&&(s=o)),this._debug("next delay",s),s},t.prototype._wait=function(){var t=this;return new Promise((function(e){setTimeout(e,t._getNextDelay())}))},t.prototype._getNextUrl=function(t){if("string"===typeof t)return Promise.resolve(t);if("function"===typeof t){var e=t();if("string"===typeof e)return Promise.resolve(e);if(e.then)return e}throw Error("Invalid URL")},t.prototype._connect=function(){var t=this;if(!this._connectLock&&this._shouldReconnect){this._connectLock=!0;var e=this._options,n=e.maxRetries,i=void 0===n?O.maxRetries:n,a=e.connectionTimeout,r=void 0===a?O.connectionTimeout:a,o=e.WebSocket,s=void 0===o?A():o;if(this._retryCount>=i)this._debug("max retries reached",this._retryCount,">=",i);else{if(this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),!T(s))throw Error("No valid WebSocket class provided");this._wait().then((function(){return t._getNextUrl(t._url)})).then((function(e){t._closeCalled||(t._debug("connect",{url:e,protocols:t._protocols}),t._ws=t._protocols?new s(e,t._protocols):new s(e),t._ws.binaryType=t._binaryType,t._connectLock=!1,t._addListeners(),t._connectTimeout=setTimeout((function(){return t._handleTimeout()}),r))}))}}},t.prototype._handleTimeout=function(){this._debug("timeout event"),this._handleError(new P(Error("TIMEOUT"),this))},t.prototype._disconnect=function(t,e){if(void 0===t&&(t=1e3),this._clearTimeouts(),this._ws){this._removeListeners();try{this._ws.close(t,e),this._handleClose(new D(t,e,this))}catch(n){}}},t.prototype._acceptOpen=function(){this._debug("accept open"),this._retryCount=0},t.prototype._callEventListener=function(t,e){"handleEvent"in e?e.handleEvent(t):e(t)},t.prototype._removeListeners=function(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))},t.prototype._addListeners=function(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))},t.prototype._clearTimeouts=function(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)},t}(),L=I,F={name:"DashBoard",components:{LineChart:x},data:function(){return{websocket:null,loading:!0,stat:{},memory_pressure:0,memory_used:"",memory_cached:"",memory_free:"",memory_total:"",cpu_analytic:{datasets:[{label:"cpu user",borderColor:"#36a3eb",backgroundColor:"#36a3eb",pointRadius:0,data:[]},{label:"cpu total",borderColor:"#ff6385",backgroundColor:"#ff6385",pointRadius:0,data:[]}],options:{responsive:!0,maintainAspectRatio:!1,responsiveAnimationDuration:0,elements:{line:{tension:0}},scales:{yAxes:[{ticks:{max:100,min:0,stepSize:20,display:!0}}],xAxes:[{type:"time",time:{unit:"minute"}}]}}},cpu:0,disk_percentage:0,disk_total:"",disk_used:"",uptime:"",loadavg:{}}},created:function(){this.websocket=new L(this.getWebSocketRoot()+"/analytic?token="+btoa(this.$store.state.user.token)),this.websocket.onmessage=this.wsOnMessage,this.websocket.onopen=this.wsOpen;for(var t=new Date,e=0;e<120;e++)this.cpu_analytic.datasets[0].data.push({x:t,y:0}),this.cpu_analytic.datasets[1].data.push({x:t,y:0})},destroyed:function(){this.websocket.close()},methods:{wsOpen:function(){this.websocket.send("ping")},wsOnMessage:function(t){var e=JSON.parse(t.data);this.cpu=e.cpu_system+e.cpu_user;var n=new Date;this.cpu_analytic.datasets[0].data.push({x:n,y:e.cpu_user}),this.cpu_analytic.datasets[1].data.push({x:n,y:this.cpu}),this.cpu_analytic.datasets[0].data.length>120&&(this.cpu_analytic.datasets[0].data.shift(),this.cpu_analytic.datasets[1].data.shift()),this.cpu=this.cpu.toFixed(2),this.memory_pressure=e.memory_pressure,this.memory_used=e.memory_used,this.memory_cached=e.memory_cached,this.memory_free=e.memory_free,this.memory_total=e.memory_total,this.disk_percentage=e.disk_percentage,this.disk_used=e.disk_used,this.disk_total=e.disk_total;var i=Math.floor(e.uptime),a=Math.floor(i/86400);i-=86400*a;var r=Math.floor(i/3600);i-=3600*r,this.uptime=a+"d "+r+"h "+Math.floor(i/60)+"m",this.loadavg=e.loadavg}}},R=F,N=(n("1dd2"),Object(b["a"])(R,i,a,!1,null,"2b303a0f",null));e["default"]=N.exports},b680:function(t,e,n){"use strict";var i=n("23e7"),a=n("a691"),r=n("408a"),o=n("1148"),s=n("d039"),l=1..toFixed,u=Math.floor,c=function(t,e,n){return 0===e?n:e%2===1?c(t,e-1,n*t):c(t*t,e/2,n)},d=function(t){var e=0,n=t;while(n>=4096)e+=12,n/=4096;while(n>=2)e+=1,n/=2;return e},h=function(t,e,n){var i=-1,a=n;while(++i<6)a+=e*t[i],t[i]=a%1e7,a=u(a/1e7)},f=function(t,e){var n=6,i=0;while(--n>=0)i+=t[n],t[n]=u(i/e),i=i%e*1e7},g=function(t){var e=6,n="";while(--e>=0)if(""!==n||0===e||0!==t[e]){var i=String(t[e]);n=""===n?i:n+o.call("0",7-i.length)+i}return n},p=l&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!s((function(){l.call({})}));i({target:"Number",proto:!0,forced:p},{toFixed:function(t){var e,n,i,s,l=r(this),u=a(t),p=[0,0,0,0,0,0],m="",v="0";if(u<0||u>20)throw RangeError("Incorrect fraction digits");if(l!=l)return"NaN";if(l<=-1e21||l>=1e21)return String(l);if(l<0&&(m="-",l=-l),l>1e-21)if(e=d(l*c(2,69,1))-69,n=e<0?l*c(2,-e,1):l/c(2,e,1),n*=4503599627370496,e=52-e,e>0){h(p,0,n),i=u;while(i>=7)h(p,1e7,0),i-=7;h(p,c(10,i,1),0),i=e-1;while(i>=23)f(p,1<<23),i-=23;f(p,1<<i),h(p,1,1),f(p,2),v=g(p)}else h(p,0,n),h(p,1<<-e,0),v=g(p)+o.call("0",u);return u>0?(s=v.length,v=m+(s<=u?"0."+o.call("0",u-s)+v:v.slice(0,s-u)+"."+v.slice(s-u))):v=m+v,v}})}}]);